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 implementing a function that populates a context dictionary for a custom web page. The function `populate_page_context` should take a `page_obj` object as input and return a dictionary containing the necessary data to render the custom page. The context dict... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert populate_page_context(Page(title='Home', content='Welcome to the homepage.', get_associated_events=lambda: ['Event1', 'Event2'])) == {'title': 'Home', 'content': 'Welcome to the homepage.', 'associated_events': ['Event1', 'Event2']}\", \"assert populate_page... | {
"split": "train",
"index": 66100,
"acecode_id": "oss_22561",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that calculates the average of the last `n` elements in a given list of integers. The function should take two parameters: a list of integers and an integer `n`, and return the average of the last `n` elements in the list. If t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_of_last_n([3, 7, 2, 8, 5], 3) == 5.0\", \"assert average_of_last_n([10, 20, 30], 5) == 20.0\", \"assert average_of_last_n([5], 1) == 5.0\", \"assert average_of_last_n([1, 2], 1) == 2.0\", \"assert average_of_last_n([4, 4, 4, 4], 2) == 4.0\", \"assert... | {
"split": "train",
"index": 66101,
"acecode_id": "oss_22695",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts a list of mixed fractions using the insertion sort algorithm. The function should take a list of fractions as input and return the sorted list. For example, if the input list is [3/2, 5/2, 1/2, 7/2, 4/2], the function should return [1/2, 3/2, 4/2... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insertion_sort([3/2, 5/2, 1/2, 7/2, 4/2]) == [1/2, 3/2, 4/2, 5/2, 7/2]\", \"assert insertion_sort([1/3, 2/3, 1/6, 5/6]) == [1/6, 1/3, 2/3, 5/6]\", \"assert insertion_sort([0, 2/5, 1/5, 3/5]) == [0, 1/5, 2/5, 3/5]\", \"assert insertion_sort([1/4, 1/2, 1/8, 3/... | {
"split": "train",
"index": 66102,
"acecode_id": "evol_16804",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `fibonacci(max_limit)` that takes an integer `max_limit` as input and returns a list containing the Fibonacci numbers that are less than or equal to `max_limit`. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == [0]\", \"assert fibonacci(4) == [0, 1, 1, 2, 3]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(7) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(8) == [0, 1, 1, 2, 3, 5, 8]\", ... | {
"split": "train",
"index": 66103,
"acecode_id": "evol_9482",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a configuration dictionary for a virtual machine (VM) based on a given username and network name. Your function should take two parameters: a string 'username' representing the user who wants to create the VM, and a string ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_vm_config('user1', 'Network1') == {'username': 'user1', 'network': 'Network1', 'image_name': 'jumpBox-Ubuntu18.04.ova'}\", \"assert create_vm_config('user2', 'Network2') == {'username': 'user2', 'network': 'Network2', 'image_name': 'jumpBox-Ubuntu18.0... | {
"split": "train",
"index": 66104,
"acecode_id": "bigcode_python_fns_31997",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of events represented as a list of tuples. Each tuple contains an event name and a session identifier. Your task is to transform this list into a new list that includes an additional index called 'Trial'. This 'Trial' index should count the number of occurr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert enumerate_trials([('A', 'S1'), ('B', 'S1'), ('A', 'S1'), ('B', 'S2'), ('A', 'S2')]) == [('A', 'S1', 1), ('B', 'S1', 1), ('A', 'S1', 2), ('B', 'S2', 1), ('A', 'S2', 1)]\", \"assert enumerate_trials([('A', 'S1'), ('A', 'S1'), ('A', 'S1')]) == [('A', 'S1', 1), ... | {
"split": "train",
"index": 66105,
"acecode_id": "bigcode_python_fns_38902",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a text fragment and a list of character subsets, implement a function that searches for each subset within the text and returns a dictionary containing each subset as a key and a list of starting indices where the subset appears in the text. The search should be performed... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_substrings('Hello world', ['world', 'Hello']) == {'world': [6], 'Hello': [0]}\", \"assert search_substrings('Python programming', ['Python', 'programming', 'Java']) == {'Python': [0], 'programming': [7], 'Java': []}\", \"assert search_substrings('abcd... | {
"split": "train",
"index": 66106,
"acecode_id": "evol_25065",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary where the keys are strings and the values can be of any type. Your task is to implement a function that encodes this dictionary into a specific string format. The format should start with the string 'DICT_START', followed by each key-value pair in the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert encode_dictionary({'b': 2, 'a': 1}) == 'DICT_START[a]:1[b]:2DICT_END'\", \"assert encode_dictionary({}) == 'DICT_STARTDICT_END'\", \"assert encode_dictionary({'x': 'hello', 'y': 'world'}) == 'DICT_START[x]:hello[y]:worldDICT_END'\", \"assert encode_dictionar... | {
"split": "train",
"index": 66107,
"acecode_id": "bigcode_python_fns_21495",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the initialization of a client with specific settings. The function `initialize_client` should accept parameters for `client_cls`, `bk_app_code`, `bk_app_secret`, and `accept_language`, along with any additional keyword arg... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_client('ClientClass', None, None, None) == {'class_name': 'ClientClass', 'credentials': {'app_code': 'default_app_code', 'app_secret': 'default_app_secret'}, 'ssl_verify': True, 'accept_language': 'en'}\", \"assert initialize_client('ClientClass',... | {
"split": "train",
"index": 66108,
"acecode_id": "bigcode_python_fns_18745",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function named 'is_num_even_or_prime' that takes an integer input and returns a tuple of two boolean values. The first boolean should indicate whether the provided integer is an even number, and the second boolean should indicate if the number is a prime number. A p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_num_even_or_prime(2) == (True, True)\", \"assert is_num_even_or_prime(3) == (False, True)\", \"assert is_num_even_or_prime(4) == (True, False)\", \"assert is_num_even_or_prime(5) == (False, True)\", \"assert is_num_even_or_prime(6) == (True, False)\", \"a... | {
"split": "train",
"index": 66109,
"acecode_id": "evol_9717",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the behavior of unlocking a screen and clearing notifications on an Android device. Your function should take a boolean input `is_locked` which indicates whether the screen is locked or not. If the screen is locked, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_device(True) == 'Screen unlocked and notifications cleared.'\", \"assert manage_device(False) == 'Notifications cleared.'\", \"assert manage_device(True) == 'Screen unlocked and notifications cleared.'\", \"assert manage_device(False) == 'Notification... | {
"split": "train",
"index": 66110,
"acecode_id": "oss_1903",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that takes two lists of integers as input and swaps their elements while keeping the indices of each number unchanged. The function should return the modified lists. If the two lists do not have the same length, return an error message indicating that both lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert swap_list_elements([1, 2, 3], [4, 5, 6]) == ([4, 5, 6], [1, 2, 3])\", \"assert swap_list_elements([10, 20], [30, 40]) == ([30, 40], [10, 20])\", \"assert swap_list_elements([], []) == ([], [])\", \"assert swap_list_elements([1], [2]) == ([2], [1])\", \"asser... | {
"split": "train",
"index": 66111,
"acecode_id": "evol_29422",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns the product of all distinct integers in the list. If the list is empty, the function should return 1.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```pyt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert distinct_product([1, 2, 3, 4]) == 24\", \"assert distinct_product([1, 2, 2, 3, 4]) == 24\", \"assert distinct_product([1, 1, 1, 1]) == 1\", \"assert distinct_product([0, 1, 2]) == 0\", \"assert distinct_product([]) == 1\", \"assert distinct_product([5, 5, 6,... | {
"split": "train",
"index": 66112,
"acecode_id": "evol_9676",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function called 'moor_sailboat' that returns the string 'The sailboat is now moored'. This function should not take any parameters and should only return the specified string when called.\nPlease reason step by step, then write a self-contained Python solution. Give yo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert moor_sailboat() == 'The sailboat is now moored'\", \"assert moor_sailboat() == 'The sailboat is now moored'\", \"assert moor_sailboat() == 'The sailboat is now moored'\", \"assert moor_sailboat() == 'The sailboat is now moored'\", \"assert moor_sailboat() ==... | {
"split": "train",
"index": 66113,
"acecode_id": "evol_10533",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to determine whether a product amendment can be retired based on predefined retirement settings. Given an `amendment_id`, you must return `True` if the amendment can be retired and `False` otherwise. The retirement rules are as follow... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retire_amendment(2) == True\", \"assert retire_amendment(4) == True\", \"assert retire_amendment(6) == True\", \"assert retire_amendment(8) == True\", \"assert retire_amendment(10) == True\", \"assert retire_amendment(1) == False\", \"assert retire_amendment... | {
"split": "train",
"index": 66114,
"acecode_id": "oss_19429",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are to implement a function `validate_login(username: str, password: str) -> str` that simulates the login process for a user. The function should check if the provided username and password match a predefined database of users. The database contains the following users: {'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_login('user1', 'pass1') == 'Login successful'\", \"assert validate_login('user1', 'wrongpass') == 'Invalid password'\", \"assert validate_login('user4', 'pass1') == 'User not found'\", \"assert validate_login('user2', 'pass2') == 'Login successful'\... | {
"split": "train",
"index": 66115,
"acecode_id": "bigcode_python_fns_25800",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing process IDs of running processes. Your task is to implement a function `kill_processes(process_ids: List[int]) -> List[int]` that simulates killing each process with the given IDs. The function should return a list of integers repre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert kill_processes([1, 2, 3, 4, 5]) == [2, 4]\", \"assert kill_processes([7, 8, 9]) == [8]\", \"assert kill_processes([]) == []\", \"assert kill_processes([11, 13, 15]) == []\", \"assert kill_processes([1, 3, 5, 7, 9]) == []\", \"assert kill_processes([6, 7, 8, ... | {
"split": "train",
"index": 66116,
"acecode_id": "bigcode_python_fns_28423",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of boolean values that may also contain None values. Your task is to implement a function called `boolean_counts_report` that returns a string report of the counts of each unique value in the list. The output string should include the counts for `True`, `Fa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert boolean_counts_report([True, False, True, None, True, False, None]) == 'True (3) | False (2) | None (2)'\", \"assert boolean_counts_report([False, False, None]) == 'False (2) | None (1)'\", \"assert boolean_counts_report([None, None, None]) == 'None (3)'\", ... | {
"split": "train",
"index": 66117,
"acecode_id": "bigcode_python_fns_8475",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a skyline. Your task is to implement a function `get_maximum_heights` that takes this list as input and returns the maximum height among the buildings. The function should only return the maximum height, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_maximum_heights([3, 1, 4, 1, 5, 9]) == 9\", \"assert get_maximum_heights([1, 2, 3, 4, 5]) == 5\", \"assert get_maximum_heights([5, 5, 5, 5, 5]) == 5\", \"assert get_maximum_heights([10]) == 10\", \"assert get_maximum_heights([]) == 0\", \"assert get_maxi... | {
"split": "train",
"index": 66118,
"acecode_id": "oss_34724",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function in Python that removes the last element of a list and returns the modified list. If the last element is a nested list, you should also remove the last element of that nested list. If that nested list becomes empty after the removal, you should eliminate that e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pop_nested(['a', 'b', ['c', 'd'], 'e']) == ['a', 'b', ['c', 'd']]\", \"assert pop_nested([1, 2, [3, 4, [5]]]) == [1, 2, [3, 4]]\", \"assert pop_nested([[1, 2, 3], 4, 5]) == [[1, 2, 3], 4]\", \"assert pop_nested([['a', 'b'], ['c', 'd'], 'e']) == [['a', 'b'], ... | {
"split": "train",
"index": 66119,
"acecode_id": "evol_13582",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `largest_number(lst)` that takes a list of integers as input and returns the largest integer in the list. The input list will always contain at least one integer.\nPlease reason step by step, then write a self-contained Python solution. Give your final prog... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largest_number([12, 34, 56, 78, 99]) == 99\", \"assert largest_number([-1, -5, -3, -4]) == -1\", \"assert largest_number([100, 200, 150, 300]) == 300\", \"assert largest_number([0, 0, 0, 0]) == 0\", \"assert largest_number([1]) == 1\", \"assert largest_numbe... | {
"split": "train",
"index": 66120,
"acecode_id": "evol_15499",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `prime_number(n)` that checks if a given integer `n` is a prime number. If `n` is a prime number, the function should return `True` and `None`. If `n` is not a prime number, the function should return `False` and the smallest divisor of `n` greater than 1. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prime_number(2) == (True, None)\", \"assert prime_number(3) == (True, None)\", \"assert prime_number(4) == (False, 2)\", \"assert prime_number(5) == (True, None)\", \"assert prime_number(6) == (False, 2)\", \"assert prime_number(7) == (True, None)\", \"asser... | {
"split": "train",
"index": 66121,
"acecode_id": "evol_25799",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing numbers in different formats: hexadecimal (starting with '0x'), binary (starting with '0b'), and decimal (floating point values). Implement a function `organize_nums(num_list)` that converts these numbers to decimal values and sorts ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert organize_nums(['0xC', '2', '0b1010', '0x5']) == [2.0, 5.0, 10.0, 12.0]\", \"assert organize_nums(['0b111', '0x1F', '3.14', '0b10']) == [2.0, 3.14, 7.0, 31.0]\", \"assert organize_nums(['0xB', '0b110', '1.1', '0x4']) == [1.1, 4.0, 6.0, 11.0]\", \"assert organ... | {
"split": "train",
"index": 66122,
"acecode_id": "evol_25559",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a pressure value in a specified unit and you need to convert it to another specified unit. The function `trans_pressure(src: float, dest: str = 'bar')` takes two parameters: a float `src` representing the pressure value to be converted, and a string `dest` represe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert trans_pressure(0.0, 'pascal') == 0.0\", \"assert trans_pressure(0.0, 'atm') == 0.0\", \"assert trans_pressure(0.0, 'mmHg') == 0.0\", \"assert trans_pressure(2.0, 'bar') == 2.0\", \"assert trans_pressure(100.0, 'bar') == 100.0\", \"assert trans_pressure(-1.0,... | {
"split": "train",
"index": 66123,
"acecode_id": "bigcode_python_fns_3085",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats information from a given RFID card represented as a dictionary. The dictionary contains the following keys: 'atqa', 'sak', 'uid', 'registered_at', and 'user'. Your function should process this dictionary and return a new dict... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_rfidcard({'atqa': 'ATQA1', 'sak': 'SAK1', 'uid': 'UID1', 'registered_at': datetime(2022, 1, 1, 12, 0, 0), 'user': 'user1'}) == {'atqa': 'ATQA1', 'sak': 'SAK1', 'uid': 'UID1', 'registered_at': '2022-01-01T12:00:00', 'user': 'user1'}\", \"assert format_... | {
"split": "train",
"index": 66124,
"acecode_id": "bigcode_python_fns_27685",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers and returns a new list containing only the elements that are greater than a specified benchmark value of 10. The function should be defined as follows: def larger_than_benchmark(nums: List[int]) -> List[int]:\nPlease reason ste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert larger_than_benchmark([5, 8, 10, 12, 15, 17, 20]) == [12, 15, 17, 20]\", \"assert larger_than_benchmark([1, 2, 3, 4, 5]) == []\", \"assert larger_than_benchmark([11, 12, 13]) == [11, 12, 13]\", \"assert larger_than_benchmark([10, 10, 10]) == []\", \"assert l... | {
"split": "train",
"index": 66125,
"acecode_id": "evol_4320",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates user profile data. The function should take a dictionary representing a user profile with the following fields: 'username', 'email', 'age', and 'is_active'. The 'username' should be a string with a minimum length of 3 chara... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_user_profile({'username': 'john_doe', 'email': 'john@example.com', 'age': 30, 'is_active': True}) == True\", \"assert validate_user_profile({'username': 'ab', 'email': 'john@example.com', 'age': 30, 'is_active': True}) == False\", \"assert validate_... | {
"split": "train",
"index": 66126,
"acecode_id": "oss_33266",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer representing a time duration in seconds, implement a function `convert_time(_time)` that converts this duration into a human-readable format. The function should return a string formatted as \"x years, y days, z hours, a minutes, b seconds\". You should conside... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_time(0) == '0 years, 0 days, 0 hours, 0 minutes, 0 seconds'\", \"assert convert_time(60) == '0 years, 0 days, 0 hours, 1 minutes, 0 seconds'\", \"assert convert_time(3661) == '0 years, 0 days, 1 hours, 1 minutes, 1 seconds'\", \"assert convert_time(8... | {
"split": "train",
"index": 66127,
"acecode_id": "oss_12359",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of migration operations and returns a dictionary containing the count of each type of operation. Each migration operation is represented as a string in the format \"migrations.OperationName(model_name='ModelNa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_migration_operations(['migrations.AddField(model_name=\\\"Book\\\", name=\\\"title\\\")']) == {'addfield': 1}\", \"assert count_migration_operations(['migrations.RemoveField(model_name=\\\"Book\\\", name=\\\"author\\\")']) == {'removefield': 1}\", \"as... | {
"split": "train",
"index": 66128,
"acecode_id": "oss_31865",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a log source type, and you need to implement a function that checks if the provided type matches a predefined valid log source type. The valid log source type is 'Iptables'. Write a function `check_log_source_type(log_source: str) -> bool` th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_log_source_type('Iptables') == True\", \"assert check_log_source_type('iptables') == False\", \"assert check_log_source_type('IPTABLES') == False\", \"assert check_log_source_type('Nginx') == False\", \"assert check_log_source_type('Apache') == False\"... | {
"split": "train",
"index": 66129,
"acecode_id": "bigcode_python_fns_15821",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function `longest_ascending_subarray(arr)` that returns the length of the longest contiguous ascending subarray. An ascending subarray is defined as a series of consecutive elements where each element is greater than the previous one. If ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_ascending_subarray([5, 6, 2, 3, 4, 7, 9, 10, 14, 15]) == 8\", \"assert longest_ascending_subarray([1, 2, 3, 4, 5]) == 5\", \"assert longest_ascending_subarray([5, 4, 3, 2, 1]) == 1\", \"assert longest_ascending_subarray([1, 3, 2, 3, 4]) == 3\", \"ass... | {
"split": "train",
"index": 66130,
"acecode_id": "evol_26534",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a shape defined by a mesh format and various features. Implement a function that checks whether the shape has vertex normals and whether it includes texture coordinates based on the features provided. The function should return a dictionary containing the followin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shape_properties('obj', ['uv'], False) == {'has_vertex_normals': True, 'has_vertex_texcoords': True, 'vertex_positions': [[-2.85, 0.0, -7.600000], [2.85, 0.0, 0.599999], [2.85, 0.0, -7.600000]]}\", \"assert shape_properties('obj', [], True) == {'has_vertex_n... | {
"split": "train",
"index": 66131,
"acecode_id": "bigcode_python_fns_14861",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Develop a function that accepts three string arguments and constructs a unique string that interweaves characters from the three input string arguments in a cyclic manner. If one string is longer than the others, the remaining characters from that string should be added to the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert interleave_strings('abc', '123', 'xyz') == 'a1xb2yc3z'\", \"assert interleave_strings('a', 'b', 'c') == 'abc'\", \"assert interleave_strings('', '', '') == ''\", \"assert interleave_strings('hello', 'world', '') == 'hweolrllod'\", \"assert interleave_strings... | {
"split": "train",
"index": 66132,
"acecode_id": "evol_35781",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of debug information and returns a string formatted as tab-separated values (TSV). The function should accept a list of dictionaries, where each dictionary contains two keys: 'timestamp' (a string) and 'message' (a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_tsv([]) == ''\", \"assert generate_tsv([{'timestamp': '2022-01-01 12:00:00', 'message': 'Debug message 1'}]) == '2022-01-01 12:00:00\\\\tDebug message 1\\\\n'\", \"assert generate_tsv([{'timestamp': '2022-01-01 12:00:00', 'message': 'Debug message 1... | {
"split": "train",
"index": 66133,
"acecode_id": "oss_14855",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes two integers, 'a' and 'b', and returns their sum. The function should handle both positive and negative integers, as well as the edge cases where either or both integers are zero. You are required to only implement one function named 'sum_of_two'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_two(1, 1) == 2\", \"assert sum_of_two(0, 0) == 0\", \"assert sum_of_two(-1, -1) == -2\", \"assert sum_of_two(1, -1) == 0\", \"assert sum_of_two(-5, 5) == 0\", \"assert sum_of_two(100, 200) == 300\", \"assert sum_of_two(-100, -200) == -300\", \"assert ... | {
"split": "train",
"index": 66134,
"acecode_id": "evol_16269",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_pearson_correlation(predictions, references)` that computes the Pearson correlation coefficient between two lists of numbers. The function should take two parameters: `predictions`, a list of predicted values, and `references`, a list of true val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_pearson_correlation([1, 2, 3], [1, 2, 3]) == 1.0\", \"assert calculate_pearson_correlation([1, 2, 3], [3, 2, 1]) == -1.0\", \"assert calculate_pearson_correlation([1, 2, 3, 4], [1, 2, 3, 4]) == 1.0\", \"assert calculate_pearson_correlation([1, 2, 3... | {
"split": "train",
"index": 66135,
"acecode_id": "oss_8528",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list representing an image, convert the image to BGR format. The input image can be in three different formats: grayscale (2D list), RGBA (3D list with 4 channels), or RGB (3D list with 3 channels). Your task is to implement a function that converts the input image i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_bgr([[255]]) == [[[255, 255, 255]]]\", \"assert convert_to_bgr([[[255, 0, 0, 255]]]) == [[[0, 0, 255]]]\", \"assert convert_to_bgr([[[255, 255, 255]]]) == [[[255, 255, 255]]]\", \"assert convert_to_bgr([[[123, 234, 56]]]) == [[[56, 234, 123]]]\", ... | {
"split": "train",
"index": 66136,
"acecode_id": "bigcode_python_fns_26600",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `count_occurrences_with_options` that counts the occurrences of a substring in a string. The function should support options for case sensitivity and should allow the user to specify a range within the string to search. The function signature is: `def count... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_occurrences_with_options('helloHELLO', 'hello', False) == 2\", \"assert count_occurrences_with_options('abababab', 'aba', True) == 3\", \"assert count_occurrences_with_options('abababab', 'aba', False) == 3\", \"assert count_occurrences_with_options('a... | {
"split": "train",
"index": 66137,
"acecode_id": "evol_12195",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates connecting to a database. The function should take in parameters for an alias, host, an optional port, and a server selection timeout in milliseconds. It should return a message indicating a successful connection if ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert connect('read', 'localhost', 27017, 1000) == 'Connection successful'\", \"assert connect('write', 'localhost', 27017, 500) == 'Connection successful'\", \"assert connect('analytics', 'localhost', None, 2000) == 'Connection successful'\", \"assert connect('te... | {
"split": "train",
"index": 66138,
"acecode_id": "oss_2137",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `depths` and `min_weights`. Your task is to implement a function `find_best_combination(depths: List[int], min_weights: List[int]) -> Tuple[int, int]` that performs a grid search to find the optimal combination of 'max_depth' and 'min_child_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_best_combination([3, 4, 5, 6, 7, 8, 9], [1, 2, 3, 4, 5]) == (9, 5)\", \"assert find_best_combination([2, 3], [1, 2]) == (3, 2)\", \"assert find_best_combination([1, 2, 3], [1]) == (3, 1)\", \"assert find_best_combination([5, 6, 7], [2, 3]) == (7, 3)\", ... | {
"split": "train",
"index": 66139,
"acecode_id": "oss_541",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_factors(n: int) -> List[int]` that takes a positive integer `n` as input and returns a list of all unique factors of that number, including both prime and composite factors, in ascending order. The input `n` will be a positive integer greater than zer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_factors(1) == [1]\", \"assert find_factors(2) == [1, 2]\", \"assert find_factors(3) == [1, 3]\", \"assert find_factors(4) == [1, 2, 4]\", \"assert find_factors(5) == [1, 5]\", \"assert find_factors(6) == [1, 2, 3, 6]\", \"assert find_factors(12) == [1, ... | {
"split": "train",
"index": 66140,
"acecode_id": "evol_14444",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple banking system. Your function should handle various operations related to accounts, categories, tags, transactions, and webhooks. Specifically, the function should take a list of operations, where each operatio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_banking_system([('create_account', {'name': 'John Doe', 'balance': 1000}), ('create_category', {'name': 'Utilities'}), ('create_tag', {'name': 'Monthly'}), ('create_transaction', {'amount': 100, 'category': 'Utilities'}), ('create_webhook', {'url': ... | {
"split": "train",
"index": 66141,
"acecode_id": "oss_564",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `get_even_and_merge(l1: list, l2: list) -> list` that returns only even numbers from both input lists, merged and sorted in descending order. For example, given the lists `[-1, 2, -4, 5, 6]` and `[5, 3, -5, 2, -3, 3, 8, 0, 14, 4, -10]`, the function should retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_even_and_merge([-1, 2, -4, 5, 6], [5, 3, -5, 2, -3, 3, 8, 0, 14, 4, -10]) == [14, 8, 6, 4, 2, 2, 0, -4, -10]\", \"assert get_even_and_merge([1, 3, 5], [7, 9, 11]) == []\", \"assert get_even_and_merge([2, 4, 6], [8, 10, 12]) == [12, 10, 8, 6, 4, 2]\", \"a... | {
"split": "train",
"index": 66142,
"acecode_id": "evol_11864",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple enumeration class in Python. This enumeration should allow you to define named constants with explicit integer values and associated descriptions. Create a function `create_enum` that takes a list of tuples, where each tuple contains a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_enum([('KEY_A', 0, 'Description A'), ('KEY_B', 1, 'Description B')]) == {'KEY_A': {'value': 0, 'description': 'Description A'}, 'KEY_B': {'value': 1, 'description': 'Description B'}}\", \"assert create_enum([('KEY_C', 2, 'Description C')]) == {'KEY_C'... | {
"split": "train",
"index": 66143,
"acecode_id": "bigcode_python_fns_39266",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple dependency management system for a Python package manager. This system allows you to register dependencies and check if a specific dependency is installed. You are required to define a class `Dependency` which has the following attribut... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check('numpy') == False\", \"assert check('pandas') == False\", \"assert check('matplotlib') == False\", \"assert check('requests') == False\", \"assert check('seaborn') == False\"]}"
} | {
"split": "train",
"index": 66144,
"acecode_id": "oss_29257",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer n, implement a function `fibonacci(n)` that returns the n-th Fibonacci number. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n > 1. Your implementation should optimize for time complexity and avoid ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2... | {
"split": "train",
"index": 66145,
"acecode_id": "evol_15640",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing and displaying upcoming events and their corresponding date and time ranges. Each event is represented as a list containing the event name and its start and end date and time in the format [month, day, hour, minute]. Implement a function `upcoming_e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert upcoming_events([11, 30], [12, 0]) == [['WINTER_DECORATIONS', [12, 1, 0, 0], [12, 31, 23, 59]], ['WINTER_CAROLING', [12, 1, 0, 0], [12, 31, 23, 59]], ['CHRISTMAS', [12, 25, 0, 0], [12, 25, 23, 59]], ['NEWYEARS_FIREWORKS', [12, 26, 0, 0], [1, 1, 23, 59]]]\", ... | {
"split": "train",
"index": 66146,
"acecode_id": "oss_25430",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are developing a function to control a robotic arm that has two joints: 'right' and 'left'. Your task is to implement a function `convert_to_dict` that takes an input `inp` and converts it into a dictionary mapping for each robotic arm joint based on the following rules: 1)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_dict('10,20') == {'right': '10', 'left': '20'}\", \"assert convert_to_dict([30, 40]) == {'right': 30, 'left': 40}\", \"assert convert_to_dict(None) == {'right': 0, 'left': 0}\", \"assert convert_to_dict('5,15') == {'right': '5', 'left': '15'}\", \... | {
"split": "train",
"index": 66147,
"acecode_id": "oss_5856",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing a sequence of dependencies, implement a function `parse_dependencies(dependencies: List[int]) -> List[int]` that returns a list where each element in the output list represents the number of dependencies that depend on the corresponding ind... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_dependencies([0, 1, 2, 3, 4]) == [1, 1, 1, 1, 1]\", \"assert parse_dependencies([]) == []\", \"assert parse_dependencies([4, 4, 4, 4, 4]) == [0, 0, 0, 0, 5]\", \"assert parse_dependencies([0]) == [1]\", \"assert parse_dependencies([5, 5, 5, 5, 5, 5]) =... | {
"split": "train",
"index": 66148,
"acecode_id": "bigcode_python_fns_18690",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with converting a simplified Abstract Syntax Tree (AST) representation of a single Python statement into its corresponding source code string. The AST will be represented as a dictionary where the key is the type of the statement and the value is another dictiona... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ast_to_source({'Assign': {'target': 'x', 'value': '5'}}) == 'x = 5'\", \"assert ast_to_source({'Print': {'value': 'Hello, World!'}}) == 'print(\\\"Hello, World!\\\")'\", \"assert ast_to_source({'Assign': {'target': 'y', 'value': '10'}}) == 'y = 10'\", \"asse... | {
"split": "train",
"index": 66149,
"acecode_id": "bigcode_python_fns_29446",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and a dictionary with integer keys and unique string values, return the list in a special order. For each element in the list, append its corresponding string value from the dictionary to a new list. Then order this new list in a peculiar manner: Start ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert peculiar_ordering([1, 2, 3, 4, 5], {1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e'}) == ['a', 'e', 'b', 'd', 'c']\", \"assert peculiar_ordering([-1, 0, 1], {-1: 'neg', 0: 'zero', 1: 'pos'}) == ['neg', 'pos', 'zero']\", \"assert peculiar_ordering([2, 5, 1, 4, 3], {1:... | {
"split": "train",
"index": 66150,
"acecode_id": "evol_22843",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of historical records, represented as dictionaries with 'date' and 'value' keys. Your function should take a list of such records, reverse the order of the records, and return the reversed list. Each record shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_historical_data([{ 'date': '2022-01-01', 'value': 100 }, { 'date': '2022-01-02', 'value': 150 }, { 'date': '2022-01-03', 'value': 120 }]) == [{ 'date': '2022-01-03', 'value': 120 }, { 'date': '2022-01-02', 'value': 150 }, { 'date': '2022-01-01', 'val... | {
"split": "train",
"index": 66151,
"acecode_id": "oss_30345",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple counter. The function should accept a series of commands to perform operations on the counter, which starts at 0 and is initially alive. The commands are as follows: 'increment', 'decrement', 'close', and 'get_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_counter(['increment', 'increment', 'get_value']) == 2\", \"assert simulate_counter(['increment', 'decrement', 'get_value']) == 0\", \"assert simulate_counter(['increment', 'increment', 'close', 'increment', 'get_value']) == 2\", \"assert simulate_co... | {
"split": "train",
"index": 66152,
"acecode_id": "oss_25652",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes DNS records for multiple hosted zones. Your function should take a list of hosted zones, each represented as a dictionary containing the zone name and its configuration, and a list of records to be created or deleted. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_dns_records([{'name': 'example.com', 'config': {'PrivateZone': False}}], [{'zone-name': 'example.com', 'record-name': 'www', 'type': 'A', 'value': '192.0.2.1'}]) == ['Created record www of type A in zone example.com']\", \"assert process_dns_records(... | {
"split": "train",
"index": 66153,
"acecode_id": "bigcode_python_fns_24972",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Write a function `find_employee(employees: List[Tuple[str, str, int]], query: str) -> str` that takes a list of employee data and a query string. The list consists of tuples where each tuple contains the employee ID (string), employee name (string), and years of service (intege... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_employee([('E001', 'Alice Smith', 5), ('E002', 'Bob Johnson', 3)], 'E001') == 'ID: E001 , Name: Alice Smith , Years of service: 5'\", \"assert find_employee([('E001', 'Alice Smith', 5), ('E002', 'Bob Johnson', 3)], 'E002') == 'ID: E002 , Name: Bob Johns... | {
"split": "train",
"index": 66154,
"acecode_id": "evol_18697",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple rate limiter. The rate limiter allows a certain number of requests within a specific time frame. The function should take three parameters: 'limit' (an integer representing the maximum number of requests allowe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_rate_limit(5, 3, '2023-10-01 12:00:00') == {'limit': 5, 'remaining': 3, 'resetAt': '2023-10-01 12:00:00'}\", \"assert get_rate_limit(5, 0, '2023-10-01 12:00:00') == {'limit': 5, 'remaining': 0, 'resetAt': '2023-10-01 12:00:00'}\", \"assert get_rate_limit... | {
"split": "train",
"index": 66155,
"acecode_id": "bigcode_python_fns_10110",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that creates a user profile dictionary given a user's name, age, and location. The function should take three parameters: 'name' (a string), 'age' (an integer), and 'location' (a string). It should return a dictionary containing these details with the keys ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_user_profile('Alice', 30, 'New York') == {'name': 'Alice', 'age': 30, 'location': 'New York'}\", \"assert create_user_profile('Bob', 25, 'Los Angeles') == {'name': 'Bob', 'age': 25, 'location': 'Los Angeles'}\", \"assert create_user_profile('Charlie',... | {
"split": "train",
"index": 66156,
"acecode_id": "evol_23676",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing ionospheric data represented as a 2D array of numerical values. Implement a function `find_maximum` that takes a 2D list of floats and returns the maximum value found in the array. If the array is empty or if all values are NaN (Not a Number), the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_maximum([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]) == 6.0\", \"assert find_maximum([[], []]) == None\", \"assert find_maximum([[0.0, 0.0], [0.0, 0.0]]) == 0.0\", \"assert find_maximum([[float('nan')]]) == None\", \"assert find_maximum([[float('nan'), 3.0], [1.... | {
"split": "train",
"index": 66157,
"acecode_id": "oss_12204",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to transform each integer in the list according to the following rules: If the integer is divisible by 3, replace it with 'Fizz'. If the integer is divisible by 5, replace it with 'Buzz'. If the integer is divisible by both 3 and 5... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fizz_buzz_list([1, 2, 3]) == [1, 2, 'Fizz']\", \"assert fizz_buzz_list([5, 10, 15]) == ['Buzz', 'Buzz', 'FizzBuzz']\", \"assert fizz_buzz_list([-3, -5, -15]) == ['Fizz', 'Buzz', 'FizzBuzz']\", \"assert fizz_buzz_list([0, 1, 2]) == ['FizzBuzz', 1, 2]\", \"ass... | {
"split": "train",
"index": 66158,
"acecode_id": "bigcode_python_fns_19645",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple package management system that can handle the installation and removal of packages. Your system should be able to add new packages and remove existing packages. You need to implement a function `manage_packages(operations: List[Tuple[str, s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_packages([('add', 'numpy'), ('add', 'pandas'), ('remove', 'numpy')]) == ['numpy', 'numpy, pandas', 'pandas']\", \"assert manage_packages([('add', 'matplotlib'), ('remove', 'matplotlib')]) == ['matplotlib', '']\", \"assert manage_packages([('add', 'req... | {
"split": "train",
"index": 66159,
"acecode_id": "oss_19538",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that filters a list of patients based on specific criteria. The function should take in a list of patients and return a filtered list based on the given criteria. If the input list is empty, the function should return an empty list. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_patients([], 'age', 25) == []\", \"assert filter_patients([{'name': 'Alice', 'age': 25, 'gender': 'female'}], 'age', 25) == [{'name': 'Alice', 'age': 25, 'gender': 'female'}]\", \"assert filter_patients([{'name': 'Bob', 'age': 30, 'gender': 'male'}], ... | {
"split": "train",
"index": 66160,
"acecode_id": "oss_4167",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called 'can_it_fly' that determines if a given list of integers can 'fly'. A list can 'fly' if it meets the following conditions: it must be a palindrome, the sum of its elements must be less than or equal to a given weight 'w', it must contain exactly 'n' ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_it_fly([1, 2], 5, 2, 3, 4) == False\", \"assert can_it_fly([3, 2, 3], 1, 2, 1, 3) == False\", \"assert can_it_fly([3], 5, 1, 1, 0) == True\", \"assert can_it_fly([7, 7, 7], 21, 1, 0, 0) == False\", \"assert can_it_fly([2, 3, 2, 3], 10, 3, 2, 2) == False\... | {
"split": "train",
"index": 66161,
"acecode_id": "evol_9193",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates an SVG representation of a simple circle. The function should take in parameters for the circle's center coordinates, radius, stroke color, and fill color. Implement the function `draw_circle(center: Tuple[int, int], radius... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert draw_circle((50, 50), 30, 'rgb(10, 10, 16)', 'red') is None\", \"assert draw_circle((100, 100), 20, 'rgb(255, 0, 0)', 'blue') is None\", \"assert draw_circle((0, 0), 10, 'rgb(0, 255, 0)', 'yellow') is None\", \"assert draw_circle((200, 200), 15, 'rgb(0, 0, 2... | {
"split": "train",
"index": 66162,
"acecode_id": "evol_481",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining the order of feed types based on their digestibility for a group of animals. Digestibility is related to the nitrogen to carbon ratio of different feed types. You will receive a dictionary that maps feed type identifiers to their nitrogen and car... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert order_feed_types({'agliv_1': (0, 0), 'agliv_2': (2, 2), 'stded_1': (0, 0)}) == ['agliv_2', 'agliv_1', 'stded_1']\", \"assert order_feed_types({'agliv_1': (6, 12), 'stded_1': (0, 0)}) == ['agliv_1', 'stded_1']\", \"assert order_feed_types({'agliv_1': (4, 8), ... | {
"split": "train",
"index": 66163,
"acecode_id": "bigcode_python_fns_8431",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary `feature` where each key is a string representing the name of a band, and each value is a nested list (2D list) representing the raw data of that band. Your task is to implement a function `get_normalized_band(feature: dict, name: str, size: int) -> L... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_normalized_band({'band1': [[1, 2], [3, 4]]}, 'band1', 2) == [[0.0, 0.3333333333333333], [0.6666666666666666, 1.0]]\", \"assert get_normalized_band({'band2': [[5, 5], [5, 5]]}, 'band2', 2) == [[0.0, 0.0], [0.0, 0.0]]\", \"assert get_normalized_band({'band... | {
"split": "train",
"index": 66164,
"acecode_id": "bigcode_python_fns_41273",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_maximum` that returns the maximum integer from the list. If the list is empty, the function should return None. The input list can contain both positive and negative integers. Your task is to implement the `find_maximum` function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_maximum([3, 5, 1, 8, 2]) == 8\", \"assert find_maximum([-1, -5, -3, -4]) == -1\", \"assert find_maximum([0, 0, 0]) == 0\", \"assert find_maximum([]) == None\", \"assert find_maximum([100, 200, 300]) == 300\", \"assert find_maximum([-10, -20, 5, -30]) ==... | {
"split": "train",
"index": 66165,
"acecode_id": "bigcode_python_fns_8817",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with filtering out obscene words from a given text. Implement a function called `filter_obscene_words(text: str, obscene_words: List[str]) -> str` that takes a string `text`, and a list of obscene words `obscene_words`. The function should return a new string tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_obscene_words('This is a test.', ['test']) == 'This is a .'\", \"assert filter_obscene_words('Hello World!', ['hello']) == ' World!'\", \"assert filter_obscene_words('No obscene words here.', []) == 'No obscene words here.'\", \"assert filter_obscene_... | {
"split": "train",
"index": 66166,
"acecode_id": "oss_23199",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of points represented as tuples (u, v) on a 2D surface, write a function that determines if a curve can be interpolated through these points with the following conditions: \n1. The first point and the last point should be equal if the curve is closed. \n2. If the c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_interpolate([(0.0, 0.5), (1.0, 0.5)], 0.1, False, 0) == True\", \"assert can_interpolate([(0.0, 0.5), (0.0, 0.5)], 0.1, True, 0) == True\", \"assert can_interpolate([(0.0, 0.5), (1.0, 0.5)], 0.1, True, 0) == False\", \"assert can_interpolate([(0.0, 0.5),... | {
"split": "train",
"index": 66167,
"acecode_id": "bigcode_python_fns_36072",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are required to implement a function called `process_datum` that takes an integer `datum` as input and processes it according to the following rules: If the datum is even, it should be multiplied by 2. If the datum is odd, it should be incremented by 1. The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_datum(0) == 0\", \"assert process_datum(1) == 2\", \"assert process_datum(2) == 4\", \"assert process_datum(3) == 4\", \"assert process_datum(4) == 8\", \"assert process_datum(5) == 6\", \"assert process_datum(6) == 12\", \"assert process_datum(7) ==... | {
"split": "train",
"index": 66168,
"acecode_id": "oss_25309",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats a database connection string. The function should take a dictionary containing the database connection details and return a formatted connection string. The input dictionary will have the following keys: 'host', 'port', and '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_db_connection({'host': 'localhost', 'port': 27017, 'database': 'mydb'}) == 'localhost:27017/mydb'\", \"assert format_db_connection({'host': '127.0.0.1', 'port': 5432, 'database': 'testdb'}) == '127.0.0.1:5432/testdb'\", \"assert format_db_connection({... | {
"split": "train",
"index": 66169,
"acecode_id": "bigcode_python_fns_11911",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a square matrix represented as a list of lists, determine if it is a permutation matrix. A permutation matrix is a square binary matrix (only contains 0s and 1s) where each row and each column contains exactly one '1' and all other elements are '0'. Implement a function `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_permutation_matrix([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) == True\", \"assert is_permutation_matrix([[0, 1, 0], [0, 0, 1], [1, 0, 0]]) == True\", \"assert is_permutation_matrix([[1, 0], [0, 0]]) == False\", \"assert is_permutation_matrix([[1, 0, 0], [1, 0, 0]... | {
"split": "train",
"index": 66170,
"acecode_id": "bigcode_python_fns_3847",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of mixed data types which may include integers, strings, dictionaries, or lists. Your task is to implement a function `extract_first_value(data)` that extracts the first valid value from the list. A valid value is defined as follows: if the value is a list,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_first_value([1, 2, 3]) == 1\", \"assert extract_first_value(['a', 'b', 'c']) == 'a'\", \"assert extract_first_value([{'value': 'found'}, 2, 3]) == 'found'\", \"assert extract_first_value([[1, 2], 3, 4]) == 1\", \"assert extract_first_value([2, {'valu... | {
"split": "train",
"index": 66171,
"acecode_id": "bigcode_python_fns_8663",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two integers, `num_cols` and `num_rows`, which represent the number of columns and rows, respectively. Your task is to create a grid (2D list) filled with the integer `1`. Implement a function `create_ones_grid(num_cols: int, num_rows: int) -> List[List[int]]` tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_ones_grid(3, 2) == [[1, 1, 1], [1, 1, 1]]\", \"assert create_ones_grid(5, 5) == [[1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1]]\", \"assert create_ones_grid(1, 1) == [[1]]\", \"assert create_ones_grid(0, 0) == []\... | {
"split": "train",
"index": 66172,
"acecode_id": "bigcode_python_fns_21164",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a 3D model in the glTF format. This dictionary contains a key 'nodes' which is a list of dictionaries. Each dictionary in the 'nodes' list represents a node and contains a key 'name' which is a string. Write a function that takes in this ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_node_index({'nodes': [{'name': 'Node1'}, {'name': 'Node2'}, {'name': 'Node3'}]}, 'Node2') == 1\", \"assert get_node_index({'nodes': [{'name': 'Node1'}, {'name': 'Node2'}, {'name': 'Node3'}]}, 'Node4') == -1\", \"assert get_node_index({'nodes': []}, 'Node... | {
"split": "train",
"index": 66173,
"acecode_id": "bigcode_python_fns_21581",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the radiance range for different bands in satellite imagery metadata. Implement a function that computes the radiance range based on the type of metadata provided. The function should take three parameters: `metadata_type`, a string that can be e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_radiance_range('newMeta', 1, metadata=type('Metadata', (), {'RADIANCE_MINIMUM_BAND_1': 0.5, 'QUANTIZE_CAL_MAX_BAND_1': 1.0, 'QUANTIZE_CAL_MIN_BAND_1': 0.2})()) == 0.8\", \"assert calculate_radiance_range('oldMeta', 1, metadata=type('Metadata', (), ... | {
"split": "train",
"index": 66174,
"acecode_id": "oss_15123",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple permission system for a web application. The system should determine whether a user has a specific permission based on a list of permissions they possess. You need to implement a function `has_permission(permissions: List[str], permissi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_permission(['read', 'write'], 'read') == True\", \"assert has_permission(['read', 'write'], 'write') == True\", \"assert has_permission(['read', 'write'], 'execute') == False\", \"assert has_permission(['admin', 'user'], 'Admin') == False\", \"assert has... | {
"split": "train",
"index": 66175,
"acecode_id": "oss_17789",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the prices of a stock on different days, write a function that calculates the maximum profit you can achieve by buying on one day and selling on another day. If no profit can be made, return 0. You may assume that you can only make one buy ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxProfit([10, 7, 5, 8, 11, 9]) == 6\", \"assert maxProfit([1, 2, 3, 4, 5]) == 4\", \"assert maxProfit([5, 4, 3, 2, 1]) == 0\", \"assert maxProfit([7, 1, 5, 3, 6, 4]) == 5\", \"assert maxProfit([2, 4, 1]) == 2\", \"assert maxProfit([3, 2]) == 0\", \"assert m... | {
"split": "train",
"index": 66176,
"acecode_id": "evol_8205",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with designing a function that simulates the creation of user accounts based on their names and account types. The function should take a list of tuples where each tuple contains a user's name and their account type ('type1' or 'type2'). Your function should retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_accounts([('Alice', 'type1'), ('Bob', 'type2')]) == ['account_1', 'account_2']\", \"assert create_accounts([('Charlie', 'type1'), ('David', 'type3')]) == ['account_1', 'Invalid account type']\", \"assert create_accounts([('Eve', 'type2'), ('Frank', 't... | {
"split": "train",
"index": 66177,
"acecode_id": "oss_7064",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string consisting of lowercase letters, write a function `count_unique_characters(s: str) -> int` that returns the number of unique characters in the string. For example, if the input string is 'hello', the function should return 4 because the unique characters are 'h',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_characters('hello') == 4\", \"assert count_unique_characters('abcdef') == 6\", \"assert count_unique_characters('aabbcc') == 3\", \"assert count_unique_characters('') == 0\", \"assert count_unique_characters('xyz') == 3\", \"assert count_unique_... | {
"split": "train",
"index": 66178,
"acecode_id": "bigcode_python_fns_19123",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and an integer target. Your function should return a tuple containing the first index of the target integer in the list, the count of occurrences of the target integer in the list, and a boolean indicating wh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_target_info([1, 2, 3, 4, 5], 3) == (2, 1, True)\", \"assert find_target_info([1, 2, 3, 4, 5], 6) == (-1, 0, False)\", \"assert find_target_info([1, 1, 1, 1, 1], 1) == (0, 5, True)\", \"assert find_target_info([-1, -2, -3, -2, -1], -2) == (1, 2, True)\",... | {
"split": "train",
"index": 66179,
"acecode_id": "bigcode_python_fns_37167",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the average intensity from a given list of intensity values. The function should take a list of floats representing intensity values as input and return the average intensity. If the input list is empty, the function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_intensity([1.0, 2.0, 3.0]) == 2.0\", \"assert average_intensity([10.0, 20.0, 30.0, 40.0]) == 25.0\", \"assert average_intensity([5.5, 5.5, 5.5]) == 5.5\", \"assert average_intensity([-1.0, -2.0, -3.0]) == -2.0\", \"assert average_intensity([0.0, 0.0,... | {
"split": "train",
"index": 66180,
"acecode_id": "oss_22546",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two points in 3D space represented by their coordinates p1 and p2, implement a function `distance(p1, p2)` that calculates the Euclidean distance between the two points. Each point is represented as a list of three integers [x, y, z].\nPlease reason step by step, then wri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert distance([1, 2, 3], [4, 5, 6]) == 5.196152422706632\", \"assert distance([0, 0, 0], [1, 1, 1]) == 1.7320508075688772\", \"assert distance([-1, -1, -1], [1, 1, 1]) == 3.4641016151377544\", \"assert distance([3, 4, 5], [3, 4, 5]) == 0.0\", \"assert distance([1... | {
"split": "train",
"index": 66181,
"acecode_id": "evol_28334",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of square-line pairs, where each pair consists of a border type and a line type. The border type can be 'outer', 'inner', or 'none', and the line type can be 'TL' (top-left), 'TR' (top-right), 'BL' (bottom-left), 'BR' (bottom-right), or 'square' (complete s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert countSquares([('outer', 'TR'), ('inner', 'square'), ('outer', 'BL'), ('outer', 'BR'), ('outer', 'TL'), ('none', 'TL')]) == {('outer', 'TR'): 1, ('inner', 'square'): 1, ('outer', 'BL'): 1, ('outer', 'BR'): 1, ('outer', 'TL'): 1, ('none', 'TL'): 1}\", \"assert... | {
"split": "train",
"index": 66182,
"acecode_id": "oss_9565",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of product stock quantities from multiple warehouses, where each warehouse has its own quantity of a particular product. Your task is to implement a function `products_with_low_stock(stocks: List[Tuple[int, int]], threshold: int) -> List[int]` that takes in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert products_with_low_stock([(1, 5), (2, 10), (1, 3)], 8) == [1]\", \"assert products_with_low_stock([(1, 10), (2, 10), (3, 10)], 20) == [1, 2, 3]\", \"assert products_with_low_stock([(1, 5), (1, 5), (2, 5)], 10) == [1, 2]\", \"assert products_with_low_stock([(1... | {
"split": "train",
"index": 66183,
"acecode_id": "bigcode_python_fns_1523",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a list of integers based on specific criteria. Implement a function named `validate_numbers` that takes a list of integers as input and returns a tuple containing two boolean values. The first boolean should indicate whethe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_numbers([1, 2, 3, 4]) == (False, False)\", \"assert validate_numbers([2, 4, 6, 8]) == (False, True)\", \"assert validate_numbers([-1, 0, 2]) == (True, False)\", \"assert validate_numbers([-2, -4, -6]) == (True, True)\", \"assert validate_numbers([1,... | {
"split": "train",
"index": 66184,
"acecode_id": "oss_18920",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer 'x' and a list of integers 'y', your task is to calculate a strange sum based on the elements of 'y' that are greater than or equal to 'x'. First, compute the average of those elements. The strange sum is then defined as 'x + 5 * average'. Additionally, if 'x' ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert main(10, [1, 2, 3, 4, 5]) == None\", \"assert main(100, [10, 20, 30]) == None\", \"assert main(10, []) == None\", \"assert main(15, [5, 10]) == None\", \"assert main(25, [1, 2, 3, 4]) == None\"]}"
} | {
"split": "train",
"index": 66185,
"acecode_id": "evol_23954",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simplified message bundling system. Your goal is to create a function `bundle_messages(messages: List[str]) -> str` that takes a list of messages and concatenates them into a single string separated by a space. The function should return the c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bundle_messages(['Hello', 'World']) == 'Hello World'\", \"assert bundle_messages(['This', 'is', 'a', 'test']) == 'This is a test'\", \"assert bundle_messages(['One', 'Two']) == 'One Two'\", \"assert bundle_messages(['SingleMessage']) == 'SingleMessage'\", \"... | {
"split": "train",
"index": 66186,
"acecode_id": "oss_887",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, develop a function that constructs a binary search tree (BST) from the first list. Then, for each element in the second list, check if that element exists in the BST. If an element from the second list is found in the BST, return its index from the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_indices([2, 9, 3, 1, 5, 7], [1, 7, 5]) == [3, 5, 4]\", \"assert find_indices([10, 20, 30], [20, 40]) == [1, -1]\", \"assert find_indices([5, 3, 8, 1], [8, 1]) == [2, 3]\", \"assert find_indices([1], [1]) == [0]\", \"assert find_indices([1, 2, 3], [4, 5]... | {
"split": "train",
"index": 66187,
"acecode_id": "evol_18678",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a base URL (seed_url) and a list of URLs (links). Your task is to normalize each URL from the list by removing any fragment (the part of the URL after the '#' character) and converting it to an absolute URL based on the base URL. Implement a function `normalize_ur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_urls('http://example.com', ['about', 'http://example.com/contact#info', 'http://example.com/services#details', 'http://other.com/page']) == ['http://example.com/about', 'http://example.com/contact', 'http://example.com/services', 'http://other.com/... | {
"split": "train",
"index": 66188,
"acecode_id": "bigcode_python_fns_49024",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given an array of integers `arr`. Your task is to write a function that returns an array `vector` where each element at index `i` represents the nearest smaller element to the right of `arr[i]`. If there is no smaller element to the right of `arr[i]`, the value at index... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert nearest_smaller_to_right([4, 5, 2, 10, 8]) == [2, 2, -1, 8, -1]\", \"assert nearest_smaller_to_right([5, 4, 3, 2, 1]) == [4, 3, 2, 1, -1]\", \"assert nearest_smaller_to_right([10, 5, 6, 2, 8]) == [5, 2, 2, -1, -1]\", \"assert nearest_smaller_to_right([3, 2, ... | {
"split": "train",
"index": 66189,
"acecode_id": "oss_12443",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string input representing a configuration data and returns a dictionary with the parsed key-value pairs. The configuration data is formatted as 'key1=value1;key2=value2;...'. Your function should handle empty strings and inva... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_config('key1=value1;key2=value2') == {'key1': 'value1', 'key2': 'value2'}\", \"assert parse_config('') == {}\", \"assert parse_config('key1=value1;key1=value1;key2=value2') == {'key1': 'value1', 'key2': 'value2'}\", \"assert parse_config('invalid_forma... | {
"split": "train",
"index": 66190,
"acecode_id": "oss_23366",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a secure random secret key for session management in a web application. The secret key should be a string consisting of random characters chosen from a set of allowed characters, which includes uppercase letters, lowerc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_secret_key(1) != generate_secret_key(1)\", \"assert len(generate_secret_key(5)) == 5\", \"assert all(c in string.ascii_letters + string.digits + string.punctuation for c in generate_secret_key(10))\", \"assert len(generate_secret_key(16)) == 16\", \... | {
"split": "train",
"index": 66191,
"acecode_id": "oss_23670",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the distance and midpoint between two 3D points in space. A 3D point is represented by its coordinates (x, y, z). Your task is to implement a function called `point_operations` that takes in two tuples representing the coordinates of two points a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert point_operations((1, 2, 3), (4, 5, 6)) == (5.196152422706632, (2.5, 3.5, 4.5))\", \"assert point_operations((0, 0, 0), (0, 0, 0)) == (0.0, (0.0, 0.0, 0.0))\", \"assert point_operations((1, 1, 1), (1, 1, 1)) == (0.0, (1.0, 1.0, 1.0))\", \"assert point_operati... | {
"split": "train",
"index": 66192,
"acecode_id": "oss_29486",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given two integers, develop a function that calculates their sum without using the '+' operator. The function should utilize bitwise operations to achieve this. Implement the function `add_without_plus_operator(x: int, y: int) -> int` that takes two integers `x` and `y` and ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_without_plus_operator(0, 0) == 0\", \"assert add_without_plus_operator(1, 1) == 2\", \"assert add_without_plus_operator(5, 3) == 8\", \"assert add_without_plus_operator(-1, -1) == -2\", \"assert add_without_plus_operator(10, 20) == 30\", \"assert add_wit... | {
"split": "train",
"index": 66193,
"acecode_id": "evol_34112",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates URLs for programming problems and contests from the Codeforces online judge platform. Implement a function named `generate_codeforces_url` that takes in two parameters: `problem_code` (a string representing the problem code... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_codeforces_url('A', 1234) == ('https://codeforces.com/contest/1234/problem/A', 'https://codeforces.com/contest/1234')\", \"assert generate_codeforces_url('B', 5678) == ('https://codeforces.com/contest/5678/problem/B', 'https://codeforces.com/contest... | {
"split": "train",
"index": 66194,
"acecode_id": "oss_21520",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with merging multiple lists of integers into a single list while ensuring that the merged list contains only unique integers in sorted order. Write a function `merge_unique_sorted(*lists: List[List[int]]) -> List[int]` that takes in a variable number of lists of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_unique_sorted([1, 2, 3], [3, 4], [2, 5]) == [1, 2, 3, 4, 5]\", \"assert merge_unique_sorted([], [1, 2, 2, 3]) == [1, 2, 3]\", \"assert merge_unique_sorted([5, 5, 5], [5, 5, 5]) == [5]\", \"assert merge_unique_sorted([1, 1, 1], [2, 2, 2]) == [1, 2]\", \... | {
"split": "train",
"index": 66195,
"acecode_id": "bigcode_python_fns_41483",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom loss function for a neural network training process. The loss function combines two components: Negative Log-Likelihood (NLL) loss and Kullback-Leibler (KL) divergence loss, weighted by a KL weight. Your task is to write a Python functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_loss(0.0, 0.0, 1.0, 1) == 0.0\", \"assert custom_loss(1.0, 2.0, 3.0, 1) == 7.0\", \"assert custom_loss(3.0, 6.0, 0.0, 3) == 1.0\", \"assert custom_loss(20.0, 10.0, 1.0, 10) == 3.0\", \"assert custom_loss(15.0, 5.0, 0.0, 5) == 3.0\", \"assert custom_lo... | {
"split": "train",
"index": 66196,
"acecode_id": "oss_26793",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given two strings s and t, create a new string where all occurrences of any character in t that are present in s are removed. Implement a function that takes in these two strings and returns the modified string. Note that subsequent occurrences of the characters in string t sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_characters('hello world!', 'lo') == 'he wrd!'\", \"assert remove_characters('abcdef', '') == 'abcdef'\", \"assert remove_characters('', 'xyz') == ''\", \"assert remove_characters('test case', 't') == 'es case'\", \"assert remove_characters('1234567890... | {
"split": "train",
"index": 66197,
"acecode_id": "evol_6665",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of movie ratings represented as a list of integers. Write a function `calc_mean_score(movies: List[int]) -> float` that calculates the mean score of the movies. The mean should be rounded to one decimal place. If the list is empty, return 0.0. For example, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calc_mean_score([5, 4, 3]) == 4.0\", \"assert calc_mean_score([1, 2, 3, 4, 5]) == 3.0\", \"assert calc_mean_score([5, 5, 5]) == 5.0\", \"assert calc_mean_score([10, 20, 30, 40]) == 25.0\", \"assert calc_mean_score([]) == 0.0\", \"assert calc_mean_score([4]) ... | {
"split": "train",
"index": 66198,
"acecode_id": "bigcode_python_fns_3500",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that calculates relocations for activities based on specific conditions. The function `get_relocations` takes three parameters: an integer `GVT`, a list of dictionaries `activities`, and an integer `horizon`. Each dictionary in the `activ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_relocations(5, [{'location': 'A', 'relocatable': True}, {'location': 'B', 'relocatable': False}], 10) == {}\", \"assert get_relocations(5, [{'location': 'A', 'relocatable': True}, {'location': 'A', 'relocatable': True}], 10) == {}\", \"assert get_relocat... | {
"split": "train",
"index": 66199,
"acecode_id": "oss_6606",
"num_tests": 6
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.