data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "Implement a function `filter_and_multiply_abs_values(lst)` that takes a list of numerical values and returns the multiplication result of the absolute values of these numbers, considering only elements that are both: a) closest rounded-down integers, and b) divisible by a prime... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_and_multiply_abs_values([1.5, 4.8, -2.2]) == 1\", \"assert filter_and_multiply_abs_values([-1.7, 2, 2]) == 1\", \"assert filter_and_multiply_abs_values([13, 17, 19]) == 1\", \"assert filter_and_multiply_abs_values([1, 1, 1]) == 1\", \"assert filter_an... | {
"split": "train",
"index": 85300,
"acecode_id": "evol_22694",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given an alphanumeric string S, write a function that generates a dictionary where the keys represent the substrings that consist exclusively of a single unique character and the values denote their corresponding occurrence counts. For instance, if S = 'aaaba', the output shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert substrings('abc') == {'a': 1, 'b': 1, 'c': 1}\", \"assert substrings('abcabc') == {'a': 2, 'b': 2, 'c': 2}\", \"assert substrings('a') == {'a': 1}\", \"assert substrings('') == {}\", \"assert substrings('xyz') == {'x': 1, 'y': 1, 'z': 1}\", \"assert substrin... | {
"split": "train",
"index": 85301,
"acecode_id": "evol_19958",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the outputs of different tests. Your task is to implement a function that checks if there are any duplicate outputs in the list. If there are duplicates, return True; otherwise, return False. Write a function named `check_duplicates... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_duplicates([1, 2, 3, 4, 5]) == False\", \"assert check_duplicates([1, 2, 3, 4, 5, 1]) == True\", \"assert check_duplicates([10, 20, 30, 40, 50]) == False\", \"assert check_duplicates([10, 20, 30, 20, 50]) == True\", \"assert check_duplicates([]) == Fal... | {
"split": "train",
"index": 85302,
"acecode_id": "bigcode_python_fns_37644",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the unique elements from the original list, maintaining the order of their first appearance. Write a function `get_unique_elements(arr: List[int]) -> List[int]` wher... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_elements([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert get_unique_elements([]) == []\", \"assert get_unique_elements([100, 200, 300]) == [100, 200, 300]\", \"assert get_unique_elements([1]) == [1]\", \"assert get_unique_elements([42]) == [42]\"]... | {
"split": "train",
"index": 85303,
"acecode_id": "bigcode_python_fns_48100",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to generate a bootstrap sample from a given dataset. A bootstrap sample is a random sample with replacement from the original dataset. The function should take a list of integers (representing the dataset) and an integer (representing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gen_bs_sample([10, 20, 30], 2) in [[10, 10], [20, 20], [30, 30], [10, 20], [20, 30]]\", \"assert gen_bs_sample([1, 1, 1], 4) == [1, 1, 1, 1]\", \"assert len(gen_bs_sample([5, 6, 7], 10)) == 10\", \"assert gen_bs_sample([2, 4], 1) in [[2], [4]]\", \"assert ge... | {
"split": "train",
"index": 85304,
"acecode_id": "oss_28958",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a task generator. The function should take an initial number of executions, generate a specified number of tasks, and return the total number of executions after adding the newly generated tasks. Additionally, the funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run_task_generator(0, 5, 5) == (10, 5)\", \"assert run_task_generator(3, 2, 2) == (7, 3)\", \"assert run_task_generator(10, 0, 0) == (10, 5)\", \"assert run_task_generator(1, 4, 5) == (10, 5)\", \"assert run_task_generator(2, 3, 3) == (8, 4)\", \"assert run_... | {
"split": "train",
"index": 85305,
"acecode_id": "bigcode_python_fns_23095",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing a Python package configuration dictionary. Write a function `minimum_package_versions(package_config)` that takes a dictionary representing the package configuration and returns a dictionary containing the minimum required version for each package ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minimum_package_versions({'install_requires': ['numpy >= 1.18.0', 'pandas >= 1.1.0', 'scikit-learn']}) == {'numpy': '1.18.0', 'pandas': '1.1.0', 'scikit-learn': 'any'}\", \"assert minimum_package_versions({'install_requires': ['requests >= 2.24.0', 'flask >=... | {
"split": "train",
"index": 85306,
"acecode_id": "oss_12552",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of model options for a Django application. Each model option is represented as a dictionary containing the name of the model and its corresponding options. The function should extract and return the verbos... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_verbose_names([{'name': 'order', 'options': {'verbose_name': 'Order', 'verbose_name_plural': 'Orders'}}, {'name': 'item', 'options': {'verbose_name': 'Item', 'verbose_name_plural': 'Items'}}]) == {'Order': 'Orders', 'Item': 'Items'}\", \"assert extra... | {
"split": "train",
"index": 85307,
"acecode_id": "oss_26578",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `median(l: list) -> float` that calculates the median of elements in a list without using sorting techniques or built-in functions. The function should handle cases with both even and odd numbers of elements, as well as duplicates. The list can contain nega... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median([3, 1, 2, 4, 5]) == 3\", \"assert median([1, 2, 2, 4, 5]) == 2\", \"assert median([7]) == 7\", \"assert median([1, 3, 3, 6, 7, 8, 9]) == 6\", \"assert median([1, 2, 3, 4]) == 2.5\", \"assert median([10, 20, 30, 40, 50]) == 30\", \"assert median([-1, -... | {
"split": "train",
"index": 85308,
"acecode_id": "evol_28572",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of page links in the format of strings, you need to implement a function that transforms each link by replacing the substring 'v3' with 'VV'. After transforming the link, extract all the digits from the modified link to form a game ID. Finally, construct a JSON URL... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_urls(['http://example.com/v3/page1', 'http://example.com/v3/page2']) == ['http://www.afa.com.ar/deposito/html/v3/htmlCenter/data/deportes/futbol/primeraa/events/1.json', 'http://www.afa.com.ar/deposito/html/v3/htmlCenter/data/deportes/futbol/primeraa/eve... | {
"split": "train",
"index": 85309,
"acecode_id": "bigcode_python_fns_1173",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a list of virtual devices for a server. The function should take two parameters: a device generator function `device` and an integer `count`. The function should return a list containing `count` instances of devices created... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_virtual_devices(lambda: 'Device', 3) == ['Device', 'Device', 'Device']\", \"assert generate_virtual_devices(lambda: 42, 5) == [42, 42, 42, 42, 42]\", \"assert generate_virtual_devices(lambda: {'id': 1}, 2) == [{'id': 1}, {'id': 1}]\", \"assert gener... | {
"split": "train",
"index": 85310,
"acecode_id": "bigcode_python_fns_38820",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a grid of size `width x height`, and a specific cell identified by its row and column indices (`row`, `col`), return a list of all coordinates within the grid that are not in the same row or column as the specified cell. The returned list should contain tuples of the form... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert box_without_row_and_column_of(0, 0, 3, 3) == [(1, 1), (1, 2), (2, 1), (2, 2)]\", \"assert box_without_row_and_column_of(1, 1, 4, 4) == [(0, 0), (0, 2), (0, 3), (2, 0), (2, 2), (2, 3), (3, 0), (3, 2), (3, 3)]\", \"assert box_without_row_and_column_of(3, 3, 6,... | {
"split": "train",
"index": 85311,
"acecode_id": "bigcode_python_fns_49346",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a music library that contains a collection of albums. Each album has an 'id' and a 'title'. Your goal is to implement a function `serialize_albums(albums: List[Dict[str, str]]) -> List[Dict[str, str]]` that takes a list of album dictionaries and ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert serialize_albums([]) == []\", \"assert serialize_albums([{'id': '1', 'title': 'Album One'}]) == [{'id': '1', 'title': 'Album One'}]\", \"assert serialize_albums([{'id': '1', 'title': 'Album One'}, {'id': '2', 'title': 'Album Two'}]) == [{'id': '1', 'title': ... | {
"split": "train",
"index": 85312,
"acecode_id": "oss_17382",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a Python function that generates shell commands for creating directories based on a given mapping of file names to their respective directories. You will receive a dictionary called `files_directory` which maps file names to their respective director... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_commands({'file1.txt': 'dir1/'}, '/home/user/') == ['mkdir -p /home/user/dir1/']\", \"assert generate_commands({'file2.txt': 'dir2/'}, '/root/') == ['mkdir -p /root/dir2/']\", \"assert generate_commands({'file3.txt': 'nested/dir3/'}, '/var/www/') ==... | {
"split": "train",
"index": 85313,
"acecode_id": "oss_25204",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple function to manage API endpoints. Each API endpoint is represented as a string. The function should take an initial list of API endpoints, add a new endpoint if it is not already present, remove an existing endpoint if it exists, and re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert api_endpoint_manager(['api', 'experiments', 'recommendations'], 'users', 'experiments') == ['api', 'recommendations', 'users']\", \"assert api_endpoint_manager(['api', 'experiments', 'recommendations'], 'api', 'experiments') == ['api', 'recommendations']\", ... | {
"split": "train",
"index": 85314,
"acecode_id": "oss_34276",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a dataset where each key is a column name and the corresponding value is a list of values in that column. Your task is to convert all values in specified columns to integers. If a value cannot be converted to an integer, it should be repl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_columns_to_int({'A': ['1', '2', '3'], 'B': ['4', '5', 'foo'], 'C': ['6', 'bar', '8']}, ['A', 'B']) == {'A': [1, 2, 3], 'B': [4, 5, -1], 'C': ['6', 'bar', '8']}\", \"assert convert_columns_to_int({'X': ['10', '20', '30'], 'Y': ['a', 'b', 'c'], 'Z': ['... | {
"split": "train",
"index": 85315,
"acecode_id": "bigcode_python_fns_40661",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing pixel intensities of a horizontal projection of an image, along with a threshold value. Your task is to find the upper and lower bounds of the zone where the pixel intensity crosses the threshold value. The lower bound is defined as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_vertical_bounds([0, 0, 0, 0, 0, 0, 0, 0], 1) == [0, 8]\", \"assert find_vertical_bounds([255, 255, 255, 255, 0, 0, 0, 0], 100) == [4, 4]\", \"assert find_vertical_bounds([200, 200, 200, 200, 200], 200) == [0, 5]\", \"assert find_vertical_bounds([10, 10,... | {
"split": "train",
"index": 85316,
"acecode_id": "bigcode_python_fns_21796",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a simplified re-authentication process in a smart home system. The function `re_authenticate` takes two parameters: `current_state`, an integer representing the current state of a configuration entry, and `error_occu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert re_authenticate(1, True) == 3\", \"assert re_authenticate(0, True) == 3\", \"assert re_authenticate(2, True) == 3\", \"assert re_authenticate(3, True) == 3\", \"assert re_authenticate(4, True) == 3\", \"assert re_authenticate(1, False) == 1\", \"assert re_au... | {
"split": "train",
"index": 85317,
"acecode_id": "oss_32423",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates a user's input for resetting a password. The function should ensure that the reset key is provided and that the two password fields match. Implement the `validate_reset_password` function that takes in three paramete... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_reset_password('valid_key', 'password123', 'password123') == (True, 'Password reset successful.')\", \"assert validate_reset_password('', 'password123', 'password123') == (False, 'Reset key cannot be empty.')\", \"assert validate_reset_password('val... | {
"split": "train",
"index": 85318,
"acecode_id": "oss_17345",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string that may contain multiple names, write a function `find_name(s)` that uses regular expressions to extract and return all occurrences of names formatted as 'FirstName LastName', where 'FirstName' starts with an uppercase letter followed by lowercase letters, and '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_name('Hello, my name is John Doe and I have a friend named Jane Smith.') == ['John Doe', 'Jane Smith']\", \"assert find_name('There is only one name here: Alice Wonderland.') == ['Alice Wonderland']\", \"assert find_name('No names here!') == []\", \"ass... | {
"split": "train",
"index": 85319,
"acecode_id": "evol_12918",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer `n` and an array `m` of `n` integers, find the lexicographically largest sequence that satisfies the following conditions: \n1. The integer `1` occurs once in the sequence. \n2. Each integer between `2` and `n` occurs twice in the sequence. \n3. For every integ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert constructDistancedSequence(3, [1, 2, 3]) == [3, 1, 2, 3, 2]\", \"assert constructDistancedSequence(5, [1, 2, 3, 4, 5]) == [5, 3, 1, 4, 3, 5, 2, 4, 2]\", \"assert constructDistancedSequence(1, [1]) == [1]\", \"assert constructDistancedSequence(2, [1, 2]) == [... | {
"split": "train",
"index": 85320,
"acecode_id": "evol_27393",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of prime numbers, implement a function that generates all unique Pythagorean triplets (a, b, c) where a, b, and c are prime numbers and satisfy the condition a^2 + b^2 = c^2. The input is a list of prime numbers and the output should be a list of tuples representin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pythagorean_triplets([2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67]) == []\", \"assert pythagorean_triplets([5, 7, 11]) == []\", \"assert pythagorean_triplets([2, 3, 5]) == []\", \"assert pythagorean_triplets([2, 5, 13, 17]) == []\"... | {
"split": "train",
"index": 85321,
"acecode_id": "evol_23181",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `search_audio_files(query: str) -> List[AudioFile]` that searches for audio files in an indexed database using a specific query string. The function should return a list of `AudioFile` objects that match the search criteria based on their title. The `AudioF... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_audio_files('test') == []\", \"assert len(search_audio_files('example')) == 1\", \"assert len(search_audio_files('unknown')) == 0\", \"assert search_audio_files('another test song') == []\", \"assert search_audio_files('not found') == []\", \"assert s... | {
"split": "train",
"index": 85322,
"acecode_id": "evol_32153",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `write_formatted_mons(pkmn_string: str) -> None` that takes a single string input containing the names of Pokémon separated by commas. The function should format this string by replacing each comma with a new line character, effectively l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert write_formatted_mons('Pikachu,Charmander,Bulbasaur') == 'Pikachu\\\\nCharmander\\\\nBulbasaur\\\\n'\", \"assert write_formatted_mons('Squirtle,Jigglypuff') == 'Squirtle\\\\nJigglypuff\\\\n'\", \"assert write_formatted_mons('Eevee,Flareon,Vaporeon,Glaceon') =... | {
"split": "train",
"index": 85323,
"acecode_id": "bigcode_python_fns_21494",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that checks if a given URL is already stored in a collection of URLs. If the URL is already present, the function should return a message indicating that the URL is already registered. If the URL is not present, the function should add the URL t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_url(['http://example.com'], 'http://example.com') == 'link already registered'\", \"assert register_url(['http://example.com'], 'http://new-url.com') == 'URL registered successfully'\", \"assert register_url([], 'http://first-url.com') == 'URL regis... | {
"split": "train",
"index": 85324,
"acecode_id": "bigcode_python_fns_15352",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of numbers, implement a function that rounds each number to the nearest multiple of a specified base value. The base value must be greater than or equal to 0.01. The function should also allow specifying the number of significant decimal places to round to. Your fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_round([1.5, 2.5, 3.5], 0.5, 1) == [1.5, 2.5, 3.5]\", \"assert custom_round([1.1234, 2.5678, 3.9101], 0.1, 2) == [1.10, 2.60, 3.90]\", \"assert custom_round([0.0, 0.01, 0.02], 0.01, 2) == [0.00, 0.01, 0.02]\", \"assert custom_round([5.55, 5.57, 5.58], ... | {
"split": "train",
"index": 85325,
"acecode_id": "bigcode_python_fns_9807",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fib(n)` that computes the nth Fibonacci number using an efficient algorithm. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n >= 2. Your implementation should handle large values of n (up to 10^6) efficient... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fib(0) == 0\", \"assert fib(1) == 1\", \"assert fib(2) == 1\", \"assert fib(3) == 2\", \"assert fib(4) == 3\", \"assert fib(5) == 5\", \"assert fib(6) == 8\", \"assert fib(7) == 13\", \"assert fib(8) == 21\", \"assert fib(9) == 34\", \"assert fib(10) == 55\"... | {
"split": "train",
"index": 85326,
"acecode_id": "evol_25502",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with updating the configuration for a web application. You have a list of allowed hosts and a list of installed applications. Your goal is to implement a Python function that modifies these lists based on the following requirements: 1. Add 'example.com' to the li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_configuration(['localhost', '0.0.0.0', '127.0.0.1', '.ngrok.io'], ['debug_toolbar', 'django.contrib.auth']) == (['localhost', '127.0.0.1', '.ngrok.io', 'example.com'], ['debug_toolbar', 'django.contrib.auth', 'django.contrib.admin'])\", \"assert updat... | {
"split": "train",
"index": 85327,
"acecode_id": "oss_35466",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes an array of integers and returns the sum of all even integers in the array. If there are no even integers, the function should return 0. Implement the function `sum_of_evens(arr: List[int]) -> int` where `arr` is a list of inte... | 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, 0, 3, 5]) == -2\", \"assert sum_of_evens([1, 3, 5]) == 0\", \"assert sum_of_evens([2, 4, 6]) == 12\", \"assert sum_of_evens([]) == 0\", \"assert... | {
"split": "train",
"index": 85328,
"acecode_id": "oss_11018",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string of text, implement a function `word_tally(text)` that counts the number of occurrences of each word in the text while excluding common stop words such as 'a', 'the', 'in', 'on', 'of', 'with', 'and', 'is', 'it', 'to'. The function should return a dictionary where ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_tally('The quick brown fox jumps over the lazy dog') == {'quick': 1, 'brown': 1, 'fox': 1, 'jumps': 1, 'over': 1, 'lazy': 1, 'dog': 1}\", \"assert word_tally('the cat in the hat') == {'cat': 1, 'hat': 1}\", \"assert word_tally('To be or not to be') == {... | {
"split": "train",
"index": 85329,
"acecode_id": "evol_6223",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `invert_sequence(seq)` that returns a new list containing the elements of the input list in reverse order. The input list may contain any number of integers, including duplicates, and can be empty.\nPlease reason step by step, then wri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert invert_sequence([3, 4, 7, 9, 10]) == [10, 9, 7, 4, 3]\", \"assert invert_sequence([]) == []\", \"assert invert_sequence([1]) == [1]\", \"assert invert_sequence([1, 2, 3, 4]) == [4, 3, 2, 1]\", \"assert invert_sequence([5, 5, 5]) == [5, 5, 5]\", \"assert inve... | {
"split": "train",
"index": 85330,
"acecode_id": "evol_7378",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that organizes a list of posts and categories for display purposes. You will be given two lists: one containing posts and the other containing categories. Each post is represented as a dictionary with fields `id`, `title`, `content`, `cre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_dashboard_data([{'id': 1, 'title': 'Post A', 'content': 'Content A', 'created_on': '2023-10-01', 'likes': 10}, {'id': 2, 'title': 'Post B', 'content': 'Content B', 'created_on': '2023-10-02', 'likes': 20}, {'id': 3, 'title': 'Post C', 'content': 'Content... | {
"split": "train",
"index": 85331,
"acecode_id": "oss_35633",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of contact information represented as dictionaries. Each contact dictionary contains the following attributes: id, firstname, lastname, address, email, email2, email3, home, mobile, work, and phone2. Your task is to implement a function `pr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_contact_list([{'id': 1, 'firstname': ' John ', 'lastname': ' Doe ', 'address': ' 123 Elm St ', 'email': ' john@example.com ', 'email2': ' ', 'email3': ' ', 'home': ' 555-1234 ', 'mobile': ' 555-5678 ', 'work': ' 555-8765 ', 'phone2': ' 555-4321 ' }])... | {
"split": "train",
"index": 85332,
"acecode_id": "oss_28590",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are required to implement a function that calculates the area under a curve using the trapezoidal rule. The trapezoidal rule approximates the definite integral of a function by dividing the area under the curve into trapezoids. Your function should take three lists as input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_area_under_curve([0, 2], [0, 4], [0, 4]) == 4.0\", \"assert calculate_area_under_curve([0, 2, 4, 6], [0, 0, 0, 0], [0, 0, 0, 0]) == 0.0\", \"assert calculate_area_under_curve([1, 2, 3, 4], [1, 1, 1, 1], [0, 1, 2, 3]) == 3.0\", \"assert calculate_ar... | {
"split": "train",
"index": 85333,
"acecode_id": "oss_20179",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with updating the names of university buildings based on a list of keywords. Write a function that takes a list of building information and a list of keywords as input. The first row of the building information contains headers, and the subsequent rows contain de... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_building_names([['ID', 'Building Name', 'Location'], ['1', 'Troy', 'North'], ['2', 'VCC', 'East'], ['3', 'Walker', 'South'], ['4', 'West', 'West']], ['Troy', 'VCC', 'Walker', 'West']) == [['ID', 'Building Name', 'Location'], ['1', 'Troy Building', 'No... | {
"split": "train",
"index": 85334,
"acecode_id": "oss_22611",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs encryption using the Caesar cipher technique. The function should take a string 'message' and an integer 'key' as input. The 'key' determines the number of positions each letter in the 'message' is shifted. Non-alphabetical characters should r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert caesar_cipher('Hello World', 3) == 'Khoor Zruog'\", \"assert caesar_cipher('abc', 1) == 'bcd'\", \"assert caesar_cipher('xyz', 2) == 'zab'\", \"assert caesar_cipher('Python 3.8', 5) == 'Udymts 3.8'\", \"assert caesar_cipher('1234', 7) == '1234'\", \"assert c... | {
"split": "train",
"index": 85335,
"acecode_id": "evol_23608",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to format and return weather data in a structured format. The function should take in four parameters: `showTown`, `showDescription`, `showTemp`, and `showCountry`. It should return a dictionary where the keys are 'showTown', 'showDes... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert formatWeatherData('New York', 'Cloudy', '72\\u00b0F', 'USA') == {'showTown': 'New York', 'showDescription': 'Cloudy', 'showTemp': '72\\u00b0F', 'showCountry': 'USA'}\", \"assert formatWeatherData('Los Angeles', 'Sunny', '85\\u00b0F', 'USA') == {'showTown': '... | {
"split": "train",
"index": 85336,
"acecode_id": "oss_18630",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `analyze_number(n: int) -> Tuple[bool, bool, bool]` that takes a positive integer `n` as input and returns a tuple containing three boolean values. The first boolean indicates whether `n` is a prime number, the second indicates whether `n` is part of the Fi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_number(2) == (True, True, True)\", \"assert analyze_number(3) == (True, True, True)\", \"assert analyze_number(5) == (True, True, True)\", \"assert analyze_number(21) == (False, True, False)\", \"assert analyze_number(34) == (False, True, False)\", \... | {
"split": "train",
"index": 85337,
"acecode_id": "evol_31551",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given five integers, implement a function `compute_median(a, b, c, d, e)` that returns the median of these five integers. The median is the middle value when the integers are sorted in ascending order. If there are duplicates, the median should still be calculated correctly.\nP... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_median(1, 3, 5, 7, 9) == 5\", \"assert compute_median(10, 2, 8, 4, 6) == 6\", \"assert compute_median(5, 5, 5, 5, 5) == 5\", \"assert compute_median(-1, -3, -2, -4, -5) == -3\", \"assert compute_median(0, 0, 0, 1, 1) == 0\", \"assert compute_median(1... | {
"split": "train",
"index": 85338,
"acecode_id": "evol_21629",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages a dataset based on a specified flag. The function will take in a boolean parameter `force` and a string parameter `dataset_path`. If the `force` parameter is set to `True`, the function should return a string indicating t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_dataset(True, '/path/to/dataset') == 'Dataset at /path/to/dataset has been deleted.'\", \"assert manage_dataset(False, '/path/to/dataset') == 'Dataset at /path/to/dataset remains intact.'\", \"assert manage_dataset(True, '/another/path/to/dataset') ==... | {
"split": "train",
"index": 85339,
"acecode_id": "oss_2194",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a nested sequence (which can be a list of lists or a single list) and an expected shape represented by a tuple of integers, return True if the total number of elements in the flattened sequence matches the product of the integers in the expected shape; otherwise, return F... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shape_is_ok([[1, 2, 3], [4, 5, 6]], (2, 3)) == True\", \"assert shape_is_ok([[1, 2], [3, 4, 5]], (2, 4)) == False\", \"assert shape_is_ok([1, 2, 3, 4, 5, 6], (3, 2)) == True\", \"assert shape_is_ok([], (0,)) == True\", \"assert shape_is_ok([1, 2], (2,)) == T... | {
"split": "train",
"index": 85340,
"acecode_id": "bigcode_python_fns_22796",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that sets up logging based on a provided configuration dictionary. The function should take a configuration dictionary as an argument and return a logger object configured according to the specifications in the dictionary. The conf... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert setup_logging_from_config({'version': 1, 'formatters': {'simple': {'format': '%(levelname)s: %(message)s'}}, 'handlers': {'console': {'class': 'logging.StreamHandler', 'level': 'INFO', 'formatter': 'simple'}}, 'loggers': {'test_logger': {'level': 'INFO', 'ha... | {
"split": "train",
"index": 85341,
"acecode_id": "oss_7007",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates and formats phone numbers. The function should take a phone number as input in the format `+551100000000` (where `+55` is the country code for Brazil) and then parse and validate it. If the phone number is valid, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_and_format_phone_number('+551100000000') == '+55 11 0000-0000'\", \"assert validate_and_format_phone_number('+5511000000000') == 'Invalid phone number'\", \"assert validate_and_format_phone_number('+551234567890') == '+55 12 3456-7890'\", \"assert v... | {
"split": "train",
"index": 85342,
"acecode_id": "oss_6567",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a square 2D list (matrix) of integers, write a function that calculates the sum of the main diagonal elements and the sum of the counter-diagonal elements. The main diagonal consists of elements where the row index and column index are equal, while the counter-diagonal co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert diagonal_sums([[1]]) == (1, 1)\", \"assert diagonal_sums([[1, 2], [3, 4]]) == (5, 5)\", \"assert diagonal_sums([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == (15, 15)\", \"assert diagonal_sums([[10, 20, 30], [40, 50, 60], [70, 80, 90]]) == (150, 150)\", \"assert diag... | {
"split": "train",
"index": 85343,
"acecode_id": "evol_30821",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a simple product inventory system. Implement a function `manage_inventory(actions: List[Tuple[str, str, int]]) -> Dict[str, int]` that takes a list of actions to perform on the inventory. Each action is represented as a tuple containing a string ind... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_inventory([('add', 'apple', 10)]) == {'apple': 10}\", \"assert manage_inventory([('add', 'banana', 5), ('add', 'banana', 3)]) == {'banana': 8}\", \"assert manage_inventory([('add', 'orange', 7), ('remove', 'orange', 2)]) == {'orange': 5}\", \"assert m... | {
"split": "train",
"index": 85344,
"acecode_id": "oss_14308",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that divides the list into segments based on a specified interval. The function should use a greedy approach to determine the optimal segments. A segment is considered optimal if the chi-squared statistic calculated from the segmen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert divide_segments([1, 2, 3, 4, 5], (0, 5)) == [(0, 5)]\", \"assert divide_segments([1, 1, 1, 1, 1], (0, 5)) == [(0, 5)]\", \"assert divide_segments([1, 2, 3], (0, 3)) == [(0, 3)]\", \"assert divide_segments([10, 20, 30], (0, 3)) == [(0, 3)]\", \"assert divide_... | {
"split": "train",
"index": 85345,
"acecode_id": "bigcode_python_fns_35729",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates a given secret code for a two-factor authentication system. The secret code should be a string that has a maximum length of 10 characters and should only contain alphanumeric characters (both letters and numbers). Yo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_secret_code('abc123') == True\", \"assert is_valid_secret_code('1234567890') == True\", \"assert is_valid_secret_code('abc!@#') == False\", \"assert is_valid_secret_code('') == False\", \"assert is_valid_secret_code('ABCD1234') == True\", \"assert i... | {
"split": "train",
"index": 85346,
"acecode_id": "oss_19630",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of Fortran namelist file names and extracts the base filenames from them. Each file is guaranteed to contain a well-formed namelist with a 'base_filename' key. Write a Python function called `extract_base_file... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_base_filename(['filelist1.nml']) == {'filelist1.nml': 'output1'}\", \"assert extract_base_filename(['filelist2.nml']) == {'filelist2.nml': 'output2'}\", \"assert extract_base_filename(['filelist3.nml', 'filelist4.nml']) == {'filelist3.nml': 'output3'... | {
"split": "train",
"index": 85347,
"acecode_id": "oss_2811",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `s` consisting of lowercase English letters and spaces. The string contains a hidden message encoded using a simple substitution cipher. In this cipher, each letter is shifted a certain number of places down or up the alphabet. Your task is to implement a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode_cipher('abc def ghi', 1) == 'zab cde fgh'\", \"assert decode_cipher('z y x', 1) == 'y x w'\", \"assert decode_cipher('hello world', 0) == 'hello world'\", \"assert decode_cipher('a b c', 1) == 'z a b'\", \"assert decode_cipher('xyz', 3) == 'uvw'\", \"... | {
"split": "train",
"index": 85348,
"acecode_id": "oss_7568",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `flush_buffers()` that attempts to flush all standard output and error buffers. The function should handle any exceptions that may arise during the flush operation without stopping the execution. The function does not take any parameters and does not return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flush_buffers() is None\", \"assert flush_buffers() is None\", \"assert flush_buffers() is None\", \"assert flush_buffers() is None\", \"assert flush_buffers() is None\", \"assert flush_buffers() is None\", \"assert flush_buffers() is None\", \"assert flush_... | {
"split": "train",
"index": 85349,
"acecode_id": "bigcode_python_fns_27565",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two positive integers, write a function `lcm(a: int, b: int) -> int` that returns the Least Common Multiple (LCM) of the two numbers. The LCM of two integers a and b is the smallest positive integer that is divisible by both a and b.\nPlease reason step by step, then writ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lcm(15, 10) == 30\", \"assert lcm(5, 3) == 15\", \"assert lcm(7, 5) == 35\", \"assert lcm(1, 1) == 1\", \"assert lcm(8, 12) == 24\", \"assert lcm(9, 6) == 18\", \"assert lcm(14, 21) == 42\", \"assert lcm(10, 25) == 50\", \"assert lcm(11, 22) == 22\", \"asser... | {
"split": "train",
"index": 85350,
"acecode_id": "evol_16881",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary where the keys are public key IDs (strings) and the values are x.509 certificate data (strings), implement a function that returns a list of all public key IDs in the dictionary. The function should only return the keys that have non-empty certificate data. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_non_empty_cert_ids({'key1': 'cert1', 'key2': 'cert2', 'key3': ''}) == ['key1', 'key2']\", \"assert get_non_empty_cert_ids({'key1': '', 'key2': '', 'key3': ''}) == []\", \"assert get_non_empty_cert_ids({'key1': 'cert1'}) == ['key1']\", \"assert get_non_em... | {
"split": "train",
"index": 85351,
"acecode_id": "bigcode_python_fns_39870",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of unique non-zero integers, calculate the cumulative sum of the absolute values of the integers in the array multiplied by the cumulative product of their signs. The function should return None if the array is empty or contains zero. Implement the function below... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prod_signs([]) == None\", \"assert prod_signs([0, 1]) == None\", \"assert prod_signs([7]) == 7\", \"assert prod_signs([-7]) == -7\", \"assert prod_signs([-10, -2, -8]) == -20\"]}"
} | {
"split": "train",
"index": 85352,
"acecode_id": "evol_17826",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a dataset by converting certain types of values into a specific format. Write a function `process_dataset(data)` that takes in a list called `data`. The function should do the following: If an element in `data` is a datetim... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_dataset([]) == []\", \"assert process_dataset([datetime(2021, 1, 1)]) == [1609459200.0]\", \"assert process_dataset([datetime(2021, 1, 1), datetime(2022, 1, 1)]) == [1609459200.0, 1640995200.0]\", \"assert process_dataset([datetime(2020, 5, 15), [dat... | {
"split": "train",
"index": 85353,
"acecode_id": "bigcode_python_fns_46493",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `below_zero` that accepts a list of integers representing bank deposit and withdrawal transactions. The account starts with a balance of zero. Your function should determine if the account balance ever dips below zero during these tra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert below_zero([1, 2, 3]) == (False, None, 6)\", \"assert below_zero([0, 0, 0]) == (False, None, 0)\", \"assert below_zero([10, -5, -6]) == (True, -6, -1)\", \"assert below_zero([6, -1, -6]) == (True, -6, -1)\", \"assert below_zero([1, 1, 1]) == (False, None, 3)... | {
"split": "train",
"index": 85354,
"acecode_id": "evol_21923",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of instructions that control a handheld game console. The instructions can be one of the following formats: 'acc +/-N' which increases or decreases an accumulator by the value N, 'jmp +/-N' which jumps to a new instruction relative to the current position, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_accumulator_value(['nop +0', 'acc +1', 'jmp +4', 'acc +3', 'jmp -3', 'acc -99', 'acc +1', 'jmp -4', 'acc +6']) == 5\", \"assert find_accumulator_value(['nop +0', 'nop +0', 'nop +0']) == 0\", \"assert find_accumulator_value(['acc +1', 'jmp +1', 'acc +2',... | {
"split": "train",
"index": 85355,
"acecode_id": "oss_30263",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple traffic light control system at a junction. The system consists of two stations, station 5 and station 6. Station 5 is responsible for controlling a red light, while station 6 is responsible for measuring the duration for which the green ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert traffic_light_duration() == 5\", \"assert traffic_light_duration() == 5\", \"assert traffic_light_duration() == 5\", \"assert traffic_light_duration() == 5\", \"assert traffic_light_duration() == 5\", \"assert traffic_light_duration() == 5\", \"assert traffi... | {
"split": "train",
"index": 85356,
"acecode_id": "oss_15121",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function named `remove_duplicates` that takes a list of integers as input and returns a new list containing only the unique elements from the input list, preserving the order of their first occurrences. For example, if the input list is [11, 46, 70, 23, 11, 33, 46],... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([11, 46, 70, 23, 11, 33, 46]) == [11, 46, 70, 23, 33]\", \"assert remove_duplicates([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert remove_duplicates([5, 5, 5, 5]) == [5]\", \"assert remove_duplicates([]) == []\", \"assert remove_duplicates... | {
"split": "train",
"index": 85357,
"acecode_id": "evol_16968",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_prime(n)` that checks if a given integer `n` is a prime number. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Your function should return True if `n` is prime and False oth... | 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(10) == False\", \"assert is_prime(11) == True\", \"assert is_prime(13) == True\", \"assert is_prime(14) == False\", \"as... | {
"split": "train",
"index": 85358,
"acecode_id": "evol_2974",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the number of ticks on a graph's x and y axes. Your task is to implement a function `reduce_ticks(ticks: List[int]) -> List[int]` that reduces the number of ticks by a factor of 1.5 if the number of ticks is greater than 4. The func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reduce_ticks([5, 10]) == [3, 6]\", \"assert reduce_ticks([4, 3]) == [4, 3]\", \"assert reduce_ticks([6, 8, 12]) == [4, 5, 8]\", \"assert reduce_ticks([2, 3]) == [2, 3]\", \"assert reduce_ticks([9]) == [6]\", \"assert reduce_ticks([0, 1, 2, 3, 4]) == [0, 1, 2... | {
"split": "train",
"index": 85359,
"acecode_id": "bigcode_python_fns_6422",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that converts a given temperature in Celsius to Fahrenheit. The function should take a single argument, a float representing the temperature in Celsius, and return the corresponding temperature in Fahrenheit as a float.\nPlease reason step by step, then write a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert celsius_to_fahrenheit(0) == 32.0\", \"assert celsius_to_fahrenheit(100) == 212.0\", \"assert celsius_to_fahrenheit(-40) == -40.0\", \"assert celsius_to_fahrenheit(37) == 98.6\", \"assert celsius_to_fahrenheit(25) == 77.0\", \"assert celsius_to_fahrenheit(-10... | {
"split": "train",
"index": 85360,
"acecode_id": "evol_11921",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `text` and a list of `stopwords`, write a function `remove_stopwords(text: str, stopwords: List[str]) -> List[str]` that tokenizes the input string by removing punctuation and returns a list of words in lowercase, excluding any words that are present in the `stop... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_stopwords('Hello, world! This is a test.', ['is', 'a', 'this']) == ['hello', 'world', 'test']\", \"assert remove_stopwords('Python is great!', ['is', 'great']) == ['python']\", \"assert remove_stopwords('Tokenization, removal of stopwords.', ['removal... | {
"split": "train",
"index": 85361,
"acecode_id": "bigcode_python_fns_32134",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a list of user profiles for an application. Each profile is represented by a string (the profile name). Implement a function `remove_profile(profiles: List[str], profile_name: str) -> List[str]` that removes a specified profile name from the list of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_profile(['user1', 'user2', 'user3'], 'user2') == ['user1', 'user3']\", \"assert remove_profile(['user1', 'user2', 'user3'], 'user4') == ['user1', 'user2', 'user3']\", \"assert remove_profile(['user1'], 'user1') == []\", \"assert remove_profile([], 'us... | {
"split": "train",
"index": 85362,
"acecode_id": "bigcode_python_fns_40731",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two strings, `input1` and `input2`, write a function `shortest_unique_subsequence(input1: str, input2: str) -> str` that returns the shortest unique subsequence formed by combining characters from both strings such that no characters from `input2` are present in the subse... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shortest_unique_subsequence('ABC', 'XYZ') == 'ABCXYZ'\", \"assert shortest_unique_subsequence('ABCDE', 'CDEFG') == 'ABFG'\", \"assert shortest_unique_subsequence('PYTHON', 'JAVA') == 'PYTHONJAVA'\", \"assert shortest_unique_subsequence('FOO', 'FOOBAR') == 'B... | {
"split": "train",
"index": 85363,
"acecode_id": "evol_34733",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of response packets and a dictionary that maps sequence numbers to callback functions. Each response packet has a sequence number and a payload. Your task is to process the response packets and call the appropriate callback function from the dictionary usin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_responses([{'sequence_number': 1, 'payload': 'data1'}, {'sequence_number': 2, 'payload': 'data2'}], {1: lambda x: x['payload'] + ' processed'}) == None\", \"assert handle_responses([{'sequence_number': 1, 'payload': 'data1'}, {'sequence_number': 3, 'p... | {
"split": "train",
"index": 85364,
"acecode_id": "bigcode_python_fns_6842",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a set of positive integers. Your task is to write a function that takes this set as input and returns the smallest positive integer that is not present in the set. Implement the function `find_smallest_missing_integer(retrieved_documents: set) -> int`. For example... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_smallest_missing_integer({100, 3022, 3307, 3308, 3309, 1001, 202}) == 1\", \"assert find_smallest_missing_integer({1, 2, 3, 4, 5}) == 6\", \"assert find_smallest_missing_integer({2, 3, 4, 5}) == 1\", \"assert find_smallest_missing_integer({-1, -2, -3}) ... | {
"split": "train",
"index": 85365,
"acecode_id": "oss_16214",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves a value from an object based on the Python version being used. Given an object, the function should return the value of a specified attribute if the object is not `None`. If the object is `None`, the function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_val_from_obj(None, 'attr', 'default_value') == 'default_value'\", \"assert get_val_from_obj(None, 'attr', 42) == 42\", \"assert get_val_from_obj(None, 'attr', None) == None\", \"assert get_val_from_obj(None, 'attr', 'default_value') == 'default_value'\",... | {
"split": "train",
"index": 85366,
"acecode_id": "oss_9472",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of student records, where each record contains a name (string), age (integer), marks (integer), and sex (string). Write a function `calculate_average_marks` that takes this list as input and returns a dictionary with the average marks for each sex. The dict... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_marks([('Amy', 19, 85, 'Female'), ('John', 43, 90, 'Male'), ('Alice', 35, 78, 'Female'), ('Daniel', 21, 88, 'Male')]) == {'Female': 81.5, 'Male': 89.0}\", \"assert calculate_average_marks([('Mike', 30, 95, 'Male'), ('Sara', 22, 85, 'Female'... | {
"split": "train",
"index": 85367,
"acecode_id": "evol_19330",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a user accessing a web page. The function should take a string representing the page URL and return a dictionary with the response status code and the template used to render the page. If the URL is '/', the response should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert access_page('/') == {'status_code': 200, 'template': 'core/home.html'}\", \"assert access_page('/about') == {'status_code': 404, 'template': 'error/404.html'}\", \"assert access_page('/contact') == {'status_code': 404, 'template': 'error/404.html'}\", \"asse... | {
"split": "train",
"index": 85368,
"acecode_id": "bigcode_python_fns_19763",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple database for storing and retrieving YAML formatted strings. Your task is to implement the function `yaml_database(files: Dict[str, str], filename: str) -> Dict[str, Any]` where `files` is a dictionary with filename... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert yaml_database({'f1.yaml': 'key: value'}, 'f1.yaml') == {'key': 'value'}\", \"assert yaml_database({'f2.yaml': 'key2: value2'}, 'f2.yaml') == {'key2': 'value2'}\", \"assert yaml_database({'f3.yaml': 'key3: value3'}, 'f4.yaml') == {}\", \"assert yaml_database(... | {
"split": "train",
"index": 85369,
"acecode_id": "oss_11004",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the automation of setting up files for a Python wrapper around a C++ library. The function should perform the following tasks: 1. Take a list of file names and a target directory as input. 2. Return a list of strings, where... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_file_operations(['v8eval.h', 'v8eval_python.h'], '/path/to/py_v8eval_dir') == ['Copied v8eval.h to /path/to/py_v8eval_dir', 'Copied v8eval_python.h to /path/to/py_v8eval_dir', 'Created directory dne in /path/to/py_v8eval_dir']\", \"assert simulate_f... | {
"split": "train",
"index": 85370,
"acecode_id": "oss_34004",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function named `max_subarray_sum` that returns the maximum sum of any contiguous subarray within the input list. A contiguous subarray is defined as a sequence of elements that are adjacent in the list. The function should take a single paramet... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([-2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6\", \"assert max_subarray_sum([1, 2, 3, 4, 5]) == 15\", \"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([0, 0, 0, 0]) == 0\", \"assert max_subarray_sum([3, -2, 5, -1]) == 6\... | {
"split": "train",
"index": 85371,
"acecode_id": "oss_29634",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the values of a time series, implement a function that computes the linear trend line coefficients (slope and intercept) using linear regression and returns the y-values of the trend line for each corresponding x-value in the input list. Yo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert linear_trend([1, 2, 3, 4, 5]) == [1.0, 2.0, 3.0, 4.0, 5.0]\", \"assert linear_trend([2, 4, 6, 8]) == [2.0, 4.0, 6.0, 8.0]\", \"assert linear_trend([10, 20, 30, 40, 50]) == [10.0, 20.0, 30.0, 40.0, 50.0]\", \"assert linear_trend([5, 10, 15]) == [5.0, 10.0, 15... | {
"split": "train",
"index": 85372,
"acecode_id": "bigcode_python_fns_23008",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the output shapes of a linear classifier, write a function that determines if the classifier produces a single output shape or multiple output shapes. The function should return 'single' if there is only one output shape and 'multiple' if t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_output_shapes([1]) == 'single'\", \"assert classify_output_shapes([1, 2]) == 'multiple'\", \"assert classify_output_shapes([1, 1, 1]) == 'multiple'\", \"assert classify_output_shapes([3]) == 'single'\", \"assert classify_output_shapes([2, 4]) == 'mu... | {
"split": "train",
"index": 85373,
"acecode_id": "bigcode_python_fns_17164",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a directed graph represented as an adjacency list, where each index of the list corresponds to a vertex and contains a list of its direct neighbors. Implement a function `dfs_traversal(adjacency_list: List[List[int]], start_vertex: int) -> List[int]` that performs... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dfs_traversal([[1, 2], [3], [4, 5], [], [], []], 0) == [0, 1, 3, 2, 4, 5]\", \"assert dfs_traversal([[1], [2], [3], []], 0) == [0, 1, 2, 3]\", \"assert dfs_traversal([[1], [2], [0]], 0) == [0, 1, 2]\", \"assert dfs_traversal([[], [0]], 1) == [1, 0]\", \"asse... | {
"split": "train",
"index": 85374,
"acecode_id": "oss_24951",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that identifies the longest common subsequence (LCS) shared among three provided string sequences. The function should be capable of processing special characters, numerical values, and Unicode characters within the string sequences. Additionally, the functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_common_subsequence('abc', 'ab', 'a') == 1\", \"assert longest_common_subsequence('12345', '2345', '345') == 3\", \"assert longest_common_subsequence('abc\\u2728', 'a\\u2728bc', '\\u2728abc') == 3\", \"assert longest_common_subsequence('', '', '') == ... | {
"split": "train",
"index": 85375,
"acecode_id": "evol_18643",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string input and returns the string in reversed order. The function should ignore spaces and only reverse the characters that are not spaces. For example, given the input 'hello world', the function should return 'dlrowolleh'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_string('hello world') == 'dlrowolleh'\", \"assert reverse_string(' spaces ') == 'secaps'\", \"assert reverse_string(' ab cd ') == 'dcba'\", \"assert reverse_string('123 456') == '654321'\", \"assert reverse_string('single') == 'elgnis'\", \"asser... | {
"split": "train",
"index": 85376,
"acecode_id": "bigcode_python_fns_33868",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, `y_true` and `y_score`, representing the true labels and predicted scores respectively, implement a function `balanced_accuracy(y_true: List[int], y_score: List[float]) -> float` that calculates the balanced accuracy score. The balanced accuracy is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert balanced_accuracy([0, 1], [0.2, 0.9]) == 1.0\", \"assert balanced_accuracy([1, 0, 0, 1], [0.95, 0.05, 0.0, 0.99]) == 1.0\", \"assert balanced_accuracy([1, 0, 1, 0, 1], [0.8, 0.2, 0.9, 0.1, 0.6]) == 1.0\", \"assert balanced_accuracy([1, 0, 0, 1, 1], [0.9, 0.4... | {
"split": "train",
"index": 85377,
"acecode_id": "bigcode_python_fns_20737",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked to implement a function that simulates a simplified music database query. The function `music_query` takes in a string `field` and an optional parameter `mpd_query`. The `field` can be one of the following: 'album', 'artist', 'date', or 'genre'. If the `field` is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert music_query('genre', 'Unknown Artist') == []\", \"assert music_query('date', None) == []\", \"assert music_query('artist', None) == []\", \"assert music_query('album', 'Unknown Album') == []\", \"assert music_query('date', 'Nonexistent Artist') == []\", \"as... | {
"split": "train",
"index": 85378,
"acecode_id": "bigcode_python_fns_7490",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given an array of unique integers, implement a function that finds the second smallest integer in the array. The function signature is `def find_second_smallest(array: List[int]) -> int:`.\nPlease reason step by step, then write a self-contained Python solution. Give your final... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_second_smallest([4, 5, 8, 2, 9, 13]) == 4\", \"assert find_second_smallest([1, 2, 3, 4, 5]) == 2\", \"assert find_second_smallest([-10, -5, 0, 5, 10]) == -5\", \"assert find_second_smallest([100, 200, 300, 400]) == 200\", \"assert find_second_smallest([... | {
"split": "train",
"index": 85379,
"acecode_id": "evol_6014",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list representing a DNA sequence, you need to determine if a specific subsequence exists within that sequence. The DNA sequence is represented as a list of characters, where each character can be 'a', 't', 'g', or 'c'. Write a function `contains_sequence(dna_sequence: L... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contains_sequence(['a', 't', 'g', 'c', 'a', 't', 'g'], ['a', 't']) == True\", \"assert contains_sequence(['a', 't', 'g', 'c'], ['g', 'c']) == True\", \"assert contains_sequence(['a', 't', 'g', 'c'], ['c', 'a']) == False\", \"assert contains_sequence(['g', 'c... | {
"split": "train",
"index": 85380,
"acecode_id": "bigcode_python_fns_6200",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a text generation process based on a set of input parameters. Your function should take a dictionary as input, which contains the following keys: 'text' (a string representing the prompt), 'temperature' (a float representin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_text({'text': 'Hello World', 'temperature': 0.6, 'min_length': 10, 'max_length': 50}) == 'Hello World... generated text.'\", \"assert generate_text({'text': 'Goodbye', 'temperature': 0.4, 'min_length': 5, 'max_length': 10}) == 'Goodbye'\", \"assert ... | {
"split": "train",
"index": 85381,
"acecode_id": "bigcode_python_fns_44652",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a string representation of a configuration file containing various settings for a documentation website. The configuration file string contains the following relevant settings: a dictionary with 'html_theme_options', a string for 'master_doc', a string for 'html_l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_config_info(\\\"html_theme_options = {'navigation_depth': 4}; master_doc = 'index'; html_logo = '../resources/images/logo-white.png'; html_js_files = [('https://krill.jorijn.com/script.js', {'data-site': 'MXGDAIWO'})]\\\") == {'navigation_depth': 4, ... | {
"split": "train",
"index": 85382,
"acecode_id": "oss_27879",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates a list of hostnames or IP addresses for a network connection. The function should take a list of strings as input and return a dictionary containing two lists: one for valid hosts and another for invalid hosts. A val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_hosts(['.invalid.com', 'valid.com.', 'valid-host', '5.5.5.5']) == {'valid': ['valid-host', '5.5.5.5'], 'invalid': ['.invalid.com', 'valid.com.']}\", \"assert validate_hosts(['valid1', 'valid-2', '192.168.0.1', '2001:db8:0:0:0:0:0:2']) == {'valid': [... | {
"split": "train",
"index": 85383,
"acecode_id": "oss_4925",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Write a function that calculates the number of each vowel found in a given string and returns a dictionary categorizing the counts of each vowel ('a', 'e', 'i', 'o', 'u'). The string can be multi-lined and may contain special characters or digits. Your function should ignore no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_vowels('') == 'Error: String should not be empty'\", \"assert count_vowels(123) == 'Error: Input should be a string'\", \"assert count_vowels(None) == 'Error: Input should be a string'\", \"assert count_vowels('This is a test.') == {'a': 1, 'e': 1, 'i'... | {
"split": "train",
"index": 85384,
"acecode_id": "evol_5125",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with optimizing the dimensions of two data blocks, n and m, to fit within a specified amount of memory. Given the maximum allowable dimensions for n and m, the dimensionality of the data, coefficients that represent the required memory for various configurations,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_dim_over_nm(10, 15, 1, 0.2, 0.3, 0.0, 0.0, 0.0, 5.0, 50.0) == (10, 15)\", \"assert select_dim_over_nm(30, 40, 4, 0.1, 0.1, 0.0, 0.0, 0.0, 10.0, 100.0) == (30, 40)\", \"assert select_dim_over_nm(10, 10, 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0) == (10, 10)... | {
"split": "train",
"index": 85385,
"acecode_id": "bigcode_python_fns_28244",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a session. Your task is to implement a function that removes a specific key, 'wc_infringement_invoice', from the dictionary if it exists. Additionally, you should set a boolean flag 'modified' to True if the key was removed, or False othe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_infringement_invoice({'wc_infringement_invoice': 100, 'user_id': 1}) == ({'user_id': 1}, True)\", \"assert delete_infringement_invoice({'user_id': 1}) == ({'user_id': 1}, False)\", \"assert delete_infringement_invoice({}) == ({}, False)\", \"assert de... | {
"split": "train",
"index": 85386,
"acecode_id": "bigcode_python_fns_45705",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the connection setup of a mock client. The function `create_mock_client(fail: bool) -> str` should take a boolean parameter `fail`. If `fail` is `True`, the function should return 'Connection Failed'. If `fail` is `False`, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_mock_client(True) == 'Connection Failed'\", \"assert create_mock_client(False) == 'Connection Successful'\", \"assert create_mock_client(True) == 'Connection Failed'\", \"assert create_mock_client(False) == 'Connection Successful'\", \"assert create_m... | {
"split": "train",
"index": 85387,
"acecode_id": "bigcode_python_fns_28482",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string prefix, implement a function `get_state_vect_cols(prefix: str) -> List[str]` that returns the names of six state vector components with the provided prefix. The components consist of positions (r) and velocities (v) along the x, y, and z axes. If the prefix is an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_state_vect_cols('') == ['r_x', 'r_y', 'r_z', 'v_x', 'v_y', 'v_z']\", \"assert get_state_vect_cols('physics') == ['physics_r_x', 'physics_r_y', 'physics_r_z', 'physics_v_x', 'physics_v_y', 'physics_v_z']\", \"assert get_state_vect_cols('test') == ['test_r... | {
"split": "train",
"index": 85388,
"acecode_id": "bigcode_python_fns_40580",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that computes the least common multiple (LCM) of two given integers a and b. The LCM of two integers is the smallest positive integer that is divisible by both integers. The function should take two parameters, a and b, and return their LCM. If either a or ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lcm(4, 5) == 20\", \"assert lcm(0, 5) == 0\", \"assert lcm(5, 0) == 0\", \"assert lcm(1, 1) == 1\", \"assert lcm(12, 15) == 60\", \"assert lcm(7, 3) == 21\", \"assert lcm(9, 6) == 18\", \"assert lcm(8, 12) == 24\", \"assert lcm(10, 10) == 10\", \"assert lcm(... | {
"split": "train",
"index": 85389,
"acecode_id": "evol_29154",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to simulate the process of individuals forming friendships based on certain criteria. Each individual is represented as an index in a friendship matrix, and their potential friendships are determined by a set of parameters. Given a fr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_friends(0, [[0, 0], [0, 0]], [0.5, 0.5], 1, 2) == [[0, 1], [1, 0]]\", \"assert make_friends(1, [[0, 0, 0], [0, 0, 0], [0, 0, 0]], [0.3, 0.7, 0.6], 1, 2) == [[0, 0, 0], [0, 0, 1], [0, 1, 0]]\", \"assert make_friends(0, [[0, 0, 0], [0, 0, 0], [0, 0, 0]], ... | {
"split": "train",
"index": 85390,
"acecode_id": "oss_843",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a user ID based on a user's username and first name. The user ID should be created by concatenating the first letter of the username with the first letter of the first name, both converted to uppercase. Write a function `ge... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_user_id('jozko', 'Jozko') == 'JJ'\", \"assert generate_user_id('alice', 'Bob') == 'AB'\", \"assert generate_user_id('charlie', 'Charlie') == 'CC'\", \"assert generate_user_id('david', 'Smith') == 'DS'\", \"assert generate_user_id('eve', 'Adams') == ... | {
"split": "train",
"index": 85391,
"acecode_id": "oss_25179",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string prefix and an integer n, implement a function `makeFields(prefix: str, n: int) -> List[str]` that generates a list of field names. Each field name should be formed by concatenating the prefix with numbers starting from 1 up to n. For example, if the prefix is 'fi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert makeFields('field', 3) == ['field1', 'field2', 'field3']\", \"assert makeFields('user', 5) == ['user1', 'user2', 'user3', 'user4', 'user5']\", \"assert makeFields('item', 0) == []\", \"assert makeFields('test', 1) == ['test1']\", \"assert makeFields('data', ... | {
"split": "train",
"index": 85392,
"acecode_id": "bigcode_python_fns_22236",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a file path in the format '/results/{optimizer}/{blackbox}/{seed}.csv'. Your task is to extract the optimizer, blackbox, and seed values from this file path. Implement the function `extract_file_info(filepath: str) -> Tuple[str, str, str]` th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_file_info('/results/adam/box1/123.csv') == ('adam', 'box1', '123')\", \"assert extract_file_info('/results/sgd/box2/456.csv') == ('sgd', 'box2', '456')\", \"assert extract_file_info('/results/rmsprop/box3/789.csv') == ('rmsprop', 'box3', '789')\", \"... | {
"split": "train",
"index": 85393,
"acecode_id": "bigcode_python_fns_22393",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `expand_last_change(state_var: dict) -> List[dict]` that processes a state variable representing the last change in a service. The input is a dictionary `state_var` that contains two keys: 'name' (a string) and 'value' (a string). The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert expand_last_change({'name': 'LastChange', 'value': '<Event><InstanceID val=\\\"0\\\"><StateVariable val=\\\"Volume\\\">50</StateVariable></InstanceID></Event>'}) == [{'name': 'Volume', 'value': '50'}]\", \"assert expand_last_change({'name': 'LastChange', 'va... | {
"split": "train",
"index": 85394,
"acecode_id": "bigcode_python_fns_5331",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of objects and generates a new list of dictionaries based on certain conditions. Each object in the input list is represented as a dictionary with various attributes. The function should create a new dictionary f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_objects([{'user': 'Alice', 'rating': {'point': 8}}, {'user': 'Bob', 'rating': {'point': 7}}, {'user': None, 'rating': {'point': 6}}]) == [{'user': 'Alice', 'point': 8}, {'user': 'Bob', 'point': 7}, {'user': None, 'point': 6}]\", \"assert process_obje... | {
"split": "train",
"index": 85395,
"acecode_id": "oss_20975",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates and processes a given price input represented as a string. The function should take a single parameter, a string representing a price, which may contain commas as decimal separators. Your function should replace any commas ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_price('abc') == 'ERRO! \\\"abc\\\" \\u00e9 um pre\\u00e7o inv\\u00e1lido!'\", \"assert validate_price(' 20.00 ') == 20.0\", \"assert validate_price('') == 'ERRO! \\\"\\\" \\u00e9 um pre\\u00e7o inv\\u00e1lido!'\", \"assert validate_price('1000')... | {
"split": "train",
"index": 85396,
"acecode_id": "oss_13215",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining if a bingo card has a complete line based on drawn numbers. Implement a function `check_bingo(drawn, card)` that takes in two parameters: a list of integers `drawn`, which represents the numbers drawn in the bingo game, and a 5x5 matrix `card`, w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_bingo([1, 2, 3], [[(True, 1), (True, 2), (True, 3), (False, 4), (False, 5)], [(False, 6), (False, 7), (False, 8), (False, 9), (False, 10)], [(False, 11), (False, 12), (False, 13), (False, 14), (False, 15)], [(False, 16), (False, 17), (False, 18), (Fals... | {
"split": "train",
"index": 85397,
"acecode_id": "oss_30221",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given object is an instance of a specific class or any of its subclasses. The function should take two parameters: an object and a class. If the object is an instance of the class (or any class that inherits from it), the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_instance_of(5, int) == True\", \"assert is_instance_of(5.0, float) == True\", \"assert is_instance_of('hello', str) == True\", \"assert is_instance_of([1, 2, 3], list) == True\", \"assert is_instance_of((1, 2), tuple) == True\", \"assert is_instance_of({'... | {
"split": "train",
"index": 85398,
"acecode_id": "oss_2212",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that adjusts the learning rate of an optimizer based on the current training step. The function takes in an integer 'step' and returns the adjusted learning rate. The learning rate is adjusted as follows: If the step is 500,000, the learning rate should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert adjust_learning_rate(500000) == 0.0005\", \"assert adjust_learning_rate(1000000) == 0.0003\", \"assert adjust_learning_rate(2000000) == 0.0001\", \"assert adjust_learning_rate(0) == 0.001\", \"assert adjust_learning_rate(499999) == 0.001\", \"assert adjust_l... | {
"split": "train",
"index": 85399,
"acecode_id": "bigcode_python_fns_30288",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.