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": "Given a list of integers representing the number of eligible stops for students in various scenarios, return a list of the counts of eligible stops that are greater than or equal to a specified threshold. The function should take two parameters: a list of integers 'stop_counts'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert eligible_stops([5, 10, 15, 20], 10) == [10, 15, 20]\", \"assert eligible_stops([1, 2, 3, 4, 5], 3) == [3, 4, 5]\", \"assert eligible_stops([10, 20, 30, 40], 25) == [30, 40]\", \"assert eligible_stops([0, 0, 0, 0], 1) == []\", \"assert eligible_stops([5, 10, ...
{ "split": "train", "index": 66600, "acecode_id": "bigcode_python_fns_31218", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string as an input and returns the string repeated three times. For example, if the input string is 'abc', the output should be 'abcabcabc'.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert double_string('Hello') == 'HelloHelloHello'\", \"assert double_string('World') == 'WorldWorldWorld'\", \"assert double_string('') == ''\", \"assert double_string('Python') == 'PythonPythonPython'\", \"assert double_string('123') == '123123123'\", \"assert do...
{ "split": "train", "index": 66601, "acecode_id": "evol_29743", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of tasks and logs relevant information based on their configurations. Each task is represented by a dictionary containing three keys: 'batchid' (a unique identifier for the batch of tasks), 'tasktype' (a string r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_tasks([{'batchid': '1', 'tasktype': 'TYPE_A', 'apptype': 'App1'}, {'batchid': '2', 'tasktype': 'TYPE_B', 'apptype': 'App2'}]) == ['Processing task 1 of type TYPE_A', 'Processing task 2 of type TYPE_B']\", \"assert process_tasks([{'batchid': '3', 'tas...
{ "split": "train", "index": 66602, "acecode_id": "oss_15364", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a history navigation feature for a software application. The application maintains a model that tracks its current position in a history stack with a variable called `relativeHistoryIndex`. You are provided with a method `forwardAction` that ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert history_forward(3, True) == 3\", \"assert history_forward(5, True) == 5\", \"assert history_forward(0, True) == 0\", \"assert history_forward(7, False) == 0\", \"assert history_forward(2, False) == 0\", \"assert history_forward(10, True) == 10\", \"assert hi...
{ "split": "train", "index": 66603, "acecode_id": "oss_10982", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string 'name' and a value 'default', implement a function 'deferred_setting' that returns a callable function. When this callable function is invoked, it should return a tuple containing the 'name' and 'default' values. Your function should ensure that the returned call...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert deferred_setting('username', 'guest')() == ('username', 'guest')\", \"assert deferred_setting('timeout', 30)() == ('timeout', 30)\", \"assert deferred_setting('retry_limit', 5)() == ('retry_limit', 5)\", \"assert deferred_setting('theme', 'dark')() == ('them...
{ "split": "train", "index": 66604, "acecode_id": "bigcode_python_fns_11659", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that appends cookie information to a given URI. The function should take a URI as input and return the URI with appended cookie information in the format 'Cookie=<cookie_name>=<cookie_value>; <cookie_name>=<cookie_value>; ...'. You ar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert with_cookies('https://example.com/api') == 'https://example.com/api|Cookie=session_id=abc123; user_id=user123'\", \"assert with_cookies('http://test.com') == 'http://test.com|Cookie=session_id=abc123; user_id=user123'\", \"assert with_cookies('https://exampl...
{ "split": "train", "index": 66605, "acecode_id": "oss_11518", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `create_monitor(verbose: int) -> str` that simulates the creation of a monitor object for tracking training progress. This function takes a single argument, `verbose`, which is an integer representing the level of verbosity of the output....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_monitor(0) == 'Monitor object created with verbosity level: 0'\", \"assert create_monitor(1) == 'Monitor object created with verbosity level: 1'\", \"assert create_monitor(2) == 'Monitor object created with verbosity level: 2'\", \"assert create_monit...
{ "split": "train", "index": 66606, "acecode_id": "bigcode_python_fns_47753", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that calculates the price difference between two cryptocurrency pairs given their current prices. Your function should take two cryptocurrency pairs as input, along with their respective current prices, and return the absolute diff...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert price_difference('BTCUSDT', 50000.0, 'ETHUSDT', 4000.0) == 46000.0\", \"assert price_difference('BTCUSDT', 60000.5, 'ETHUSDT', 3500.0) == 56500.5\", \"assert price_difference('BTCUSDT', 0.0, 'ETHUSDT', 3000.0) == 3000.0\", \"assert price_difference('BTCUSDT'...
{ "split": "train", "index": 66607, "acecode_id": "oss_9697", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns a flattened list. If the input list is already a 1-dimensional list, return it as is. If the input list is a 2-dimensional list with a single column, flatten it to a 1-dimensional list. If the input list has any other ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flatten_array([[1], [2], [3]]) == [1, 2, 3]\", \"assert flatten_array([1, 2, 3]) == [1, 2, 3]\", \"assert flatten_array([[1], [2], [3], [4]]) == [1, 2, 3, 4]\", \"assert flatten_array([[1], [2]]) == [1, 2]\", \"assert flatten_array([]) == []\", \"assert flat...
{ "split": "train", "index": 66608, "acecode_id": "bigcode_python_fns_25323", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a specified number of random dinosaur names based on a given text corpus. The function should take the following parameters: a list of dinosaur names, a character-to-index mapping, a number of names to generate, and a seed ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_dino_names([], {'T': 0}, 1, 10) == []\", \"assert generate_dino_names(['Stegosaurus'], {'S': 0, 't': 1, 'e': 2, 'g': 3, 'o': 4, 's': 5, 'a': 6, 'u': 7, 'r': 8}, 0, 5) == []\", \"assert generate_dino_names(['Pterodactyl'], {'P': 0, 't': 1, 'e': 2, 'r...
{ "split": "train", "index": 66609, "acecode_id": "bigcode_python_fns_21053", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing monthly rainfall data and categorizing each month based on the total rainfall. Create a function `classify_rainfall` that takes a list of monthly rainfall measurements as input and returns a list of strings indicating the classification for each mo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_rainfall([2.5, 5.1, 18.3, 22.8, 15.4, 10.2, 8.6, 6.7, 3.5, 1.2, 4.8, 7.3]) == ['LIGHT RAINFALL', 'LIGHT RAINFALL', 'MODERATE RAINFALL', 'PLENTY RAINFALL', 'MODERATE RAINFALL', 'LIGHT RAINFALL', 'LIGHT RAINFALL', 'LIGHT RAINFALL', 'LIGHT RAINFALL', '...
{ "split": "train", "index": 66610, "acecode_id": "oss_31155", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a sequence of observations represented as a string of characters, where each character corresponds to a specific discrete state. Your task is to implement a function `calculate_emission_probabilities(observations: str, letter_to_emission: dict) -> list` that compu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_emission_probabilities('ACGT', {'A': 1, 'C': 2, 'G': 3, 'T': 4}) == [1, 2, 3, 4]\", \"assert calculate_emission_probabilities('XYZ', {'X': 0, 'Y': 1, 'Z': 2}) == [0, 1, 2]\", \"assert calculate_emission_probabilities('', {'A': 1}) == []\", \"assert...
{ "split": "train", "index": 66611, "acecode_id": "bigcode_python_fns_47635", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the heights of a series of bars, write a function `max_area(heights: List[int]) -> int` that computes the largest rectangular area that can be formed by these bars. The width of each bar is assumed to be 1. Bars can be of different heights,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_area([1,8,6,2,5,4,8,3,7]) == 49\", \"assert max_area([1,1]) == 1\", \"assert max_area([4,3,2,1,4]) == 16\", \"assert max_area([]) == 0\", \"assert max_area([1,3,2,3,1]) == 6\", \"assert max_area([1,2,3,4,5,6,7,8,9,10]) == 25\", \"assert max_area([10,9,8,...
{ "split": "train", "index": 66612, "acecode_id": "bigcode_python_fns_38757", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that toggles the active status of a user account based on the username provided. The function should take a list of user accounts and a username as input. Each user account is represented as a dictionary with the keys 'username', 'is_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert toggle_user_status([{'username': 'alice', 'is_active': True, 'is_staff': False}], 'alice') == \\\"'alice' account is now inactive.\\\"\", \"assert toggle_user_status([{'username': 'bob', 'is_active': False, 'is_staff': False}], 'bob') == \\\"'bob' account is...
{ "split": "train", "index": 66613, "acecode_id": "bigcode_python_fns_42635", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given two inputs, implement a function called 'add_two_numbers' that takes two parameters. The function should return the sum of the two numbers if both are integers. If either of the inputs is not an integer, the function should return the error message: 'Invalid Input. Please...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_two_numbers(1, 2) == 3\", \"assert add_two_numbers(-1, 5) == 4\", \"assert add_two_numbers(0, 0) == 0\", \"assert add_two_numbers(10, 20) == 30\", \"assert add_two_numbers(100, 250) == 350\", \"assert add_two_numbers(3.5, 2) == 'Invalid Input. Please inp...
{ "split": "train", "index": 66614, "acecode_id": "evol_10811", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a simplified version of a swing-up control problem for a pendulum. The function `simulate_swingup_control` should take in an integer representing the number of swings to simulate and a boolean indicating whether the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_swingup_control(0, True) == 0\", \"assert simulate_swingup_control(0, False) == 0\", \"assert simulate_swingup_control(1, True) == 10\", \"assert simulate_swingup_control(1, False) == 1\", \"assert simulate_swingup_control(5, True) == 50\", \"assert...
{ "split": "train", "index": 66615, "acecode_id": "oss_16467", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with determining whether a monkey can reach a bunch of bananas hanging from the ceiling. Given the monkey's maximum jump height and the height of the bananas from the ground, create a Python function called `can_reach_bananas` that takes two parameters: `monkey_j...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_reach_bananas(3.5, 4.2) == False\", \"assert can_reach_bananas(3.0, 5.0) == False\", \"assert can_reach_bananas(4.0, 4.0) == True\", \"assert can_reach_bananas(5.0, 3.0) == True\", \"assert can_reach_bananas(2.5, 2.5) == True\", \"assert can_reach_banana...
{ "split": "train", "index": 66616, "acecode_id": "oss_28455", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of buildings in a skyline. Your task is to implement a function `max_area(heights: List[int]) -> int` that calculates the maximum rectangular area that can be formed by any two buildings in the skyline. The width of the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_area([1,8,6,2,5,4,8,3,7]) == 49\", \"assert max_area([1,1]) == 1\", \"assert max_area([4,3,2,1,4]) == 16\", \"assert max_area([1,3,2,5,25,24,5]) == 24\", \"assert max_area([1,2,3,4,5]) == 6\", \"assert max_area([5,4,3,2,1]) == 6\", \"assert max_area([1,2...
{ "split": "train", "index": 66617, "acecode_id": "bigcode_python_fns_27762", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a list of numbers, write a function that determines if the list can be divided into two or more sub-sequences, each of which is an arithmetic sequence. Your function should return the least number of sub-sequences the given list can be divided into while still satisfying ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_sequences([1, 2, 3, 4, 5]) == 1\", \"assert min_sequences([3, 6, 9, 12]) == 1\", \"assert min_sequences([1, 3, 5, 7, 9]) == 1\", \"assert min_sequences([10, 20, 30, 40, 50]) == 1\", \"assert min_sequences([1, 5, 9, 13]) == 1\", \"assert min_sequences([5,...
{ "split": "train", "index": 66618, "acecode_id": "evol_30580", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that takes in the list and a target integer. The function should return all the indices of the target integer in the list. If the target integer is not found, return the string 'Target not found in the list'.\nPlease reason step by ste...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_elements([1, 2, 5, 7, 5, 9, 5], 5) == [2, 4, 6]\", \"assert find_elements([1, 2, 3, 4, 5], 6) == 'Target not found in the list'\", \"assert find_elements([5, 5, 5, 5, 5], 5) == [0, 1, 2, 3, 4]\", \"assert find_elements([], 5) == 'Target not found in the...
{ "split": "train", "index": 66619, "acecode_id": "evol_307", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with verifying the integrity of a file link in a caching system. Implement a function `verify_link(master_link: str, dest_link: str) -> bool` that checks if the destination link points to a valid cached file. The function should return True if the destination lin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_link('master_image_1', 'dest_image_1') == True\", \"assert verify_link('master_image_2', 'dest_image_2') == False\", \"assert verify_link('master_image_4', 'dest_image_4') == False\", \"assert verify_link('master_image_5', 'dest_image_5') == False\", ...
{ "split": "train", "index": 66620, "acecode_id": "bigcode_python_fns_10916", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a 3D matrix composed of integers, implement a function that returns the maximum cumulative product of any submatrix formed by contiguous elements of the 3D matrix. A submatrix is defined as any rectangular block of the original matrix. The function should take the input a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_product_submatrix([[[1]]]) == 1\", \"assert max_product_submatrix([[[0]]]) == 0\", \"assert max_product_submatrix([[[1,-1,1],[1,1,-1]], [[-1,-1,-1],[1,1,1]]]) == 1\", \"assert max_product_submatrix([]) == 0\", \"assert max_product_submatrix([[[1,2],[3,4]...
{ "split": "train", "index": 66621, "acecode_id": "evol_81", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple banking system. Write a function `bank_operations(operations: List[Tuple[str, str, int]]) -> List[int]` that takes a list of operations and returns a list of account balances after performing each operation. Each operation is represented ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_operations([('deposit', 'A', 100), ('deposit', 'A', 50), ('withdraw', 'A', 130)]) == [20]\", \"assert bank_operations([('withdraw', 'ABC', 50), ('deposit', 'ABC', 200), ('withdraw', 'ABC', 150)]) == [50]\", \"assert bank_operations([('deposit', 'X', 100...
{ "split": "train", "index": 66622, "acecode_id": "oss_21890", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes an integer input representing a choice for a game mode and returns that choice. The valid choices are numbers from 1 to 4, where each number corresponds to a different game mode. If the input is not within this range, the funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_game_mode(1) == 1\", \"assert get_game_mode(2) == 2\", \"assert get_game_mode(3) == 3\", \"assert get_game_mode(4) == 4\", \"assert get_game_mode(0) == -1\", \"assert get_game_mode(5) == -1\", \"assert get_game_mode(-1) == -1\", \"assert get_game_mode(10...
{ "split": "train", "index": 66623, "acecode_id": "bigcode_python_fns_260", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a JSON object represented as a Python dictionary. Write a function `remove_none_values(json_data)` that takes this JSON object as input and returns a modified JSON object with all key-value pairs where the value is `None` removed. The function should also handle n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_none_values({'name': 'Alice', 'age': None, 'city': 'Wonderland'}) == {'name': 'Alice', 'city': 'Wonderland'}\", \"assert remove_none_values({'key1': 'value1', 'key2': None, 'key3': {'key4': None, 'key5': 'value5'}}) == {'key1': 'value1', 'key3': {'key...
{ "split": "train", "index": 66624, "acecode_id": "oss_3151", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of strings and a target string to remove from that list. Implement a function `remove_entity_from_list(entity: str, lst: List[str]) -> List[str]` that removes the first occurrence of the target string from the list and returns the updated list. If the targe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_entity_from_list('banana', ['apple', 'orange', 'banana']) == ['apple', 'orange']\", \"assert remove_entity_from_list('apple', ['apple', 'orange', 'banana']) == ['orange', 'banana']\", \"assert remove_entity_from_list('orange', ['apple', 'orange', 'ban...
{ "split": "train", "index": 66625, "acecode_id": "evol_21255", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `find_kth_element` that takes a list of non-negative integers `l` and an integer `k`. The function should return the k-th element of a new list `l'`, where `l'` retains the same elements as `l` at indices not divisible by three, and at indices divisi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_kth_element([1, 2, 3], 1) == 2\", \"assert find_kth_element([1, 2, 3], 0) == 1\", \"assert find_kth_element([1, 2, 3], 2) == 3\", \"assert find_kth_element([5, 6, 3, 4, 8, 9, 2], 4) == 8\", \"assert find_kth_element([5, 6, 3, 4, 8, 9, 2], 5) == 9\", \"a...
{ "split": "train", "index": 66626, "acecode_id": "evol_8469", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, implement a function that inverts the casing of alphabetic characters, replaces odd digits with their subsequent even counterparts, and duplicates any special symbols. Write a function named `adjust_case_and_alter` that takes a single string argument and returns...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert adjust_case_and_alter('A1b2C3d4!') == 'a2B2c4D4!!'\", \"assert adjust_case_and_alter('') == ''\", \"assert adjust_case_and_alter('Uppercase!') == 'uPPERCASE!!'\", \"assert adjust_case_and_alter('Lowercase!') == 'lOWERCASE!!'\", \"assert adjust_case_and_alter...
{ "split": "train", "index": 66627, "acecode_id": "evol_13154", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a list of stack frames represented as dictionaries, where each dictionary contains the keys 'filename', 'lineno', 'name', and 'line' representing the filename, line number, function name, and the line of code respectively. Your task is to create a function that ta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_frame_with_filename([{'filename':'file1.py', 'lineno':1, 'name':'func1', 'line':'print(1)'}, {'filename':'file2.py', 'lineno':2, 'name':'func2', 'line':'print(2)'}], 0) == {'filename':'new_file.py', 'lineno':1, 'name':'func1', 'line':'print(1)'}\", \"as...
{ "split": "train", "index": 66628, "acecode_id": "bigcode_python_fns_21476", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given an integer n, representing the numbers 1 through n. A permutation of these n integers is called a beautiful arrangement if for every i (1 <= i <= n), either perm[i] is a multiple of i or i is a multiple of perm[i]. Your task is to write a function that returns the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert countArrangement(1) == 1\", \"assert countArrangement(2) == 2\", \"assert countArrangement(3) == 3\", \"assert countArrangement(4) == 8\", \"assert countArrangement(5) == 10\", \"assert countArrangement(7) == 41\", \"assert countArrangement(8) == 132\"]}" }
{ "split": "train", "index": 66629, "acecode_id": "evol_24789", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a sequence of frames in a video clip. Your task is to write a function that generates a list of temporary file names for GIF frames based on the given file name and the number of frames. The temporary file names should follow the fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_temp_file_names([1, 2, 3], 'video') == ['video_GIFTEMP0001.png', 'video_GIFTEMP0002.png', 'video_GIFTEMP0003.png']\", \"assert generate_temp_file_names([1, 2], 'clip') == ['clip_GIFTEMP0001.png', 'clip_GIFTEMP0002.png']\", \"assert generate_temp_fil...
{ "split": "train", "index": 66630, "acecode_id": "bigcode_python_fns_16334", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a recursive function in Python that takes an integer and returns a new integer formed by reversing its digits. The function should handle both positive and negative integers, maintaining the sign of the number. For example, if the input is -123, the output should be -...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_integer(123) == 321\", \"assert reverse_integer(-123) == -321\", \"assert reverse_integer(0) == 0\", \"assert reverse_integer(100) == 1\", \"assert reverse_integer(-100) == -1\", \"assert reverse_integer(4567) == 7654\", \"assert reverse_integer(-456...
{ "split": "train", "index": 66631, "acecode_id": "evol_21999", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that sets the attributes of an item based on an input dictionary. The function should take a dictionary as input and update the attributes of an item defined by the keys 'name', 'price', and 'quantity'. If the input dictionary is empt...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_item_attributes({'name': 'Widget', 'price': 19.99, 'quantity': 5}) == {'name': 'Widget', 'price': 19.99, 'quantity': 5}\", \"assert set_item_attributes({'name': 'Gadget', 'price': 29.99}) == {'name': 'Gadget', 'price': 29.99, 'quantity': 0}\", \"assert s...
{ "split": "train", "index": 66632, "acecode_id": "oss_23846", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of strings as input and returns a dictionary where the keys are the strings that appear more than once in the list and the values are their respective counts of occurrences. If there are no duplicates, return an empty dictionary.\nPlease r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_duplicates(['apple', 'banana', 'cherry', 'apple', 'cherry']) == {'apple': 2, 'cherry': 2}\", \"assert count_duplicates(['dog', 'cat', 'dog', 'cat', 'mouse']) == {'dog': 2, 'cat': 2}\", \"assert count_duplicates(['red', 'blue', 'red', 'green', 'blue']) ...
{ "split": "train", "index": 66633, "acecode_id": "evol_22091", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given email address exists in a predefined list of users. The function should take a single string input, representing the email address. If the email exists in the list, return a dictionary with the email as the key and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_email_exists('user1@example.com') == {'user1@example.com': 'exists'}\", \"assert check_email_exists('user2@example.com') == {'user2@example.com': 'exists'}\", \"assert check_email_exists('test@example.com') == {'test@example.com': 'exists'}\", \"assert...
{ "split": "train", "index": 66634, "acecode_id": "bigcode_python_fns_13075", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given secret key is valid for a user submission. The function should take a username and a secret key as input parameters. It will return 'Valid secret key' if the secret key matches the predefined key for the user, and '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_secret_key('test_user', 'hi') == 'Valid secret key'\", \"assert check_secret_key('test_user', 'wrong_key') == 'Invalid secret key'\", \"assert check_secret_key('user1', 'password123') == 'Valid secret key'\", \"assert check_secret_key('user1', 'passwor...
{ "split": "train", "index": 66635, "acecode_id": "bigcode_python_fns_47423", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement the function `extract_number` that takes a float `number` and an integer `precision`, and returns the float number preserving precision up to the specified decimal point. The function should handle both positive and negative floats, ensuring that the output maintains ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_number(4.70, 2) == 4.70\", \"assert extract_number(-3.200, 3) == -3.200\", \"assert extract_number(5.0, 1) == 5.0\", \"assert extract_number(-2.5, 1) == -2.5\", \"assert extract_number(0.0, 2) == 0.00\", \"assert extract_number(3.14159, 3) == 3.142\"...
{ "split": "train", "index": 66636, "acecode_id": "evol_8355", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of sweep names and a specific setup name. Your task is to check if a given sweep name exists in the list of sweep names for that setup. If the sweep name exists, return True; otherwise, return False. Implement a function `check_sweep(sweep_names: List[str],...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_sweep(['LastAdaptive', 'FirstSweep'], 'Setup1', 'LastAdaptive') == True\", \"assert check_sweep(['LastAdaptive', 'FirstSweep'], 'Setup1', 'NonExistentSweep') == False\", \"assert check_sweep(['AdaptiveSweep', 'FinalSweep'], 'Setup2', 'AdaptiveSweep') =...
{ "split": "train", "index": 66637, "acecode_id": "bigcode_python_fns_2397", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a tuple of strings, implement a function that concatenates all the non-empty strings in the tuple, separating them with a plus sign (+). If all strings are empty, return an empty string. Your function should handle any number of strings in the input tuple. Write a functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert join_nonempty(('', '', '')) == ''\", \"assert join_nonempty(('', 'test', '')) == 'test'\", \"assert join_nonempty(('single',)) == 'single'\", \"assert join_nonempty(('',)) == ''\", \"assert join_nonempty(('', '')) == ''\"]}" }
{ "split": "train", "index": 66638, "acecode_id": "bigcode_python_fns_12041", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Write a function that takes a list of strings and returns a new list containing only the valid IPv4 addresses. A valid IPv4 address consists of four decimal numbers separated by dots, where each number is between 0 and 255, inclusive. Implement the function `valid_ipv4_addresse...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert valid_ipv4_addresses(['127.0.0.1', 'hello123', '256.0.0.1', '192.168.0.1']) == ['127.0.0.1', '192.168.0.1']\", \"assert valid_ipv4_addresses(['0.0.0.0', '255.255.255.255', '192.168.1.1']) == ['0.0.0.0', '255.255.255.255', '192.168.1.1']\", \"assert valid_ipv...
{ "split": "train", "index": 66639, "acecode_id": "evol_32313", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with building a function that generates a list of arguments for a hypothetical command-line tool based on a set of provided inputs. Your function should take the following parameters: \n\n- `plugin_name` (string): The name of the plugin to use. \n- `output_path` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_command_args('proto', '/output/path', ['opt1', 'opt2'], ['--verbose'], False) == ['--proto_out=/output/path', '--proto_opt=opt1,opt2', '--verbose']\", \"assert build_command_args('plugin', 'C:\\\\output\\\\path', [], [], True) == ['--plugin_out=C:\\\\o...
{ "split": "train", "index": 66640, "acecode_id": "bigcode_python_fns_17500", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given an image represented by its width and height, along with two float values, height_rate and width_rate, which are used to determine a rectangular region to crop from the image. The height_rate and width_rate must be in the interval (0, 1]. Your task is to write a f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert crop_region(100, 100, 0.5, 0.5) is not None\", \"assert crop_region(200, 150, 0.8, 0.7) is not None\", \"assert crop_region(300, 400, 0.9, 0.9) is not None\", \"assert crop_region(640, 480, 0.1, 0.2) is not None\", \"assert crop_region(800, 600, 0.3, 0.4) is...
{ "split": "train", "index": 66641, "acecode_id": "bigcode_python_fns_36799", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents a protein with a unique 'pdb_code' and a score associated with it. Your task is to implement a function that returns the 'pdb_code' and the corresponding score of the protein with the highest score from the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert result_by_score([{'pdb_code': '1ABC', 'score': 2.5}, {'pdb_code': '2XYZ', 'score': 3.6}, {'pdb_code': '3DEF', 'score': 3.6}], False) == ['2XYZ', 3.6]\", \"assert result_by_score([{'pdb_code': '1ABC', 'score': 1.0}, {'pdb_code': '2XYZ', 'score': 2.0}, {'pdb_c...
{ "split": "train", "index": 66642, "acecode_id": "bigcode_python_fns_16307", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer array, determine if it can be split into three contiguous segments such that the product of the elements in each segment is equal. If it is possible, return True; otherwise, return False. Handle cases where the array is empty or contains zeroes properly.\nPleas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_be_divided([1, 2, 3, 6]) == False\", \"assert can_be_divided([0, 0, 0]) == True\", \"assert can_be_divided([]) == False\", \"assert can_be_divided([1, 2, 2, 4]) == False\", \"assert can_be_divided([2, 2, 4]) == False\", \"assert can_be_divided([8, 2, 2, ...
{ "split": "train", "index": 66643, "acecode_id": "evol_27334", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a DNS resolver. The function should take a list of domain names as input and return a list of corresponding IP addresses. For any domain name provided, the function should always return the fixed IP address '10.15.0.9'. You...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert resolve_domains(['example.com', 'test.com', 'mydomain.org']) == ['10.15.0.9', '10.15.0.9', '10.15.0.9']\", \"assert resolve_domains(['google.com']) == ['10.15.0.9']\", \"assert resolve_domains(['localhost', 'example.local']) == ['10.15.0.9', '10.15.0.9']\", ...
{ "split": "train", "index": 66644, "acecode_id": "oss_26642", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a score between 0 and 100, implement a function `assign_grade(score)` that returns the corresponding grade based on the following criteria: 'A' for scores 90 and above, 'B' for scores 80 to 89, 'C' for scores 70 to 79, 'D' for scores 60 to 69, 'E' for scores 50 to 59, and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert assign_grade(95) == 'A'\", \"assert assign_grade(90) == 'A'\", \"assert assign_grade(89) == 'B'\", \"assert assign_grade(85) == 'B'\", \"assert assign_grade(80) == 'B'\", \"assert assign_grade(79) == 'C'\", \"assert assign_grade(75) == 'C'\", \"assert assign...
{ "split": "train", "index": 66645, "acecode_id": "evol_26241", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `solve_puzzle(puzzle: List[List[int]]) -> List[List[int]]` that takes a 2D list representing a puzzle grid. The grid contains integers that represent different states of the puzzle. The function should return a new 2D list representin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solve_puzzle([[3, 1], [4, 2]]) == [[1, 2], [3, 4]]\", \"assert solve_puzzle([[1, 2], [3, 4]]) == [[1, 2], [3, 4]]\", \"assert solve_puzzle([[4, 3], [2, 1]]) == [[1, 2], [3, 4]]\", \"assert solve_puzzle([[1]]) == [[1]]\", \"assert solve_puzzle([[1, 3], [2, 4]...
{ "split": "train", "index": 66646, "acecode_id": "oss_11516", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a context object represented as a dictionary that contains properties related to a project, including its description, author, version, and a data property. Implement a function called `process_context` that takes this context object as input and modifies its prop...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_context({'project_description': {'text': 'bold description', 'bold': True}, 'project_author': 'Fizzy', 'project_version': '1.2.3', 'data': {'description': ['override for ', {'text': 'data pack', 'color': 'red'}]}}) == {'project_description': {'text':...
{ "split": "train", "index": 66647, "acecode_id": "oss_8086", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D grid representing an image consisting of pixels, where each pixel is represented by a tuple of RGB values (0-255). Implement a function `flood_fill(image: List[List[Tuple[int, int, int]]], seed_pixel: Tuple[int, int], key_color: Tuple[int, int, int], new_colo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flood_fill([[(0, 0, 0), (0, 0, 0), (0, 0, 0)], [(0, 0, 0), (255, 255, 255), (0, 0, 0)], [(0, 0, 0), (0, 0, 0), (0, 0, 0)]], (1, 1), (255, 255, 255), (255, 0, 0)) == [[(0, 0, 0), (0, 0, 0), (0, 0, 0)], [(0, 0, 0), (255, 0, 0), (0, 0, 0)], [(0, 0, 0), (0, 0, 0...
{ "split": "train", "index": 66648, "acecode_id": "bigcode_python_fns_44800", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the setup and configuration of a remote folder in a file management system. Write a function `setup_and_configure_folder(folder_name: str, config_options: dict) -> str` that takes the name of the folder and a dictionary of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert setup_and_configure_folder('example_folder', {'option1': 'value1', 'option2': 'value2'}) == 'Folder example_folder has been set up and configured successfully.'\", \"assert setup_and_configure_folder('test_folder', {'settingA': 'enabled'}) == 'Folder test_fo...
{ "split": "train", "index": 66649, "acecode_id": "oss_23558", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `print_backwards` that takes a string as input and returns a new string containing the characters of the input string in reverse order. Each character in the reversed string should be separated by a newline character. Do not use any built-in reverse functions.\...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_backwards('') == ''\", \"assert print_backwards('A') == 'A'\", \"assert print_backwards('ab') == 'b\\\\na'\", \"assert print_backwards('abc') == 'c\\\\nb\\\\na'\", \"assert print_backwards('12345') == '5\\\\n4\\\\n3\\\\n2\\\\n1'\", \"assert print_backw...
{ "split": "train", "index": 66650, "acecode_id": "evol_31199", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function that calculates the sum of all even numbers in the list. If there are no even numbers, return 0. The function should have the following signature: `def sum_of_evens(numbers: List[int]) -> int:`. Where `numbe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 15, 20, 25]) == 30\", \"assert sum_of_evens([-2, -4, -6]) == -12\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([0, 1, 2, 3]) == 2\", \"assert sum_of_evens([]) == 0\", \"a...
{ "split": "train", "index": 66651, "acecode_id": "bigcode_python_fns_16125", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the binding of a socket to a random port. Implement a function `bind_random_port` that opens a socket, binds it to an available port, and returns the port number. If the binding is successful, the function should return the port number that was op...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bind_random_port() >= 1024 and bind_random_port() <= 65535\", \"assert bind_random_port() >= 1024 and bind_random_port() <= 65535\", \"assert bind_random_port() >= 1024 and bind_random_port() <= 65535\", \"assert bind_random_port() >= 1024 and bind_random_po...
{ "split": "train", "index": 66652, "acecode_id": "bigcode_python_fns_9079", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `extract_and_sum_numbers(s: str) -> int` that takes a string `s` as input, isolates all numeric values within the string, and returns their sum. If there are no numeric values, return 0. If any non-numeric characters are detected during extraction, the function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_and_sum_numbers('I have 4 cats, 2 dogs and seven fishes in my house') == 6\", \"assert extract_and_sum_numbers('There are 3 apples and 5 oranges') == 8\", \"assert extract_and_sum_numbers('No numbers here!') == 0\", \"assert extract_and_sum_numbers('...
{ "split": "train", "index": 66653, "acecode_id": "evol_12278", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes two strings and outputs a log of messages based on the content of the strings. The function should take two parameters: `input_string` and `verbose`. The `input_string` represents the data to be processed, while `verbose` i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_data('Hello, World!', True) == ['Processing input of length 13', 'Content: Hello, World!']\", \"assert process_data('Test message', False) == ['Processing input of length 12']\", \"assert process_data('', True) == ['Processing input of length 0', 'Co...
{ "split": "train", "index": 66654, "acecode_id": "oss_31356", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a configuration dictionary and an instance ID, write a function that adds or updates a tag in the configuration for a specified submission name. The function should take three parameters: a dictionary 'config', a string 'instance_id', and a string 'submission_name'. The f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_tag({'instance_1': {'Name': 'old_submission'}}, 'instance_1', 'new_submission') == {'instance_1': {'Name': 'new_submission'}}\", \"assert update_tag({}, 'instance_1', 'first_submission') == {'instance_1': {'Name': 'first_submission'}}\", \"assert upda...
{ "split": "train", "index": 66655, "acecode_id": "bigcode_python_fns_41419", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating whether a person has the necessary permissions based on their role. Implement a function named `validate_person_permission` that takes two parameters: a `person_role` (a string representing the role of the person) and a `required_permission` (a st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_person_permission('admin', 'any_permission') == True\", \"assert validate_person_permission('editor', 'edit') == True\", \"assert validate_person_permission('editor', 'view') == False\", \"assert validate_person_permission('viewer', 'view') == True\...
{ "split": "train", "index": 66656, "acecode_id": "oss_4489", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that receives a list of integers and returns a list of remainders when the sum of every two consecutive integers is divided by the third integer in the sequence. The function should validate that the list has a minimum length of three and is not null. If the in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_remainders([1, 2, 3]) == [0]\", \"assert get_remainders([1, 1, 1, 1]) == [0, 0]\", \"assert get_remainders([0, 0, 5]) == [0]\", \"assert get_remainders([10, 0, 10]) == [0]\", \"assert get_remainders([5, 5, 5]) == [0]\", \"assert get_remainders([100, 200,...
{ "split": "train", "index": 66657, "acecode_id": "evol_523", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given an integer 'size', generate a linked list containing integers from 0 to size-1. You need to implement a function 'generate_linked_list(size: int) -> List[int]' that returns a list of integers representing the values in the linked list. The input 'size' will always be a po...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_linked_list(1) == [0]\", \"assert generate_linked_list(2) == [0, 1]\", \"assert generate_linked_list(3) == [0, 1, 2]\", \"assert generate_linked_list(4) == [0, 1, 2, 3]\", \"assert generate_linked_list(5) == [0, 1, 2, 3, 4]\", \"assert generate_link...
{ "split": "train", "index": 66658, "acecode_id": "bigcode_python_fns_32974", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to open a package located in a specific folder and determine if it is an override package. Write a Python function `open_and_check_package` that takes two arguments: 1. `folder_path` (string) - The path of the folder where the package is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert open_and_check_package('/valid/path', 'override_package') == (True, True)\", \"assert open_and_check_package('/valid/path', 'normal_package') == (True, False)\", \"assert open_and_check_package('/another/valid/path', 'override_test') == (True, True)\", \"ass...
{ "split": "train", "index": 66659, "acecode_id": "oss_11743", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dataset representing reviews from Amazon. Each review is associated with a unique identifier, and you want to check if the dataset contains a specific number of reviews. Implement a function called `check_review_count` that takes in two parameters: `dataset` (a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_review_count(['review1', 'review2'], 2) == True\", \"assert check_review_count(['review1', 'review2', 'review3'], 3) == True\", \"assert check_review_count(['review1'], 1) == True\", \"assert check_review_count([], 0) == True\", \"assert check_review_c...
{ "split": "train", "index": 66660, "acecode_id": "bigcode_python_fns_797", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `process_data(data: str) -> str` that takes a string `data` as input and returns the uppercase version of that string. The function should handle an empty string and return it unchanged.\nPlease reason step by step, then write a self-contained Python soluti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_data('hello') == 'HELLO'\", \"assert process_data('world') == 'WORLD'\", \"assert process_data('') == ''\", \"assert process_data('Python') == 'PYTHON'\", \"assert process_data('LeetCode') == 'LEETCODE'\", \"assert process_data('123abc') == '123ABC'\...
{ "split": "train", "index": 66661, "acecode_id": "evol_23397", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array of integers representing the output of an activation function. Your task is to implement a function that computes the gradient of the activation function based on the given output and its corresponding input. The function should take two parameters: an ar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_gradient([1, 2, 3], [0, 1, 2]) == [0, 2, 3]\", \"assert compute_gradient([0, -1, 3], [1, -1, 2]) == [0, 0, 3]\", \"assert compute_gradient([5, 0, -2], [1, 1, 0]) == [5, 0, 0]\", \"assert compute_gradient([-3, 4, 2], [-1, 2, 3]) == [0, 4, 2]\", \"asse...
{ "split": "train", "index": 66662, "acecode_id": "bigcode_python_fns_7115", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given IP address is valid. An IP address is considered valid if it consists of four octets separated by dots, where each octet is an integer from 0 to 255. Your task is to implement the function `is_valid_ip(ip: str) -> b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_ip('192.168.0.1') == True\", \"assert is_valid_ip('255.255.255.255') == True\", \"assert is_valid_ip('0.0.0.0') == True\", \"assert is_valid_ip('256.100.50.25') == False\", \"assert is_valid_ip('192.168.1.300') == False\", \"assert is_valid_ip('192....
{ "split": "train", "index": 66663, "acecode_id": "oss_28681", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simplified version of a contact change tracking system. You need to create a function `enqueue_contact_change` that takes two parameters: `contact_pk`, which is an integer representing the primary key of the contact, and `change_type`, which i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert enqueue_contact_change(1, 'update') == 'Change of type update for contact 1 has been enqueued.'\", \"assert enqueue_contact_change(2, 'delete') == 'Change of type delete for contact 2 has been enqueued.'\", \"assert enqueue_contact_change(3, 'add') == 'Chang...
{ "split": "train", "index": 66664, "acecode_id": "oss_14580", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function that updates a dictionary representing package contents with new files and directories. The function takes in a dictionary of existing contents, a list of newly created files, and a list of newly created directories. Your task is to add these ne...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_package_contents({'file1.txt': ('obj', '0', '0')}, ['file2.txt'], ['dir1/']) == {'file1.txt': ('obj', '0', '0'), 'file2.txt': ('obj', '0', '0'), 'dir1/': ('dir',)}\", \"assert update_package_contents({'file1.txt': ('obj', '0', '0'), 'dir1/': ('dir',)}...
{ "split": "train", "index": 66665, "acecode_id": "bigcode_python_fns_21372", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a given string is a valid form action attribute in an HTML document. A valid form action attribute is defined as either an empty string or None. Your function should return True if the form action attribute meets this c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_form_action('') == True\", \"assert validate_form_action(None) == True\", \"assert validate_form_action('http://example.com') == False\", \"assert validate_form_action(' /submit') == False\", \"assert validate_form_action('') == True\", \"assert val...
{ "split": "train", "index": 66666, "acecode_id": "oss_229", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of file names and a string representing a file type. Each file name can either be a regular file, an ITR file, or a DFP file. Your task is to create a function that returns a dictionary of available files. For regular files, include them directly in the dic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_available_files(['file1.xml', 'file2.xml'], 'regular') == {'file1.xml': 'file1.xml', 'file2.xml': 'file2.xml'}\", \"assert extract_available_files(['itr_file1.zip', 'itr_file2.zip'], 'ITR') == {'itr/itr_file1.zip': 'itr_file1.zip', 'itr/itr_file2.zip...
{ "split": "train", "index": 66667, "acecode_id": "bigcode_python_fns_10960", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function `advanced_prime_digit_sum(input_dict)` that takes a dictionary with lists of integers as its parameter. The function should identify the largest prime number within each list. It also needs to compute the sum of the digits of this prime number for each list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert advanced_prime_digit_sum({'list1': None, 'list2': []}) == {'list1': 'None or empty', 'list2': 'None or empty'}\", \"assert advanced_prime_digit_sum({'list1': [1, 4, 6], 'list2': [0, 1, -1]}) == {'list1': 'No prime number', 'list2': 'No prime number'}\", \"as...
{ "split": "train", "index": 66668, "acecode_id": "evol_33626", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function that accepts a N x N bi-dimensional matrix and returns its mathematical transpose. Additionally, the function should check if the matrix is square. If the matrix is not square, return an error message. If it is square, return the transposed matrix.\nPlease ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert matrix_operations([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [[1, 4, 7], [2, 5, 8], [3, 6, 9]]\", \"assert matrix_operations([[1, 2], [3, 4]]) == [[1, 3], [2, 4]]\", \"assert matrix_operations([[1]]) == [[1]]\", \"assert matrix_operations([[0, 0], [0, 0]]) == [[0...
{ "split": "train", "index": 66669, "acecode_id": "evol_27038", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the behavior of reading environment variables. Specifically, you need to write a function that takes a list of strings representing environment variable names and returns a dictionary indicating whether each environment variable is set or not. For...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_environment_variable_values(['SKIP_EVERYTHING']) == {'SKIP_EVERYTHING': True}\", \"assert get_environment_variable_values(['DEBUG_MODE']) == {'DEBUG_MODE': False}\", \"assert get_environment_variable_values(['TEST_MODE']) == {'TEST_MODE': False}\", \"ass...
{ "split": "train", "index": 66670, "acecode_id": "oss_8685", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `get_travel_method(vessel)` that takes an instance of a class `Vessel` or any subclass of `Vessel` and returns the string representation of the travel method associated with that instance. The `Vessel` class should have a base travel method that returns 'Ge...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_travel_method(Vessel()) == 'Generic Travel'\", \"assert get_travel_method(Spaceship()) == 'Space Travel'\", \"assert get_travel_method(Vessel()) == 'Generic Travel'\", \"assert get_travel_method(Spaceship()) == 'Space Travel'\", \"assert get_travel_metho...
{ "split": "train", "index": 66671, "acecode_id": "evol_8027", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages callbacks for different types of experiments in a machine learning framework. Your task is to implement the function `execute_callbacks` that takes in a dictionary of experiment types and their corresponding callback function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_callbacks({'RL': [lambda: 'RL Callback 1', lambda: 'RL Callback 2'], 'TD': [lambda: 'TD Callback 1']}, 'RL') == ['RL Callback 1', 'RL Callback 2']\", \"assert execute_callbacks({'RL': [lambda: 'RL Callback 1'], 'TD': [lambda: 'TD Callback 1', lambda:...
{ "split": "train", "index": 66672, "acecode_id": "oss_25034", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing an employee's internet usage deductions from their salary. Write a function that takes an initial salary and a list of website tabs open in the employee's browser. For each tab, apply the following deductions based on the website being visited: Face...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_salary(300, ['Reddit', 'Reddit']) == 200.0\", \"assert manage_salary(150, ['Facebook']) == 'You have lost your salary.'\", \"assert manage_salary(600, ['Instagram', 'Instagram']) == 400.0\", \"assert manage_salary(100, ['Reddit', 'Reddit', 'Reddit']) ...
{ "split": "train", "index": 66673, "acecode_id": "oss_12812", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of integers representing sales data for a grocery store over a month, implement a function `predict_sales(sales_data: List[int], look_back: int) -> List[int]` that predicts the next sales value based on the previous `look_back` number of sales values. The function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict_sales([], 1) == []\", \"assert predict_sales([1, 1, 1], 3) == []\", \"assert predict_sales([2, 3], 2) == []\", \"assert predict_sales([0, 0, 0, 0, 0], 1) == [0, 0, 0, 0]\", \"assert predict_sales([5], 1) == []\"]}" }
{ "split": "train", "index": 66674, "acecode_id": "evol_23794", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a class type and an attribute name, implement a function that checks if the specified attribute exists in the class's hierarchy. The function should return True if the attribute is found in the class or any of its parent classes; otherwise, it should return False. If the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert mro_hasattr(int, '__abs__') == True\", \"assert mro_hasattr(str, 'upper') == True\", \"assert mro_hasattr(list, 'append') == True\", \"assert mro_hasattr(dict, 'keys') == True\", \"assert mro_hasattr(set, 'add') == True\", \"assert mro_hasattr(object, '__ini...
{ "split": "train", "index": 66675, "acecode_id": "bigcode_python_fns_42302", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of robots, where each robot has a color represented as a tuple of three integers (red, green, blue), write a function that extracts and returns a list of the green color channel values from each robot. The input list will contain 'n' robots, and you need to return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_green_values([(255, 0, 0), (0, 255, 0), (0, 0, 255)]) == [0, 255, 0]\", \"assert extract_green_values([(0, 0, 0), (0, 0, 0)]) == [0, 0]\", \"assert extract_green_values([(100, 150, 200), (50, 75, 100), (25, 125, 175)]) == [150, 75, 125]\", \"assert e...
{ "split": "train", "index": 66676, "acecode_id": "bigcode_python_fns_30404", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages a dictionary with additional functionality for publishing and retrieving values. The function, `publisher_dict`, should take the following parameters: \n\n1. `data`: A dictionary that contains key-value pairs, where the v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert publisher_dict({'a': 1, 'b': 2}, {}, 'a') == 1\", \"assert publisher_dict({'a': 1, 'b': 2}, {}, 'b') == 2\", \"assert publisher_dict({'a': 1, 'b': lambda: 3}, {'b': lambda: 3}, 'b') == 3\", \"assert publisher_dict({'a': 1, 'b': 2}, {}, 'c') == None\", \"asse...
{ "split": "train", "index": 66677, "acecode_id": "oss_13063", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to determine the type of pattern to fill a mesh based on an integer input. The fill function takes an integer parameter `i` and should return a string that describes the pattern to fill the mesh according to the following rules: 1. If...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fill(6) == 'square pattern'\", \"assert fill(4) == 'circular pattern'\", \"assert fill(9) == 'triangular pattern'\", \"assert fill(7) == 'random pattern'\", \"assert fill(0) == 'square pattern'\", \"assert fill(12) == 'square pattern'\", \"assert fill(10) ==...
{ "split": "train", "index": 66678, "acecode_id": "oss_2897", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of buildings in a city. Your task is to implement a function `max_visible_buildings(heights: List[int]) -> int` that returns the maximum number of buildings that can be seen from the left side of the city. A building can...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_visible_buildings([1, 2, 3, 4, 5]) == 5\", \"assert max_visible_buildings([5, 4, 3, 2, 1]) == 1\", \"assert max_visible_buildings([1, 3, 2, 5, 4]) == 3\", \"assert max_visible_buildings([10, 20, 10, 30, 40]) == 4\", \"assert max_visible_buildings([3, 1, ...
{ "split": "train", "index": 66679, "acecode_id": "bigcode_python_fns_23171", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a positive integer `n`, implement a function that computes the next number in the Collatz sequence based on the following rules: if `n` is even, return `n / 2`; if `n` is odd, return `3 * n + 1`. The function should be named `collatz_next`. You can assume that the input i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert collatz_next(1) == 4\", \"assert collatz_next(2) == 1\", \"assert collatz_next(3) == 10\", \"assert collatz_next(4) == 2\", \"assert collatz_next(5) == 16\", \"assert collatz_next(6) == 3\", \"assert collatz_next(7) == 22\", \"assert collatz_next(8) == 4\", ...
{ "split": "train", "index": 66680, "acecode_id": "bigcode_python_fns_47898", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that constructs a URL for a website based on the given IP address and port number. The function should take two parameters: `IP` (a string representing the IP address in IPv4 format) and `PORT` (an integer representing the port num...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_url('127.0.0.1', 8080) == 'http://127.0.0.1:8080/'\", \"assert construct_url('192.168.1.1', 80) == 'http://192.168.1.1:80/'\", \"assert construct_url('255.255.255.255', 65535) == 'http://255.255.255.255:65535/'\", \"assert construct_url('10.0.0.1',...
{ "split": "train", "index": 66681, "acecode_id": "oss_11991", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a dictionary representing a task installation configuration. The function should take the following parameters: 'task_name' (a string representing the name of the task), 'version' (a string representing the version of the t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_install_task('TaskA', '1.0.0', ['dep1', 'dep2']) == {'task_name': 'TaskA', 'version': '1.0.0', 'dependencies': ['dep1', 'dep2']}\", \"assert generate_install_task('TaskB', '2.1.3', []) == {'task_name': 'TaskB', 'version': '2.1.3', 'dependencies': []...
{ "split": "train", "index": 66682, "acecode_id": "bigcode_python_fns_32976", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function in Python that identifies which elements in a multi-dimensional array are odd numbers. The function should be able to process inputs like ([1, 2, 3, 4, 5]) and ([1, 2, [3, 4, 5]]) similarly. The function should return the odd numbers along with their indice...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_odds([2, 4, 6, 8]) == []\", \"assert find_odds([1, [3, 5], 7]) == [(1, (0,)), (3, (1, 0)), (5, (1, 1)), (7, (2,))]\", \"assert find_odds([[1, 2], [3, [4, 5]]]) == [(1, (0, 0)), (3, (1, 0)), (5, (1, 1, 1))]\", \"assert find_odds([]) == []\", \"assert fin...
{ "split": "train", "index": 66683, "acecode_id": "evol_10348", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of integers 'numbers', your task is to implement a function that returns a new list containing the unique elements of 'numbers' sorted in non-decreasing order. The function should not modify the original list. If the given list is empty, return an empty list. Imple...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_sort_unique([3, 4, 5, 1, 2, 2]) == [1, 2, 3, 4, 5]\", \"assert custom_sort_unique([3, 5, 4, 1, 2, 2]) == [1, 2, 3, 4, 5]\", \"assert custom_sort_unique([1, 2, 3, 5, 5, 4, 4]) == [1, 2, 3, 4, 5]\", \"assert custom_sort_unique([5, 4, 3, 1, 2, 2]) == [1,...
{ "split": "train", "index": 66684, "acecode_id": "evol_12741", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages a list of unique elements. The function should allow for adding elements to the list, removing elements from the list, and checking if a specific element is present in the list. The function should take a list of operatio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_unique_list([('add', 1), ('add', 2), ('check', 1)]) == [True]\", \"assert manage_unique_list([('add', 1), ('remove', 1), ('check', 1)]) == [False]\", \"assert manage_unique_list([('add', 1), ('add', 2), ('add', 2), ('check', 2)]) == [True]\", \"assert...
{ "split": "train", "index": 66685, "acecode_id": "oss_2500", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a data preprocessing function to normalize a specific column of a dataset represented as a list of dictionaries. The function should normalize the specified column using z-score normalization and return the normalized values as a list. \n\nYou a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_column([{'xcoord': 1, 'curr_data': 10}, {'xcoord': 2, 'curr_data': 20}, {'xcoord': 3, 'curr_data': 30}], 'curr_data') == [-1.224744871391589, 0.0, 1.224744871391589]\", \"assert normalize_column([{'xcoord': 1, 'curr_data': 5}, {'xcoord': 2, 'curr_d...
{ "split": "train", "index": 66686, "acecode_id": "oss_13249", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a configuration string and extracts specific settings based on the given criteria. The configuration string contains variable assignments for various settings. Your function should extract and return a dictionary of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_documented_settings('napoleon_use_param = True # Enable parameter documentation\\\\nnapoleon_use_rtype = False # Disable return type documentation') == {'napoleon_use_param': True, 'napoleon_use_rtype': False}\", \"assert extract_documented_setting...
{ "split": "train", "index": 66687, "acecode_id": "oss_34456", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n, write a function `is_power_of_two(n)` that determines whether n is a power of 2. A number is considered a power of 2 if it can be expressed as 2 raised to the power of some integer. For example, the numbers 1 (2^0), 2 (2^1), 4 (2^2), and 8 (2^3) are all powe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_power_of_two(1) == True\", \"assert is_power_of_two(2) == True\", \"assert is_power_of_two(3) == False\", \"assert is_power_of_two(4) == True\", \"assert is_power_of_two(5) == False\", \"assert is_power_of_two(6) == False\", \"assert is_power_of_two(7) ==...
{ "split": "train", "index": 66688, "acecode_id": "oss_6988", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are working on a machine learning project and need to format hyperparameters for a gradient boosting model. You have two dictionaries containing parameter settings for the XGBoost library. Your task is to create a function that takes these two dictionaries and generates a f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_xgboost_params({'max_depth': 5, 'subsample': 0.6, 'colsample_bytree': 0.5, 'n_estimators': 580}, {'objective': 'binary:logistic', 'booster': 'gbtree', 'learning_rate': 0.02, 'max_depth': 5}) == 'max_depth: 5\\\\nsubsample: 0.6\\\\ncolsample_bytree: 0....
{ "split": "train", "index": 66689, "acecode_id": "oss_11120", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list and an index as parameters. The function should remove the element at the specified index from the list and return a dictionary containing the updated list and the removed element. If the list is empty or the index is out of range, the fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_element([1, 2, 3, 4], 2) == {'list': [1, 2, 4], 'element': 3}\", \"assert remove_element([10, 20, 30], 0) == {'list': [20, 30], 'element': 10}\", \"assert remove_element([5], 0) == {'list': [], 'element': 5}\", \"assert remove_element([7, 14, 21], 1) ...
{ "split": "train", "index": 66690, "acecode_id": "evol_9467", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function that returns an array containing the unique elements in ascending order. The function should handle array lengths up to 10^5 and include negative elements. Your function should have the following signature: `def unique_sorted(arr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_sorted([3, 1, 2, 3, 1]) == [1, 2, 3]\", \"assert unique_sorted([-1, -2, -1, -3, 0]) == [-3, -2, -1, 0]\", \"assert unique_sorted([5, 5, 5, 5, 5]) == [5]\", \"assert unique_sorted([]) == []\", \"assert unique_sorted([10, -10, 0, 10, 5]) == [-10, 0, 5, ...
{ "split": "train", "index": 66691, "acecode_id": "evol_25073", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that converts a list of positional arguments into a list of strings. The function should ensure that no argument is None or an empty string. If any argument is None or an empty string, the function should raise a ValueError with the messa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert args_to_strings(1, 'hello', 3.5) == ['1', 'hello', '3.5']\", \"assert args_to_strings('apple', 'banana', 'cherry') == ['apple', 'banana', 'cherry']\", \"assert args_to_strings(' leading space', 'trailing space ') == ['leading space', 'trailing space']\",...
{ "split": "train", "index": 66692, "acecode_id": "bigcode_python_fns_35152", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating an error handling function for an application that needs to manage various internal validation errors. Write a function `handle_internal_validation_error` that takes an error object as input. The function should extract the class name and message fr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_internal_validation_error(InternalValidationError('Invalid input')) == 'Error: InternalValidationError - Invalid input'\", \"assert handle_internal_validation_error(InternalValidationError('Missing field')) == 'Error: InternalValidationError - Missing...
{ "split": "train", "index": 66693, "acecode_id": "bigcode_python_fns_6144", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a list of coordinates and corresponding names. The function should take a list of tuples representing coordinates (x, y), a list of corresponding names, a number of decimal places, and a coordinate reference syst...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_geographical_data([(1.12345, 2.67891)], ['Point1'], 2, 'EPSG:4326') == [{'Point': (1.12345, 2.68), 'Name': 'Point1'}]\", \"assert process_geographical_data([(10.11111, 20.22222)], ['SinglePoint'], 1, 'EPSG:4326') == [{'Point': (10.11111, 20.2), 'Name...
{ "split": "train", "index": 66694, "acecode_id": "oss_34578", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of items represented as strings and a target namespace. Your task is to implement a function that moves a specific item down in the list by a given number of positions, without exceeding the bounds of the list. If the item is already at the bottom of the li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert move_item_down(['item1', 'item2', 'item3', 'item4'], 'item2', 'namespace1', 1) == ['item1', 'item3', 'item2', 'item4']\", \"assert move_item_down(['item1', 'item2', 'item3', 'item4'], 'item3', 'namespace1', 2) == ['item1', 'item2', 'item4', 'item3']\", \"ass...
{ "split": "train", "index": 66695, "acecode_id": "bigcode_python_fns_19050", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of tuples where each tuple contains a key-value pair, write a function that converts this list into a dictionary. The function should handle cases where there are duplicate keys by keeping the last value associated with each key. The input list will contain tuples ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_to_dict([('a', 1), ('b', 2), ('c', 3)]) == {'a': 1, 'b': 2, 'c': 3}\", \"assert list_to_dict([('a', 1), ('b', 2), ('a', 3)]) == {'a': 3, 'b': 2}\", \"assert list_to_dict([('key1', 'value1'), ('key2', 'value2'), ('key3', 'value3')]) == {'key1': 'value1',...
{ "split": "train", "index": 66696, "acecode_id": "bigcode_python_fns_9307", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of trail ARNs and their associated tags. Each trail has a unique ARN and a tag represented as a dictionary with 'Key' and 'Value'. Your task is to implement a function that identifies and returns a list of trail ARNs that have a specific tag with Key 'workf...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_trails(['arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail1', 'arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail2'], [{'Key': 'workflow', 'Value': 'assisted-log-enabler'}, {'Key': 'other', 'Value': 'value'}]) == ['arn:aws:cloudtrail:us-east-1:...
{ "split": "train", "index": 66697, "acecode_id": "bigcode_python_fns_21615", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries where each dictionary represents key-value pairs. Your task is to consolidate all these dictionaries into a single dictionary. Implement the function `consolidate_dicts(dicts: List[Dict[str, Any]]) -> Dict[str, Any]` that takes a list of dic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert consolidate_dicts([{'key1': 'value1'}, {'key2': 'value2'}, {'key1': 'value3'}]) == {'key1': 'value3', 'key2': 'value2'}\", \"assert consolidate_dicts([{'a': 1}, {'b': 2}, {'c': 3}]) == {'a': 1, 'b': 2, 'c': 3}\", \"assert consolidate_dicts([{'key1': 'value1'...
{ "split": "train", "index": 66698, "acecode_id": "oss_25733", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that computes the number of unique words in a given sentence. A word is defined as a sequence of characters separated by spaces. Note that the comparison of words should be case-insensitive. The function should return the count of unique words after normalizing...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_unique_word_count('Hello world hello') == 2\", \"assert find_unique_word_count('The quick brown fox jumps over the lazy dog') == 8\", \"assert find_unique_word_count('Python Python python') == 1\", \"assert find_unique_word_count('A B C A B C') == 3\", ...
{ "split": "train", "index": 66699, "acecode_id": "evol_24785", "num_tests": 11 }