data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are given two dictionaries representing the dispositions of two labels. Each dictionary contains a 'disp' key that maps primary labels to their dispositions, a 'cat' key for the category, a 'bidi' key for the bidirectional property, and a 'cp_out' key representing the code ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_labels('A', {'disp': {'A': 'active'}, 'cat': 'Primary', 'bidi': 'LTR', 'cp_out': '0x0041'}, {'disp': {'A': 'active'}, 'cat': 'Primary', 'bidi': 'LTR', 'cp_out': '0x0041'}) == (True, '')\", \"assert compare_labels('A', {'disp': {'A': 'active'}, 'cat':... | {
"split": "train",
"index": 67800,
"acecode_id": "bigcode_python_fns_39799",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing heights of a series of buildings. Your task is to implement a function `max_water_trapped(heights: List[int]) -> int` that calculates the maximum amount of water that can be trapped between the buildings after a rain. The water trap... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_water_trapped([0,1,0,2,1,0,1,3,2,1,2,1]) == 6\", \"assert max_water_trapped([4,2,0,3,2,5]) == 9\", \"assert max_water_trapped([]) == 0\", \"assert max_water_trapped([1]) == 0\", \"assert max_water_trapped([1,1]) == 0\", \"assert max_water_trapped([1,2]) ... | {
"split": "train",
"index": 67801,
"acecode_id": "bigcode_python_fns_41934",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function that returns all unique permutations of the string. The function should not use any built-in permutation functions and should handle cases with duplicate characters efficiently. The output should be a list of strings representing the unique ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sorted(unique_permutations('abc')) == ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']\", \"assert sorted(unique_permutations('aab')) == ['aab', 'aba', 'baa']\", \"assert sorted(unique_permutations('aaa')) == ['aaa']\", \"assert sorted(unique_permutations('abcd'))... | {
"split": "train",
"index": 67802,
"acecode_id": "evol_16259",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a Python dictionary where the keys are state abbreviations and the values are their corresponding full names. Write a function `reverse_state_dict(state_dict)` that takes this dictionary as input and returns a new dictionary where the keys are the full state names... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_state_dict({'AL': 'ALAMEDA', 'CA': 'CALIFORNIA', 'NY': 'NEW YORK'}) == {'ALAMEDA': 'AL', 'CALIFORNIA': 'CA', 'NEW YORK': 'NY'}\", \"assert reverse_state_dict({'TX': 'TEXAS', 'FL': 'FLORIDA'}) == {'TEXAS': 'TX', 'FLORIDA': 'FL'}\", \"assert reverse_st... | {
"split": "train",
"index": 67803,
"acecode_id": "oss_15446",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_passphrase()` that creates a randomized passphrase using four distinct English words, one distinct symbol, and one randomly chosen digit. The passphrase should be formatted such that the chosen elements are intertwined. The function should return the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_passphrase() != generate_passphrase()\", \"assert len(generate_passphrase()) > 0\", \"assert any(char.isdigit() for char in generate_passphrase())\", \"assert generate_passphrase().count('@') == 0\", \"assert generate_passphrase().count('#') == 0\",... | {
"split": "train",
"index": 67804,
"acecode_id": "evol_18182",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of atom representations from a protein structure, where each atom is represented as a dictionary containing 'atom_name' and its corresponding 'position' in a 3D space (x, y, z). Your task is to implement a function `get_alpha_carbon_positions(atoms: List[Di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_alpha_carbon_positions([{'atom_name': 'CA', 'position': (1, 2, 3)}, {'atom_name': 'N', 'position': (4, 5, 6)}]) == [(1, 2, 3)]\", \"assert get_alpha_carbon_positions([{'atom_name': 'O', 'position': (1, 2, 3)}, {'atom_name': 'CA', 'position': (7, 8, 9)}])... | {
"split": "train",
"index": 67805,
"acecode_id": "bigcode_python_fns_16167",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `custom_sort` that takes a list of integers as input and returns a new list that contains the same integers sorted in ascending order. You must not use Python's built-in sort function. The input list may contain duplicate values. The function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_sort([3, 5, 4, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert custom_sort([]) == []\", \"assert custom_sort([5, 5, 5]) == [5, 5, 5]\", \"assert custom_sort([-1, -3, 2, 0]) == [-3, -1, 0, 2]\", \"assert custom_sort([10, 9, 8, 7, 6]) == [6, 7, 8, 9, 10]\", \"ass... | {
"split": "train",
"index": 67806,
"acecode_id": "evol_21744",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function called `test_exceptions` that takes two parameters, `value1` and `value2`. This function should handle different types of exceptions that may arise during arithmetic operations. Specifically, it should catch `ZeroDivisionError`, `TypeError`, and any other gener... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert test_exceptions(10, 0) == 'Error: Division by zero encountered.'\", \"assert test_exceptions(10, 'a') == 'Error: Unsupported operand types.'\", \"assert test_exceptions('10', 2) == 'Error: Unsupported operand types.'\", \"assert test_exceptions(10, None) == ... | {
"split": "train",
"index": 67807,
"acecode_id": "evol_23639",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list that may contain integers, floats, complex numbers, booleans, None, or nested lists, implement a function `find_min_disparity(arr)` that returns the minimum absolute difference between any two numeric elements in the list and the corresponding pair of elements that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_min_disparity([1.5, 2.5, 3.5]) == (1.0, (1.5, 2.5))\", \"assert find_min_disparity([True, False, 1, 2, None]) == (0, (1, 1))\", \"assert find_min_disparity(['a', 'b', None, 2, 3]) == (1, (2, 3))\", \"assert find_min_disparity([]) == 'Not enough numeric ... | {
"split": "train",
"index": 67808,
"acecode_id": "evol_34379",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that finds the maximum difference between any two elements in the list, where the larger element appears after the smaller element. The function should return this maximum difference. If no such difference exists, return 0.\nPlease... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_difference([3, 5, 1, 9, 2]) == 8\", \"assert max_difference([7, 1, 2, 5, 3]) == 4\", \"assert max_difference([10, 7, 5, 3, 2]) == 0\", \"assert max_difference([1, 2, 3, 4, 5]) == 4\", \"assert max_difference([5, 3, 2, 1]) == 0\", \"assert max_difference(... | {
"split": "train",
"index": 67809,
"acecode_id": "bigcode_python_fns_39235",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary of allergens and their potential ingredients. Each allergen maps to a set of ingredients that may contain it. Your task is to implement a function `find_allergen_ingredients(possible_allergens: dict) -> dict` that returns a dictionary mapping allergen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_allergen_ingredients({'dairy': {'milk', 'cheese'}, 'nuts': {'almonds'}, 'fish': {'salmon'}, 'shellfish': {'shrimp'}}) == {'nuts': 'almonds', 'fish': 'salmon', 'shellfish': 'shrimp'}\", \"assert find_allergen_ingredients({'meat': {'chicken', 'beef'}, 'nu... | {
"split": "train",
"index": 67810,
"acecode_id": "oss_28236",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates raising a business exception. The function, `raise_business_exception`, should take an error code, an optional error message, and optional error data. If the error message is not provided, it should default to a predefi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert raise_business_exception('404') == {'error_code': '404', 'error_message': 'Not Found', 'error_data': None, 'error_app': 'bsm_config'}\", \"assert raise_business_exception('500') == {'error_code': '500', 'error_message': 'Internal Server Error', 'error_data':... | {
"split": "train",
"index": 67811,
"acecode_id": "bigcode_python_fns_26548",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a line in a document. The document may contain various types of content, including headers, footers, and commands. Your task is to extract and return a list of commands that are enclosed between the lines \"# ### sta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_commands([\\\"Header\\\", \\\"# ### start commands ###\\\", \\\"COMMAND 1\\\", \\\"COMMAND 2\\\", \\\"# ### end commands ###\\\", \\\"Footer\\\"]) == [\\\"COMMAND 1\\\", \\\"COMMAND 2\\\"]\", \"assert extract_commands([\\\"Some text\\\", \\\"# ### st... | {
"split": "train",
"index": 67812,
"acecode_id": "oss_26423",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to manage the inventory of a grocery store. Specifically, you need to implement a function `manage_inventory(operations: List[Tuple[str, str, int]]) -> List[Dict[str, int]]` that processes a list of operations on the inventory. Each opera... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_inventory([('add', 'apple', 10), ('add', 'banana', 5)]) == [{'name': 'apple', 'quantity': 10}, {'name': 'banana', 'quantity': 5}]\", \"assert manage_inventory([('add', 'apple', 10), ('update', 'apple', 15)]) == [{'name': 'apple', 'quantity': 15}]\", \... | {
"split": "train",
"index": 67813,
"acecode_id": "oss_4882",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a platform name. Write a function called `unload_platforms` that takes in a list of strings and returns a boolean indicating whether all platforms were successfully unloaded. The function should simulate the unloadin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unload_platforms(['Platform1', 'Platform2', 'Platform3']) == True\", \"assert unload_platforms(['Platform1', '', 'Platform3']) == False\", \"assert unload_platforms(['', 'Platform2', '']) == False\", \"assert unload_platforms(['Platform1']) == True\", \"asse... | {
"split": "train",
"index": 67814,
"acecode_id": "bigcode_python_fns_8918",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the behavior of asteroids in a 2D space environment. Each asteroid is represented by its position (x, y), velocity (vx, vy), and radius. Write a function called `simulate_asteroids` that takes a list of asteroids, where each asteroid is represente... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_asteroids([{'position': (0, 0), 'velocity': (1, 0), 'radius': 1}, {'position': (2, 0), 'velocity': (-1, 0), 'radius': 1}], 1) == ([(1, 0), (1, 0)], [True])\", \"assert simulate_asteroids([{'position': (0, 0), 'velocity': (2, 2), 'radius': 3}, {'posi... | {
"split": "train",
"index": 67815,
"acecode_id": "oss_18719",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a dataset represented as a list of lists where each inner list corresponds to a row of data. Each element in the inner lists is a string, and you need to convert all the values in a specified column of the dataset from strings to floats. Implement a function `conv... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert (data := [['1.2', '2.3'], ['3.4', '4.5']]) or (convert_column_to_float(data, 0) or data == [[1.2, '2.3'], [3.4, '4.5']])\", \"assert (data := [[' 5.6 ', ' 6.7 '], [' 7.8', '8.9']]) or (convert_column_to_float(data, 1) or data == [[' 5.6 ', 6.7], [' 7.8... | {
"split": "train",
"index": 67816,
"acecode_id": "bigcode_python_fns_17989",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `are_anagrams(s1: str, s2: str) -> bool` that takes in two strings and returns True if they are anagrams of each other, or False otherwise. Two strings are considered anagrams if they contain the same characters in the same frequency, regardless of their order.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_anagrams('bombe', 'bemob') == True\", \"assert are_anagrams('listen', 'silent') == True\", \"assert are_anagrams('triangle', 'integral') == True\", \"assert are_anagrams('apple', 'papel') == True\", \"assert are_anagrams('rat', 'tar') == True\", \"assert... | {
"split": "train",
"index": 67817,
"acecode_id": "evol_11904",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function to calculate the factorial of a given non-negative integer n using recursion. The function should return the factorial value. You can assume that the input n will be a non-negative integer.\nPlease reason step by step, then write a self-contained Python solutio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(... | {
"split": "train",
"index": 67818,
"acecode_id": "evol_22731",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the indices of a dataset. Your task is to implement a function that checks if the provided index is valid for accessing the dataset. A valid index is only 0, meaning you should return True if the index is 0 and False for any other i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_index(0) == True\", \"assert is_valid_index(1) == False\", \"assert is_valid_index(-1) == False\", \"assert is_valid_index(2) == False\", \"assert is_valid_index(5) == False\", \"assert is_valid_index(10) == False\", \"assert is_valid_index(100) == ... | {
"split": "train",
"index": 67819,
"acecode_id": "bigcode_python_fns_31635",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `get_standard_container_list()` that returns a list of standard container names used in programming languages. The list should include the following containers: 'Array', 'List', 'Set', 'Map', 'Stack', 'Queue', 'Deque', 'HashMap', 'HashSet', 'TreeMap', 'TreeSet'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_standard_container_list() == ['Array', 'List', 'Set', 'Map', 'Stack', 'Queue', 'Deque', 'HashMap', 'HashSet', 'TreeMap', 'TreeSet', 'Vector', 'LinkedList', 'PriorityQueue', 'Tuple', 'Dictionary', 'String', 'Stream', 'File']\", \"assert 'Array' in get_sta... | {
"split": "train",
"index": 67820,
"acecode_id": "bigcode_python_fns_31452",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `next_prime(n: int) -> int` that takes an integer `n` as input and returns the smallest prime number greater than `n`. A prime number is defined as a natural number greater than 1 that is not a product of two smaller natural numbers. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next_prime(0) == 2\", \"assert next_prime(1) == 2\", \"assert next_prime(2) == 3\", \"assert next_prime(3) == 5\", \"assert next_prime(4) == 5\", \"assert next_prime(5) == 7\", \"assert next_prime(6) == 7\", \"assert next_prime(7) == 11\", \"assert next_prim... | {
"split": "train",
"index": 67821,
"acecode_id": "oss_3389",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the root of a binary tree, return the values of the nodes that are visible when the tree is viewed from the right side, arranged in a top-to-bottom order. A node is considered visible from the right side if it is the last node encountered at its respective level during a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rightSideView(TreeNode(1, TreeNode(2), TreeNode(3, None, TreeNode(4)))) == [1, 3, 4]\", \"assert rightSideView(TreeNode(1, None, TreeNode(3))) == [1, 3]\", \"assert rightSideView(None) == []\", \"assert rightSideView(TreeNode(1)) == [1]\", \"assert rightSide... | {
"split": "train",
"index": 67822,
"acecode_id": "evol_9479",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representation of a number, reverse the order of a specified number of triplets of digits in that string. Each triplet consists of three consecutive digits. If the number of triplets exceeds the available triplets in the string, only reverse the available triplet... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_triplets('123456789', 0) == '123456789'\", \"assert reverse_triplets('456789', 2) == '789456'\", \"assert reverse_triplets('000111222333', 4) == '333222111000'\", \"assert reverse_triplets('123456789', 3) == '789456123'\", \"assert reverse_triplets('... | {
"split": "train",
"index": 67823,
"acecode_id": "evol_33309",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a user is authenticated and returns a corresponding response. The function should take a dictionary representing a user and a view function as arguments. The user dictionary contains a boolean key 'is_authenticated' that in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_user_authenticated({'is_authenticated': True}, lambda: 'View executed') == 'View executed'\", \"assert check_user_authenticated({'is_authenticated': False}, lambda: 'View executed') == {'code': 400, 'errmsg': '\\u8bf7\\u767b\\u5f55\\u540e\\u91cd\\u8bd5... | {
"split": "train",
"index": 67824,
"acecode_id": "oss_11915",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a notification system. Your goal is to create a function called `noti_emit` that sends a notification message to a specific destination. The function takes two parameters: `msg` (a string representing the notification message) and an optional `r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert noti_emit('Hello, World!') == 'Message sent to all clients.'\", \"assert noti_emit('Hello, Room A', 'Room A') == 'Message sent to Room A.'\", \"assert noti_emit('Update available!') == 'Message sent to all clients.'\", \"assert noti_emit('Meeting at 3 PM', '... | {
"split": "train",
"index": 67825,
"acecode_id": "oss_5829",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `count_candidates` that takes a list of candidate names as input and returns the number of unique candidates. The input will be an array of strings representing the names of the candidates. Your function should count the unique... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_candidates(['Alice', 'Bob', 'Alice', 'Charlie']) == 3\", \"assert count_candidates(['Alice', 'alice', 'Bob', 'bob', 'Charlie']) == 3\", \"assert count_candidates([]) == 0\", \"assert count_candidates(['John', 'Doe', 'Jane', 'Doe', 'john']) == 3\", \"as... | {
"split": "train",
"index": 67826,
"acecode_id": "oss_34933",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a JSON object, write a function `find_keys(json_data: dict, keys: List[str]) -> List[Any]` that extracts all values associated with the specified keys from the JSON object, including values nested within other objects or arrays. The function should handle cases where keys... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_keys({'book': {'title': 'To Kill a Mockingbird', 'author': 'Harper Lee', 'publicationYear': 1960}}, ['author', 'publicationYear']) == ['Harper Lee', 1960]\", \"assert find_keys({'book': {'additionalInfo': {'nominations': {'author': 'N/A', 'publicationYe... | {
"split": "train",
"index": 67827,
"acecode_id": "evol_19783",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a string as input and moves all numeric substrings to the end of the string while maintaining the relative order of the non-numeric characters. The function should also return the count of unique numeric substrings found in the input string. The nume... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert move_numbers('hello-100world1.5') == ('helloworld', 2)\", \"assert move_numbers('') == ('', 0)\", \"assert move_numbers('123abc456def') == ('abcdef', 2)\", \"assert move_numbers('no_numbers_here') == ('no_numbers_here', 0)\", \"assert move_numbers('test-3.14... | {
"split": "train",
"index": 67828,
"acecode_id": "evol_2437",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with evaluating whether a given list of disciplines can be categorized as examples of 'Partitioned Bureaucracy'. A discipline is considered to be part of 'Partitioned Bureaucracy' if it contains the term 'neoclassical economics'. Write a function `is_partitioned_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_partitioned_bureaucracy(['Anglo-Saxon neoclassical economics']) == True\", \"assert is_partitioned_bureaucracy(['Behavioral economics', 'Game theory']) == False\", \"assert is_partitioned_bureaucracy(['Econometrics', 'Development economics']) == False\", ... | {
"split": "train",
"index": 67829,
"acecode_id": "bigcode_python_fns_13052",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of strings representing numerical values. Your function should convert each string to a floating-point value. If a string cannot be converted to a float, your function should return `None` for that value in the o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_numerical_strings(['3.14', '2.718', 'hello', '42']) == [3.14, 2.718, None, 42.0]\", \"assert process_numerical_strings(['-5', '2.0', 'text', '3e4']) == [-5.0, 2.0, None, 30000.0]\", \"assert process_numerical_strings(['1', '2', '3', '4']) == [1.0, 2.... | {
"split": "train",
"index": 67830,
"acecode_id": "oss_29182",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves a list of time logs for a specific user based on their user ID, epic ID, month, and year. Each time log should include the ID, username, epic name, epic area name, start time, end time, hours counted, and days counted. Impl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_timelogs(1, 2, 5, 2023) == [{'id': 101, 'username': 'user1', 'epic_name': 'Epic A', 'epic_area_name': 'Area 1', 'start_time': '2023-05-01T08:00:00', 'end_time': '2023-05-01T12:00:00', 'count_hours': 4, 'count_days': 1}]\", \"assert get_timelogs(2, 3, 6, ... | {
"split": "train",
"index": 67831,
"acecode_id": "bigcode_python_fns_22832",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a GitHub repository's information. Implement a function `manage_repo` that takes a repository's name as input and performs a series of operations: increment the number of stars by a given number, change the repository's name, and return the final st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_repo('repo1', 0) == {'name': 'repo1', 'stars': 0}\", \"assert manage_repo('repo1', 1) == {'name': 'repo1', 'stars': 1}\", \"assert manage_repo('repo1', 5) == {'name': 'repo1', 'stars': 5}\", \"assert manage_repo('repo2', 3) == {'name': 'repo2', 'stars... | {
"split": "train",
"index": 67832,
"acecode_id": "oss_15787",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a dictionary and returns a list of keys sorted by their corresponding values in ascending order. If two or more keys have the same value, sort those keys in alphabetical order (case insensitive). Implement this function to ensure it performs efficien... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_keys_by_value({'z': 1, 'a': 2, 'b': 3, 'd': 4, 'y': 5, 'x': 5}) == ['z', 'a', 'b', 'd', 'x', 'y']\", \"assert sort_keys_by_value({'apple': 3, 'banana': 2, 'cherry': 2, 'date': 1}) == ['date', 'banana', 'cherry', 'apple']\", \"assert sort_keys_by_value({... | {
"split": "train",
"index": 67833,
"acecode_id": "evol_3456",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two integer values representing bytes, `first_int_byte` and `second_int_byte`, both in the range from 0 to 255. Your task is to write a function that normalizes these two integer bytes into a single integer by converting them into their hexadecimal representation,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_bytes(255, 255) == 65535\", \"assert normalize_bytes(0, 0) == 0\", \"assert normalize_bytes(1, 2) == 258\", \"assert normalize_bytes(255, 0) == 65280\", \"assert normalize_bytes(5, 5) == 1285\", \"assert normalize_bytes(1, 0) == 256\", \"assert nor... | {
"split": "train",
"index": 67834,
"acecode_id": "bigcode_python_fns_20161",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Alice and Bob are playing a game with a chalkboard that initially contains non-negative integers. On their turns, each player can either remove one number from the chalkboard or replace an even number with its half (rounded down). Alice goes first. If at any point the sum of th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert canAliceWin([0, 0, 0]) == True\", \"assert canAliceWin([2, 3, 5]) == True\", \"assert canAliceWin([2, 4, 8]) == True\", \"assert canAliceWin([4, 4, 4]) == True\", \"assert canAliceWin([1, 2, 3]) == True\", \"assert canAliceWin([6, 6, 6]) == True\", \"assert ... | {
"split": "train",
"index": 67835,
"acecode_id": "evol_4477",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates unique test cases based on given constraints. The function should take in two integers: `minLength`, the minimum length of each test case, and `minSequences`, the minimum number of unique sequences required. The functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_unique_test_case(1, 5) == [(0,), (1,), (2,), (3,), (4,)]\", \"assert generate_unique_test_case(2, 3) == [(0, 0), (0, 1), (0, 2)]\", \"assert generate_unique_test_case(3, 2) == [(0, 0, 0), (0, 0, 1)]\", \"assert generate_unique_test_case(3, 5) == [(0... | {
"split": "train",
"index": 67836,
"acecode_id": "oss_27341",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of orders, where each order is represented as a dictionary containing the following keys: 'id' (an integer representing the order ID), 'status' (a string representing the current status of the order), 'date' (a string representing the date when the order wa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_order_status([{'id': 1, 'status': 'Pending', 'date': '2021-01-18T13:23:40', 'payment_method': 'credit', 'products': [], 'total_price': 100.0}, {'id': 2, 'status': 'Shipped', 'date': '2021-01-19T09:00:00', 'payment_method': 'paypal', 'products': [], 't... | {
"split": "train",
"index": 67837,
"acecode_id": "bigcode_python_fns_8915",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a testing framework for a scientific computing library. The framework consists of a series of test cases, each responsible for testing a specific module of the library. Your function should accept a list of test module ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run_tests(['Shape', 'Slice']) == {'Shape': 'Test Shape module passed', 'Slice': 'Test Slice module passed'}\", \"assert run_tests(['Timer']) == {'Timer': 'Test Timer module passed'}\", \"assert run_tests(['Utils', 'DtypeInfo']) == {'Utils': 'Test Utils modul... | {
"split": "train",
"index": 67838,
"acecode_id": "oss_7417",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers, where each integer represents the height of a building. Your task is to implement a function that calculates the total amount of rainwater that can be trapped between the buildings after it rains. The rainwater trapped is determined by the heig... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert trap_rainwater([0,1,0,2,1,0,1,3,2,1,2,1]) == 6\", \"assert trap_rainwater([4,2,0,3,2,5]) == 9\", \"assert trap_rainwater([1,0,2]) == 1\", \"assert trap_rainwater([2,0,2]) == 2\", \"assert trap_rainwater([1,1,1,1]) == 0\", \"assert trap_rainwater([0,2,0]) == ... | {
"split": "train",
"index": 67839,
"acecode_id": "bigcode_python_fns_41899",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, write a function that returns a sorted list of all unique characters present in the strings combined. The function should ignore case sensitivity (i.e., 'a' and 'A' are considered the same character) and should not include any whitespace characters in t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_chars(['abc', 'ABC']) == ['a', 'b', 'c']\", \"assert unique_chars(['']) == []\", \"assert unique_chars(['Different cases']) == ['a', 'c', 'd', 'e', 'f', 'i', 'n', 'r', 's', 't']\", \"assert unique_chars(['aabbcc', 'AABBCC']) == ['a', 'b', 'c']\", \"as... | {
"split": "train",
"index": 67840,
"acecode_id": "bigcode_python_fns_10156",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Write a recursive function in Python to compute the factorial of a non-negative integer n. The factorial of n, denoted as n!, is the product of all positive integers less than or equal to n. Implement the function as follows: def factorial(n):\nPlease reason step by step, then ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(... | {
"split": "train",
"index": 67841,
"acecode_id": "evol_20118",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `notify_device_disappearance` that simulates the removal of a device and notifies observers about the event. The function takes three parameters: a list of observers (strings), a dictionary of devices (where keys are device names and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert notify_device_disappearance(['Observer1', 'Observer2'], {'DeviceA': 1, 'DeviceB': 2}, 'DeviceA') == ['Device DeviceA has disappeared.', 'Device DeviceA has disappeared.']\", \"assert notify_device_disappearance(['Observer1'], {'DeviceX': 10, 'DeviceY': 20}, ... | {
"split": "train",
"index": 67842,
"acecode_id": "oss_4326",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dataset represented as a list of dictionaries, where each dictionary contains information about an office. Each dictionary has the following structure: {'Office Name': str, 'Location': str, 'Employees': int}. Implement a function `get_office_count_by_location(of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_office_count_by_location([], 'New York') == 0\", \"assert get_office_count_by_location([{'Office Name': 'Office A', 'Location': 'New York', 'Employees': 10}], 'New York') == 1\", \"assert get_office_count_by_location([{'Office Name': 'Office A', 'Locatio... | {
"split": "train",
"index": 67843,
"acecode_id": "bigcode_python_fns_32970",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of numbers, `list_a` and `list_b`, write a function `zip_apply` that takes a function `fn` that accepts two float arguments and returns a single float. The function should apply `fn` to each pair of corresponding elements from `list_a` and `list_b`, returning a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert zip_apply(lambda x, y: x + y, [1.0, 2.0, 3.0], [4.0, 5.0, 6.0]) == [5.0, 7.0, 9.0]\", \"assert zip_apply(lambda x, y: x * y, [1.0, 2.0], [3.0, 4.0]) == [3.0, 8.0]\", \"assert zip_apply(lambda x, y: x - y, [10.0, 20.0, 30.0], [1.0, 2.0, 3.0]) == [9.0, 18.0, 2... | {
"split": "train",
"index": 67844,
"acecode_id": "bigcode_python_fns_42864",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of quintic polynomial coefficients and a specific time value. Your task is to implement a function that calculates the position at that time based on the quintic polynomial defined by the coefficients. The polynomial is represented as follows: P(t) = c[0] *... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_position([1, 0, 0, 0, 0, 0], 1) == 1\", \"assert calculate_position([0, 0, 0, 0, 0, 1], 5) == 1\", \"assert calculate_position([1, 1, 1, 1, 1, 1], 1) == 6\", \"assert calculate_position([0, 0, 0, 0, 0, 0], 10) == 0\", \"assert calculate_position([2... | {
"split": "train",
"index": 67845,
"acecode_id": "bigcode_python_fns_24058",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining whether a specific host is reachable over TCP on a given port within a specified timeout. Write a function `is_host_reachable(host: str, port: int, timeout: int) -> bool` that attempts to establish a TCP connection to the provided host and port. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_host_reachable('8.8.8.8', 53, 5) == True\", \"assert is_host_reachable('256.256.256.256', 80, 5) == False\", \"assert is_host_reachable('0.0.0.0', 80, 5) == False\", \"assert is_host_reachable('example.com', 443, 5) == True\", \"assert is_host_reachable('... | {
"split": "train",
"index": 67846,
"acecode_id": "bigcode_python_fns_10541",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and an integer representing the number of left rotations to perform on the list. Your task is to rotate the list to the left by the given number of rotations and return the updated list as the output. The rotation should be performed in such a w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert left_rotate([1, 2, 3, 4, 5], 2) == [3, 4, 5, 1, 2]\", \"assert left_rotate([1, 2, 3, 4, 5], 0) == [1, 2, 3, 4, 5]\", \"assert left_rotate([1, 2, 3, 4, 5], 5) == [1, 2, 3, 4, 5]\", \"assert left_rotate([1, 2, 3, 4, 5], 6) == [2, 3, 4, 5, 1]\", \"assert left_r... | {
"split": "train",
"index": 67847,
"acecode_id": "oss_7510",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `count_primes_in_range(start: int, end: int) -> int` that takes two integers, `start` and `end`, and returns the count of prime numbers within the inclusive range from `start` to `end`. The function should handle cases where `start` is greater than `end`, retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_primes_in_range(0, 100) == 25\", \"assert count_primes_in_range(1, 1) == 0\", \"assert count_primes_in_range(2, 2) == 1\", \"assert count_primes_in_range(20, 20) == 0\", \"assert count_primes_in_range(15, 15) == 0\", \"assert count_primes_in_range(0, 0... | {
"split": "train",
"index": 67848,
"acecode_id": "evol_30217",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the coordinates of four distinct points on a Cartesian plane, determine whether the quadrilateral formed by these points contains the origin (0, 0). Implement the function `contains_origin(quadrilateral: List[Tuple[int, int]]) -> bool`, where `quadrilateral` is a list of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contains_origin([(-175, 41), (-421, -714), (574, -645), (100, 200)]) == False\", \"assert contains_origin([(1, 1), (2, 2), (3, 1), (2, 0)]) == False\", \"assert contains_origin([(100, 100), (200, 200), (200, 100), (100, 200)]) == False\", \"assert contains_o... | {
"split": "train",
"index": 67849,
"acecode_id": "evol_16451",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `has_permission` that determines if a user has permission to access a specific object based on certain conditions. The function should accept the following parameters: \n1. `obj`: an object that has a method `get_user()` which... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_permission(MockObj(user1), user1) == True\", \"assert has_permission(MockObj(user2), user1) == False\", \"assert has_permission(MockObj(user1), user1, allow_superuser=False) == True\", \"assert has_permission(MockObj(user2), user2, allow_superuser=False)... | {
"split": "train",
"index": 67850,
"acecode_id": "bigcode_python_fns_17253",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes three integers representing the lengths of the sides of a triangle and returns a string indicating whether the triangle is 'Equilateral', 'Isosceles', or 'Scalene'. An equilateral triangle has all three sides of equal length, an isosceles triangl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_triangle_type(3, 3, 3) == 'Equilateral'\", \"assert check_triangle_type(5, 5, 3) == 'Isosceles'\", \"assert check_triangle_type(4, 2, 4) == 'Isosceles'\", \"assert check_triangle_type(6, 7, 8) == 'Scalene'\", \"assert check_triangle_type(10, 10, 10) ==... | {
"split": "train",
"index": 67851,
"acecode_id": "evol_6368",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `doubly_linked_list_operations(operations: List[Tuple[str, int]]) -> List[bool]` that takes a list of operations to perform on a doubly linked list of integers. Each operation is represented as a tuple, where the first element is a string that can be either... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert doubly_linked_list_operations([('insert', 15), ('search', 15)]) == [True]\", \"assert doubly_linked_list_operations([('insert', 10), ('insert', 20), ('search', 10)]) == [True]\", \"assert doubly_linked_list_operations([('insert', 25), ('search', 30)]) == [Fa... | {
"split": "train",
"index": 67852,
"acecode_id": "evol_20672",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that analyzes the results of a test suite. The function should take a list of tuples representing the outcomes of tests, where each tuple contains the name of the test case and a boolean indicating if it passed (True) or failed (False).... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_test_results([('test1', True), ('test2', False)]) == {'total': 2, 'passed': 1, 'failed': 1}\", \"assert analyze_test_results([('test1', True), ('test2', True), ('test3', True)]) == {'total': 3, 'passed': 3, 'failed': 0}\", \"assert analyze_test_resul... | {
"split": "train",
"index": 67853,
"acecode_id": "bigcode_python_fns_26911",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `update_user_uri_list(existing_uris, new_uris)` that takes two lists of URIs and returns a new list that contains all unique URIs from both lists. The order of the URIs in the resulting list should be the same as their first appearanc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_user_uri_list(['http://example.com'], ['http://example.com']) == ['http://example.com']\", \"assert update_user_uri_list(['http://example.com'], ['http://example.org']) == ['http://example.com', 'http://example.org']\", \"assert update_user_uri_list([... | {
"split": "train",
"index": 67854,
"acecode_id": "oss_902",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes three integers as input and returns the median value among those integers. The function should handle all integer values, including negative integers and zero, accurately.\nPlease reason step by step, then write a self-contained Python solution. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median_of_three(1, 2, 3) == 2\", \"assert median_of_three(3, 1, 2) == 2\", \"assert median_of_three(-1, 0, 1) == 0\", \"assert median_of_three(-10, -5, -1) == -5\", \"assert median_of_three(0, 0, 0) == 0\", \"assert median_of_three(10, 20, 30) == 20\", \"ass... | {
"split": "train",
"index": 67855,
"acecode_id": "evol_3334",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple banking operation for an account. Implement a function called `bank_operations` that takes an initial balance and a list of operations. Each operation is either a deposit (represented as a positive integer) or a withdrawal (represented as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_operations(1000, [200, -150, -300]) == 750\", \"assert bank_operations(600, [200, -100, -300, 200]) == 600\", \"assert bank_operations(0, []) == 0\", \"assert bank_operations(400, [-400, 400, -200]) == 200\", \"assert bank_operations(800, [100, -250, 50... | {
"split": "train",
"index": 67856,
"acecode_id": "oss_10505",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of IDs and retrieves corresponding text data for each ID from a predefined set of mappings. The function should take a list of IDs and return a dictionary where the keys are the IDs and the values are the corresp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_text_data([1, 2, 3]) == {1: 'Text for 1', 2: 'Text for 2', 3: 'Not Found'}\", \"assert fetch_text_data([4, 5]) == {4: 'Not Found', 5: 'Not Found'}\", \"assert fetch_text_data([]) == {}\", \"assert fetch_text_data([1]) == {1: 'Text for 1'}\", \"assert f... | {
"split": "train",
"index": 67857,
"acecode_id": "oss_5723",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of strings and returns a new list containing only the unique strings, maintaining the order of their first occurrence. Write a function `unique_strings(strings: List[str]) -> List[str]` that achieves this. The input ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_strings(['apple', 'banana', 'apple', 'orange']) == ['apple', 'banana', 'orange']\", \"assert unique_strings(['a', 'b', 'c', 'a', 'b', 'c']) == ['a', 'b', 'c']\", \"assert unique_strings(['hello', 'world', 'hello']) == ['hello', 'world']\", \"assert un... | {
"split": "train",
"index": 67858,
"acecode_id": "bigcode_python_fns_24222",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a dictionary representing package data for a software distribution. The dictionary contains information about the inclusion of specific file types within the package. Your task is to implement a function that filters... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_package_data({'include_package_data': True, 'package_data': {'': ['*.svg', '*.ui']}}, ['*.svg']) == {'include_package_data': True, 'package_data': {'': ['*.ui']}}\", \"assert filter_package_data({'include_package_data': True, 'package_data': {'': ['*.... | {
"split": "train",
"index": 67859,
"acecode_id": "oss_16097",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates running a test on a device with an APK. Your function should accept the following parameters: `apk_path` (a string representing the path to an APK file), `refresh_bins` (a boolean indicating whether to refresh binaries), `d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run_test_simulation(None, False, None, False) == 'No APK provided'\", \"assert run_test_simulation('/path/to/app.apk', False, None, False) == 'No device specified'\", \"assert run_test_simulation('/path/to/app.apk', False, '654321', False) == 'Running tests ... | {
"split": "train",
"index": 67860,
"acecode_id": "bigcode_python_fns_14536",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a function `fibonacci_sequence(n)` that generates the first `n` numbers in the Fibonacci sequence using an array data structure. The function should raise a ValueError if `n` is not a positive integer. The Fibonacci sequence starts with 0 and 1, and each subsequent number... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci_sequence(1) == [0]\", \"assert fibonacci_sequence(2) == [0, 1]\", \"assert fibonacci_sequence(3) == [0, 1, 1]\", \"assert fibonacci_sequence(4) == [0, 1, 1, 2]\", \"assert fibonacci_sequence(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci_sequence(6) =... | {
"split": "train",
"index": 67861,
"acecode_id": "evol_33930",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `isDuplicatedOffer` that checks if there exists an active offer with the same name and category ID in a list of offers. The function takes two parameters: a string `name` representing the name of the offer to check for duplication and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isDuplicatedOffer('Summer Sale', 1) == True\", \"assert isDuplicatedOffer('Winter Sale', 2) == False\", \"assert isDuplicatedOffer('Cyber Monday', 4) == False\", \"assert isDuplicatedOffer('Easter Discount', 3) == False\", \"assert isDuplicatedOffer('Memoria... | {
"split": "train",
"index": 67862,
"acecode_id": "oss_25441",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Create a function that accepts an alphanumeric string as input and returns the sum of all the individual digits present in the string. Additionally, the function should check whether the string contains any characters other than digits and letters. If such invalid characters ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_digits_in_string('a1b2c3d4e5') == 15\", \"assert sum_digits_in_string('123abc') == 6\", \"assert sum_digits_in_string('abcDEF') == 0\", \"assert sum_digits_in_string('1a2b3c4') == 10\", \"assert sum_digits_in_string('') == 0\", \"assert sum_digits_in_str... | {
"split": "train",
"index": 67863,
"acecode_id": "evol_5932",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of sentences, write a function `get_vocabulary(sentences: List[str]) -> Tuple[List[str], Dict[str, int]]` that computes the vocabulary of the provided sentences. The function should return a tuple containing two elements: a sorted list of unique words in descending... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_vocabulary(['Hello world', 'hello again']) == (['hello', 'world', 'again'], {'hello': 2, 'world': 1, 'again': 1})\", \"assert get_vocabulary(['This is a test.', 'This is only a test.']) == (['this', 'is', 'a', 'test', 'only'], {'this': 2, 'is': 2, 'a': 2... | {
"split": "train",
"index": 67864,
"acecode_id": "bigcode_python_fns_31738",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a skyline. Your task is to determine the maximum height of the buildings that can be seen from the left side. A building can be seen if it is taller than all the buildings to its left. Write a function `m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_visible_height([1, 3, 2, 4, 1]) == 4\", \"assert max_visible_height([5, 3, 8, 2, 6]) == 8\", \"assert max_visible_height([1, 2, 3, 4, 5]) == 5\", \"assert max_visible_height([5, 4, 3, 2, 1]) == 5\", \"assert max_visible_height([2, 2, 2, 2]) == 2\", \"ass... | {
"split": "train",
"index": 67865,
"acecode_id": "bigcode_python_fns_32635",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a string as input and returns a dictionary containing the count of each unique alphabetical character in both upper-case and lower-case forms. The dictionary should have keys representing each character, and values representing the number of times ea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert charCount('Hello World') == {'h': 1, 'e': 1, 'l': 3, 'o': 2, 'w': 1, 'r': 1, 'd': 1}\", \"assert charCount('abcABC') == {'a': 2, 'b': 2, 'c': 2}\", \"assert charCount('Python 3.9!') == {'p': 1, 'y': 1, 't': 1, 'h': 1, 'o': 1, 'n': 1}\", \"assert charCount(''... | {
"split": "train",
"index": 67866,
"acecode_id": "evol_24332",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `find_max_value(nums)` that returns the maximum value in the list. If the list is empty, the function should return None.\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 find_max_value([1, 2, 3, 4, 5]) == 5\", \"assert find_max_value([-1, -2, -3, -4, -5]) == -1\", \"assert find_max_value([5, 4, 3, 2, 1]) == 5\", \"assert find_max_value([2, 2, 2, 2, 2]) == 2\", \"assert find_max_value([0]) == 0\", \"assert find_max_value([-10... | {
"split": "train",
"index": 67867,
"acecode_id": "evol_18116",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts a list of dictionaries based on multiple attributes. The function should handle cases where an attribute may not exist in some dictionaries, placing those dictionaries at the end of the sorted list. The function should take a list of dictionaries... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_dict_list([{'name': 'Anna', 'age': 30}, {'name': 'John', 'age': 25}], ['age']) == [{'name': 'John', 'age': 25}, {'name': 'Anna', 'age': 30}]\", \"assert sort_dict_list([{'name': 'Anna', 'age': 30}, {'name': 'Bob', 'age': 30}], ['age', 'name']) == [{'nam... | {
"split": "train",
"index": 67868,
"acecode_id": "evol_21493",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the movement of a turtle based on a series of commands. The turtle starts at a given position (x, y) in a 2D space and can turn left and move forward according to the specified commands. The commands are defined as follows: 'lt(degrees)' turns the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert final_position((0, 0), ['lt(90)', 'fd(1)']) == (0.0, 1.0)\", \"assert final_position((0, 0), ['lt(45)', 'fd(10)']) == (7.07, 7.07)\", \"assert final_position((0, 0), ['fd(100)', 'lt(90)', 'fd(100)', 'lt(90)', 'fd(100)', 'lt(90)', 'fd(100)']) == (0.0, 0.0)\",... | {
"split": "train",
"index": 67869,
"acecode_id": "oss_19232",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates saving the contents of a replay buffer. The function should return a JSON object representing the action of saving the replay buffer. If the replay buffer is not active, the function should return an error message indic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert save_replay_buffer(True) == {'status': 'Success', 'action': 'SaveReplayBuffer'}\", \"assert save_replay_buffer(False) == {'error': 'Replay Buffer is not active'}\", \"assert save_replay_buffer(True) == {'status': 'Success', 'action': 'SaveReplayBuffer'}\", \... | {
"split": "train",
"index": 67870,
"acecode_id": "bigcode_python_fns_10326",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that parses the metadata from a setup dictionary of a Python package and returns a dictionary containing relevant information. The setup dictionary is structured with keys such as 'name', 'version', 'description', 'author', 'author... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_setup_file({'name': 'edhsmm', 'version': '0.1.2', 'description': 'An implementation of HMM', 'author': 'poypoyan', 'author_email': 'poypoyan@example.com', 'url': 'https://github.com/poypoyan/edhsmm', 'license': 'MIT'}) == {'name': 'edhsmm', 'version': ... | {
"split": "train",
"index": 67871,
"acecode_id": "oss_34743",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a URI that conforms to specific license formats. Your task is to implement a function `uri_to_dict(uri: str) -> dict` that converts the given URI into a dictionary containing specific components. The function should handle three types of URIs... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert uri_to_dict('http://licenses.example.com/by/4.0/') == {'code': 'by', 'version': '4.0', 'jurisdiction': None}\", \"assert uri_to_dict('http://licenses.example.com/by/4.0/us/') == {'code': 'by', 'version': '4.0', 'jurisdiction': 'us'}\", \"assert uri_to_dict('... | {
"split": "train",
"index": 67872,
"acecode_id": "bigcode_python_fns_10075",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of change sets represented as dictionaries, where each dictionary contains information about a specific change in a cloud infrastructure management system. Each change set has three keys: 'action', 'logical_resource_id', and 'physical_resou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_change_info({'action': 'Create', 'logical_resource_id': 'MyEC2Instance', 'physical_resource_id': 'i-0abc123'}) == ('Create', 'MyEC2Instance', 'i-0abc123')\", \"assert extract_change_info({'action': 'Update', 'logical_resource_id': 'MyS3Bucket'}) == (... | {
"split": "train",
"index": 67873,
"acecode_id": "oss_30903",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of queue names and returns a formatted string that lists all the queues in a bullet-point format. The input will be a list of strings, where each string represents the name of a queue. If the list is empty, the function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_queues(['Queue1', 'Queue2', 'Queue3']) == '\\u2022 Queue1\\\\n\\u2022 Queue2\\\\n\\u2022 Queue3'\", \"assert format_queues(['QueueA']) == '\\u2022 QueueA'\", \"assert format_queues([]) == 'No queues available.'\", \"assert format_queues(['QueueX', 'Qu... | {
"split": "train",
"index": 67874,
"acecode_id": "bigcode_python_fns_28264",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the dimensions of an image represented by two integers m and n, and a 2D list (matrix) 'image' containing pixel values (integers) of the image, return a new 2D list that represents a downsized version of the image. The downsized image should have dimensions (m//2) x (n//2... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert downsized_image(4, 4, [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]]) == [[3, 5], [11, 13]]\", \"assert downsized_image(3, 3, [[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [[3]]\", \"assert downsized_image(5, 4, [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, ... | {
"split": "train",
"index": 67875,
"acecode_id": "bigcode_python_fns_23394",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes and analyzes a string containing YAML data. The function should take a string as input, which represents YAML formatted data. If the string is successfully deserialized into a dictionary, the function should return the nest... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_yaml_data('key: value') == {'key': 'value'}\", \"assert process_yaml_data('key: {subkey: subvalue}') == {'key': {'subkey': 'subvalue'}}\", \"assert process_yaml_data('- item1\\\\n- item2') == ['item1', 'item2']\", \"assert process_yaml_data('invalid:... | {
"split": "train",
"index": 67876,
"acecode_id": "oss_11483",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a representation of a tree with nodes, where each node has a name and a length. Write a function `validate_tree(tree: List[Tuple[str, int]]) -> None` that checks if the tree is valid based on the following criteria: \n\n1. The tree must contain at least 2 nodes. \... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_tree([('root', 0), ('leaf1', 5)]) is None\", \"assert validate_tree([('root', 0), ('leaf1', 0), ('leaf2', 3)]) is None\", \"assert validate_tree([('root', 0), ('leaf1', 1), ('internal1', 2)]) is None\", \"assert validate_tree([('root', 0), ('leaf1',... | {
"split": "train",
"index": 67877,
"acecode_id": "bigcode_python_fns_17799",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given two strings S and P, write a function that returns a list of all starting indices where the pattern P occurs within the string S. The occurrence should account for overlapping instances. For example, if S = 'AAAA' and P = 'AA', the function should return [0, 1, 2] as the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert final_instance_position('AAAA', 'AA') == [0, 1, 2]\", \"assert final_instance_position('ABABAB', 'AB') == [0, 2, 4]\", \"assert final_instance_position('HelloHello', 'lo') == [3, 8]\", \"assert final_instance_position('banana', 'ana') == [1, 3]\", \"assert f... | {
"split": "train",
"index": 67878,
"acecode_id": "evol_16565",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of country names in English. Your task is to implement a function that translates each country name from English to Spanish. The function should take a list of strings as input, where each string represents a country name in English. The function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert translate_countries(['United States', 'Canada', 'Mexico']) == ['Estados Unidos', 'Canad\\u00e1', 'M\\u00e9xico']\", \"assert translate_countries(['Germany', 'France']) == ['Alemania', 'Francia']\", \"assert translate_countries(['Italy', 'Spain', 'United King... | {
"split": "train",
"index": 67879,
"acecode_id": "bigcode_python_fns_15211",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that calculates the total price of items in a shopping cart after applying a percentage discount based on certain conditions. The function should take a list of items, where each item is a tuple containing the item name (string), item pric... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_price([('Watch', 100, 1)], 25, 5, 1) == 75\", \"assert calculate_total_price([('Shoes', 60, 4)], 30, 5, 4) == 168\", \"assert calculate_total_price([('Book', 15, 6)], 0, 5, 5) == 90\", \"assert calculate_total_price([('Desk', 200, 1), ('Chair... | {
"split": "train",
"index": 67880,
"acecode_id": "oss_23722",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given two integers, x and y, representing the coordinates of a point in a 2D space. You also have two other integers, x_max and y_max, which represent the maximum width and height of a bounding box. Your task is to calculate the relative width and height of the point (x... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_dimensions(10, 20, 100, 200) == {'width': 10.0, 'height': 20.0}\", \"assert calculate_dimensions(0, 0, 100, 200) == {'width': 0.0, 'height': 0.0}\", \"assert calculate_dimensions(50, 100, 100, 200) == {'width': 50.0, 'height': 100.0}\", \"assert ca... | {
"split": "train",
"index": 67881,
"acecode_id": "bigcode_python_fns_40734",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `create_diary_entry(date: str, title: str, text: str, mood: str, weather: str) -> dict` that constructs a digital diary entry. The function should take in a date, title, text content, mood, and weather as parameters and return a dictionary representing the diar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_diary_entry('02/20/2023', 'A Beautiful Day', 'Today was a beautiful day. I went for a long walk in the park...', 'happy', 'sunny') == {'date': '02/20/2023', 'title': 'A Beautiful Day', 'text': 'Today was a beautiful day. I went for a long walk in the ... | {
"split": "train",
"index": 67882,
"acecode_id": "evol_1473",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of 2D points representing the vertices of a polygon. Implement a function `calculate_exterior_length(points)` that calculates the total exterior length of the polygon formed by these points. The exterior length is the sum of the distances between each conse... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_exterior_length([(0, 0), (0, 1), (1, 1), (1, 0)]) == 4.0\", \"assert calculate_exterior_length([(1, 1), (3, 1), (3, 4), (1, 4)]) == 10.0\", \"assert calculate_exterior_length([(0, 0), (3, 0), (3, 4), (0, 4)]) == 14.0\", \"assert calculate_exterior_... | {
"split": "train",
"index": 67883,
"acecode_id": "oss_24467",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Create a function `sort_dict` that takes a dictionary as an input, where the keys are strings and the values are integers. The function should return a new dictionary sorted in ascending order based on the integer values. If two keys have the same integer value, they should mai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_dict({'Jerry': 10, 'Marcus': 3, 'Hanna': 5}) == {'Marcus': 3, 'Hanna': 5, 'Jerry': 10}\", \"assert sort_dict({'Alice': 2, 'Bob': 2, 'Charlie': 1}) == {'Charlie': 1, 'Alice': 2, 'Bob': 2}\", \"assert sort_dict({'X': 5, 'Y': 2, 'Z': 5, 'A': 1}) == {'A': 1... | {
"split": "train",
"index": 67884,
"acecode_id": "evol_8249",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a name, implement a function `change_name(name: str) -> str` that processes the name as follows: If the name is longer than 31 characters, it should be truncated to the first 31 characters. The function should return the processed name. Ensure that t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert change_name('John Doe') == 'John Doe'\", \"assert change_name('Alice') == 'Alice'\", \"assert change_name('') == ''\", \"assert change_name('A' * 32) == 'A' * 31\", \"assert change_name('A' * 31) == 'A' * 31\", \"assert change_name('Short') == 'Short'\", \"a... | {
"split": "train",
"index": 67885,
"acecode_id": "bigcode_python_fns_27746",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines whether a given integer is a prime number. A prime number is defined as a number greater than 1 that has no positive divisors other than 1 and itself. Implement the function `is_prime(n: int) -> bool` that takes an integer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"assert is_prime(7) == True\", \"assert is_prime(8) == False\", \"assert is_prime(9) == False\", \"asser... | {
"split": "train",
"index": 67886,
"acecode_id": "bigcode_python_fns_48147",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple email message generator. Implement a function `generate_email(to: str, subject: str, template: str) -> dict` that takes in the recipient's email address, the subject of the email, and the HTML template for the email body. The function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_email('test@example.com', 'Test Subject', '<h1>Test Body</h1>') == {'to': 'test@example.com', 'subject': 'Test Subject', 'template': '<h1>Test Body</h1>'}\", \"assert generate_email('user@domain.com', 'Welcome', '<p>Welcome to our service!</p>') == ... | {
"split": "train",
"index": 67887,
"acecode_id": "bigcode_python_fns_14337",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a nested list of integers and returns a new list containing only the even numbers. The function should utilize list comprehension and must handle lists with varying levels of nesting. For example, given the list [[1, 2, [3, 4]], 5, [[6, 7], 8]], ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert even_numbers([[1, 2, [3, 4]], 5, [[6, 7], 8]]) == [2, 4, 6, 8]\", \"assert even_numbers([1, [2, 3], 4, [[5], [6]]]) == [2, 4, 6]\", \"assert even_numbers([[[2]], 3, [4]]) == [2, 4]\", \"assert even_numbers([1, 3, 5]) == []\", \"assert even_numbers([[1, 2], [... | {
"split": "train",
"index": 67888,
"acecode_id": "evol_11423",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D array of integers representing a grayscale image, where each integer is between 0 and 255. Your task is to implement a function that converts the image to a binary image based on a threshold value. The binary image should contain 1 for pixels that are greater... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_binary_image([[50, 200], [150, 0]], 100) == [[0, 1], [1, 0]]\", \"assert convert_to_binary_image([[100]], 100) == [[1]]\", \"assert convert_to_binary_image([[255, 255, 255], [0, 0, 0]], 128) == [[1, 1, 1], [0, 0, 0]]\", \"assert convert_to_binary_... | {
"split": "train",
"index": 67889,
"acecode_id": "bigcode_python_fns_15990",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Write a function `hex_to_bin(hexa: str) -> str` that converts a given hexadecimal number (represented as a string) to its binary representation. If the input contains any invalid hexadecimal characters (i.e., characters not in the range 0-9 and A-F/a-f), the function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hex_to_bin('1A3F') == '1101000111111'\", \"assert hex_to_bin('0') == '0'\", \"assert hex_to_bin('FF') == '11111111'\", \"assert hex_to_bin('10') == '10000'\", \"assert hex_to_bin('1') == '1'\", \"assert hex_to_bin('2A') == '101010'\", \"assert hex_to_bin('AB... | {
"split": "train",
"index": 67890,
"acecode_id": "evol_33926",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a unique identifier for a wallet based on a provided seed. The function should take a string `seed` as input and return a string identifier that is derived from the seed using a hashing algorithm. For the purpose of this pr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_wallet_id('testSeed') == 'deeStset_id'\", \"assert generate_wallet_id('exampleSeed') == 'deeSelpmaxe_id'\", \"assert generate_wallet_id('randomString') == 'gnirtSmodnar_id'\", \"assert generate_wallet_id('uniqueSeed') == 'deeSeuqinu_id'\", \"assert ... | {
"split": "train",
"index": 67891,
"acecode_id": "bigcode_python_fns_34581",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with altering a field in a database table for a migration operation. Given the name of a field and its new definition, your goal is to create a migration operation that alters the field in the `auctions` table. Write a function `create_migration_operation(field_n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_migration_operation('start_time', 'models.DateTimeField()') == {'model_name': 'auction', 'name': 'start_time', 'field': 'models.DateTimeField()'}\", \"assert create_migration_operation('end_time', 'models.DateTimeField()') == {'model_name': 'auction',... | {
"split": "train",
"index": 67892,
"acecode_id": "oss_5655",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a three-dimensional matrix and returns a flat list of all its elements in the order they appear. The input will be a list of lists of lists, and the output should be a single list containing each element in the original order. For example, given ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert display_elements([[[1, 2], [3, 4]], [[5, 6], [7, 8]], [[9, 10], [11, 12]]]) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]\", \"assert display_elements([[[0]]]) == [0]\", \"assert display_elements([]) == []\", \"assert display_elements([[[1, 2], [3]], [[4, 5], [... | {
"split": "train",
"index": 67893,
"acecode_id": "evol_35172",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given dictionary containing file paths for CSS and JavaScript resources. The function should extract and return a list of unique file extensions present in the file paths. The dictionary structure is as follows:\n\... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_file_extensions({'css': {'example_css': ('css/examples/main.css',)}, 'js': {}}) == ['css']\", \"assert extract_file_extensions({'css': {}, 'js': {'app': ('js/app/main.js',)}}) == ['js']\", \"assert extract_file_extensions({'css': {'example_css': ('cs... | {
"split": "train",
"index": 67894,
"acecode_id": "oss_3684",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing and concatenating multiple lists of integers. Your goal is to write a Python function that takes a list of lists of integers and concatenates them into a single list. The function should return the concatenated list. If the input list is empty, re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concatenate_lists([[1, 2], [3, 4], [5]]) == [1, 2, 3, 4, 5]\", \"assert concatenate_lists([[1, 2], [], [3]]) == [1, 2, 3]\", \"assert concatenate_lists([[], [], []]) == []\", \"assert concatenate_lists([[1], [2], [3], [4]]) == [1, 2, 3, 4]\", \"assert concat... | {
"split": "train",
"index": 67895,
"acecode_id": "oss_22903",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two positive integers, implement a function that calculates the Greatest Common Divisor (GCD) of the two integers without using any built-in functions for GCD calculation. The function should take two arguments, `a` and `b`, and return their GCD.\nPlease reason step by st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gcd(9, 6) == 3\", \"assert gcd(15, 5) == 5\", \"assert gcd(100, 25) == 25\", \"assert gcd(14, 28) == 14\", \"assert gcd(21, 14) == 7\", \"assert gcd(13, 7) == 1\", \"assert gcd(48, 18) == 6\", \"assert gcd(56, 48) == 8\", \"assert gcd(81, 27) == 27\", \"asse... | {
"split": "train",
"index": 67896,
"acecode_id": "evol_11935",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `update_multimedia_content` that takes a dictionary of attributes and updates the default attributes of a multimedia content instance based on the provided dictionary. The default attributes are as follows: `nola` (None), `is_excluded_fro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_multimedia_content({}) == {'nola': None, 'is_excluded_from_dfp': False, 'can_embed_player': False, 'language': None, 'funder_message': None, 'ga_page': None, 'ga_event': None, 'hashtag': None, 'episode_count': None, 'display_episode_number': False, 's... | {
"split": "train",
"index": 67897,
"acecode_id": "oss_9659",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates adding a new contact to a contact management system. The function should take in a dictionary representing the contact details and return a confirmation message indicating that the contact has been added successfully. The c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_contact({'name': 'Alice', 'email': 'alice@example.com', 'phone': '1234567890'}) == 'Contact added successfully.'\", \"assert add_contact({'name': 'Bob', 'email': 'bob@example.com'}) == 'Error: All fields are required.'\", \"assert add_contact({'name': 'C... | {
"split": "train",
"index": 67898,
"acecode_id": "oss_20094",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and returns a list of all occurrences of the exact phrases 'hello people', 'HELLO PEOPLE', and any case variations in between, along with their respective starting indices in the input string. The function should consider words ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_occurrences('This is a test string with no matches.') == []\", \"assert find_occurrences('No occurrences here!') == []\", \"assert find_occurrences('Hellohello people are not valid') == []\", \"assert find_occurrences('HELLO PEOPLE in all caps!') == [('... | {
"split": "train",
"index": 67899,
"acecode_id": "evol_31244",
"num_tests": 5
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.