data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a user's name as input and returns a personalized greeting message. The function should accept a single string representing the user's name and return a string that greets the user. If the provided name is an empty string, the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert greet_user('Alice') == 'Hello, Alice!'\", \"assert greet_user('Bob') == 'Hello, Bob!'\", \"assert greet_user('Charlie') == 'Hello, Charlie!'\", \"assert greet_user('David') == 'Hello, David!'\", \"assert greet_user('Eve') == 'Hello, Eve!'\", \"assert greet_u... | {
"split": "train",
"index": 64600,
"acecode_id": "oss_20497",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two dictionaries: `target_group_dict` and `prediction_dict`. The `target_group_dict` contains a key 'quantiles' which maps to a list of valid quantiles. The `prediction_dict` contains a nested key 'prediction' which further contains a key 'quantile' that maps to a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_quantiles({'quantiles': [0.1, 0.5, 0.9]}, {'prediction': {'quantile': [0.1, 0.5, 0.9]}}) == []\", \"assert validate_quantiles({'quantiles': [0.1, 0.5, 0.9]}, {'prediction': {'quantile': [0.1, 0.5]}}) == ['prediction_dict quantiles != valid_quantiles... | {
"split": "train",
"index": 64601,
"acecode_id": "bigcode_python_fns_20979",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a tuple that contains the length of a sentence and a list of tokens (words) in that sentence, write a function that constructs and returns the complete sentence as a single string. Each token in the list is an object with a 'text' attribute that holds the actual word. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_sentence_content((5, [{'text': 'Hello'}, {'text': 'world'}, {'text': 'this'}, {'text': 'is'}, {'text': 'test'}])) == 'Helloworldthisistest'\", \"assert get_sentence_content((3, [{'text': 'Leet'}, {'text': 'Code'}, {'text': 'Rocks'}])) == 'LeetCodeRocks'\... | {
"split": "train",
"index": 64602,
"acecode_id": "bigcode_python_fns_17430",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that prints the contents of a survey catalog table. The function should take the following parameters: \n- VLTable (a list of dictionaries, where each dictionary represents a row in the survey catalog table),\n- image (a string repres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_survey_table([{'id': 1, 'name': 'Survey A'}, {'id': 2, 'name': 'Survey B'}], 'image1', 'stdout', []) == \\\"[{'id': 1, 'name': 'Survey A'}, {'id': 2, 'name': 'Survey B'}]\\\"\", \"assert print_survey_table([], 'image2', 'stdout', []) == \\\"[]\\\"\", \... | {
"split": "train",
"index": 64603,
"acecode_id": "bigcode_python_fns_32163",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, write a function that decomposes n into its prime factors and returns a list of these prime factors where each prime factor is included multiple times equal to the number of digits in the prime factor. If a prime factor is not a palindrome, it should not be ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prime_factor_palindrome(30) == []\", \"assert prime_factor_palindrome(11) == [11, 11]\", \"assert prime_factor_palindrome(1) == []\", \"assert prime_factor_palindrome(100) == []\", \"assert prime_factor_palindrome(131) == [131, 131, 131]\", \"assert prime_fa... | {
"split": "train",
"index": 64604,
"acecode_id": "evol_12510",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a folder name in the format 'hive1_rpi1_day-YYYYMMDD/', write a function `folder_datetime(foldername: str) -> datetime` that extracts the date part from the folder name and returns it as a UTC datetime object. You can assume that the date in the fold... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert folder_datetime('hive1_rpi1_day-20230101/') == datetime(2023, 1, 1, 0, 0, tzinfo=timezone.utc)\", \"assert folder_datetime('hive1_rpi1_day-20221231/') == datetime(2022, 12, 31, 0, 0, tzinfo=timezone.utc)\", \"assert folder_datetime('hive1_rpi1_day-20220715/'... | {
"split": "train",
"index": 64605,
"acecode_id": "bigcode_python_fns_9395",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing a mix of uppercase letters, lowercase letters, and digits. Write a function `check_string` that takes a single argument (the input string) and returns `True` if the string contains at least one uppercase letter, one lowercase letter, and one di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_string('Hello123') == True\", \"assert check_string('abcdef') == False\", \"assert check_string('123456') == False\", \"assert check_string('ABCDEF') == False\", \"assert check_string('HelloWorld') == False\", \"assert check_string('hello123') == False... | {
"split": "train",
"index": 64606,
"acecode_id": "oss_21394",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with finding the run number associated with a given luminosity block in a high-energy physics experiment. The relationship between luminosity blocks and run numbers is represented in a predefined dictionary. Your goal is to implement a function `findRunForLumi(lu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findRunForLumi(1) == 1\", \"assert findRunForLumi(2) == 1\", \"assert findRunForLumi(3) == 1\", \"assert findRunForLumi(4) == 1\", \"assert findRunForLumi(5) == 1\", \"assert findRunForLumi(6) == 2\", \"assert findRunForLumi(7) == 2\", \"assert findRunForLum... | {
"split": "train",
"index": 64607,
"acecode_id": "oss_18270",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function called `remove_links` that takes a string `text` as input and removes all hyperlinks and Twitter handles from the text. A hyperlink is defined as any substring that starts with 'http://' or 'https://' followed by any alphanumeric characte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_links('No links or handles here!') == 'No links or handles here!'\", \"assert remove_links('@user1 Visit us at https://www.example.com for more info.') == ' Visit us at for more info.'\", \"assert remove_links('Here is a link to my site: https://mysi... | {
"split": "train",
"index": 64608,
"acecode_id": "oss_6347",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a recursive binary search algorithm to find an element in a sorted array without using any built-in binary search function. Your solution must also include error handling for cases where the array is not sorted or the element is not in the array. The function should p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_search([2, 4, 6, 8, 10], 8) == 3\", \"assert binary_search([1, 3, 5, 7, 9], 1) == 0\", \"assert binary_search([10, 20, 30, 40, 50], 50) == 4\", \"assert binary_search([5, 10, 15, 20, 25], 15) == 2\", \"assert binary_search([2, 4, 6, 8, 10], 2) == 0\",... | {
"split": "train",
"index": 64609,
"acecode_id": "evol_28533",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a language translation feature for a web application. The application has a function `get_lang_name(lang)` that takes a language code as input and returns the corresponding language name. Your task is to implement the `_()` function to provide l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert _('English') == 'English'\", \"assert _('Spanish') == 'Spanish'\", \"assert _('French') == 'French'\", \"assert _('Ingl\\u00e9s') == 'Ingl\\u00e9s'\", \"assert _('Espa\\u00f1ol') == 'Espa\\u00f1ol'\", \"assert _('Franc\\u00e9s') == 'Franc\\u00e9s'\", \"asser... | {
"split": "train",
"index": 64610,
"acecode_id": "oss_14634",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a configuration dictionary representing devices and their associated instruments. Each device is a key in the dictionary, and its corresponding value is a sub-dictionary that may contain an 'instrument' key. If t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_instruments({'device1': {'instrument': 'guitar'}, 'device2': {'instrument': 'drum'}, 'device3': {}}) == ['guitar', 'drum', 'default']\", \"assert get_instruments({'d1': {}, 'd2': {'instrument': 'flute'}, 'd3': {'instrument': 'piano'}}) == ['default', 'fl... | {
"split": "train",
"index": 64611,
"acecode_id": "oss_12002",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `text`, implement a function `contains_keyword(text: str, keyword: str) -> bool` that checks if the `keyword` is present in the `text`. The function should return `True` if the `keyword` is found, and `False` otherwise. The check should be case-insensitive. The s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contains_keyword('Hello, world!', 'hello') == True\", \"assert contains_keyword('Case-sensitive Check', 'check') == True\", \"assert contains_keyword('Python Programming', 'java') == False\", \"assert contains_keyword('This is a test', 'test') == True\", \"a... | {
"split": "train",
"index": 64612,
"acecode_id": "bigcode_python_fns_21283",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing job information for a particle physics experiment. The input consists of a list of jobs, where each job is represented as a dictionary containing the keys: 'path' (a string representing the file directory), 'ENERGY' (an integer representing the en... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_jobs([{'path': '/job1', 'ENERGY': 100, 'PHYSLIST': 'list1'}, {'path': '/job2', 'ENERGY': 200, 'PHYSLIST': 'list2'}], [100, 200], [100, 200]) == (2, [100, 200], {'list1', 'list2'})\", \"assert process_jobs([], [], []) == (0, [], set())\", \"assert pro... | {
"split": "train",
"index": 64613,
"acecode_id": "oss_10550",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages a library of books. The function should allow the following operations: adding a book with a title, author, and genre, removing a book by its title, displaying all books with their details, and searching for a book by its tit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert library_operations([('add', 'Python Programming', 'John Smith', 'Programming'), ('add', 'Data Science with Python', 'Emily Brown', 'Data Science'), ('add', 'Python for Beginners', 'Michael Johnson', 'Programming'), ('display', None, None, None)]) == ['Python... | {
"split": "train",
"index": 64614,
"acecode_id": "oss_28170",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of words, implement a function that returns a new list containing only the words that have at least 2 consonants. A consonant is defined as any letter that is not a vowel (a, e, i, o, u).\nPlease reason step by step, then write a self-contained Python solution. Giv... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_consonants(['A', 'I', 'O', 'U']) == []\", \"assert filter_consonants(['Cool', 'Pool', 'Tool', 'School']) == ['Cool', 'Pool', 'Tool', 'School']\", \"assert filter_consonants(['Shy', 'Cry', 'Try']) == ['Shy', 'Cry', 'Try']\", \"assert filter_consonants(... | {
"split": "train",
"index": 64615,
"acecode_id": "evol_18049",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `guess_number_feedback(guess: int) -> str` that simulates a number guessing game. The function should take an integer `guess` as input, which represents the player's guess of a hidden number between 1 and 1,000. The function should return one of three strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert guess_number_feedback(250) == 'higher'\", \"assert guess_number_feedback(750) == 'lower'\", \"assert guess_number_feedback(500) == 'correct'\", \"assert guess_number_feedback(1) == 'higher'\", \"assert guess_number_feedback(1000) == 'lower'\", \"assert guess... | {
"split": "train",
"index": 64616,
"acecode_id": "evol_28691",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of 'n' arrays containing integers, implement a function that computes and returns the number of unique digits present in each array. The function should categorize the unique digits into even and odd numbers, returning the total count of unique even digits and uniq... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert array_analysis([[10, 12, 13]]) == [(2, 2)]\", \"assert array_analysis([[22, 22, 22]]) == [(1, 0)]\", \"assert array_analysis([[5, 55, 555]]) == [(0, 1)]\", \"assert array_analysis([[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]) == [(5, 5)]\", \"assert array_analysis([[0, ... | {
"split": "train",
"index": 64617,
"acecode_id": "evol_2678",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers as input. Your task is to write a function `transform_list` that returns a new list where each element is multiplied by 2 and then squared. The output list should contain the transformed values in the same order as the input list. For example, i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_list([3, 5, 7, 9]) == [36, 100, 196, 324]\", \"assert transform_list([1, 2, 3]) == [4, 16, 36]\", \"assert transform_list([0]) == [0]\", \"assert transform_list([-1, -2, -3]) == [4, 16, 36]\", \"assert transform_list([2, 4, 6]) == [16, 64, 144]\", ... | {
"split": "train",
"index": 64618,
"acecode_id": "oss_6934",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two arrays, write a function that interleaves their elements one by one and then reverses the order of items in the resultant array. If one array is shorter than the other, the remaining elements from the longer array should be appended at the end. Implement a function `i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert interleave_reverse([1, 2, 3], [4, 5, 6, 7, 8]) == [8, 7, 6, 3, 5, 2, 4, 1]\", \"assert interleave_reverse([], [1, 2, 3]) == [3, 2, 1]\", \"assert interleave_reverse([1, 2, 3], []) == [3, 2, 1]\", \"assert interleave_reverse([1], [2]) == [2, 1]\", \"assert in... | {
"split": "train",
"index": 64619,
"acecode_id": "evol_12459",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `remove_module(module_name: str) -> str` that simulates the removal of a module from a system. The function takes a single argument, `module_name`, which is a string representing the name of the module to be removed. If the module name is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_module('moduleA') == 'moduleA has been correctly removed.'\", \"assert remove_module('moduleB') == 'moduleB has been correctly removed.'\", \"assert remove_module('moduleC') == 'moduleC has been correctly removed.'\", \"assert remove_module('moduleC')... | {
"split": "train",
"index": 64620,
"acecode_id": "bigcode_python_fns_8505",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings and a prefix string, implement a function that returns a list of all the strings from the input list that start with the given prefix. The function should be named 'filter_by_prefix' and should take two parameters: a list of strings 'strings' and a strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_by_prefix(['apple', 'banana', 'apricot', 'grape'], 'ap') == ['apple', 'apricot']\", \"assert filter_by_prefix(['cat', 'dog', 'caterpillar', 'fish'], 'ca') == ['cat', 'caterpillar']\", \"assert filter_by_prefix(['red', 'blue', 'green'], 'b') == ['blue'... | {
"split": "train",
"index": 64621,
"acecode_id": "evol_25255",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You have n super washing machines on a line. Initially, each washing machine has some dresses or is empty. For each move, you can choose any m (1 ≤ m ≤ n) washing machines and pass one dress of each selected washing machine to one of its adjacent washing machines simultaneously... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findMinMoves([1,0,5]) == 3\", \"assert findMinMoves([0,3,0]) == 2\", \"assert findMinMoves([0,2,0]) == -1\", \"assert findMinMoves([0,0,0,0]) == 0\", \"assert findMinMoves([0,1]) == -1\", \"assert findMinMoves([10,5,0,5]) == 10\", \"assert findMinMoves([0,0,... | {
"split": "train",
"index": 64622,
"acecode_id": "evol_26689",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to detect collisions between a player character and a list of enemy characters in a 2D space. The function should check if the bounding box of the player intersects with any of the enemy characters. You are given a list of enemy posit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert collision_check([(100, 200), (300, 400)], (400, 500), (50, 50), (30, 30)) == False\", \"assert collision_check([(0, 0)], (6, 6), (5, 5), (5, 5)) == False\", \"assert collision_check([], (100, 100), (50, 50), (30, 30)) == False\", \"assert collision_check([(5... | {
"split": "train",
"index": 64623,
"acecode_id": "oss_36500",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `import_functions` that simulates the import of several functions from different modules in a project structure. Your task is to create a dictionary that maps the names of the functions to their respective simulated implementations. The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert import_functions()['permissions']() == 'permissions'\", \"assert import_functions()['reviews_next_page']() == 'reviews_next_page'\", \"assert import_functions()['review_history']() == 'review_history'\", \"assert import_functions()['search_next_page']() == '... | {
"split": "train",
"index": 64624,
"acecode_id": "oss_27782",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of distinct integers, implement a function that calculates the numerical gap between the smallest and largest integers in the array. The function should return this gap as an integer. For example, given the input array [10, 7, 5, 12, 4], the function should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_gap([10, 7, 5, 12, 4]) == 8\", \"assert find_gap([1, 2, 3, 4, 5]) == 4\", \"assert find_gap([-10, -20, 0, 10]) == 30\", \"assert find_gap([100, 50, 0, -50]) == 150\", \"assert find_gap([7]) == 0\", \"assert find_gap([-5, -1, -10, -2]) == 9\", \"assert f... | {
"split": "train",
"index": 64625,
"acecode_id": "evol_19687",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a variable number of arguments, which may include integers and non-integer types (like strings). The function should return the largest integer among the provided arguments. If there are no integers, the function should raise an exception. For ex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largest_integer(3, 'hello', 8, 1, 5) == 8\", \"assert largest_integer(10, 'abc', 20, 30, 'xyz') == 30\", \"assert largest_integer(-5, 'test', -10, -3) == -3\", \"assert largest_integer(0, 'string', 1) == 1\", \"assert largest_integer(4, 2, 'a', 6) == 6\", \"... | {
"split": "train",
"index": 64626,
"acecode_id": "evol_26615",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two strings, `first` and `second`. Your task is to write a function that merges these two strings based on their lengths. If both strings are of the same length, you should concatenate them. If the lengths are different, you should return a new string that contain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_strings('hello', 'world') == 'helloworld'\", \"assert merge_strings('abc', 'de') == 'String1 Length: 3\\\\nString1: abc\\\\n\\\\nString2 Length: 2\\\\nString2: de\\\\n'\", \"assert merge_strings('', 'notempty') == 'String1 Length: 0\\\\nString1: \\\\n\... | {
"split": "train",
"index": 64627,
"acecode_id": "bigcode_python_fns_29021",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that calculates the total number of files located in a list of directories. Each directory is represented as a string, and the function should count all files within each specified directory, assuming each directory string contains a numb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_files(['dir1: 5 files', 'dir2: 10 files', 'dir3: 2 files']) == 17\", \"assert count_files(['dirA: 0 files', 'dirB: 0 files']) == 0\", \"assert count_files(['singleDir: 1 file']) == 1\", \"assert count_files(['emptyDir: 0 files']) == 0\", \"assert count... | {
"split": "train",
"index": 64628,
"acecode_id": "bigcode_python_fns_31586",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_spaceship(model: str, launch_year: int, fuel_type: str) -> dict` that takes three parameters: a string `model`, an integer `launch_year`, and a string `fuel_type`. The function should return a dictionary representation of a spaceship with the keys '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_spaceship('Apollo', 1969, 'Hydrogen') == {'model': 'Apollo', 'launch_year': 1969, 'fuel_type': 'Hydrogen'}\", \"assert create_spaceship('Voyager', 1977, 'Nuclear') == {'model': 'Voyager', 'launch_year': 1977, 'fuel_type': 'Nuclear'}\", \"assert create... | {
"split": "train",
"index": 64629,
"acecode_id": "evol_8604",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that prepares input for a hypothetical command-line tool. The function `prepare_command_input` should take the following parameters: `multi` (a boolean indicating whether multiple sequences are being used), `sequences` (a list of strings ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prepare_command_input(True, ['ACGT', 'TGCA'], 'standard') == (['nupack', True, 'ACGT,TGCA', 'standard'], 'ACGT,TGCA')\", \"assert prepare_command_input(False, ['A', 'C'], 'reverse') == (['nupack', False, 'A,C', 'reverse'], 'A,C')\", \"assert prepare_command_... | {
"split": "train",
"index": 64630,
"acecode_id": "bigcode_python_fns_31169",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that counts the occurrences of each distinct integer and returns a list of tuples. Each tuple should contain a distinct integer and its count, sorted in descending order by count. If two integers have the same count, they should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_occurrences([1, 2, 3, 4, 5, 1, 2, 3]) == [(1, 2), (2, 2), (3, 2), (4, 1), (5, 1)]\", \"assert count_occurrences([1, 1, 2, 3, 3, 3]) == [(3, 3), (1, 2), (2, 1)]\", \"assert count_occurrences([5, 5, 5, 4, 4, 3, 3, 3, 3]) == [(3, 4), (5, 3), (4, 2)]\", \"... | {
"split": "train",
"index": 64631,
"acecode_id": "evol_16977",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats a given email subject line by prepending a predefined marketplace name and ensuring that the subject is stripped of any leading or trailing whitespace. The marketplace name is 'My Marketplace'. Implement the function `format_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_email_subject('Daily Update') == 'My Marketplace Daily Update'\", \"assert format_email_subject(' Weekly Summary ') == 'My Marketplace Weekly Summary'\", \"assert format_email_subject(' ') == 'My Marketplace'\", \"assert format_email_subject('Hell... | {
"split": "train",
"index": 64632,
"acecode_id": "bigcode_python_fns_1454",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of words represented as strings. A word is considered to have an elision if it contains a vowel followed immediately by the same vowel (e.g., 'aa', 'ee', 'ii', 'oo', 'uu'). Implement a function `elision_count(words: List[str]) -> int` that returns the numbe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert elision_count(['hello', 'world']) == 0\", \"assert elision_count(['book', 'apple', 'banana']) == 1\", \"assert elision_count(['a', 'e', 'i', 'o', 'u']) == 0\", \"assert elision_count(['aa', 'ee', 'ii', 'oo', 'uu']) == 5\", \"assert elision_count(['test', 'he... | {
"split": "train",
"index": 64633,
"acecode_id": "bigcode_python_fns_20763",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `execute_function` that takes a callable (a function) as an argument and returns the result of executing that function. Your function should be able to execute any function that takes no arguments and returns a value. Implement... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_function(lambda: 42) == 42\", \"assert execute_function(lambda: 'Hello, World!') == 'Hello, World!'\", \"assert execute_function(lambda: [1, 2, 3]) == [1, 2, 3]\", \"assert execute_function(lambda: {'key': 'value'}) == {'key': 'value'}\", \"assert ex... | {
"split": "train",
"index": 64634,
"acecode_id": "oss_13505",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the creation of a command-line argument parser. The function should accept a list of command options and return a dictionary representing the parsed arguments. The command options can include 'version', 'config-file', 'upda... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_command_parser(['--version']) == {'version': '__version__', 'command': 'paste'}\", \"assert create_command_parser(['--config-file', 'config.json']) == {'config_file': 'config.json', 'command': 'paste'}\", \"assert create_command_parser(['--update-conf... | {
"split": "train",
"index": 64635,
"acecode_id": "bigcode_python_fns_25035",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of strings and returns a new list containing only those strings that have a length greater than a specified threshold. Your function should take two parameters: a list of strings and an integer threshold. It shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_long_strings(['apple', 'banana', 'pear'], 5) == ['banana']\", \"assert filter_long_strings([], 2) == []\", \"assert filter_long_strings(['hello', 'world'], 0) == ['hello', 'world']\", \"assert filter_long_strings(['single', 'double', 'triple'], -1) ==... | {
"split": "train",
"index": 64636,
"acecode_id": "oss_4351",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `greet_world(isHello: bool) -> str` that returns 'Hello World' if the value of the parameter `isHello` is True, and returns 'Bye World' otherwise.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert greet_world(True) == 'Hello World'\", \"assert greet_world(False) == 'Bye World'\", \"assert greet_world(True) == 'Hello World'\", \"assert greet_world(False) == 'Bye World'\", \"assert greet_world(True) == 'Hello World'\", \"assert greet_world(False) == 'By... | {
"split": "train",
"index": 64637,
"acecode_id": "evol_18569",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines if a given string has been modified compared to an original string. The function should take two strings as input: `original` and `current`. If the `current` string is different from the `original` string, the function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_for_modification('Hello, World!', 'Hello, World!') == 'Hello, World!'\", \"assert check_for_modification('Hello, World!', 'Hello, Universe!') == '*Hello, World!'\", \"assert check_for_modification('Python is great', 'Python is great') == 'Python is gre... | {
"split": "train",
"index": 64638,
"acecode_id": "oss_13763",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of command-line arguments as strings. Your task is to write a function that takes this list and returns a dictionary that categorizes these arguments into three categories: 'list', 'open', and 'update'. Each key in the dictionary should have a boolean value... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_arguments([]) == {'list': False, 'open': False, 'update': False}\", \"assert categorize_arguments(['--list']) == {'list': True, 'open': False, 'update': False}\", \"assert categorize_arguments(['--open']) == {'list': False, 'open': True, 'update':... | {
"split": "train",
"index": 64639,
"acecode_id": "bigcode_python_fns_712",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes an array of numbers as input and finds the largest element along with its index. After finding the largest element, reverse the array in-place and return the new index of the largest element. The function should not use built-in functions to reverse ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maximum_element_and_reverse([1, 2, 3, 4, 5]) == 0\", \"assert maximum_element_and_reverse([5, 4, 3, 2, 1]) == 4\", \"assert maximum_element_and_reverse([1]) == 0\", \"assert maximum_element_and_reverse([10, 20, 30]) == 0\", \"assert maximum_element_and_rever... | {
"split": "train",
"index": 64640,
"acecode_id": "evol_22366",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function to collect user tweets based on a given input structure. The input will be a dictionary where each key is a user's name, and the value is a list of periods (tuples) representing the start and end dates for which to collect tweets. Your fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert collect_tweets({'user1': [(datetime(2021, 1, 1), datetime(2021, 1, 5))], 'user2': [(datetime(2021, 1, 6), datetime(2021, 1, 10))], 'user3': [(datetime(2021, 1, 11), datetime(2021, 1, 15))]}) == ({'user2': [(datetime(2021, 1, 6), datetime(2021, 1, 10))]}, 1)\... | {
"split": "train",
"index": 64641,
"acecode_id": "bigcode_python_fns_14995",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a string `value`, determine if it is a valid SEDOL identifier. A valid SEDOL identifier consists of exactly 7 characters where the first 6 characters can be digits (0-9) or letters from the set {B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Y, Z}, and the last ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_sedol('1234567') == True\", \"assert is_sedol('B1234A') == False\", \"assert is_sedol('A1B2C3D') == False\", \"assert is_sedol('1234568') == True\", \"assert is_sedol('ABCDE1F') == False\", \"assert is_sedol('123456') == False\", \"assert is_sedol('12345A... | {
"split": "train",
"index": 64642,
"acecode_id": "bigcode_python_fns_24761",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a Tic-Tac-Toe board represented as a 2D list where each cell can be 'X', 'O', or an empty string ''. Your task is to implement a function called `next_move(board: List[List[str]]) -> str` that returns the optimal move for the current player (either 'X' or 'O'). Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next_move([['X', 'X', 'O'], ['O', 'X', ''], ['O', '', '']]) == (1, 2)\", \"assert next_move([['X', 'X', ''], ['O', 'O', 'X'], ['', 'X', '']]) == (0, 2)\", \"assert next_move([['X', 'O', 'X'], ['X', '', 'O'], ['O', '', '']]) == (1, 1)\", \"assert next_move([[... | {
"split": "train",
"index": 64643,
"acecode_id": "bigcode_python_fns_5843",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of sponsorship entities. Each sponsorship entity is represented as a dictionary with three fields: 'name', 'level', and 'contact_info'. Your function should take a list of these dictionaries and return a list of name... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_gold_sponsors([]) == []\", \"assert get_gold_sponsors([{'name': 'Sponsor A', 'level': 'Gold', 'contact_info': 'info@a.com'}]) == ['Sponsor A']\", \"assert get_gold_sponsors([{'name': 'Sponsor B', 'level': 'Silver', 'contact_info': 'info@b.com'}, {'name':... | {
"split": "train",
"index": 64644,
"acecode_id": "oss_27239",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a JSON response from a dashboard API and extracts specific information from it. The JSON response contains data related to a reporting dashboard and a collection exercise. Your function should handle cases where the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_dashboard_response({'report': {'sampleSize': 0}}) == 0\", \"assert process_dashboard_response({'report': {'sampleSize': 5, 'collectionExerciseUrl': 'http://example.com/collection/1'}}) == 'http://example.com/collection/1'\", \"assert process_dashboar... | {
"split": "train",
"index": 64645,
"acecode_id": "oss_32871",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function `collect_positive_numbers` that collects positive integers from a given list until a non-positive integer is encountered. The function should take a list of integers as input and return a list of all the positive integers collected before the first non-positiv... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert collect_positive_numbers([1, 2, 3, 0, 5]) == [1, 2, 3]\", \"assert collect_positive_numbers([5, 10, -1, 2]) == [5, 10]\", \"assert collect_positive_numbers([-1, -2, -3]) == []\", \"assert collect_positive_numbers([10, 20, 30, -5, 40]) == [10, 20, 30]\", \"as... | {
"split": "train",
"index": 64646,
"acecode_id": "evol_35244",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_organism_info(hierarchy: str, age: str, habitat: str) -> str` that takes in three parameters: a string representing the classification hierarchy of a botanical organism, a string representing its evolutionary age, and a string representing its habitat.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_organism_info('Plantae > Angiosperms > Eudicots > Rosids > Fagales > Betulaceae > Alnus', 'Cretaceous period', 'Tropical rainforests') == 'Hierarchy: Plantae > Angiosperms > Eudicots > Rosids > Fagales > Betulaceae > Alnus, Age: Cretaceous period, Habita... | {
"split": "train",
"index": 64647,
"acecode_id": "evol_28537",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `s` that represents a text input. Your task is to create a function `italicize_text(s)` that takes this string as input and returns a new string with the text formatted for LaTeX italicization. The output string should be wrapped in LaTeX syntax for itali... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert italicize_text('Hello') == '\\\\textit{Hello}'\", \"assert italicize_text('World') == '\\\\textit{World}'\", \"assert italicize_text('') == '\\\\textit{}'\", \"assert italicize_text('123') == '\\\\textit{123}'\", \"assert italicize_text('!@#$') == '\\\\texti... | {
"split": "train",
"index": 64648,
"acecode_id": "bigcode_python_fns_7199",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string 's' representing the name of a stack, return a list of stack names that the given stack 's' directly depends on. Each stack name in the output should be separated by a space in the input string. If there are no dependencies, return an empty list. The dependencies... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert depends_on_stacks('A B C') == ['B', 'C']\", \"assert depends_on_stacks('D') == []\", \"assert depends_on_stacks('X Y Z W') == ['Y', 'Z', 'W']\", \"assert depends_on_stacks('') == []\", \"assert depends_on_stacks('SingleDependency') == []\", \"assert depends_... | {
"split": "train",
"index": 64649,
"acecode_id": "bigcode_python_fns_27211",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a collection of polar bears, each represented by a dictionary containing their attributes. You need to implement a function `setPolarBearattr(attrs)` that takes a dictionary `attrs` as input, which contains the following keys: 'user_id', 'username',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert setPolarBearattr({'user_id': 1, 'username': 'Polar1', 'happiness': 100, 'oldHappiness': 50, 'size': 200}) == 'Polar bear added.'\", \"assert setPolarBearattr({'user_id': 2, 'username': 'Polar2', 'happiness': 90, 'oldHappiness': 60, 'size': 180}) == 'Polar be... | {
"split": "train",
"index": 64650,
"acecode_id": "bigcode_python_fns_48668",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns a new list containing only the positive prime numbers from the input list. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Implement the function `filter_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_positive_primes([-5, 3, 7, -2, 4, 9, 15, 33]) == [3, 7]\", \"assert filter_positive_primes([1, 2, 3, 4, 5, 6]) == [2, 3, 5]\", \"assert filter_positive_primes([-10, -5, -1]) == []\", \"assert filter_positive_primes([0, 1, 2, 3]) == [2, 3]\", \"assert ... | {
"split": "train",
"index": 64651,
"acecode_id": "evol_26119",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `bubble_sort(arr)` that takes a list of integers as input and sorts the list in ascending order using the Bubble Sort algorithm. The function should return the sorted list. Do not use any built-in sorting functions.\nPlease reason step by step, then write a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert bubble_sort([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert bubble_sort([3, 1, 2]) == [1, 2, 3]\", \"assert bubble_sort([10, -1, 2, 0]) == [-1, 0, 2, 10]\", \"assert bubble_sort([2, 2, 2, 2]) == [2,... | {
"split": "train",
"index": 64652,
"acecode_id": "evol_4296",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing lines from a configuration file. Each line can either be a comment (starting with '#'), empty, or formatted as 'key=value'. Your task is to implement a function that parses these lines and returns a dictionary where each key correspo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_config(['# This is a comment', 'key1=value1', 'key2=42', 'key1=value2']) == {'key1': 'value2', 'key2': 42}\", \"assert parse_config(['', '# comment', 'keyA=valueA', 'keyB=100', 'keyA=anotherValue']) == {'keyA': 'anotherValue', 'keyB': 100}\", \"assert ... | {
"split": "train",
"index": 64653,
"acecode_id": "bigcode_python_fns_23428",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to simulate a simple marbles game between two players. The game begins with a certain number of marbles, and players take turns removing marbles from the pile. Each player can remove either 1, 2, or 3 marbles on their turn. The player... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert marbles_game(10) == 'Player 1'\", \"assert marbles_game(13) == 'Player 1'\", \"assert marbles_game(15) == 'Player 1'\", \"assert marbles_game(18) == 'Player 1'\", \"assert marbles_game(19) == 'Player 1'\", \"assert marbles_game(20) == 'Player 2'\", \"assert ... | {
"split": "train",
"index": 64654,
"acecode_id": "oss_10845",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the number of children in different processes. Write a function `count_children(process_children: List[int]) -> List[int]` that returns a list where each element at index `i` is the total number of children for the process `i`, whic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_children([0, 0, 0]) == [0, 0, 0]\", \"assert count_children([5]) == [5]\", \"assert count_children([0, 5, 0]) == [5, 5, 0]\", \"assert count_children([0, 0, 2]) == [2, 2, 2]\", \"assert count_children([0]) == [0]\", \"assert count_children([4, 0, 3]) =... | {
"split": "train",
"index": 64655,
"acecode_id": "bigcode_python_fns_32325",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers as input and returns a tuple containing two elements: a list of the mode(s) (the number(s) that appear most frequently) and the median (the middle value when the numbers are sorted). The function should handle cases where there... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_mode_and_median([1, 2, 2, 3, 4]) == ([2], 2)\", \"assert find_mode_and_median([10, 10, 20, 30, 30]) == ([10, 30], 20)\", \"assert find_mode_and_median([1, 1, 1, 2, 2, 3]) == ([1], 1.5)\", \"assert find_mode_and_median([5, 5, 5, 5]) == ([5], 5)\", \"asse... | {
"split": "train",
"index": 64656,
"acecode_id": "evol_34205",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of dictionaries representing insurance policies with their respective attributes such as 'location', 'coverage_type', 'tiv' (total insured value), and 'bi_tiv' (business interruption total insured value), write a function that computes the aggregated total insured ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_agg_tiv([{'location': 'A', 'coverage_type': 'bi_coverage', 'tiv': 1000, 'bi_tiv': 300}, {'location': 'B', 'coverage_type': 'normal', 'tiv': 2000, 'bi_tiv': 500}], ['location']) == [{'location': 'A', 'agg_tiv': 300}, {'location': 'B', 'agg_tiv': 1500}... | {
"split": "train",
"index": 64657,
"acecode_id": "bigcode_python_fns_31792",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of measurements, where each measurement is represented as a dictionary with a 'value' key and a 'unit' key. Your task is to create a function that converts all measurements to a standard unit (for example, all values should be converted to meters if the uni... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_measurements([{'value': 100, 'unit': 'cm'}, {'value': 1, 'unit': 'm'}, {'value': 0.5, 'unit': 'km'}]) == [{'value': 1.0, 'unit': 'm', 'original_unit': 'cm'}, {'value': 1.0, 'unit': 'm', 'original_unit': 'm'}, {'value': 500.0, 'unit': 'm', 'original_u... | {
"split": "train",
"index": 64658,
"acecode_id": "bigcode_python_fns_2584",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of entity names and returns a dictionary that maps each entity name to a predefined structure. The function should take a list of selected entity names and return a dictionary that contains the entity names as keys, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_entities(['genre', 'comedy']) == {'genre': {'comedy': {'action': {1: 1}, 'drama': {1: 1}}}}\", \"assert process_entities(['genre', 'action']) == {'genre': {'action': {'thriller': {1: 1}}}}\", \"assert process_entities(['comedy', 'action']) == {}\", \... | {
"split": "train",
"index": 64659,
"acecode_id": "bigcode_python_fns_6823",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You need to create a function that determines the number of unique contributors from a list of contributor usernames. The function should take a list of strings, where each string represents a contributor's username, and return the count of unique contributors. Create a functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_contributors(['user1', 'user2', 'user1', 'user3']) == 3\", \"assert count_unique_contributors(['userA', 'userB', 'userC', 'userA', 'userB']) == 3\", \"assert count_unique_contributors(['contributor1', 'contributor2', 'contributor3']) == 3\", \"a... | {
"split": "train",
"index": 64660,
"acecode_id": "oss_35680",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `apply_filter_to_list` that takes in a list and a filter function. The function should apply the filter to each element in the list and return a new list containing only the elements that pass the filter. The filter function is defined... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_filter_to_list([1, 2, 3, 4, 5], lambda x: x % 2 == 0) == [2, 4]\", \"assert apply_filter_to_list([10, 15, 20, 25], lambda x: x > 15) == [20, 25]\", \"assert apply_filter_to_list([-1, -2, -3, -4], lambda x: x < 0) == [-1, -2, -3, -4]\", \"assert apply_f... | {
"split": "train",
"index": 64661,
"acecode_id": "bigcode_python_fns_49172",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an image represented as a 2D grid of pixels, where each pixel can be either 'W' (white) or 'C' (colored), write a function `trim_whitespace(image: List[List[str]], border_width_pixels: int) -> List[List[str]]` that trims whitespace (white pixels) from the edges of the ima... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert trim_whitespace([['W', 'W', 'W'], ['W', 'C', 'W'], ['W', 'W', 'W']], 1) == [['C']]\", \"assert trim_whitespace([['C', 'C', 'C'], ['C', 'C', 'C'], ['C', 'C', 'C']], 0) == [['C', 'C', 'C'], ['C', 'C', 'C'], ['C', 'C', 'C']]\", \"assert trim_whitespace([['W']],... | {
"split": "train",
"index": 64662,
"acecode_id": "bigcode_python_fns_7925",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that filters a list of text documents based on a specified language. Given a list of documents where each document is represented by a dictionary containing 'text' and 'language' keys, and a string representing the target language, your task is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_documents([{'text': 'Hello, world!', 'language': 'en'}, {'text': 'Bonjour le monde!', 'language': 'fr'}], 'en') == ['Hello, world!']\", \"assert filter_documents([{'text': 'Hola, mundo!', 'language': 'es'}, {'text': 'Hola, amigo!', 'language': 'es'}],... | {
"split": "train",
"index": 64663,
"acecode_id": "oss_13234",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an array of integers and sorts it using the merge sort algorithm. The function should return a new array containing the sorted integers, while ensuring the sorting is done in O(n log n) time complexity.\nPlease reason step by step, then write a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sort([3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]) == [1, 1, 2, 3, 3, 4, 5, 5, 5, 6, 9]\", \"assert merge_sort([10, -1, 2, 0, 5]) == [-1, 0, 2, 5, 10]\", \"assert merge_sort([1]) == [1]\", \"assert merge_sort([]) == []\", \"assert merge_sort([7, 3, 5, 1, 9, 2]) =... | {
"split": "train",
"index": 64664,
"acecode_id": "evol_27305",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a unique barcode represented as a random alphanumeric string of a specified length. Your task is to implement the `generate_barcode` function that accepts an integer `length` as a parameter and returns a string that is a randomly generated alphanu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_barcode(10) is not None\", \"assert len(generate_barcode(10)) == 10\", \"assert all(c.isalnum() for c in generate_barcode(10))\", \"assert len(generate_barcode(5)) == 5\", \"assert all(c.isalnum() for c in generate_barcode(5))\", \"assert len(genera... | {
"split": "train",
"index": 64665,
"acecode_id": "oss_31333",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple bank account. The function should take an initial balance, a list of deposits, a list of withdrawals, and an interest rate. The function will return the final balance after applying all the deposits and withdra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_bank_account(0, [100], [50], 0.1) == 55.0\", \"assert simulate_bank_account(100, [50], [], 0.1) == 165.0\", \"assert simulate_bank_account(1000, [1000], [0], 0.1) == 2200.0\", \"assert simulate_bank_account(300, [200, 100], [50], 0.0) == 550.0\", \"... | {
"split": "train",
"index": 64666,
"acecode_id": "oss_3082",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a row of a table. Each row contains several columns separated by commas. Your task is to implement a function that parses this list of strings and returns a 2D list (list of lists) containing only the non-empty value... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_table(['A, B, C', ' D , E , F ', 'G,,H']) == [['A', 'B', 'C'], ['D', 'E', 'F'], ['G', 'H']]\", \"assert parse_table(['1,2,3', '4,5,6', '', '7,8']) == [['1', '2', '3'], ['4', '5', '6'], [], ['7', '8']]\", \"assert parse_table(['', '', '']) == [[], [], [... | {
"split": "train",
"index": 64667,
"acecode_id": "bigcode_python_fns_44270",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the Euclidean distance between two points in an n-dimensional space. The points will be provided as lists of equal length, where the length of the lists represents the number of dimensions. The function should return a float representing the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert euclidean_distance([1, 2], [4, 6]) == 5.0\", \"assert euclidean_distance([1, 2, 3], [4, 5, 6]) == 5.196152422706632\", \"assert euclidean_distance([0, 0], [0, 0]) == 0.0\", \"assert euclidean_distance([3, 4], [0, 0]) == 5.0\", \"assert euclidean_distance([1,... | {
"split": "train",
"index": 64668,
"acecode_id": "evol_35643",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that extracts the date mentioned in a given string, which may include the word 'tomorrow'. The date is specified in the format 'day month year', where 'day' is an integer representing the day of the month, 'month' is a full month name... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_date('I have a meeting scheduled for tomorrow, 25 December 2022') == '2022-12-26'\", \"assert extract_date('I will be visiting on 15 January 2023 tomorrow') == '2023-01-16'\", \"assert extract_date('The event is set for tomorrow, 1 February 2022') ==... | {
"split": "train",
"index": 64669,
"acecode_id": "oss_21826",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates a unique hostname based on a given name and user ID. The function should take two parameters: a string `name` and an integer `uid`. Your goal is to implement a function `generate_hostname` that formats the hostname a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_hostname('my_container/', 123) == 'my_container-nfs-123'\", \"assert generate_hostname('/user/', 456) == 'user-nfs-456'\", \"assert generate_hostname('container-name', 789) == 'container-name-nfs-789'\", \"assert generate_hostname('another/container... | {
"split": "train",
"index": 64670,
"acecode_id": "oss_8753",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two arrays of integers, you need to calculate the Manhattan distance matrix between them. The Manhattan distance between two points (x1, y1) and (x2, y2) is defined as |x2 - x1| + |y2 - y1|. Your task is to implement the function `manhattan_distance_matrix(a, b)` which ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manhattan_distance_matrix([1, 2, 3], [4, 5]) == [[3, 4], [2, 3], [1, 2]]\", \"assert manhattan_distance_matrix([0], [0]) == [[0]]\", \"assert manhattan_distance_matrix([1, 1], [1, 1]) == [[0, 0], [0, 0]]\", \"assert manhattan_distance_matrix([-1, 0, 1], [1, ... | {
"split": "train",
"index": 64671,
"acecode_id": "oss_4660",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a music playlist generator. The function should return a random song from a simulated collection of songs belonging to a randomly selected artist. You will provide the function `get_random_song()` which will generate a list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_random_song() is not None\", \"assert isinstance(get_random_song(), str)\", \"assert get_random_song() != get_random_song()\", \"assert get_random_song() != get_random_song()\", \"assert get_random_song() is not None\", \"assert get_random_song() != 'Art... | {
"split": "train",
"index": 64672,
"acecode_id": "oss_31638",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing character modifiers for a role-playing game. Implement a function `get_total_modifications(modifier_name: str, modifications: Dict[str, int], add_modifications: Dict[str, int], remove_modifications: List[str]) -> Dict[str, int]` that calculates the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_total_modifications('CaptainDignitiyPassive', {'att': 30}, {}, []) == {'att': 30}\", \"assert get_total_modifications('CrueCommandership', {'crit_damage': 25}, {'boss_damage': 15}, []) == {'crit_damage': 25, 'boss_damage': 15}\", \"assert get_total_modif... | {
"split": "train",
"index": 64673,
"acecode_id": "oss_16804",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes in a list of integers and returns a new list containing only the even integers from the original list, maintaining their original order. The function signature should be: `def filter_even_numbers(numbers: List[int]) -> List... | 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]) == [10, 20]\", \"assert filter_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([7, 9, 11,... | {
"split": "train",
"index": 64674,
"acecode_id": "oss_16253",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of rectangles, `y_true` and `y_pred`, each containing the coordinates and dimensions of rectangles in the format `(x, y, width, height)`. Your task is to determine how many rectangles in `y_pred` overlap with any rectangle in `y_true`. Two rectangles ove... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_overlaps([(0, 0, 1, 1)], [(1, 1, 1, 1)]) == 0\", \"assert count_overlaps([(0, 0, 2, 2)], [(1, 1, 2, 2)]) == 1\", \"assert count_overlaps([(0, 0, 3, 3)], [(1, 1, 1, 1), (2, 2, 1, 1)]) == 2\", \"assert count_overlaps([(0, 0, 1, 1)], [(0, 0, 1, 1)]) == 1\... | {
"split": "train",
"index": 64675,
"acecode_id": "bigcode_python_fns_36797",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple caching system. Implement a function `initialize_cache(app: str) -> str` that initializes a cache for a given application. The function takes a string `app` representing the name of the application and returns a message indicating whether t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_cache('MyApp') == 'Cache initialized for MyApp'\", \"assert initialize_cache('AnotherApp') == 'Cache initialized for AnotherApp'\", \"assert initialize_cache('TestApp') == 'Cache initialized for TestApp'\", \"assert initialize_cache('DemoApp') == ... | {
"split": "train",
"index": 64676,
"acecode_id": "bigcode_python_fns_47375",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that describes tasks based on a given cluster name and a list of task identifiers. The function should take in two parameters: a string `cluster` that represents the name of the cluster and a list of strings `tasks` that contains up t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert describe_tasks('my-cluster', ['task1', 'task2']) == {'tasks': [{'taskArn': 'task1', 'lastStatus': 'RUNNING', 'desiredStatus': 'RUNNING'}, {'taskArn': 'task2', 'lastStatus': 'STOPPED', 'desiredStatus': 'STOPPED'}], 'failures': []}\", \"assert describe_tasks('... | {
"split": "train",
"index": 64677,
"acecode_id": "bigcode_python_fns_38756",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a nested structure consisting of lists, dictionaries, and other types of values, implement a function that replaces specific values based on a provided mapping. The function should take three parameters: the original nested structure, a dictionary of replacements, and a b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert recursively_replace({'a': 1, 'b': 2}, {1: 'one', 2: 'two'}, False) == {'a': 'one', 'b': 'two'}\", \"assert recursively_replace([1, 2, 3], {1: 'one', 2: 'two'}, False) == ['one', 'two', 3]\", \"assert recursively_replace({'x': 100, 'y': {'a': 1}}, {100: 'hund... | {
"split": "train",
"index": 64678,
"acecode_id": "bigcode_python_fns_22267",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates an argument parser for a command-line interface. The function should accept a list of command-line arguments and return a dictionary containing the values of specific options. The options to be parsed are: 'batch', 'cli... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_arguments(['--batch-size', '10', '--client', 'local_batch', '-o', 'output.txt', '-t', '60']) == {'batch': '10', 'client': 'local_batch', 'output': 'output.txt', 'timeout': '60'}\", \"assert parse_arguments(['-b', '5', '-c', 'remote', '--output', 'resul... | {
"split": "train",
"index": 64679,
"acecode_id": "oss_5837",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates basic banking operations. Your function should take a list of operations and an initial balance, and return the final balance after executing all operations. The operations can be one of the following: \n1. 'deposit <am... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert final_balance(['deposit 500', 'withdraw 300', 'apply_interest 10'], 0) == 220.0\", \"assert final_balance(['deposit 1000', 'withdraw 1000'], 0) == 0.0\", \"assert final_balance(['deposit 100', 'withdraw 50', 'apply_interest 20'], 0) == 60.0\", \"assert final... | {
"split": "train",
"index": 64680,
"acecode_id": "oss_36679",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a trade date in the format 'YYYYMMDD', write a function that checks if the given date is a valid trading day. A trading day is defined as a day that is not a weekend (Saturday or Sunday) and is within the range of valid trading days from '20200701' t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_trading_day('20200711') == False\", \"assert is_valid_trading_day('20201231') == True\", \"assert is_valid_trading_day('20201230') == True\", \"assert is_valid_trading_day('20201226') == False\", \"assert is_valid_trading_day('20200701') == True\", ... | {
"split": "train",
"index": 64681,
"acecode_id": "bigcode_python_fns_40749",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given an array of floating-point numbers, write a function to find the median of the numbers. Your function should return None if the array is empty. The function should handle both positive and negative numbers.\nPlease reason step by step, then write a self-contained Python s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_median([1.5, 2.5, 3.5]) == 2.5\", \"assert find_median([-1.0, -2.0, -3.0, -4.0]) == -2.5\", \"assert find_median([0.0, 0.0, 0.0]) == 0.0\", \"assert find_median([]) == None\", \"assert find_median([3.0, 1.0]) == 2.0\", \"assert find_median([7.2]) == 7.2... | {
"split": "train",
"index": 64682,
"acecode_id": "evol_27950",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that analyzes a dataset represented by a dictionary. The dataset contains information about various features, including vector and embed features. Your function should determine the following: 1) the total number of examples in the da... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_dataset({'label': 1}, 5, 0, {'embed': [1, 2, 3]}) == (5, True, 3)\", \"assert analyze_dataset({'label': 2}, 3, None, {'embed': []}) == (3, False, 0)\", \"assert analyze_dataset({'label': 3}, 10, 1, {'embed': [1]}) == (10, True, 1)\", \"assert analyze... | {
"split": "train",
"index": 64683,
"acecode_id": "oss_22195",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a URL routing system for a web application. You need to implement a function that takes a list of URL patterns and adds a new URL pattern for the '订单成功' (order success) functionality. The new URL pattern should be mapped to a view named 'OrderSucces... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_order_success_pattern(['^orders/settlement/$', '^orders/commit/$']) == ['^orders/settlement/$', '^orders/commit/$', '^orders/success/$']\", \"assert add_order_success_pattern([]) == ['^orders/success/$']\", \"assert add_order_success_pattern(['^orders/su... | {
"split": "train",
"index": 64684,
"acecode_id": "oss_36673",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes model compilation configurations for a deep learning framework. The function should take a dictionary of compilation configurations and return the corresponding loss function and optimizer settings. The compilation conf... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_compilation_configs({'output': 'layer1', 'loss': 'cross_entropy', 'optimizer': {'name': 'Adam', 'options': {'lr': 0.01}}}) == ('cross_entropy', 'Adam(lr=0.01)')\", \"assert parse_compilation_configs({'output': 'layer2', 'optimizer': {'name': 'RMSprop'}... | {
"split": "train",
"index": 64685,
"acecode_id": "oss_1262",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, rearrange its digits to form a number that is a power of two. If such a rearrangement is possible, return a tuple (true, rearranged_number, steps) where rearranged_number is the smallest possible power of two that can be formed and steps is the number of swa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reorderedPowerOf2(1) == (True, 1, 0)\", \"assert reorderedPowerOf2(10) == (False, -1, -1)\", \"assert reorderedPowerOf2(16) == (True, 16, 0)\", \"assert reorderedPowerOf2(24) == (False, -1, -1)\", \"assert reorderedPowerOf2(46) == (True, 64, 1)\", \"assert r... | {
"split": "train",
"index": 64686,
"acecode_id": "evol_2717",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that verifies whether a given email address is valid based on a regular expression and checks if the email's domain extension is included in a provided list of valid domain extensions. The function should take two parameters: a string `email` and a list of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_email('test@example.com', ['.com', '.edu', '.gov']) == True\", \"assert verify_email('user@domain.edu', ['.com', '.edu', '.gov']) == True\", \"assert verify_email('admin@site.org', ['.com', '.edu', '.gov']) == False\", \"assert verify_email('info@comp... | {
"split": "train",
"index": 64687,
"acecode_id": "evol_30980",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of characters and returns all unique permutations that can be formed from those characters. The output should not include any duplicate permutations. For example, given the input list ['a', 'b', 'a'], the function should return ['aab', 'aba', ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sorted(generate_permutations(['a', 'b', 'a'])) == sorted(['aab', 'aba', 'baa'])\", \"assert sorted(generate_permutations(['a', 'a', 'b'])) == sorted(['aab', 'aba', 'baa'])\", \"assert sorted(generate_permutations(['c', 'a', 't'])) == sorted(['act', 'atc', 'c... | {
"split": "train",
"index": 64688,
"acecode_id": "evol_31903",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers where each integer represents a distinct card value. Your task is to implement a function that returns a new list containing only the unique card values in the order they first appeared in the input list. If there are duplicate values, only the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_cards([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_cards([1, 1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert unique_cards([5, 5, 5, 5]) == [5]\", \"assert unique_cards([]) == []\", \"assert unique_cards([-1, -2, -3, -1, -2]) == [-1, -2, -3]\", \"as... | {
"split": "train",
"index": 64689,
"acecode_id": "bigcode_python_fns_6785",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple function to manage an image annotation process. The function `annotate_images(images: List[str], labels: List[str]) -> Dict[str, str]` takes in a list of image file names and a corresponding list of labels. The function should return a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert annotate_images(['cat.jpg', 'dog.jpg', 'bird.jpg'], ['animal', 'pet']) == {'cat.jpg': 'animal', 'dog.jpg': 'pet'}\", \"assert annotate_images(['cat.jpg', 'dog.jpg'], ['animal', 'pet', 'friend']) == {'cat.jpg': 'animal', 'dog.jpg': 'pet'}\", \"assert annotate... | {
"split": "train",
"index": 64690,
"acecode_id": "oss_7552",
"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 integers from the original list. Your function should maintain the order of the integers as they appeared in the input list. Write a function named 'filter_... | 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([0, -2, -4, 3, 5]) == [0, -2, -4]\", \"assert filter_even... | {
"split": "train",
"index": 64691,
"acecode_id": "oss_11461",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that logs multiple outputs to a specified logger. The function should take in a dictionary of log targets, a logger function, and optional parameters for log name, log header, and logger name. Your goal is to implement the `logging... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert logging_multi_outputs({'loss': 0.5, 'accuracy': 0.8}, print, 'loss', 'train', 'tensorboard') is None\", \"assert logging_multi_outputs({'val_loss': 0.4}, print, 'val_loss', 'validation', 'tensorboard') is None\", \"assert logging_multi_outputs({}, print) is ... | {
"split": "train",
"index": 64692,
"acecode_id": "oss_6415",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines the appropriate signal connections for a custom model based on its class name. The function should take a string representing the model class name and return a list of signal connections that should be made. The rules ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert connect_signals('CountryModel') == ['set_name_ascii']\", \"assert connect_signals('RegionModel') == ['set_name_ascii', 'set_display_name']\", \"assert connect_signals('CityModel') == ['set_name_ascii', 'set_display_name', 'city_country', 'city_search_names']... | {
"split": "train",
"index": 64693,
"acecode_id": "bigcode_python_fns_27092",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer 'n', generate the 'n'-th password using a custom alphabet consisting of lowercase letters ('a' to 'z'). The passwords are generated by turning the integer 'n' into a base-26 representation where each digit corresponds to a character in the alphabet.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_password(0) == 'a'\", \"assert generate_password(1) == 'b'\", \"assert generate_password(25) == 'z'\", \"assert generate_password(26) == 'aa'\", \"assert generate_password(27) == 'ab'\", \"assert generate_password(51) == 'az'\", \"assert generate_pa... | {
"split": "train",
"index": 64694,
"acecode_id": "bigcode_python_fns_35740",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function `sum_of_squares(n)` that takes a non-negative integer `n` and returns the sum of the squares of its digits. For example, if n = 234, the function should return 4 + 9 + 16 = 29.\nPlease reason step by step, then write a self-contained Python solution. Give your ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_squares(0) == 0\", \"assert sum_of_squares(1) == 1\", \"assert sum_of_squares(5) == 25\", \"assert sum_of_squares(10) == 1\", \"assert sum_of_squares(99) == 162\", \"assert sum_of_squares(123) == 14\", \"assert sum_of_squares(234) == 29\", \"assert su... | {
"split": "train",
"index": 64695,
"acecode_id": "evol_14561",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that converts a given time in seconds to a formatted string representation in the format 'H:MM:SS'. The input will be a non-negative integer representing the total number of seconds. Your function should return the formatted time string. F... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert timeformat(0) == '0:00:00'\", \"assert timeformat(1) == '0:00:01'\", \"assert timeformat(59) == '0:00:59'\", \"assert timeformat(60) == '0:01:00'\", \"assert timeformat(61) == '0:01:01'\", \"assert timeformat(3600) == '1:00:00'\", \"assert timeformat(3661) =... | {
"split": "train",
"index": 64696,
"acecode_id": "bigcode_python_fns_8303",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the scores of different music tracks. Each track's score is represented by a unique integer ID. Your task is to implement a function that takes this list of scores and returns a dictionary where the keys are the unique scores, and t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_scores([1, 2, 2, 3, 3, 3]) == {1: 1, 2: 2, 3: 3}\", \"assert count_scores([4, 4, 4, 4]) == {4: 4}\", \"assert count_scores([5, 6, 7, 5, 6, 5]) == {5: 3, 6: 2, 7: 1}\", \"assert count_scores([]) == {}\", \"assert count_scores([10, 20, 10, 30, 20, 30, 30... | {
"split": "train",
"index": 64697,
"acecode_id": "bigcode_python_fns_39817",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `convert_minutes_to_time_format(minutes: int) -> Tuple[int, int, int, int]` that converts a given number of minutes into a more interpretable format consisting of years, days, hours, and minutes. The function should return a tuple containing four integers: ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_minutes_to_time_format(525600) == (1, 0, 0, 0)\", \"assert convert_minutes_to_time_format(0) == (0, 0, 0, 0)\", \"assert convert_minutes_to_time_format(60) == (0, 0, 1, 0)\", \"assert convert_minutes_to_time_format(1440) == (0, 1, 0, 0)\", \"assert c... | {
"split": "train",
"index": 64698,
"acecode_id": "evol_22555",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function `reverse_words(input_string)` that reverses the order of the words in the string without using any in-built functions. A word is defined as a sequence of characters separated by spaces. The function should return the new string with words in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_words('Hello World') == 'World Hello'\", \"assert reverse_words('Python is fun') == 'fun is Python'\", \"assert reverse_words('SingleWord') == 'SingleWord'\", \"assert reverse_words('') == ''\", \"assert reverse_words('One two three four') == 'four t... | {
"split": "train",
"index": 64699,
"acecode_id": "evol_27394",
"num_tests": 14
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.