data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are tasked with writing a function named `generate_text` that simulates generating text based on a given input string. The function should take the following parameters: a string `input_text`, an integer `nsamples` representing the number of samples to generate, and a float...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_text('hello', 3, 1.0) == ['helloolleh1', 'helloolleh2', 'helloolleh3']\", \"assert generate_text('world', 1, 0.5) == ['worlddlrow1']\", \"assert generate_text('test', 0, 1.0) == []\", \"assert generate_text('sample', -1, 0.8) == []\", \"assert gener...
{ "split": "train", "index": 82800, "acecode_id": "bigcode_python_fns_20194", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given two integers, `n` and `m`, return a list containing the sum of each pair of integers from 0 to `n-1` and 0 to `m-1`. The result should be a list where the value at index `i` is the sum of `i` from the first range and `i` from the second range, and continue until the small...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_pairs(2, 2) == [0, 2]\", \"assert sum_pairs(4, 4) == [0, 2, 4, 6]\", \"assert sum_pairs(5, 5) == [0, 2, 4, 6, 8]\", \"assert sum_pairs(1, 1) == [0]\", \"assert sum_pairs(8, 8) == [0, 2, 4, 6, 8, 10, 12, 14]\"]}" }
{ "split": "train", "index": 82801, "acecode_id": "bigcode_python_fns_42451", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a string representing the filename of a file, determine whether it is likely to be a pip requirements file. A filename is considered a pip requirements file if it matches any of the following conditions: it contains the substring 'requirements' and ends with '.txt', '.pip...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_requirements_file('dev-requirements.txt') == True\", \"assert is_requirements_file('requirements.txt') == True\", \"assert is_requirements_file('requirements.in') == True\", \"assert is_requirements_file('requirements.pip') == True\", \"assert is_requirem...
{ "split": "train", "index": 82802, "acecode_id": "bigcode_python_fns_40117", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes an integer input `verbose` and returns a string representing the logging level based on the following rules: If `verbose` is 1, return 'INFO'. If `verbose` is 2, return 'DEBUG'. If `verbose` is 3 or more, return 'DEBUG' but als...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_logging_level(0) == 'WARNING'\", \"assert get_logging_level(-1) == 'WARNING'\", \"assert get_logging_level(1) == 'INFO'\", \"assert get_logging_level(2) == 'DEBUG'\", \"assert get_logging_level(3) == 'DEBUG'\", \"assert get_logging_level(4) == 'DEBUG'\",...
{ "split": "train", "index": 82803, "acecode_id": "bigcode_python_fns_31675", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of column names represented as strings, your task is to clean the column names by following these steps: 1. Strip any 'unnamed' fields, for example, 'Unnamed: 0'. 2. Replace the first missing name (an empty string) with 'is_away'. 3. Replace all occurrences of '#' ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_column_names(['Unnamed: 1', 'Column#1', 'Column#2', 'Unnamed: 2', '']) == ['Column_nbr1', 'Column_nbr2', 'is_away']\", \"assert clean_column_names(['Column1', 'Column2', 'Unnamed: 0', '', 'Column#3']) == ['Column1', 'Column2', 'is_away', 'Column_nbr3']...
{ "split": "train", "index": 82804, "acecode_id": "bigcode_python_fns_17475", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages a submission model. The function should take a list of submission model names as input and return the name of the submission model that has the longest length. If there are multiple names with the longest length, return the f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_submission_name(['submission', 'model', 'test_case']) == 'submission'\", \"assert longest_submission_name(['short', 'longer', 'longest']) == 'longest'\", \"assert longest_submission_name(['same_length', 'same_length']) == 'same_length'\", \"assert lo...
{ "split": "train", "index": 82805, "acecode_id": "oss_30703", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of integers and returns a new list containing only the even integers from the original list. The function should take the following parameter: \n- `numbers` (List[int]): A list of integers. \nThe function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25, 30]) == [10, 20, 30]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([0, 1, 2, 3]) == [0, 2]\", \"assert filter_even_numbers([...
{ "split": "train", "index": 82806, "acecode_id": "oss_1218", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given string contains any instances of the format method for string formatting instead of using f-strings or the newer string interpolation methods. The function should take a single string input and return a boolean valu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_string_format('Hello World!') == False\", \"assert check_string_format('No format here') == False\", \"assert check_string_format('Use f-string: f\\\"Hello {name}\\\"') == False\", \"assert check_string_format('Just a string without formatting') == Fal...
{ "split": "train", "index": 82807, "acecode_id": "bigcode_python_fns_39792", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of a command server. Implement a function `execute_command(command: str) -> int` that takes a string `command` as input. The function should return the following: 1 if the command is 'START', 2 if the command i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_command('START') == 1\", \"assert execute_command('STOP') == 2\", \"assert execute_command('RUN') == 0\", \"assert execute_command('PAUSE') == 0\", \"assert execute_command('') == -1\", \"assert execute_command('STARTING') == 0\", \"assert execute_co...
{ "split": "train", "index": 82808, "acecode_id": "bigcode_python_fns_19211", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a recursive Python function that takes a character string s and returns its reverse. For example, if the input is 'hello', the output should be 'olleh'.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_string('pots&pans') == 'snap&stop'\", \"assert reverse_string('abc') == 'cba'\", \"assert reverse_string('madam') == 'madam'\", \"assert reverse_string('12345') == '54321'\", \"assert reverse_string('!@#') == '#@!'\", \"assert reverse_string('') == '...
{ "split": "train", "index": 82809, "acecode_id": "bigcode_python_fns_46956", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that multiplies three integers using bitwise operators instead of the traditional multiplication operator. The function should validate that the inputs are integers, returning None for any invalid input. The function signature should be: `def multiply_three...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply_three_numbers(2, 3, 4) == 24\", \"assert multiply_three_numbers(-1, 5, 2) == -10\", \"assert multiply_three_numbers(0, 5, 7) == 0\", \"assert multiply_three_numbers(3, 3, 3) == 27\", \"assert multiply_three_numbers(1, 2, 3) == 6\", \"assert multiply...
{ "split": "train", "index": 82810, "acecode_id": "evol_35231", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the configuration of an experiment's parameters using a dictionary. The function `get_experiment_config()` should return a dictionary containing the following keys and their respective default values: \n- 'in_dir': a string...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_experiment_config() == {'in_dir': 'output/influence_set/', 'out_dir': 'output/label_set/', 'val_frac': 0.1, 'edit_frac': [0.0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5]}\", \"assert get_experiment_config()['in_dir'] == 'output/influence_set/...
{ "split": "train", "index": 82811, "acecode_id": "bigcode_python_fns_42193", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers, inputList1 and inputList2, implement a function `find_common_elements(inputList1, inputList2)` that returns a list containing only those elements that exist in both inputList1 and inputList2. The output list should maintain the order of elements as ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_common_elements([1,2,3,4,5], [4,5,6,7,8]) == [4, 5]\", \"assert find_common_elements([10, 20, 30], [30, 40, 50]) == [30]\", \"assert find_common_elements([1, 2, 3], [4, 5, 6]) == []\", \"assert find_common_elements([], [1, 2, 3]) == []\", \"assert find_...
{ "split": "train", "index": 82812, "acecode_id": "evol_35395", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `time_to_minutes(days: int, hours: int, minutes: int) -> List[int]` that accepts three integers representing durations in days, hours, and minutes. The function should convert these durations into total minutes, sort them from longest to shortest, and retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert time_to_minutes(1, 0, 0) == [1440, 0, 0]\", \"assert time_to_minutes(0, 1, 0) == [60, 0, 0]\", \"assert time_to_minutes(0, 0, 10) == [10, 0, 0]\", \"assert time_to_minutes(2, 0, 30) == [2880, 30, 0]\", \"assert time_to_minutes(0, 0, 59) == [59, 0, 0]\", \"as...
{ "split": "train", "index": 82813, "acecode_id": "evol_27872", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Write a Python function called `sum_nested` that takes a single parameter, a list of integers that may include nested sublists up to three levels deep. The function should return the cumulative sum of all the integers present in the list and its nested sublists. For example, gi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_nested([1, [2, 3], [4, [5, 6]], 7]) == 28\", \"assert sum_nested([10, [20, [30]], 40]) == 100\", \"assert sum_nested([]) == 0\", \"assert sum_nested([1, 2, 3]) == 6\", \"assert sum_nested([[1, 2], [3, 4]]) == 10\", \"assert sum_nested([1, [2], [3, [4, [5...
{ "split": "train", "index": 82814, "acecode_id": "evol_35659", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a refund eligibility checker for a ticket booking system. The refund policy is defined as follows: If the event has a no-show policy, the customer is not eligible for a refund. If the event does not have a no-show policy, the customer may be eli...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_refund_eligible(False, 5) == False\", \"assert is_refund_eligible(False, 7) == True\", \"assert is_refund_eligible(False, 10) == True\", \"assert is_refund_eligible(True, 3) == False\", \"assert is_refund_eligible(True, 0) == False\", \"assert is_refund_e...
{ "split": "train", "index": 82815, "acecode_id": "oss_35672", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `validate_string(s: str) -> bool` that checks if the input string `s` meets the following criteria: \n\n1. The length of the string must be between 5 and 15 characters (inclusive).\n2. The string must contain at least one uppercase letter.\n3. The string mu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_string('abcde') == False\", \"assert validate_string('ABCDE') == False\", \"assert validate_string('12345') == False\", \"assert validate_string('Hello!') == False\", \"assert validate_string('Hello123Hello') == True\", \"assert validate_string('123...
{ "split": "train", "index": 82816, "acecode_id": "evol_1397", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with managing user permissions in a web application. Write a Python function `update_permissions(username: str, new_permissions: List[str])` that simulates updating a user's permissions. The function should perform the following tasks: 1. Print a message indicati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_permissions('admin1', ['read', 'write']) is None\", \"assert update_permissions('user1', ['execute', 'delete']) is None\", \"assert update_permissions('admin2', ['read', 'update']) is None\", \"assert update_permissions('test_user', ['create', 'read',...
{ "split": "train", "index": 82817, "acecode_id": "oss_1319", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of names and a prefix string. Write a function `filter_names_by_prefix(names: List[str], prefix: str) -> List[str]` that filters and returns a new list containing only the names that start with the given prefix. The function should be case-sensitive, meanin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_names_by_prefix(['Alice', 'Bob', 'Charlie', 'David'], 'A') == ['Alice']\", \"assert filter_names_by_prefix(['Alice', 'Bob', 'Charlie', 'David'], 'a') == []\", \"assert filter_names_by_prefix(['Alice', 'Bob', 'Charlie', 'David'], 'B') == ['Bob']\", \"a...
{ "split": "train", "index": 82818, "acecode_id": "bigcode_python_fns_13296", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that replies to a ping message with a specific response. Write a function `respond_to_ping(action: Dict[str, str]) -> str` that takes in a dictionary `action` representing a ping message. The dictionary contains a single key, 'payload...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert respond_to_ping({'payload': 'hdmimatrix@dummy'}) == 'PONG'\", \"assert respond_to_ping({'payload': '*'}) == 'PONG'\", \"assert respond_to_ping({'payload': 'random_string'}) == 'NO RESPONSE'\", \"assert respond_to_ping({'payload': 'hdmimatrix@dummy'}) == 'PON...
{ "split": "train", "index": 82819, "acecode_id": "bigcode_python_fns_12813", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string containing digits from 2-9. Each digit maps to a set of possible letters as shown in the following mapping: 2 -> \"abc\", 3 -> \"def\", 4 -> \"ghi\", 5 -> \"jkl\", 6 -> \"mno\", 7 -> \"pqrs\", 8 -> \"tuv\", 9 -> \"wxyz\". Write a function to return all po...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert letter_combinations('') == []\", \"assert letter_combinations('2') == ['a', 'b', 'c']\", \"assert sorted(letter_combinations('23')) == sorted(['ad', 'ae', 'af', 'bd', 'be', 'bf', 'cd', 'ce', 'cf'])\", \"assert sorted(letter_combinations('24')) == sorted(['ag...
{ "split": "train", "index": 82820, "acecode_id": "oss_5679", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of host node instances based on their 'agent_installed' property. The function should take in a list of dictionaries, where each dictionary represents a host node instance. If the 'agent_installed' property of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_tasks([{'agent_installed': True}]) == ['Sending Event: Starting Worker Installer', 'Executing Operation: cloudify.interfaces.worker_installer.start']\", \"assert process_tasks([{'agent_installed': False}]) == ['Sending Event: Creating Agent', 'Execut...
{ "split": "train", "index": 82821, "acecode_id": "oss_6509", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers that may include positive numbers, negative numbers, and zeros, implement a function `max_product_three` that determines the maximum product that can be obtained by multiplying any three distinct elements from the list. The function should return this m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_product_three([-1, -2, 4, 5, 8, 9, 0]) == 360\", \"assert max_product_three([1, 2, 3, 4, 5]) == 60\", \"assert max_product_three([-10, -10, 5, 2]) == 500\", \"assert max_product_three([0, 0, 0]) == 0\", \"assert max_product_three([1, 2, 3, 0, -1, -2]) ==...
{ "split": "train", "index": 82822, "acecode_id": "evol_18506", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a string 'prefix' and a string 'field_name', write a function that generates an environment variable name by concatenating the 'prefix' and 'field_name' with an underscore '_' in between. The resulting string should be in uppercase. If the 'prefix' is empty, the function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_var_name('', 'some_var') == 'SOME_VAR'\", \"assert generate_var_name('my_app', 'some_var') == 'MY_APP_SOME_VAR'\", \"assert generate_var_name('test', 'example') == 'TEST_EXAMPLE'\", \"assert generate_var_name('APP', 'config') == 'APP_CONFIG'\", \"as...
{ "split": "train", "index": 82823, "acecode_id": "bigcode_python_fns_13352", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n, implement a function called `henon_sequence` that returns a list containing the first n elements of the Henon sequence. The Henon sequence is defined as follows: The first element is 0, the second element is 1, and for all subsequent elements, the value at i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert henon_sequence(0) == []\", \"assert henon_sequence(1) == [0]\", \"assert henon_sequence(2) == [0, 1]\", \"assert henon_sequence(3) == [0, 1, 1]\", \"assert henon_sequence(4) == [0, 1, 1, 0]\"]}" }
{ "split": "train", "index": 82824, "acecode_id": "oss_29352", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that performs a multi-entry compare-and-set operation on a hypothetical in-memory key-value store. The function should take a list of tuples, where each tuple consists of a key and a new value. The function should return True if all e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multi_entry_compare_and_set({'foo': 1, 'bar': 2}, [('foo', 1), ('bar', 3)]) == False\", \"assert multi_entry_compare_and_set({'a': 10, 'b': 20}, [('a', 10), ('b', 25)]) == False\", \"assert multi_entry_compare_and_set({}, [('x', 1)]) == False\", \"assert mul...
{ "split": "train", "index": 82825, "acecode_id": "bigcode_python_fns_919", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `is_watchdog_running` that checks if a watchdog process for a credential server is currently running based on the given list of process IDs (PIDs). The function should take a list of integers representing PIDs and return a boolean value i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_watchdog_running([123, 456, 789]) == True\", \"assert is_watchdog_running([1]) == True\", \"assert is_watchdog_running([]) == False\", \"assert is_watchdog_running([0]) == True\", \"assert is_watchdog_running([100, 200, 300]) == True\", \"assert is_watchd...
{ "split": "train", "index": 82826, "acecode_id": "bigcode_python_fns_49841", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a line from a calendar file. Each calendar starts with 'BEGIN:VCALENDAR' and ends with 'END:VCALENDAR'. Your task is to implement a function that extracts and returns a list of complete calendar strings. Each complet...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_calendars(['BEGIN:VCALENDAR', 'VERSION:2.0', 'END:VCALENDAR']) == ['BEGIN:VCALENDARVERSION:2.0END:VCALENDAR']\", \"assert extract_calendars(['No calendar data']) == []\", \"assert extract_calendars(['BEGIN:VCALENDAR', 'VERSION:2.0', 'END:VCALENDAR', ...
{ "split": "train", "index": 82827, "acecode_id": "bigcode_python_fns_20942", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves a list of unique items from a given list of strings. The function should return the list of items sorted in alphabetical order. Implement the function `get_unique_sorted_items(items: List[str]) -> List[str]` where `items` i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_sorted_items(['apple', 'banana', 'apple', 'orange']) == ['apple', 'banana', 'orange']\", \"assert get_unique_sorted_items(['zebra', 'lion', 'tiger', 'lion']) == ['lion', 'tiger', 'zebra']\", \"assert get_unique_sorted_items(['cat', 'dog', 'elephan...
{ "split": "train", "index": 82828, "acecode_id": "bigcode_python_fns_20297", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing file names with their respective extensions. Your task is to implement a function that removes all files with a specific extension from the list. Write a function `remove_files_with_extension(file_list: List[str], extension: str) -> ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_files_with_extension(['file1.txt', 'file2.zip', 'file3.zip', 'file4.doc'], 'zip') == ['file1.txt', 'file4.doc']\", \"assert remove_files_with_extension(['image.jpg', 'image.png', 'image.gif'], 'jpg') == ['image.png', 'image.gif']\", \"assert remove_fi...
{ "split": "train", "index": 82829, "acecode_id": "bigcode_python_fns_10320", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simplified optimization algorithm. Given a list of weights, a list of predictions, and a learning rate, your function should adjust the predictions based on the weights and the learning rate using the following formul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert optimize_predictions([0.5], [1.0], 0.5) == [0.75]\", \"assert optimize_predictions([1.0, 1.0, 1.0], [1.0, 1.0, 1.0], 1.0) == [0.0, 0.0, 0.0]\", \"assert optimize_predictions([0.5, 0.5, 0.5], [0.5, 0.5, 0.5], 1.0) == [0.0, 0.0, 0.0]\", \"assert optimize_predi...
{ "split": "train", "index": 82830, "acecode_id": "bigcode_python_fns_5033", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that modifies a request object based on a specified run option. The function should take in a string `run_option` which can be either 'manual' or 'scheduled', a string `run_schedule`, a dictionary `request`, and a dictionary `messages...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modify_request('manual', '', {}, {'AdhocRun': {}}) == {'adHocRun': {}}\", \"assert modify_request('manual', '', {'key': 'value'}, {'AdhocRun': {}}) == {'key': 'value', 'adHocRun': {}}\", \"assert modify_request('scheduled', 'option1', {}, {'ScheduledRun': {'...
{ "split": "train", "index": 82831, "acecode_id": "bigcode_python_fns_2226", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simplified observer pattern in Python. In this problem, you will need to create an `Observer` class and a `Subject` class to demonstrate the observer pattern.\\n\\nYour task is to implement the `Observer` class with the following specification...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert obs1.get_value() == 10\", \"assert obs2.get_value() == 10\", \"assert obs1.get_value() != 5\", \"assert obs2.get_value() != 15\", \"assert obs1.get_value() == 10\", \"assert obs2.get_value() == 10\", \"assert obs1.get_value() == obs2.get_value()\", \"assert ...
{ "split": "train", "index": 82832, "acecode_id": "oss_12167", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a URL configuration for a simple API that manages a list of tasks. You need to set up the URL patterns to handle various actions such as retrieving, creating, updating, and deleting tasks. The API will have an endpoint named 'tasks', which should be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_url_patterns(['list', 'create']) == ['/tasks/', '/tasks/']\", \"assert generate_url_patterns(['retrieve', 'update', 'delete']) == ['/tasks/<id>/', '/tasks/<id>/', '/tasks/<id>/']\", \"assert generate_url_patterns(['list', 'create', 'retrieve']) == [...
{ "split": "train", "index": 82833, "acecode_id": "oss_1893", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function `estimate_energy_efficiency` that takes a list of operational parameters for industrial equipment as input and returns an estimated energy efficiency score. The input will be a list of floats representing various operational parameters, and the output should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert estimate_energy_efficiency([0, 0, 0]) == 0.0\", \"assert estimate_energy_efficiency([200, 0, 0]) == 100.0\", \"assert estimate_energy_efficiency([0, 200, 0]) == 60.0\", \"assert estimate_energy_efficiency([0, 0, 200]) == 40.0\", \"assert estimate_energy_effi...
{ "split": "train", "index": 82834, "acecode_id": "evol_11096", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with managing unique friendship connections between users identified by their unique user IDs. Your goal is to implement a function `make_friends(uid1: int, uid2: int) -> Tuple[int, int]` that takes two user IDs, `uid1` and `uid2`, and returns a tuple representin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_friends(1, 2) == (1, 2)\", \"assert make_friends(2, 1) == (1, 2)\", \"assert make_friends(5, 3) == (3, 5)\", \"assert make_friends(3, 5) == (3, 5)\", \"assert make_friends(10, 10) == (10, 10)\", \"assert make_friends(20, 15) == (15, 20)\", \"assert make...
{ "split": "train", "index": 82835, "acecode_id": "oss_19202", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `generate_employee_json(employees: List[Tuple[str, str, str]]) -> str` that takes a list of employee details as input. Each employee detail is represented as a tuple containing the employee's name, position, and department. The function should return a JSON str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_employee_json([]) == '[]'\", \"assert generate_employee_json([('Alice', 'Developer', 'Engineering')]) == '[{\\\"name\\\": \\\"Alice\\\", \\\"position\\\": \\\"Developer\\\", \\\"department\\\": \\\"Engineering\\\"}]'\", \"assert generate_employee_js...
{ "split": "train", "index": 82836, "acecode_id": "evol_36203", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of job pairs that represent precedence rules, determine if the jobs can be completed in a valid order such that all precedence constraints are satisfied. Each job is represented by an integer, and you are provided with a list of pairs where the first element must b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_job_order([(1, 2), (2, 3), (1, 4), (5, 6), (3, 6), (4, 6)]) == True\", \"assert is_valid_job_order([(1, 2), (2, 3), (3, 1)]) == False\", \"assert is_valid_job_order([(1, 2)]) == True\", \"assert is_valid_job_order([(1, 2), (2, 3), (1, 3)]) == True\"...
{ "split": "train", "index": 82837, "acecode_id": "bigcode_python_fns_36317", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `is_of_type_or_collection(obj, classinfo)` that checks if the given object `obj` is either an instance of the type specified by `classinfo` or if it is a collection (list, tuple, or set) where all elements are instances of `classinfo`. The function should r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_of_type_or_collection(5, int) == True\", \"assert is_of_type_or_collection('hello', str) == True\", \"assert is_of_type_or_collection([1, 2, 3], int) == True\", \"assert is_of_type_or_collection((1, 2, 3), int) == True\", \"assert is_of_type_or_collection...
{ "split": "train", "index": 82838, "acecode_id": "bigcode_python_fns_31467", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `translate_user_properties(user)` that processes a user object and translates its properties based on a predefined schema. The user object has properties that can be of different types. Specifically, you need to handle two property ty...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert translate_user_properties({'picture': '12345', 'groups': [{'group_name': 'group1', 'visible': True}, {'group_name': 'group2', 'visible': False}], 'name': 'Alice'}) == {'picture': 'http://example.com/picture/12345', 'groups': ['group1']}\", \"assert translate...
{ "split": "train", "index": 82839, "acecode_id": "oss_15424", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given three integers: N, A, and B. Write a function that takes these three integers as input and returns 'Ant' if the remainder of N divided by the sum of A and B is greater than 0 and less than or equal to A. Return 'Bug' otherwise. For example, if N=10, A=3, and B=4, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_ant_or_bug(10, 3, 4) == 'Ant'\", \"assert print_ant_or_bug(10, 5, 5) == 'Bug'\", \"assert print_ant_or_bug(10, 1, 2) == 'Ant'\", \"assert print_ant_or_bug(5, 1, 1) == 'Ant'\", \"assert print_ant_or_bug(0, 3, 3) == 'Bug'\", \"assert print_ant_or_bug(8, ...
{ "split": "train", "index": 82840, "acecode_id": "oss_6209", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that checks if a given URL is well-formed based on certain criteria. The function should take a URL as input and return a specific message and a status code based on the validation result. Your task is to implement the `validat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_url('https://www.example.com') == ('URL is valid', 200)\", \"assert validate_url('http://example.com') == ('URL is valid', 200)\", \"assert validate_url('https://sub.domain.com/path') == ('URL is valid', 200)\", \"assert validate_url('http://example...
{ "split": "train", "index": 82841, "acecode_id": "oss_16304", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a binary image represented as a 2D list where each element is either 0 or 1. A '1' represents the presence of a blood vessel, and a '0' represents the absence of a vessel. You also have a list of landmarks (x, y, type) where you want to calculate the width of the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_widths([[1, 1], [1, 0]], [(0, 1, 'A'), (1, 0, 'B')]) == [((0, 1), 1, 'A'), ((1, 0), 1, 'B')]\", \"assert calculate_widths([[0, 1, 0], [1, 1, 1], [0, 1, 0]], [(1, 1, 'A')]) == [((1, 1), 1, 'A')]\", \"assert calculate_widths([[1, 1, 1], [0, 1, 0], [1...
{ "split": "train", "index": 82842, "acecode_id": "bigcode_python_fns_14727", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a square matrix M represented as a list of lists (2D list), return the result of multiplying the transpose of M with M itself (M^t @ M). The matrix M is guaranteed to be of size n x n, where 1 <= n <= 100. The output should also be a 2D list of size n x n. \n\nFunction si...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert matrix_transpose_multiply([[1, 2], [3, 4]]) == [[10, 14], [14, 20]]\", \"assert matrix_transpose_multiply([[0, 1], [1, 0]]) == [[1, 0], [0, 1]]\", \"assert matrix_transpose_multiply([[1]]) == [[1]]\", \"assert matrix_transpose_multiply([[1, 1], [1, 1]]) == [...
{ "split": "train", "index": 82843, "acecode_id": "bigcode_python_fns_31428", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Consider the function d_n(x) which represents the n-th decimal digit of the fractional part of x, or 0 if the fractional part contains less than n digits. For example, d_7(1) = 0 and d_7(1/3) = 3. Your task is to implement a function S(n) that computes the sum S(n) = sum(d_n(1/...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert S(1) == 0\", \"assert S(2) == 0\", \"assert S(3) == 3\", \"assert S(4) == 3\", \"assert S(5) == 3\", \"assert S(6) == 9\", \"assert S(7) == 10\", \"assert S(13) == 14\"]}" }
{ "split": "train", "index": 82844, "acecode_id": "evol_28214", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Write a function that sums the length of names from a given list after removing names that either start with a lowercase letter or contain non-alphabetic characters. Implement the function `sum_name_length(names)` where `names` is a list of strings. The function should return t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_name_length(['Eve', 'frank', 'Grace2']) == 3\", \"assert sum_name_length(['Tina', 'uNcle', 'Victor2']) == 4\", \"assert sum_name_length(['Walter', 'xena']) == 6\", \"assert sum_name_length(['Yara', 'zane', 'Alice']) == 9\", \"assert sum_name_length([]) =...
{ "split": "train", "index": 82845, "acecode_id": "evol_3030", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to process image masks for a computer vision application. The function takes in three input masks, `min_mask`, `a2`, and `b2`, which represent certain image masks. Your function should perform the following steps:\n1. Calculate the ma...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_masks([[0, 1, 0], [1, 1, 1], [0, 1, 0]], [[0, 0, 0], [0, 1, 0], [0, 0, 0]], [[1, 1, 1], [1, 1, 1], [1, 1, 1]]) == [[0, 1, 0], [1, 1, 1], [0, 1, 0]]\", \"assert process_masks([[1, 0], [0, 0]], [[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[1, 0], [0, 0]]\",...
{ "split": "train", "index": 82846, "acecode_id": "oss_6478", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are working on a data processing application for neuroscience research. You need to filter an extension list based on a map of valid electrodes. The extension list contains various types of channels, such as bad channels, probe shank, and probe electrode. The electrodes val...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_extension_list_with_electrodes_valid_map(['channel1', 'channel2', 'channel3'], {'channel1': True, 'channel2': False, 'channel3': True}) == ['channel1', 'channel3']\", \"assert filter_extension_list_with_electrodes_valid_map(['channelA', 'channelB', 'c...
{ "split": "train", "index": 82847, "acecode_id": "oss_11899", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a Python function that receives two strings - `keys` and `values` - both of equal length. The function should return a dictionary that contains key-value pairs where each character from `keys` is paired with its corresponding integer value from `values`. For example, if ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_dict('abc', '123') == {'a': 1, 'b': 2, 'c': 3}\", \"assert create_dict('xyz', '456') == {'x': 4, 'y': 5, 'z': 6}\", \"assert create_dict('ABC', '789') == {'A': 7, 'B': 8, 'C': 9}\", \"assert create_dict('!@#', '012') == {'!': 0, '@': 1, '#': 2}\", \"a...
{ "split": "train", "index": 82848, "acecode_id": "evol_28057", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci(n: int) -> int` that generates the nth Fibonacci number using matrix exponentiation. 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 solution should utilize matrix exponentiation to co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2...
{ "split": "train", "index": 82849, "acecode_id": "evol_5767", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integers m and n, implement a function `intricate_prime_logic(m: int, n: int) -> int` that calculates the sum of all n-digit prime numbers that satisfy the following conditions: 1) The number must not have repeating digits, 2) The number must not be divisible by 5, 3)...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert intricate_prime_logic(100, 2) == 0\", \"assert intricate_prime_logic(100, 3) == 0\", \"assert intricate_prime_logic(25, 2) == 0\", \"assert intricate_prime_logic(10, 2) == 0\", \"assert intricate_prime_logic(30, 2) == 0\", \"assert intricate_prime_logic(13, ...
{ "split": "train", "index": 82850, "acecode_id": "evol_12421", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with counting the occurrences of pageviews for a set of documents over a specified date range. Given a list of documents identified by their IDs and an associated list of pageviews for each document, write a function that takes in two parameters: a list of docume...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_pageviews([1, 2, 1, 3], [10, 20, 30, 40]) == {1: 40, 2: 20, 3: 40}\", \"assert count_pageviews([1, 1, 1], [5, 5, 5]) == {1: 15}\", \"assert count_pageviews([], []) == {}\", \"assert count_pageviews([2, 3, 2, 3, 4], [1, 1, 1, 1, 1]) == {2: 2, 3: 2, 4: 1...
{ "split": "train", "index": 82851, "acecode_id": "bigcode_python_fns_45762", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing filenames. Your task is to write a function `extract_file_extensions(filenames: List[str]) -> List[str]` that returns a list of unique file extensions found in the provided filenames. A file extension is defined as the part of the fi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_file_extensions(['file1.txt', 'file2.jpg', 'file3.txt', 'file4', 'file5.doc']) == ['txt', 'jpg', 'doc']\", \"assert extract_file_extensions(['file1', 'file2', 'file3']) == []\", \"assert extract_file_extensions(['example.pdf', 'test.docx', 'image.png...
{ "split": "train", "index": 82852, "acecode_id": "bigcode_python_fns_16766", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a list of integers as input and returns the sum of all the odd numbers in the list. Your function should be named `sum_odd_numbers` and should take a single parameter: - `numbers` (list of integers): A list of integers, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_odd_numbers([1, 2, 3, 4, 5, 6]) == 9\", \"assert sum_odd_numbers([10, 15, 20, 25, 30]) == 40\", \"assert sum_odd_numbers([0, -1, -2, -3, -4]) == -4\", \"assert sum_odd_numbers([-1, -2, -3, -4, -5]) == -9\", \"assert sum_odd_numbers([2, 4, 6, 8]) == 0\", ...
{ "split": "train", "index": 82853, "acecode_id": "oss_7857", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings where each string contains the name of a pet owner, the number of pets they own, and the type of those pets, implement a function `group_pets(pets: List[str]) -> Dict[str, Dict[str, int]]` that groups this information into a dictionary. The keys of the d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert group_pets(['Henry 12 dogs', 'Eric 2 cats', 'David 7 birds', 'Henry 3 cats']) == {'Henry': {'dogs': 12, 'cats': 3}, 'Eric': {'cats': 2}, 'David': {'birds': 7}}\", \"assert group_pets(['Alice 5 hamsters', 'Bob 2 dogs', 'Bob 4 cats', 'Alice 1 dog']) == {'Alice...
{ "split": "train", "index": 82854, "acecode_id": "evol_26866", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array of integers. Your task is to identify the first integer in the array that is different from the integer that occurs most frequently (the majority integer). If all elements are the same, return None. Implement a function `find_deviant(arr)` that takes an a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_deviant([1,1,1,2,2,2,1]) == 2\", \"assert find_deviant([4,4,4,4]) == None\", \"assert find_deviant([10,10,10,20,10]) == 20\", \"assert find_deviant([1,1,2]) == 2\", \"assert find_deviant([8,8,8,7,8]) == 7\", \"assert find_deviant([9,9,9,9,10,9]) == 10\"...
{ "split": "train", "index": 82855, "acecode_id": "evol_26073", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple error handling mechanism for a module. Your function should accept a simulated module name as input. If the module name is 'melissa.profile_populator', the function should raise an IOError. For any other module nam...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_module_availability('numpy') == 'Module is available'\", \"assert check_module_availability('pandas') == 'Module is available'\", \"assert check_module_availability('scikit-learn') == 'Module is available'\", \"assert check_module_availability('matplot...
{ "split": "train", "index": 82856, "acecode_id": "bigcode_python_fns_26280", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the index ranges for a sub-window of a given size centered at a specific coordinate within a 2D grid. The function should ensure that the indices remain within the boundaries of the grid. The grid is represented as a 2D ar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert (slice(1, 4), slice(1, 4)) == window_slice((5, 5), (2, 2), (3, 3))\", \"assert (slice(0, 5), slice(0, 1)) == window_slice((5, 5), (2, 0), (10, 1))\", \"assert (slice(3, 4), slice(2, 3)) == window_slice((5, 5), (3, 2), (1, 1))\", \"assert (slice(1, 2), slice(...
{ "split": "train", "index": 82857, "acecode_id": "bigcode_python_fns_32200", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that retrieves the definition of a given term based on a predefined dictionary. Your function should take a string as input, representing the term to be looked up, and return the definition of the term as a string. If the term is n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_definition('python') == 'A high-level programming language.'\", \"assert get_definition('java') == 'A popular programming language.'\", \"assert get_definition('javascript') == 'A programming language commonly used for web development.'\", \"assert get_d...
{ "split": "train", "index": 82858, "acecode_id": "oss_13107", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `say_greetings(languages: List[str]) -> List[str]` that takes a list of languages and returns a list of greetings in the specified languages. The greetings should be defined in the following dictionary: {'English': 'Hello, world', 'Spanish': 'Hola, mundo', 'Fre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert say_greetings(['English']) == ['Hello, world']\", \"assert say_greetings(['Spanish']) == ['Hola, mundo']\", \"assert say_greetings(['French']) == ['Bonjour, monde']\", \"assert say_greetings(['German']) == ['Hallo, Welt']\", \"assert say_greetings(['Italian'...
{ "split": "train", "index": 82859, "acecode_id": "evol_16075", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that converts a well-formed XML string representing a list of people into a list of dictionaries. Each dictionary should contain the keys 'name' and 'age', with corresponding values extracted from the XML. The function should also validate the XML format an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_xml_to_dict('<people><person><name>Emily</name><age>25</age></person></people>') == [{'name': 'Emily', 'age': '25'}]\", \"assert convert_xml_to_dict('<people><person><name>Mark</name><age>32</age></person></people>') == [{'name': 'Mark', 'age': '32'}...
{ "split": "train", "index": 82860, "acecode_id": "evol_9742", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the behavior of a window management system. Implement a function `restore_window(window)` that takes a dictionary representing a window's state. The dictionary has two keys: 'is_minimized' (a boolean indicating if the window is currently minimized...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert restore_window({'is_minimized': True, 'dimensions': {'width': 0, 'height': 0}}) == {'is_minimized': False, 'dimensions': {'width': 450, 'height': 450}}\", \"assert restore_window({'is_minimized': False, 'dimensions': {'width': 450, 'height': 450}}) == {'is_m...
{ "split": "train", "index": 82861, "acecode_id": "bigcode_python_fns_3273", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that logs a greeting message along with a dictionary of keyword arguments. Write a function `log_greeting(logger, kwargs)` that takes two parameters: `logger`, which is an object with an `info` method for logging messages, and `kwargs`, a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_greeting(mock_logger, {'name': 'Alice'}) == None\", \"assert log_greeting(mock_logger, {'age': 30}) == None\", \"assert log_greeting(mock_logger, {'country': 'USA', 'city': 'New York'}) == None\", \"assert log_greeting(mock_logger, {}) == None\", \"asser...
{ "split": "train", "index": 82862, "acecode_id": "oss_9409", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with selecting a subset of images to cache based on their weighted distribution. You are given a total number of images to select, a list of images with their associated weights, and a list of nodes that indicate the current distribution of these images. Your goa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert choose_weighted_images(3, [('img1', 10), ('img2', 20), ('img3', 30)], ['node1', 'node2']) == ['img3', 'img2', 'img1']\", \"assert choose_weighted_images(2, [('img1', 1), ('img2', 1), ('img3', 1), ('img4', 1)], ['node1']) == ['img1', 'img2']\", \"assert choos...
{ "split": "train", "index": 82863, "acecode_id": "bigcode_python_fns_8646", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the total score for a set of event mentions. Each event mention has a score represented as a float. Your function should take a list of event mention scores and return the total score. If the list is empty, the function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_score([]) == 0.0\", \"assert calculate_total_score([1.0, 2.0, 3.0]) == 6.0\", \"assert calculate_total_score([-1.0, -2.0, -3.0]) == -6.0\", \"assert calculate_total_score([1.5, 2.5, -1.0]) == 3.0\", \"assert calculate_total_score([0.0, 0.0, 0...
{ "split": "train", "index": 82864, "acecode_id": "oss_20481", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `least_common_multiple_of_three(a: int, b: int, c: int) -> int` that calculates the least common multiple (LCM) of three positive integers using the Euclidean algorithm. The function should raise a ValueError if any of the integers are negative. Do not use ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert least_common_multiple_of_three(4, 5, 6) == 60\", \"assert least_common_multiple_of_three(1, 2, 3) == 6\", \"assert least_common_multiple_of_three(3, 6, 9) == 18\", \"assert least_common_multiple_of_three(7, 14, 28) == 28\", \"assert least_common_multiple_of_...
{ "split": "train", "index": 82865, "acecode_id": "evol_14719", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that categorizes companies based on their industry code. The function should take an integer input representing the industry code and return the corresponding industry name according to the following mapping: 1: 'Other', 2: 'Mining', 3: '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_company(1) == 'Other'\", \"assert categorize_company(2) == 'Mining'\", \"assert categorize_company(3) == 'Processing'\", \"assert categorize_company(4) == 'Energy'\", \"assert categorize_company(5) == 'Utilities'\", \"assert categorize_company(6) ...
{ "split": "train", "index": 82866, "acecode_id": "oss_11321", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the weights of different particles. Your task is to implement a function that calculates the total mass of all the particles. The mass of each particle is determined by its weight multiplied by a constant factor. The function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_mass([1, 2, 3], 1.0) == 6.0\", \"assert calculate_total_mass([-1, -2, -3], 2.0) == -12.0\", \"assert calculate_total_mass([0, 0, 0], 3.0) == 0.0\", \"assert calculate_total_mass([5, 10, 15], 2.0) == 60.0\", \"assert calculate_total_mass([-5, ...
{ "split": "train", "index": 82867, "acecode_id": "bigcode_python_fns_15255", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns a new list containing the negated values of the input list. The negated value of an integer x is -x. You must ensure that the input list contains only integers. Your function should handle an empty list by returning an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert negate_list([1, 2, 3]) == [-1, -2, -3]\", \"assert negate_list([-1, -2, -3]) == [1, 2, 3]\", \"assert negate_list([0, 1, -1]) == [0, -1, 1]\", \"assert negate_list([]) == []\", \"assert negate_list([5]) == [-5]\", \"assert negate_list([-5]) == [5]\", \"asser...
{ "split": "train", "index": 82868, "acecode_id": "bigcode_python_fns_11794", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_float` that takes a single parameter `txt` which can be of any type. The function should return `True` if `txt` can be converted to a float, and `False` otherwise. Your function should handle cases where the input is a number, a string representation of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_float('3.14') == True\", \"assert is_float('-2.71') == True\", \"assert is_float('0') == True\", \"assert is_float('1.0e10') == True\", \"assert is_float('inf') == True\", \"assert is_float('-inf') == True\", \"assert is_float('nan') == True\", \"assert i...
{ "split": "train", "index": 82869, "acecode_id": "bigcode_python_fns_6277", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the behavior of a Convolutional Auto-Encoder. The function should take in several parameters that define the characteristics of the auto-encoder and return a structured representation of the model's layers. Implement a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert auto_encoder_structure(32, (64, 64, 3), 3, 3, 10, 128, single_model=True) == {'encoder_layers': 3, 'encoding_size': 128, 'output_features': 10}\", \"assert auto_encoder_structure(64, (128, 128, 3), 4, 5, 20, 256, single_model=False) == {'encoder_layers': 4, ...
{ "split": "train", "index": 82870, "acecode_id": "bigcode_python_fns_2777", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of YANG module entries, where each module is represented as a dictionary containing the following keys: 'name', 'revision', 'namespace', 'features', 'import-only', and 'includes' (which is a list of tuples with submodule names and their revisions). Your tas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_yang_library([]) == '{\\\"ietf-yang-library:modules-state\\\": {\\\"module-set-id\\\": \\\"\\\", \\\"module\\\": []}}'\", \"assert make_yang_library([{'name': 'module1', 'revision': '2021-01-01', 'namespace': 'namespace1', 'features': [], 'import-only':...
{ "split": "train", "index": 82871, "acecode_id": "bigcode_python_fns_48519", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Write a function called `process_data` that takes a deeply nested data structure (which can be a combination of dictionaries, lists, or primitive data types) and processes it recursively. The function should return a new data structure that mirrors the input but maintains the i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_data({'a': 1, 'b': [2, 3]}) == {'a': 1, 'b': [2, 3]}\", \"assert process_data([1, {'a': 2}, [3, 4]]) == [1, {'a': 2}, [3, 4]]\", \"assert process_data({'nested': {'key': 'value'}}) == {'nested': {'key': 'value'}}\", \"assert process_data([{'a': 1}, {...
{ "split": "train", "index": 82872, "acecode_id": "evol_26483", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a collection of numbers. Implement a function `update_numbers(numbers: List[int], operation: str) -> List[int]` that performs the specified operation on the collection. The operation can be one of the following: 'add', 'remove', or ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_numbers([1, 2, 3], 'add') == [2, 3, 4]\", \"assert update_numbers([1, 2, 3], 'remove') == [1, 3]\", \"assert update_numbers([1, 2, 3], 'double') == [2, 4, 6]\", \"assert update_numbers([2, 2, 2], 'remove') == []\", \"assert update_numbers([1, 1, 1], '...
{ "split": "train", "index": 82873, "acecode_id": "bigcode_python_fns_38332", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers and a batch size. Your task is to partition the list into batches of the specified size. If the list cannot be evenly divided by the batch size, discard the extra elements that do not fit into a complete batch. Return a list of batches, where ea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert batch_dataset([1, 2, 3, 4, 5, 6], 2) == [[1, 2], [3, 4], [5, 6]]\", \"assert batch_dataset([1, 2, 3, 4, 5, 6, 7], 3) == [[1, 2, 3], [4, 5, 6]]\", \"assert batch_dataset([], 2) == []\", \"assert batch_dataset([1, 2, 3], 5) == []\", \"assert batch_dataset([1, ...
{ "split": "train", "index": 82874, "acecode_id": "bigcode_python_fns_39413", "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 calculate the total number of buildings that can be seen from the left side of the street. A building is considered visible if there are no taller buildings to its left. Implement ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert visible_buildings([3]) == 1\", \"assert visible_buildings([1, 2, 3, 4, 5]) == 5\", \"assert visible_buildings([5, 4, 3, 2, 1]) == 1\", \"assert visible_buildings([3, 1, 4, 2]) == 2\", \"assert visible_buildings([1, 2, 2, 1]) == 2\", \"assert visible_building...
{ "split": "train", "index": 82875, "acecode_id": "bigcode_python_fns_28522", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a string representing a currency (like 'USD', 'EUR', etc.) and returns a dictionary with the currency as the key and a hardcoded balance value as the value. The balance value is predetermined based on the currency: 'USD' should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_currency_balance('USD') == {'USD': 1000}\", \"assert get_currency_balance('EUR') == {'EUR': 800}\", \"assert get_currency_balance('JPY') == {'JPY': 110000}\", \"assert get_currency_balance('GBP') == {'GBP': 0}\", \"assert get_currency_balance('AUD') == {...
{ "split": "train", "index": 82876, "acecode_id": "bigcode_python_fns_6756", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that simulates a web crawler fetching data from a given start date. The function should take a single date string in the format 'YYYY-MM-DD' as input and return a list of strings representing the fetched data. If the given date is invalid,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fetch_data('2020-11-20') == ['data from 2020-11-20']\", \"assert fetch_data('2020-01-01') == ['data from 2020-01-01']\", \"assert fetch_data('2019-12-31') == []\", \"assert fetch_data('2020-05-15') == ['data from 2020-05-15']\", \"assert fetch_data('2020-02-...
{ "split": "train", "index": 82877, "acecode_id": "bigcode_python_fns_4449", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `apply_stylesheet(stylesheet: str) -> None` that takes a string representing a stylesheet and applies it to the current application instance. The function should simulate the effect of applying the stylesheet by printing a message indicat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert apply_stylesheet('background: red;') == None\", \"assert apply_stylesheet('color: blue;') == None\", \"assert apply_stylesheet('font-size: 14px;') == None\", \"assert apply_stylesheet('border: 1px solid black;') == None\", \"assert apply_stylesheet('padding:...
{ "split": "train", "index": 82878, "acecode_id": "bigcode_python_fns_48376", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that returns a formatted string representation of a WebDriver configuration based on the provided driver path and a list of options. The function should take in the path to the WebDriver executable and a list of additional options,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_webdriver_config('./chromedriver', ['--headless', '--disable-gpu']) == 'WebDriver configured at ./chromedriver with options: --headless, --disable-gpu'\", \"assert format_webdriver_config('./geckodriver', []) == 'WebDriver configured at ./geckodriver ...
{ "split": "train", "index": 82879, "acecode_id": "oss_3904", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are working on a game development project where various objects and elements in the game world are represented using bitmasks. Each object or element has a unique identifier represented by a BitMask32 value. Your task is to create a function that can determine whether a giv...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert checkBitmaskSubset(272, [2048]) == False\", \"assert checkBitmaskSubset(16, [16]) == True\", \"assert checkBitmaskSubset(32, [32]) == True\", \"assert checkBitmaskSubset(0, [256]) == False\", \"assert checkBitmaskSubset(4096, [2048, 4096]) == False\", \"asse...
{ "split": "train", "index": 82880, "acecode_id": "oss_8895", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a user profile and a user, implement a function that determines which fields should be visible based on the user's profile visibility settings. The function will take three parameters: a dictionary representing the user profile, a dictionary representing the user, and an ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert visible_fields({'name': 'John', 'age': 30}, {'visibility': 'ALL_USERS'}, {'bulk_shareable_fields': ['name', 'age', 'email']}) == ['name', 'age', 'email']\", \"assert visible_fields({'name': 'John', 'age': 30}, {'visibility': 'CUSTOM'}, {'custom_fields': ['na...
{ "split": "train", "index": 82881, "acecode_id": "bigcode_python_fns_45323", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that merges two sorted lists into a single sorted list without using any built-in Python list functions or set operations. The function should utilize recursion to accomplish the task. The function signature should be: `def merge_sorted_lists(l1: list, l2: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_sorted_lists([1, 2, 5, 8], [0, 3, 7]) == [0, 1, 2, 3, 5, 7, 8]\", \"assert merge_sorted_lists([4, 6, 7], [2, 5, 8]) == [2, 4, 5, 6, 7, 8]\", \"assert merge_sorted_lists([], [1]) == [1]\", \"assert merge_sorted_lists([1], []) == [1]\", \"assert merge_so...
{ "split": "train", "index": 82882, "acecode_id": "evol_22475", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that merges two dictionaries into a single dictionary. The function should take two input dictionaries and return a new dictionary that contains the unique keys from both input dictionaries. If a key is present in both dictionaries, t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_dicts({}, {'A': 1}) == {'A': 1}\", \"assert merge_dicts({'A': 1}, {}) == {'A': 1}\", \"assert merge_dicts({'X': 5}, {'Y': 10}) == {'X': 5, 'Y': 10}\", \"assert merge_dicts({'A': 1, 'B': 2}, {'B': 2, 'A': 1}) == {'A': 1, 'B': 2}\", \"assert merge_dicts(...
{ "split": "train", "index": 82883, "acecode_id": "oss_27032", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages a collection of books in a library. Each book has a title, author, and availability status. Your function should take a list of tuples representing books (where each tuple contains the title and author) and a list of titl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_library([('The Great Gatsby', 'F. Scott Fitzgerald'), ('1984', 'George Orwell')], ['The Great Gatsby']) == ['You have borrowed The Great Gatsby. Enjoy your reading!']\", \"assert manage_library([('To Kill a Mockingbird', 'Harper Lee'), ('1984', 'Georg...
{ "split": "train", "index": 82884, "acecode_id": "oss_14096", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with processing a list of lap times recorded during a racing event. Each lap time is represented as a string in the format 'MM:SS:MS', where MM is minutes, SS is seconds, and MS is milliseconds. Your goal is to implement a function that takes a list of lap times ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_fastest_lap(['01:30:500', '02:15:200', '01:25:300']) == '01:25:300'\", \"assert find_fastest_lap(['03:00:000', '03:00:001', '02:59:999']) == '02:59:999'\", \"assert find_fastest_lap(['00:59:999', '01:00:000', '00:59:998']) == '00:59:998'\", \"assert fin...
{ "split": "train", "index": 82885, "acecode_id": "oss_37422", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a configuration dictionary that contains a key `listener` which itself is a dictionary. This `listener` dictionary has a key `mute_during_output` that can either be `True` or `False`. Your task is to implement a function `handle_audio_end(config: Dict[str, Any]) -...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_audio_end({'listener': {'mute_during_output': True}}) == False\", \"assert handle_audio_end({'listener': {'mute_during_output': False}}) == True\", \"assert handle_audio_end({'listener': {}}) == True\", \"assert handle_audio_end({'mute_during_output':...
{ "split": "train", "index": 82886, "acecode_id": "bigcode_python_fns_48283", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers and returns a list of tuples. Each tuple should contain an integer and its corresponding frequency in the input list. The output list should be sorted in descending order by frequency. If two integers have th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_frequencies([1, 2, 2, 3, 1, 4]) == [(1, 2), (2, 2), (3, 1), (4, 1)]\", \"assert count_frequencies([3, 3, 3, 2, 2, 1]) == [(3, 3), (2, 2), (1, 1)]\", \"assert count_frequencies([5, 5, 5, 5, 5]) == [(5, 5)]\", \"assert count_frequencies([]) == []\", \"as...
{ "split": "train", "index": 82887, "acecode_id": "oss_802", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a random user code for a user management system. The user code should be a string of length 8 consisting of uppercase letters, lowercase letters, and digits. Your function should not take any parameters and should retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_user_code()) == 8\", \"assert all(c.isalnum() for c in generate_user_code())\", \"assert len(set(generate_user_code() for _ in range(100))) > 90\", \"assert len(generate_user_code()) == 8\", \"assert len(generate_user_code()) == 8\", \"assert le...
{ "split": "train", "index": 82888, "acecode_id": "oss_5603", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the value of the mathematical expression (x - 1)^2 for a given integer x. The function should take an integer x as input and return the result of the expression as an integer.\nPlease reason step by step, then write a self-contained Python s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_expression(0) == 1\", \"assert calculate_expression(1) == 0\", \"assert calculate_expression(2) == 1\", \"assert calculate_expression(-1) == 4\", \"assert calculate_expression(3) == 4\", \"assert calculate_expression(4) == 9\", \"assert calculate_e...
{ "split": "train", "index": 82889, "acecode_id": "evol_5354", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of histogram bars. Implement a function that calculates the area of the largest rectangle that can be formed within the histogram. The rectangle can be formed by choosing any two bars, and its height will be determined b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert largest_rectangle_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert largest_rectangle_area([1, 1, 1, 1, 1]) == 5\", \"assert largest_rectangle_area([1, 2, 3, 4, 5]) == 9\", \"assert largest_rectangle_area([5, 4, 3, 2, 1]) == 9\", \"assert largest_rectangle_area([0,...
{ "split": "train", "index": 82890, "acecode_id": "bigcode_python_fns_47795", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a migration process for a given list of applications. Each application is represented by a string. Your function should take in a list of application names and return the same list, but in reverse order. Implement a functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_migration(['App1', 'App2', 'App3']) == ['App3', 'App2', 'App1']\", \"assert reverse_migration(['Calculator', 'Notepad', 'Browser']) == ['Browser', 'Notepad', 'Calculator']\", \"assert reverse_migration(['A', 'B', 'C', 'D']) == ['D', 'C', 'B', 'A']\",...
{ "split": "train", "index": 82891, "acecode_id": "bigcode_python_fns_11590", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing visual and audio stimuli associated with specific markers in a psychological experiment. Implement a function named `get_stimuli_by_marker` that takes a list of visual stimuli and a list of audio stimuli, each represented as dictionaries, along with...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_stimuli_by_marker([{'name': 'image1', 'rating': 5, 'marker': 'A'}, {'name': 'image2', 'rating': 3}], [{'name': 'sound1', 'marker': 'A'}, {'name': 'sound2'}], 'A') == ['image1', 'sound1']\", \"assert get_stimuli_by_marker([{'name': 'image1', 'rating': 5, ...
{ "split": "train", "index": 82892, "acecode_id": "oss_6757", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with building a simple application that manages a collection of drinks. Each drink has an ID, a name, and a description. Your goal is to implement a function that takes a list of drinks (where each drink is represented as a dictionary with keys 'id', 'name', and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_drink_names([]) == []\", \"assert get_drink_names([{'id': 1, 'name': 'Cola', 'description': 'A sweet carbonated drink.'}]) == ['Cola']\", \"assert get_drink_names([{'id': 1, 'name': 'Cola', 'description': 'A sweet carbonated drink.'}, {'id': 2, 'name': '...
{ "split": "train", "index": 82893, "acecode_id": "oss_2991", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of integers and returns a new list with each integer squared. The function should handle negative numbers as well, and the output list should maintain the same order as the input list. Write the function `square_inte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert square_integers([1, 2, 3]) == [1, 4, 9]\", \"assert square_integers([-1, -2, -3]) == [1, 4, 9]\", \"assert square_integers([0]) == [0]\", \"assert square_integers([2, -3, 4]) == [4, 9, 16]\", \"assert square_integers([-10, 10]) == [100, 100]\", \"assert squa...
{ "split": "train", "index": 82894, "acecode_id": "oss_3950", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating random contact information for a fictional contact management system. Specifically, you need to implement a function called `generate_contact_info()` that generates a random email address and a random phone number. The email address should follow ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_contact_info() is not None\", \"assert 'email' in generate_contact_info()\", \"assert 'phone' in generate_contact_info()\", \"assert isinstance(generate_contact_info()['email'], str)\", \"assert isinstance(generate_contact_info()['phone'], str)\", \...
{ "split": "train", "index": 82895, "acecode_id": "oss_2957", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given the x, y, and z components of acceleration as floating-point numbers, write a function `magnitude(x: float, y: float, z: float) -> float` that calculates the magnitude of the acceleration vector using the formula √(x² + y² + z²). The function should return the magnitude a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert magnitude(3.0, 4.0, 0.0) == 5.0\", \"assert magnitude(1.0, 2.0, 2.0) == 3.0\", \"assert magnitude(0.0, 0.0, 0.0) == 0.0\", \"assert magnitude(1.0, 1.0, 1.0) == 1.7320508075688772\", \"assert magnitude(-3.0, -4.0, 0.0) == 5.0\", \"assert magnitude(5.0, 12.0, ...
{ "split": "train", "index": 82896, "acecode_id": "bigcode_python_fns_28623", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that determines if two given strings are anagrams of each other. An anagram is a word or phrase formed by rearranging the letters of a different word or phrase, using all the original letters exactly once. Your function should ignore spaces, punctuation, an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_anagrams('listen', 'silent') == True\", \"assert are_anagrams('triangle', 'integral') == True\", \"assert are_anagrams('apple', 'pale') == False\", \"assert are_anagrams('A gentleman', 'Elegant man') == True\", \"assert are_anagrams('The Morse Code', 'He...
{ "split": "train", "index": 82897, "acecode_id": "evol_6262", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string command that represents a shell command and a string path that represents the directory in which to execute the command. Write a function `execute_command(cmd: str, path: str) -> Dict[str, str]` that simulates executing the command in the specified direct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_command('echo Hello World', '/some/path') == {'out': 'Hello World\\\\n', 'err': ''}\", \"assert execute_command('ls', '/some/path') == {'out': 'file1.txt\\\\nfile2.txt\\\\n', 'err': ''}\", \"assert execute_command('pwd', '/some/path') == {'out': 'Com...
{ "split": "train", "index": 82898, "acecode_id": "bigcode_python_fns_32834", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function `string_analysis(s: str) -> Tuple[int, int, bool]` that returns the length of the given string `s`, the number of vowels in `s`, and a boolean indicating whether the string contains only printable ASCII characters. Vowels are defined as 'a', 'e', 'i', 'o', ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert string_analysis('Hello World') == (11, 3, True)\", \"assert string_analysis('Python') == (6, 1, True)\", \"assert string_analysis('123456') == (6, 0, True)\", \"assert string_analysis('') == (0, 0, True)\", \"assert string_analysis('!@#$%^&*()') == (10, 0, T...
{ "split": "train", "index": 82899, "acecode_id": "evol_29255", "num_tests": 13 }