data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `run_bandit_trials` that simulates a series of multi-armed bandit trials based on various configurations. The function should accept the following parameters: \n- `experiment` (str): The experiment configuration for the trials. \n- `m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run_bandit_trials('experiment2', False, True, 0.2, False, False) == ['Running adaptive model trial with learning rate 0.2']\", \"assert run_bandit_trials('experiment4', False, False, 0.0, False, False) == []\", \"assert run_bandit_trials('experiment6', True,... | {
"split": "train",
"index": 70500,
"acecode_id": "oss_29023",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Write a function `octal_to_decimal(x: str) -> Union[None, Tuple[int, str]]` that converts a valid octal number (given as a string) into its corresponding decimal representation as an integer and also provides a binary representation of that decimal number as a string. If the oc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert octal_to_decimal('0') == (0, '0')\", \"assert octal_to_decimal('1') == (1, '1')\", \"assert octal_to_decimal('7') == (7, '111')\", \"assert octal_to_decimal('10') == (8, '1000')\", \"assert octal_to_decimal('11') == (9, '1001')\", \"assert octal_to_decimal('... | {
"split": "train",
"index": 70501,
"acecode_id": "evol_32717",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `fromScope` and `destScope`. Your task is to implement a function `relative_scope(fromScope: List[int], destScope: List[int]) -> List[Optional[int]]` that determines the relative scope between the two lists. The relative scope is defined as ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert relative_scope([1, 2, 3], [3, 2, 1]) == [2]\", \"assert relative_scope([1, 2, 3], [4, 5, 6]) == [None]\", \"assert relative_scope([], [1, 2, 3]) == [None]\", \"assert relative_scope([5, 6], []) == [None]\", \"assert relative_scope([1, 2, 3], [1, 2, 3]) == [0... | {
"split": "train",
"index": 70502,
"acecode_id": "bigcode_python_fns_18513",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a date represented as a string in the format 'YYYY-MM-DD', write a function `first_weekday_date(date: str) -> str` that returns the date of the first weekday (Monday) of the same week as the given date. The week starts on Monday and ends on Sunday. The output should also ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert first_weekday_date('2023-10-04') == '2023-10-02'\", \"assert first_weekday_date('2023-09-30') == '2023-09-25'\", \"assert first_weekday_date('2023-10-07') == '2023-10-02'\", \"assert first_weekday_date('2023-10-03') == '2023-10-02'\", \"assert first_weekday_... | {
"split": "train",
"index": 70503,
"acecode_id": "bigcode_python_fns_19511",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the deletion of a device based on its ID. The function `delete_device(device_id: int) -> str` should accept an integer representing the device ID and return a string message indicating whether the deletion was successful or... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_device(12345) == 'Device deleted successfully.'\", \"assert delete_device(1) == 'Device deleted successfully.'\", \"assert delete_device(999) == 'Device deleted successfully.'\", \"assert delete_device(0) == 'Device not found.'\", \"assert delete_devi... | {
"split": "train",
"index": 70504,
"acecode_id": "bigcode_python_fns_37727",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `raise_and_root(x: float, y: float, n: int) -> Tuple[float, Union[float, complex], int]` that takes three parameters: a base number `x`, a number `y`, and an integer `n`. The function should return a tuple containing the following: the result of raising `x`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert raise_and_root(2, 8, 3) == (8, 2.0, 10)\", \"assert raise_and_root(3, 27, 3) == (27, 3.0, 12)\", \"assert raise_and_root(2, -8, 3) == (8, -2.0, 10)\", \"assert raise_and_root(0, 0, 1) == (0, 0.0, 0)\", \"assert raise_and_root(0, 1, 1) == (0, 1.0, 1)\", \"ass... | {
"split": "train",
"index": 70505,
"acecode_id": "evol_13610",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that simulates the process of selecting hyperparameters for a time series forecasting model. The function should take in a string representing the future index and a string representing the model class name. It should return a dictionar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_hyperparameters('IC', 'GRU') == {'learning_rate': 0.001, 'num_layers': 2, 'hidden_units': 64}\", \"assert get_hyperparameters('US', 'LSTM') == {'learning_rate': 0.01, 'num_layers': 3, 'hidden_units': 128}\", \"assert get_hyperparameters('IC', 'LSTM') == ... | {
"split": "train",
"index": 70506,
"acecode_id": "oss_36243",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of numerical datasets. Implement a function called `process_data` that takes in three lists of integers: `data1`, `data2`, and `properties`. The function should return a new list that contains the sum of corresponding elements from `data1` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data([1, 2, 3], [4, 5, 6], [7, 8]) == [5, 7, 9, 7, 8]\", \"assert process_data([1], [2, 3, 4], [5]) == [3, 5]\", \"assert process_data([1, 2], [], [3, 4]) == [3, 4]\", \"assert process_data([10, 20, 30], [1, 2], [3, 4, 5]) == [11, 22, 3, 4, 5]\", \"a... | {
"split": "train",
"index": 70507,
"acecode_id": "bigcode_python_fns_3518",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a given list of strings representing card names. Your function should take in a list of card names and return a new list that includes only the unique card names, preserving the original order of their first appearance.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_cards(['Ace', 'King', 'Queen', 'Ace', 'Jack', 'King']) == ['Ace', 'King', 'Queen', 'Jack']\", \"assert get_unique_cards(['Card1', 'Card2', 'Card1', 'Card3', 'Card2']) == ['Card1', 'Card2', 'Card3']\", \"assert get_unique_cards(['Red', 'Blue', 'Gre... | {
"split": "train",
"index": 70508,
"acecode_id": "bigcode_python_fns_14064",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of log entries, where each entry is a string formatted as 'LogLevel: Message'. The log levels can be 'ERROR', 'WARNING', 'INFO', or 'STARTUP'. Your task is to implement a function that parses the log entries and categorizes them into separate lists based on... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_logs(['ERROR: Disk failure', 'INFO: System rebooted', 'WARNING: High memory usage', 'STARTUP: Initialization complete']) == [['Disk failure'], ['High memory usage'], ['System rebooted'], ['Initialization complete']]\", \"assert parse_logs(['INFO: User ... | {
"split": "train",
"index": 70509,
"acecode_id": "bigcode_python_fns_9959",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a configuration represented as a dictionary, implement a function `get_stoplist_names(config: Dict[str, Dict[str, str]]) -> List[str]` that returns a list of names of all stoplists present in the configuration. The configuration dictionary will have keys representing vari... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_stoplist_names({'setting1': {'stoplist_a': 'value1', 'stoplist_b': 'value2'}, 'setting2': {'stoplist_c': 'value3'}}) == ['a', 'b', 'c']\", \"assert get_stoplist_names({'setting1': {'stoplist_x': 'value', 'other_setting': 'value'}, 'setting2': {}}) == ['x... | {
"split": "train",
"index": 70510,
"acecode_id": "bigcode_python_fns_22916",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a command string and extracts specific options and their values. The command string follows a specific format and contains various options. Write a Python function called `parse_command` that takes a command string a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_command('build --with-kubectl=1.19.0 --with-velero=1.5.1') == {'with-kubectl': '1.19.0', 'with-velero': '1.5.1'}\", \"assert parse_command('build --with-velero=1.0.0') == {'with-velero': '1.0.0'}\", \"assert parse_command('build --with-kubectl=1.21.0')... | {
"split": "train",
"index": 70511,
"acecode_id": "oss_3635",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a function that updates a hidden area represented by an integer. The function takes a variable number of integer arguments, each representing a change in the hidden area. Your task is to implement a function `update_hidden_area(*args: int) -> bool` that returns Tr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_hidden_area(1) == True\", \"assert update_hidden_area(-1) == True\", \"assert update_hidden_area(0) == True\", \"assert update_hidden_area(5, 10) == True\", \"assert update_hidden_area(3, 4, 5) == True\", \"assert update_hidden_area() == False\", \"as... | {
"split": "train",
"index": 70512,
"acecode_id": "bigcode_python_fns_21413",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and a comparison function. Implement a function `median(l: List[int], cmp_func: Callable[[int, int], bool]) -> float` that calculates the median of the list using the quick select algorithm. If the list is empty, raise an exception with the mess... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median([1, 3, 2], lambda x, y: x < y) == 2\", \"assert median([2, 4, 3, 1], lambda x, y: x < y) == 2.5\", \"assert median([1], lambda x, y: x < y) == 1\", \"assert median([1, 2], lambda x, y: x < y) == 1.5\", \"assert median([1, 2, 3, 4, 5, 6], lambda x, y: ... | {
"split": "train",
"index": 70513,
"acecode_id": "evol_1841",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple inventory management system. Implement a function `add_stock(fruit: str, quantity: int) -> None` that takes a fruit name and a quantity as parameters. The function should update the inventory by adding the specified quantity of the given fr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_stock('apples', 5) == None\", \"assert add_stock('oranges', 5) == None\", \"assert add_stock('bananas', 3) == None\", \"assert add_stock('apples', 0) == None\", \"assert add_stock('oranges', -5) == None\", \"assert add_stock('grapes', 7) == None\", \"ass... | {
"split": "train",
"index": 70514,
"acecode_id": "evol_1455",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of characters initialized as lst = ['a', 'b', 'c', 'd'], write a function insert_element(position, element) that takes an index position and a string element as input. The function should insert the element at the specified index if the index is valid (within the b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert_element(0, 'x') == ['x', 'a', 'b', 'c', 'd']\", \"assert insert_element(1, 'x') == ['a', 'x', 'b', 'c', 'd']\", \"assert insert_element(2, 'x') == ['a', 'b', 'x', 'c', 'd']\", \"assert insert_element(3, 'x') == ['a', 'b', 'c', 'x', 'd']\", \"assert in... | {
"split": "train",
"index": 70515,
"acecode_id": "evol_24014",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of selections, where each selection is represented by an index in a positions list. Each position is a tuple of three integers representing (x, y, z) coordinates. You also receive a region defined by three tuples, each representing the minimum and maximum v... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_region([0, 1, 2], [(1, 2, 3), (4, 5, 6), (7, 8, 9)], []) == [0, 1, 2]\", \"assert select_region([0, 1, 2], [(1, 2, 3), (4, 5, 6), (7, 8, 9)], [(10, 20), (10, 20), (10, 20)]) == []\", \"assert select_region([0], [(1, 1, 1)], [(1, 1), (1, 1), (1, 1)]) =... | {
"split": "train",
"index": 70516,
"acecode_id": "bigcode_python_fns_21469",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of words, where each word is represented as a dictionary containing the 'word' itself and its left ('l') and right ('r') boundary positions in a block of text. Your task is to determine if the text block is formatted as a table based on the following criter... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_table([{'word': 'Data', 'l': 0, 'r': 4}, {'word': 'Science', 'l': 5, 'r': 12}], 20, 2) == True\", \"assert check_table([{'word': 'Hello', 'l': 0, 'r': 5}, {'word': 'World', 'l': 6, 'r': 11}], 30, 2) == True\", \"assert check_table([{'word': 'Python', '... | {
"split": "train",
"index": 70517,
"acecode_id": "bigcode_python_fns_19147",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python program to analyze a list of file names and categorize the files based on their extensions. Your program should identify the unique categories of file extensions present in the provided list of file names. However, if a file has the '.md' e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_files(['file1.md', 'file2.html', 'file3.md', 'file4.txt']) == {'html', 'txt'}\", \"assert analyze_files(['image.png', 'document.pdf', 'notes.md', 'presentation.pptx']) == {'png', 'pdf', 'pptx'}\", \"assert analyze_files(['script.py', 'README.md', 'da... | {
"split": "train",
"index": 70518,
"acecode_id": "oss_33605",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Write a function that sorts the list in ascending order without using built-in sorting functions or libraries. Additionally, after sorting, check if the sorted list forms an Arithmetic Progression (AP). If it does, return the common difference ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_and_check_ap([1, 3, 5, 7]) == 2\", \"assert sort_and_check_ap([10, 20, 30, 40]) == 10\", \"assert sort_and_check_ap([5]) == None\", \"assert sort_and_check_ap([1, 2, 3]) == 1\", \"assert sort_and_check_ap([2, 4, 6, 8, 10]) == 2\", \"assert sort_and_chec... | {
"split": "train",
"index": 70519,
"acecode_id": "evol_26077",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of documents, each represented as a list of sentences, and a query string. Your task is to find the first document index and the locations of the first occurrence of each word in the query string within that document. If a word is not found in any document,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_word_locations([['Hello world', 'This is a test'], ['Another document here']], 'Hello world') == {'Hello': (0, [(0, 0)]), 'world': (0, [(0, 1)])}\", \"assert find_word_locations([['No matches here'], ['Still no matches']], 'test') == {'test': (0, [(-1, ... | {
"split": "train",
"index": 70520,
"acecode_id": "bigcode_python_fns_39105",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of coordinates (latitude and longitude) and a list of distances. Your task is to create a function that determines the maximum distance from the given distances and then finds the total number of unique coordinates that fall within this maximum distance. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_unique_coordinates_count([(0.0, 0.0), (0.0, 0.0)], [5, 8]) == 1\", \"assert calculate_unique_coordinates_count([(10.0, 10.0)], [1]) == 1\", \"assert calculate_unique_coordinates_count([(1.1, 1.2), (2.1, 2.2)], [0]) == 2\", \"assert calculate_unique... | {
"split": "train",
"index": 70521,
"acecode_id": "bigcode_python_fns_35236",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a string 'site', implement a function 'requires_site(site: str) -> bool' that checks if the given site is equal to a predefined constant 'SITE'. If the site matches the constant, return False, indicating that the site does not require skipping. If the site does not match,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert requires_site('example.com') == False\", \"assert requires_site('test.com') == True\", \"assert requires_site('example.org') == True\", \"assert requires_site('example.com') == False\", \"assert requires_site('example.net') == True\", \"assert requires_site(... | {
"split": "train",
"index": 70522,
"acecode_id": "bigcode_python_fns_18806",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the creation of IAM roles and the attachment of policies in a simplified manner. The function will take a list of role definitions and a list of policy attachments, and it should return a summary of the created roles an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_iam_resources([], []) == []\", \"assert manage_iam_resources([{'role_name': 'AdminRole', 'assume_role_policy_document': 'Document1'}], []) == ['Role AdminRole created without policies']\", \"assert manage_iam_resources([{'role_name': 'AdminRole', 'ass... | {
"split": "train",
"index": 70523,
"acecode_id": "oss_15653",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that simulates the loading of a predefined fixture response in JSON format. Your function should return a dictionary representing the settings response. This dictionary contains keys such as 'subscriptions', 'status', and 'user_info'. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_fixture_response() == {'subscriptions': [{'id': 1, 'type': 'premium', 'active': True}, {'id': 2, 'type': 'basic', 'active': False}], 'status': 'success', 'user_info': {'username': 'john_doe', 'email': 'john@example.com'}}\", \"assert load_fixture_respon... | {
"split": "train",
"index": 70524,
"acecode_id": "bigcode_python_fns_927",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of customer demands represented as integers, write a function `calculate_total_demand(demands: List[int]) -> int` that returns the total demand from all customers. The input is a list where each element represents the demand of a customer. The function should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_demand([1, 2, 3]) == 6\", \"assert calculate_total_demand([0, 0, 0, 0]) == 0\", \"assert calculate_total_demand([5, 10]) == 15\", \"assert calculate_total_demand([1]) == 1\", \"assert calculate_total_demand([10, 20, 30, 40, 50]) == 150\", \"a... | {
"split": "train",
"index": 70525,
"acecode_id": "bigcode_python_fns_27297",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program to manage the difficulty levels of a game. The game has three difficulty levels: Easy, Medium, and Hard. Your goal is to implement a function called `get_difficulty_level` that receives a string as an input representing the difficulty leve... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_difficulty_level('Easy') == 1\", \"assert get_difficulty_level('Medium') == 2\", \"assert get_difficulty_level('Hard') == 3\", \"assert get_difficulty_level('Very Hard') == -1\", \"assert get_difficulty_level('easy') == -1\", \"assert get_difficulty_leve... | {
"split": "train",
"index": 70526,
"acecode_id": "oss_2302",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string containing mixed uppercase, lowercase letters, and special characters, write a function that processes the string character by character and replaces uppercase letters with their corresponding ordinal values (A=1, B=2, ..., Z=26). All other characters (lowercase ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert processString('aBcDeF!@#') == 'a2c4e6!@#'\", \"assert processString('123!@#') == '123!@#'\", \"assert processString('') == ''\", \"assert processString('A') == '1'\", \"assert processString('@#$%^&*()') == '@#$%^&*()'\", \"assert processString('AaBbCcDdEe') ... | {
"split": "train",
"index": 70527,
"acecode_id": "evol_24201",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the volume of a pyramid given the lengths of its rectangular base and its height. The volume can be calculated using the formula V = (1/3) * base_area * height, where base_area is the product of the base's length and width. Write a function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pyramid_volume(3, 4, 5) == 20.0\", \"assert pyramid_volume(2, 2, 2) == 2.6666666666666665\", \"assert pyramid_volume(1, 1, 1) == 0.3333333333333333\", \"assert pyramid_volume(0, 5, 5) == 0.0\", \"assert pyramid_volume(3, 0, 5) == 0.0\", \"assert pyramid_volu... | {
"split": "train",
"index": 70528,
"acecode_id": "evol_13741",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that removes a specified prefix from a given string if it exists. The function should take two parameters: a string `input_string` representing the original string, and a string `prefix` representing the prefix to be removed. If `input_string` s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_prefix('http://example.com/media/my_image.png', 'http://example.com/media/') == 'my_image.png'\", \"assert remove_prefix('http://example.com/media/my_image.png', 'http://example.com/') == 'media/my_image.png'\", \"assert remove_prefix('my_image.png', ... | {
"split": "train",
"index": 70529,
"acecode_id": "bigcode_python_fns_41013",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating input for adding a new movie to a movie database. Implement a function called `validate_and_add_movie(title, year)` that takes the `title` (a string) and `year` (a string representing a year) of the movie as input and performs the following valida... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_and_add_movie('', '') == ('title and year are required.', True)\", \"assert validate_and_add_movie('Inception', '') == ('title and year are required.', True)\", \"assert validate_and_add_movie('', '2010') == ('title and year are required.', True)\",... | {
"split": "train",
"index": 70530,
"acecode_id": "oss_4392",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing guest profiles for a venue. Implement a function `create_guest_profile` that takes the following parameters: `first_name` (string): The first name of the guest, `last_name` (string): The last name of the guest, `default_sound_id` (integer): The defa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_guest_profile('John', 'Doe', 1, 101) == 'Profile created successfully'\", \"assert create_guest_profile('Jane', 'Doe', 3, 102) == 'Profile created successfully'\", \"assert create_guest_profile('Alice', 'Smith', 5, 103) == 'Profile created successfull... | {
"split": "train",
"index": 70531,
"acecode_id": "oss_9053",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a string consisting of arbitrary characters, write a function `least_frequency` that identifies the character that appears the least frequently in the string and returns it along with the number of times it appears. If there are multiple characters with the same least fre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert least_frequency('programmingisfun') == ('p', 1)\", \"assert least_frequency('hello') == ('h', 1)\", \"assert least_frequency('aabbccdde') == ('e', 1)\", \"assert least_frequency('abc') == ('a', 1)\", \"assert least_frequency('aabbcc') == ('a', 2)\", \"assert... | {
"split": "train",
"index": 70532,
"acecode_id": "evol_10247",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that maps specific failure types to their corresponding verbose names. The failure types and their verbose names are predefined in a dictionary. Write a function `get_verbose_failure_type(failure_type)` that takes a failure type as a stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_verbose_failure_type('user_code_failure') == '\\\\u5904\\\\u7406\\\\u51fa\\\\u9519\\\\uff08\\\\u672a\\\\u5206\\\\u7c7b\\\\uff09'\", \"assert get_verbose_failure_type('non_existent_failure') == 'Unknown Failure Type'\", \"assert get_verbose_failure_type('... | {
"split": "train",
"index": 70533,
"acecode_id": "oss_25541",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a binary tree where each node can either be an integer or another binary tree (subtree). Your task is to write a function `flatten_tree(tree: Optional[TreeNode]) -> List[Union[int, List]]` that flattens the binary tree into a list. The flattened list should contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten_tree(None) == []\", \"assert flatten_tree(TreeNode(1)) == [1]\", \"assert flatten_tree(TreeNode(2, TreeNode(1), TreeNode(3))) == [1, 2, 3]\", \"assert flatten_tree(TreeNode(5, TreeNode(3, TreeNode(1), TreeNode(4)), TreeNode(8))) == [1, 3, 4, 5, 8]\",... | {
"split": "train",
"index": 70534,
"acecode_id": "bigcode_python_fns_852",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts an array of integers using the Bubble Sort algorithm. Your function should take a list of integers as input and return the sorted list in ascending order. Make sure to handle edge cases such as empty lists and lists with duplicate values.\nPlease... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubbleSort([]) == []\", \"assert bubbleSort([1]) == [1]\", \"assert bubbleSort([3, 2, 1]) == [1, 2, 3]\", \"assert bubbleSort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert bubbleSort([1, 2, 3]) == [1, 2, 3]\", \"assert bubbleSort([2, 1]) == [1, 2]\", \"ass... | {
"split": "train",
"index": 70535,
"acecode_id": "evol_22766",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of unique integers and a target integer. Your task is to implement a function that returns all unique combinations of integers from the list that sum up to the target integer. Each combination should be represented as a list of integers. The same integer ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_combinations([1, 2, 3], 0) == [[]]\", \"assert find_combinations([], 5) == []\", \"assert find_combinations([4, 5], 10) == [[5, 5]]\", \"assert find_combinations([1], 1) == [[1]]\", \"assert find_combinations([10], 10) == [[10]]\"]}"
} | {
"split": "train",
"index": 70536,
"acecode_id": "evol_21033",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary where keys are integers and values are single-character strings, implement a function that constructs a binary search tree (BST) using the ASCII values of the dictionary's string values as nodes. The function should return the root of the binary search tree. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bst_insert({'a': 'A', 'b': 'B', 'c': 'C', 'd': 'D', 'e': 'E'}) == 65\", \"assert bst_insert({'x': 'X', 'y': 'Y'}) == 88\", \"assert bst_insert({'A': 'A'}) == 65\", \"assert bst_insert({'E': 'E', 'D': 'D'}) == 69\", \"assert bst_insert({' ': ' '}) == 32\", \"... | {
"split": "train",
"index": 70537,
"acecode_id": "evol_11314",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the retrieval of task execution details from a maintenance window. Write a function `get_maintenance_window_execution_task_details(WindowExecutionId: str, TaskId: str) -> dict` that takes in two parameters: `WindowExecution... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_maintenance_window_execution_task_details('window-123', 'task-456') == {'WindowExecutionId': 'window-123', 'TaskExecutionId': 'task-execution-task-456', 'TaskArn': 'arn:aws:tasks:us-east-1:123456789012:task/task-456', 'ServiceRole': 'service-role/my-role... | {
"split": "train",
"index": 70538,
"acecode_id": "bigcode_python_fns_39952",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple bank account system. The function should support basic operations such as depositing and withdrawing funds while keeping track of the balance and the total number of transactions. Your task is to implement a fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_account_operations([('deposit', 100), ('withdraw', 50), ('withdraw', 100)]) == (50, 2)\", \"assert bank_account_operations([('deposit', 200), ('withdraw', 50), ('withdraw', 150), ('withdraw', 10)]) == (0, 3)\", \"assert bank_account_operations([('withdr... | {
"split": "train",
"index": 70539,
"acecode_id": "oss_6453",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages settings for a document viewer application. The function, named `manage_document_viewer_settings`, takes two parameters: a list of supported languages and a default language. It returns a dictionary containing the selected la... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_document_viewer_settings(['English', 'Spanish', 'French'], 'English') == {'selected_language': 'English', 'zoom_factor': 1, 'enhance_images': False}\", \"assert manage_document_viewer_settings(['English', 'Spanish', 'French'], 'German') == {'selected_... | {
"split": "train",
"index": 70540,
"acecode_id": "oss_32834",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function `prime_array(nums)` that returns a new array containing only the prime numbers from the input array. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. F... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prime_array([2, 3, 4, 5, 6, 7, 8, 9, 10]) == [2, 3, 5, 7]\", \"assert prime_array([11, 13, 15, 17]) == [11, 13, 17]\", \"assert prime_array([4, 6, 8, 10]) == []\", \"assert prime_array([1, 2, 3]) == [2, 3]\", \"assert prime_array([]) == []\", \"assert prime_... | {
"split": "train",
"index": 70541,
"acecode_id": "evol_19864",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns a new list containing only the elements that are part of the Fibonacci sequence. The function should only include unique values from the input list in the output list and maintain the order of their first appearance. W... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_fibonacci([0, 1, 2, 3, 5, 8, 13, 21, 34, 55]) == [0, 1, 2, 3, 5, 8, 13, 21, 34, 55]\", \"assert filter_fibonacci([4, 6, 9, 10, 11]) == []\", \"assert filter_fibonacci([1, 2, 3, 4, 5, 6]) == [1, 2, 3, 5]\", \"assert filter_fibonacci([7, 8, 9, 10]) == [... | {
"split": "train",
"index": 70542,
"acecode_id": "evol_20216",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing attribute names which may contain dots ('.') and a list of variable names. Your task is to implement a function that takes a dictionary representing a system and returns a list of name-value pairs. The name-value pairs should be cons... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_name_value_pairs({'a': 1, 'b': {'c': 2, 'd': 3}, 'e': 4}, ['b.c', 'a'], ['e', 'f']) == [('b.c', 2), ('a', 1), ('e', 4)]\", \"assert get_name_value_pairs({'x': {'y': 10, 'z': 20}}, ['x.y', 'x.z', 'x.w'], ['a', 'b']) == [('x.y', 10), ('x.z', 20)]\", \"asse... | {
"split": "train",
"index": 70543,
"acecode_id": "bigcode_python_fns_6392",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that checks if a provided email address is in a valid format. The function should return True if the email is valid according to the standard email format, and False otherwise. The standard format includes a local part, an '@' symbol, a domain part, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_email('test@example.com') == True\", \"assert verify_email('user.name+tag@example.co.uk') == True\", \"assert verify_email('user@subdomain.example.com') == True\", \"assert verify_email('user@localhost') == False\", \"assert verify_email('user@.com') ... | {
"split": "train",
"index": 70544,
"acecode_id": "evol_18099",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple access control validation function in Python. The function `validate_access` takes in several parameters that determine whether access to a resource should be granted based on predefined rules. The function should return `1` if access i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_access('sensitive_data', 'internal', ['admin']) == 1\", \"assert validate_access('sensitive_data', 'internal', ['user']) == 0\", \"assert validate_access('public_data', 'external', ['user']) == 0\", \"assert validate_access('public_data', 'internal'... | {
"split": "train",
"index": 70545,
"acecode_id": "oss_37052",
"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 numbers from the original list, while maintaining the order of their first occurrence. Write a Python function `filter_even_numbers` that takes the f... | 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]) == [10, 20]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) == [2, 4,... | {
"split": "train",
"index": 70546,
"acecode_id": "oss_22579",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that determines if a given statement about square roots is true or false. The statement will be in the format 'The square root of X is Y', where X is a non-negative integer and Y is a number (which can be negative). Your function should return True if the state... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_square_root_statement('The square root of 4 is 2') == True\", \"assert check_square_root_statement('The square root of 0 is 0') == True\", \"assert check_square_root_statement('The square root of 9 is 3') == True\", \"assert check_square_root_statement... | {
"split": "train",
"index": 70547,
"acecode_id": "evol_27098",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary `settings` that contains a key 'elasticsearch_url' which holds a string representing the URL of an Elasticsearch server. Your task is to implement a function `get_client(settings: dict) -> str` that returns a string response indicating the connection ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_client({'elasticsearch_url': 'http://localhost:9200'}) == 'Connection successful'\", \"assert get_client({'elasticsearch_url': 'https://example.com'}) == 'Connection successful'\", \"assert get_client({'elasticsearch_url': 'ftp://example.com'}) == 'Inval... | {
"split": "train",
"index": 70548,
"acecode_id": "bigcode_python_fns_48230",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of alphabetical fruit names and returns a new list containing the fruit names sorted in reverse alphabetical order. You should not use any built-in Python sorting functions to achieve this. The function should be named `reverse_alphabetica... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_alphabetical_order(['banana', 'apple', 'cherry']) == ['cherry', 'banana', 'apple']\", \"assert reverse_alphabetical_order(['kiwi', 'mango', 'grape']) == ['mango', 'kiwi', 'grape']\", \"assert reverse_alphabetical_order(['watermelon', 'orange', 'apple... | {
"split": "train",
"index": 70549,
"acecode_id": "evol_12255",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that performs a simple arithmetic operation. The function should take two integers and return the result of adding them together. The function signature should be: `def add_two_numbers(a: int, b: int) -> int:`. Your task is to impl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_two_numbers(1, 2) == 3\", \"assert add_two_numbers(-1, 1) == 0\", \"assert add_two_numbers(0, 0) == 0\", \"assert add_two_numbers(100, 200) == 300\", \"assert add_two_numbers(-100, -200) == -300\", \"assert add_two_numbers(123456, 654321) == 777777\", \"... | {
"split": "train",
"index": 70550,
"acecode_id": "oss_10885",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the predicted labels and a list of integers representing the true labels, write a function `calculate_accuracy(predicted: List[int], true_labels: List[int]) -> float` that calculates the accuracy of the predictions. The accuracy is defined ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_accuracy([1, 0, 1, 1], [1, 0, 1, 0]) == 0.75\", \"assert calculate_accuracy([0, 0, 0, 0], [0, 0, 0, 0]) == 1.0\", \"assert calculate_accuracy([1, 1, 1, 1], [0, 0, 0, 0]) == 0.0\", \"assert calculate_accuracy([], []) == 0.0\", \"assert calculate_acc... | {
"split": "train",
"index": 70551,
"acecode_id": "bigcode_python_fns_26176",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list of integers, where each inner list represents a row of a matrix. The matrix contains columns named 'Spectrum_0', 'Spectrum_1', ..., 'Spectrum_n' that hold spectral values. Your task is to write a function `getSpectra(matrix: List[List[int]], indices: Lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getSpectra([[1, 2, 3], [4, 5, 6], [7, 8, 9]], [0, 2]) == [[1, 2, 3], [7, 8, 9]]\", \"assert getSpectra([[10, 20], [30, 40], [50, 60]], [1]) == [[30, 40]]\", \"assert getSpectra([[1, 2], [3, 4], [5, 6]], [3]) == []\", \"assert getSpectra([[1, 2, 3], [4, 5, 6]... | {
"split": "train",
"index": 70552,
"acecode_id": "bigcode_python_fns_2995",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file names and a version string. Your task is to implement a function that extracts and categorizes the links of uploaded Tor Browser installation files based on the provided version. The function should identify files for Windows, Linux, and macOS platf... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_tor_files(['torbrowser-install-10.0_en.exe', 'tor-browser-linux64-10.0_en.tar.xz', 'TorBrowser-10.0-osx10_zh.dmg'], '10.0') == {'torbrowser-install-10.0_en.exe': 'Windows', 'tor-browser-linux64-10.0_en.tar.xz': 'Linux', 'TorBrowser-10.0-osx10_zh.dmg'... | {
"split": "train",
"index": 70553,
"acecode_id": "bigcode_python_fns_7489",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_view_details(workflow: Dict[str, Any]) -> List[Dict[str, Union[int, str]]]` that takes a dictionary representing a workflow and returns a list of dictionaries containing details of each view associated with the workflow. The workflow dictionary contain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_view_details({'views': {1: {'name': 'View 1', 'description_text': 'Description 1', 'modified': '2023-10-01'}, 2: {'name': 'View 2', 'description_text': 'Description 2', 'modified': '2023-10-02'}}}) == [{'id': 1, 'name': 'View 1', 'description_text': 'Des... | {
"split": "train",
"index": 70554,
"acecode_id": "bigcode_python_fns_11949",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `cube_root_newton(num: float) -> float` that utilizes Newton's method to calculate the cube root of a given numerical value `num`. Your implementation should return the cube root with an accuracy of 0.01.\nPlease reason step by step, then write a self-conta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(cube_root_newton(64) - 4.0) < 0.01\", \"assert abs(cube_root_newton(1) - 1.0) < 0.01\", \"assert abs(cube_root_newton(8) - 2.0) < 0.01\", \"assert abs(cube_root_newton(125) - 5.0) < 0.01\", \"assert abs(cube_root_newton(1000) - 10.0) < 0.01\", \"assert a... | {
"split": "train",
"index": 70555,
"acecode_id": "evol_32358",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the processing of video frames in a video player. Your function should take a list of frames, where each frame is represented as a tuple containing a timestamp and the frame content. The function should return a list of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_video_frames([(0, 'frame1'), (2, 'frame2'), (5, 'frame3')]) == [(0, 'frame1'), (2, 'frame2'), (3, 'frame3')]\", \"assert process_video_frames([(1, 'start'), (3, 'middle'), (7, 'end')]) == [(1, 'start'), (2, 'middle'), (4, 'end')]\", \"assert process_... | {
"split": "train",
"index": 70556,
"acecode_id": "oss_27994",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a JSON object representing a person's name, modify it to adhere to a predefined structure that captures comprehensive personal data. The initial JSON object will only contain the key 'name'. Your task is to implement the function `modify_json(data)` that takes this input ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_json({'name': 'John'}) == {'firstName': 'John', 'lastName': '', 'age': 0, 'address': {'street': '', 'city': '', 'country': ''}, 'contact': {'email': '', 'phone': ''}}\", \"assert modify_json({'name': 'Alice'}) == {'firstName': 'Alice', 'lastName': '',... | {
"split": "train",
"index": 70557,
"acecode_id": "evol_12546",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of rainfall data for different dates and a list of catchment coordinates (each with an id, latitude, and longitude). Write a function `generate_rainfall_maps(dates: List[str], rainfall_data: List[float], catchments: List[Tuple[str, float, float]], interval:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_rainfall_maps(['2023-01-01', '2023-01-02'], [5.0, 10.0], [('catchment_1', 34.0, -118.0)], 3600) == ['20230101.png', '20230102.png']\", \"assert generate_rainfall_maps(['2023-01-01', '2023-01-02'], [0.0, 0.0], [('catchment_1', 34.0, -118.0)], 3600) =... | {
"split": "train",
"index": 70558,
"acecode_id": "bigcode_python_fns_17043",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that checks the security settings of a web application based on the DEBUG variable. The DEBUG variable is a boolean that indicates whether the application is running in debug mode. When DEBUG is set to True, it can pose a security ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_security(True) == 'Security Warning: Debug mode is enabled in production environment.'\", \"assert check_security(False) == 'Application is running in secure mode.'\", \"assert check_security(True) == 'Security Warning: Debug mode is enabled in product... | {
"split": "train",
"index": 70559,
"acecode_id": "oss_24231",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of daily new cases represented as a list of integers, where each integer represents the number of new cases reported on that day. Your task is to create a function that takes this list as input and returns a dictionary containing the maximum, minimum, and m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_cases_statistics([10, 20, 30]) == {'Max': 30, 'Min': 10, 'Mean': 20.0}\", \"assert calculate_cases_statistics([5, 15, 25, 35, 45]) == {'Max': 45, 'Min': 5, 'Mean': 25.0}\", \"assert calculate_cases_statistics([0, 0, 0, 0]) == {'Max': 0, 'Min': 0, '... | {
"split": "train",
"index": 70560,
"acecode_id": "bigcode_python_fns_5296",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of strings, write a function that returns a list of words that contain at least two consecutive vowels. A word is considered to have consecutive vowels if it contains any sequence of two or more vowels (a, e, i, o, u) appearing next to each other. You may assume ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_words_with_consecutive_vowels(['dog', 'cat', 'fish']) == []\", \"assert find_words_with_consecutive_vowels(['book', 'look', 'cook']) == ['book', 'look', 'cook']\", \"assert find_words_with_consecutive_vowels(['beautiful', 'sight', 'ocean']) == ['beautif... | {
"split": "train",
"index": 70561,
"acecode_id": "evol_25963",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function that generates the prime numbers from the factorial sequence for numbers ranging from 1 to a given limit n (inclusive). The factorial of each number should be calculated, and then the prime numbers from these factorials must be identified. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_prime_factorials(5) == ([2, 3, 5], 3)\", \"assert find_prime_factorials(10) == ([2, 3, 5, 7], 4)\", \"assert find_prime_factorials(3) == ([2, 3], 2)\", \"assert find_prime_factorials(6) == ([2, 3, 5], 3)\", \"assert find_prime_factorials(7) == ([2, 3, 5... | {
"split": "train",
"index": 70562,
"acecode_id": "evol_15014",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple system to register new users. Write a function `register_user(user_id: str, user_image: str) -> None` that takes in a user's ID and a path to their profile image. The function should store this information in an internal list of known users... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_user('user1', 'path/to/image1.jpg') is None\", \"assert register_user('user2', 'path/to/image2.jpg') is None\", \"assert register_user('user1', 'path/to/image1.jpg') is None\", \"assert register_user('user3', 'path/to/image3.jpg') is None\", \"asser... | {
"split": "train",
"index": 70563,
"acecode_id": "bigcode_python_fns_33138",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, determine the minimum number of changes required to convert the array into a palindrome, while ensuring that the number of unique elements you can modify does not exceed a specified limit. A palindrome is an array that reads the same forward and back... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minimum_changes([1, 2, 3, 4, 3, 2, 1], 2) == 0\", \"assert minimum_changes([5, 5, 5, 5, 5], 1) == 0\", \"assert minimum_changes([1, 2, 3, 2, 1], 2) == 0\", \"assert minimum_changes([4, 3, 2, 1, 2, 3, 4], 0) == 0\", \"assert minimum_changes([10, 20, 30, 20, 1... | {
"split": "train",
"index": 70564,
"acecode_id": "evol_11138",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a given URL is valid according to a specific regex pattern. The function should take a single argument, a string representing the URL, and return True if the URL is valid and False otherwise. The accepted URL format includes schemes like http... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_url('https://www.example.com') == True\", \"assert validate_url('http://localhost:8080') == True\", \"assert validate_url('ftp://example.com/file.txt') == True\", \"assert validate_url('https://192.168.0.1') == True\", \"assert validate_url('http://... | {
"split": "train",
"index": 70565,
"acecode_id": "evol_101",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string input and returns a new string that is the reverse of the original string. Your function should handle empty strings and strings containing spaces or special characters. Implement the function `reverse_string(s: str) -... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_string('Hello, World!') == '!dlroW ,olleH'\", \"assert reverse_string('Python') == 'nohtyP'\", \"assert reverse_string('') == ''\", \"assert reverse_string('12345') == '54321'\", \"assert reverse_string('racecar') == 'racecar'\", \"assert reverse_str... | {
"split": "train",
"index": 70566,
"acecode_id": "oss_22961",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing transaction amounts. Your task is to implement a function `calculate_total(transactions)` that calculates the total sum of all the transactions in the given list. The function should take one parameter: a list of integers `transacti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total([100, 200, 300]) == 600\", \"assert calculate_total([-100, -200, -300]) == -600\", \"assert calculate_total([0, 0, 0]) == 0\", \"assert calculate_total([]) == 0\", \"assert calculate_total([1]) == 1\", \"assert calculate_total([-1, 1]) == 0\"... | {
"split": "train",
"index": 70567,
"acecode_id": "oss_13400",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a configuration dictionary `global_config` that defines various parameters for binning, write a function `get_bin_vals(global_config)` that calculates and returns a list of bin values for grasping widths based on the specified bounds in the configuration. The input dictio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_bin_vals({'DATA': {'labels': {'offset_bins': [0, 10, 20]}}, 'TEST': {'bin_vals': 'max', 'allow_zero_margin': True, 'extra_opening': 0}}) == [5.0, 15.0, 20.0]\", \"assert get_bin_vals({'DATA': {'labels': {'offset_bins': [0, 10, 20]}}, 'TEST': {'bin_vals':... | {
"split": "train",
"index": 70568,
"acecode_id": "bigcode_python_fns_36451",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of numeric values. Your task is to implement a function that normalizes this list using Min-Max normalization. In Min-Max normalization, each value in the list is transformed using the formula: (x - min) / (max - min), where 'x' is the original value, 'min'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_list([1, 2, 3, 4, 5]) == [0.0, 0.25, 0.5, 0.75, 1.0]\", \"assert normalize_list([10, 20, 30]) == [0.0, 0.5, 1.0]\", \"assert normalize_list([-1, 0, 1]) == [0.0, 0.5, 1.0]\", \"assert normalize_list([]) == []\", \"assert normalize_list([100, 200, 30... | {
"split": "train",
"index": 70569,
"acecode_id": "bigcode_python_fns_22747",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a string 'output' that represents the output of a command that checks the properties of a file. The output will either indicate that the file is not a Linux kernel binary or provide the version of the kernel binary in the format: 'Linux kernel version X.Y.Z'. Your... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_kernel_version('file: Linux kernel version 5.4.0') == '5.4.0'\", \"assert get_kernel_version('file: Linux kernel version 4.19.0') == '4.19.0'\", \"assert get_kernel_version('file: Linux kernel version 5.10.2') == '5.10.2'\", \"assert get_kernel_version('... | {
"split": "train",
"index": 70570,
"acecode_id": "bigcode_python_fns_37279",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves a list of storage items associated with a specific project. The function should take in the following parameters: a project ID (integer), a marker (string), a limit on the number of items to return (integer), a sort key... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_storages_by_project(1, 'z', 5, 'name', 'asc') == []\", \"assert get_storages_by_project(1, 'x', 5, 'id', 'asc') == []\", \"assert get_storages_by_project(2, 'b', 0, 'name', 'asc') == []\", \"assert get_storages_by_project(1, 'c', 3, 'name', 'asc') == []\... | {
"split": "train",
"index": 70571,
"acecode_id": "bigcode_python_fns_49757",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing various URLs embedded within a text. Your task is to write a function that extracts all the URLs present in the given string and returns them as a list. A URL is defined as a string that starts with 'http://' or 'https://' followed by any chara... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_urls('No URLs here!') == []\", \"assert extract_urls('http://one.com http://two.com http://three.com') == ['http://one.com', 'http://two.com', 'http://three.com']\", \"assert extract_urls('Here is a link: http://test.com/page?param=value') == ['http:... | {
"split": "train",
"index": 70572,
"acecode_id": "oss_35802",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary of circuit instances where each instance has a set of ports and operations. Additionally, you have a dictionary that represents connections between these ports and another dictionary that maps ports to their names. Your task is to evaluate the circuit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_circuit({'D': {'p1': 1}}, {'D,p1': 'D,p1'}, {'D,p1': 'out'}) == {'out': 1}\", \"assert evaluate_circuit({'F': {'p1': 0}}, {'F,p1': 'F,p1'}, {'F,p1': 'final'}) == {'final': 0}\", \"assert evaluate_circuit({'H': {'p1': 6}}, {'H,p1': 'H,p1'}, {'H,p1': ... | {
"split": "train",
"index": 70573,
"acecode_id": "bigcode_python_fns_5613",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts a three-dimensional array based on the ASCII value of the third character of the second-level arrays. The function should return the sorted 3D array. If the second-level array has less than three characters, treat its ASCII value as 0 for sorting... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_3D_list([[['1', '2', '3'], ['4', '5', '6']], [['7', '8', '9'], ['0', 'a', 'b']]]) == [[['1', '2', '3'], ['4', '5', '6']], [['7', '8', '9'], ['0', 'a', 'b']]]\", \"assert sort_3D_list([[['apple'], ['banana'], ['cherry']], [['date'], ['elderberry'], ['fig... | {
"split": "train",
"index": 70574,
"acecode_id": "evol_33843",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that updates the version of a software package and constructs the application name accordingly. Your function should take a new version number as input, update the internal version representation, and return the application name fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_version('1.0.1') == 'MyApp v1.0.1'\", \"assert update_version('2.0.0') == 'MyApp v2.0.0'\", \"assert update_version('1.2.3') == 'MyApp v1.2.3'\", \"assert update_version('3.1.4') == 'MyApp v3.1.4'\", \"assert update_version('0.9.8') == 'MyApp v0.9.8'\... | {
"split": "train",
"index": 70575,
"acecode_id": "oss_9416",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `s` and a list of integers `sub_index`, implement a function that checks if there exists any word in a predefined list `dictionary` that starts with the prefix formed by the characters in `s` at the indices specified in `sub_index`. Return `True` if such a word e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_prefix('applepie', [0, 1, 2]) == True\", \"assert has_prefix('banana', [0]) == True\", \"assert has_prefix('grapefruit', [0, 1]) == True\", \"assert has_prefix('melon', [1, 2]) == False\", \"assert has_prefix('orangejuice', [0, 1, 2]) == True\", \"assert... | {
"split": "train",
"index": 70576,
"acecode_id": "bigcode_python_fns_39026",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function that checks if the string can be converted into a whole number. If the string can be converted, return the converted whole number. If it cannot be converted, return an error message. The function should also handle cases where the input stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_string('42') == 42\", \"assert validate_string('0') == 0\", \"assert validate_string('-10') == -10\", \"assert validate_string('1000000') == 1000000\", \"assert validate_string('-42') == -42\", \"assert validate_string('999999999999999999') == 99999... | {
"split": "train",
"index": 70577,
"acecode_id": "evol_6503",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a simple data processing utility that involves managing a collection of integer numbers. Your goal is to implement a function that takes a list of integers and returns the list sorted in ascending order. Write a function called `sort_numbers(numbe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_numbers([3, 1, 2]) == [1, 2, 3]\", \"assert sort_numbers([5, 5, 5]) == [5, 5, 5]\", \"assert sort_numbers([1, 2, 3]) == [1, 2, 3]\", \"assert sort_numbers([]) == []\", \"assert sort_numbers([2, 1, 2]) == [1, 2, 2]\", \"assert sort_numbers([10, -10, 0]) ... | {
"split": "train",
"index": 70578,
"acecode_id": "oss_12915",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `string_replacer` that takes three parameters: `target`, `replacement`, and `text`. The function should replace all occurrences of the string `target` in `text` with the string `replacement` and return the modified string. The replace... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_replacer('ta', 'e', 'ta ta ta') == 'e e e'\", \"assert string_replacer('t', 'T', 'test it') == 'TesT iT'\", \"assert string_replacer('hello', 'hi', 'Hello world') == 'Hello world'\", \"assert string_replacer('abc', '123', 'abcabcabc') == '123123123'\"... | {
"split": "train",
"index": 70579,
"acecode_id": "oss_30198",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple game management function that allows for transitioning to different game pages. Your task is to implement a single function `transition_to_page` that takes a string input representing the game page and returns a message indicating the trans... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transition_to_page('Quit') == 'Transitioning to Quit page.'\", \"assert transition_to_page('Pause Menu') == 'Transitioning to Pause Menu page.'\", \"assert transition_to_page('Settings') == 'Invalid page.'\", \"assert transition_to_page('Game Over') == 'Inva... | {
"split": "train",
"index": 70580,
"acecode_id": "oss_8997",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `XOR(a: int, b: int) -> int` that takes two binary inputs `a` and `b` (where `a` and `b` can be either 0 or 1) and returns the result of the XOR operation using only NAND and NOT gates. The function should utilize two NAND gates and one NOT gate to compute ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert XOR(0, 0) == 0\", \"assert XOR(0, 1) == 1\", \"assert XOR(1, 0) == 1\", \"assert XOR(1, 1) == 0\", \"assert XOR(0, 0) == 0\", \"assert XOR(1, 1) == 0\", \"assert XOR(0, 1) == 1\", \"assert XOR(1, 0) == 1\", \"assert XOR(0, 1) == 1\", \"assert XOR(1, 0) == 1\... | {
"split": "train",
"index": 70581,
"acecode_id": "evol_1357",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a filter string based on specific criteria. The function `generate_filter` takes a field name (a string), a bind parameter name (a string), and a dictionary of criteria. The criteria can contain the following keys: 'values'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_filter('age', 'age_filter', {'values': [21, 30, 45]}) == ('age=any(:age_filter)', [21, 30, 45])\", \"assert generate_filter('created_at', 'date_filter', {'date': '2023-01-01'}) == ('created_at::date=:date_filter', datetime.date(2023, 1, 1))\", \"ass... | {
"split": "train",
"index": 70582,
"acecode_id": "bigcode_python_fns_6643",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the number of items sold each day in a store over a period of 'n' days. Your task is to implement a function that calculates the total number of items sold over these 'n' days and returns this total. Write a function 'total_items_so... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_items_sold([1, 2, 3, 4, 5]) == 15\", \"assert total_items_sold([0, 0, 0, 0]) == 0\", \"assert total_items_sold([10, 20, 30]) == 60\", \"assert total_items_sold([-1, -2, -3]) == -6\", \"assert total_items_sold([5, 5, 5, 5, 5]) == 25\", \"assert total_it... | {
"split": "train",
"index": 70583,
"acecode_id": "bigcode_python_fns_43018",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dataset represented as a list of dictionaries, where each dictionary contains two keys: 'Text' and 'Summary'. Your task is to implement a function that takes this dataset and an option as input. If the option is 1, the function should return a list containing al... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_field([{'Text': 'Hello World', 'Summary': 'Greeting'}, {'Text': 'Python is great', 'Summary': 'Programming language'}], 1) == ['Hello World', 'Python is great']\", \"assert extract_field([{'Text': 'Hello World', 'Summary': 'Greeting'}, {'Text': 'Pyth... | {
"split": "train",
"index": 70584,
"acecode_id": "bigcode_python_fns_9526",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, `xs` and `ys`, write a function `sum_greater_than_average(xs: List[int], ys: List[int]) -> int` that calculates the average of the elements in the list `xs` and returns the sum of the elements in the list `ys` that are greater than this calculated a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_greater_than_average([-1, -2, -3, -4], [1, 2, 3]) == 6\", \"assert sum_greater_than_average([0, 0, 0], [1, 2, 3]) == 6\", \"assert sum_greater_than_average([1, 1, 1, 1, 1], [1, 1, 1]) == 0\", \"assert sum_greater_than_average([2, 2, 2, 2], [3, 4, 5]) == ... | {
"split": "train",
"index": 70585,
"acecode_id": "oss_13386",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a parameter specification dictionary that defines a parameter type and its possible values, implement a function `generate_values(param_spec: Dict[str, Any]) -> List[Union[int, float, str]]` that returns a list of possible values based on the type defined in the `param_sp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_values({'type': 'list', 'values': [1, 2, 3]}) == [1, 2, 3]\", \"assert generate_values({'type': 'int[0:5:1]'}) == [0, 1, 2, 3, 4, 5]\", \"assert generate_values({'type': 'int[2:8:2]'}) == [2, 4, 6, 8]\", \"assert generate_values({'type': 'int[10:0:-... | {
"split": "train",
"index": 70586,
"acecode_id": "bigcode_python_fns_26324",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a point represented as a tuple (x, y) on an elliptic curve defined by the equation y² = x³ + ax + b over a finite field of prime order p, write a function `is_on_curve(point, a, b, p)` that determines whether the given point lies on the elliptic curve. If the point is Non... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_on_curve((0, 0), 1, 1, 5) == False\", \"assert is_on_curve((0, 1), 1, 1, 5) == True\", \"assert is_on_curve((1, 2), 1, 1, 5) == False\", \"assert is_on_curve(None, 1, 1, 5) == True\", \"assert is_on_curve((1, 0), 1, 1, 5) == False\", \"assert is_on_curve(... | {
"split": "train",
"index": 70587,
"acecode_id": "bigcode_python_fns_29236",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the generation of authentication tokens based on cloud deployment configurations. Implement a function `generate_auth_token(deploy_config: Dict[str, str]) -> str` that takes a dictionary `deploy_config` containing the following keys: 'cloud', 'sam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_auth_token({'cloud': 'azure', 'sample_metadata_project': 'myProject', 'sample_metadata_host': ''}) == 'api://smapi-myProject/.default'\", \"assert generate_auth_token({'cloud': 'gcp', 'sample_metadata_project': '', 'sample_metadata_host': 'myHost'})... | {
"split": "train",
"index": 70588,
"acecode_id": "bigcode_python_fns_41960",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two strings, `instance_id` and `database_id`, write a function `validate_database_connection(instance_id: str, database_id: str) -> bool` that checks if the specified instance and database exist. The function should return `True` if both the instance and database exist, o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_database_connection('instance1', 'db1') == True\", \"assert validate_database_connection('instance2', 'db2') == True\", \"assert validate_database_connection('instance3', 'db3') == True\", \"assert validate_database_connection('instance1', 'db4') ==... | {
"split": "train",
"index": 70589,
"acecode_id": "bigcode_python_fns_25774",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that simulates launching an application based on the operating system of the user. The function should take an operating system name as a string input, which can be either 'linux', 'windows', or 'mac', and return a string message indicatin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert launch_application('linux') == 'Launching libreoffice for linux'\", \"assert launch_application('windows') == 'Launching excel for windows'\", \"assert launch_application('mac') == 'Launching Numbers for mac'\", \"assert launch_application('linux') == 'Launc... | {
"split": "train",
"index": 70590,
"acecode_id": "bigcode_python_fns_12171",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that generates a multiplication matrix of size n x n, where each element at position (i, j) is the product of (i + 1) and (j + 1). The function should return the resulting matrix as a list of lists.\nPlease reason step by step, then write a self-contained P... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_multiplication_matrix(1) == [[1]]\", \"assert create_multiplication_matrix(2) == [[1, 2], [2, 4]]\", \"assert create_multiplication_matrix(3) == [[1, 2, 3], [2, 4, 6], [3, 6, 9]]\", \"assert create_multiplication_matrix(4) == [[1, 2, 3, 4], [2, 4, 6, ... | {
"split": "train",
"index": 70591,
"acecode_id": "evol_20715",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a random key pair for encryption and decryption. The function should simulate the generation of a random key pair and return a tuple containing a mock certificate with the name 'RANDOM_CERTIF_NAME' and a mock PFX data s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_random_keypair() == ('RANDOM_CERTIF_NAME', 'PFX_DATA_RANDOM_PFX_PASSWORD')\", \"assert type(generate_random_keypair()) == tuple\", \"assert len(generate_random_keypair()) == 2\", \"assert generate_random_keypair()[0] == 'RANDOM_CERTIF_NAME'\", \"ass... | {
"split": "train",
"index": 70592,
"acecode_id": "oss_11732",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates transferring funds between two bank accounts. You should write a function `transfer_funds(sender_balance, recipient_balance, amount)` that takes in the current balance of the sender account, the current balance of the r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transfer_funds(1000, 500, 300) == (700, 800)\", \"assert transfer_funds(500, 1000, 600) == (500, 1000)\", \"assert transfer_funds(0, 1000, 0) == (0, 1000)\", \"assert transfer_funds(100, 100, 50) == (50, 150)\", \"assert transfer_funds(500, 500, 100) == (400... | {
"split": "train",
"index": 70593,
"acecode_id": "oss_27731",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python program that simulates the functionality of a simple API namespace manager. The program should allow users to add, remove, and retrieve namespaces and their associated paths. A namespace is a way of grouping related functionalities together... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert namespace_manager([('add', 'test_ns', '/test')]) == []\", \"assert namespace_manager([('add', 'user_ns', '/user'), ('get', 'user_ns')]) == ['/user']\", \"assert namespace_manager([('add', 'data_ns', '/data'), ('get', 'data_ns'), ('remove', 'data_ns'), ('get'... | {
"split": "train",
"index": 70594,
"acecode_id": "oss_29966",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a blockchain network to analyze the distribution of transactions across a specified number of blocks. Your program should implement a function called `simulate_blockchain(num_txns: int, full_blocks: int) -> List[int]` that takes two parameters: `n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_blockchain(10, 2) == [6, 4] or simulate_blockchain(10, 2) == [4, 6] or simulate_blockchain(10, 2) == [5, 5] or simulate_blockchain(10, 2) == [0, 10] or simulate_blockchain(10, 2) == [10, 0]\", \"assert simulate_blockchain(0, 1) == [0]\", \"assert si... | {
"split": "train",
"index": 70595,
"acecode_id": "oss_2545",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of nodes, implement a function `countTextNodes(nodes: List[Node]) -> int` that counts the number of nodes that are free text nodes. A node is considered a free text node if its `nodeType` is equal to `TEXT_NODE`. The `Node` class has a property `nodeType` which can... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert countTextNodes([Node(1), Node(3), Node(1), Node(5)]) == 2\", \"assert countTextNodes([Node(1), Node(1), Node(1)]) == 3\", \"assert countTextNodes([Node(2), Node(3), Node(4)]) == 0\", \"assert countTextNodes([]) == 0\", \"assert countTextNodes([Node(1), Node(... | {
"split": "train",
"index": 70596,
"acecode_id": "bigcode_python_fns_609",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that checks if any element in a given list of integers has a value greater than or equal to a specified threshold. If such an element exists, the function should return True; otherwise, it should return False. Implement a function calle... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_threshold_exceeded([1, 2, 3, 4], 3) == True\", \"assert check_threshold_exceeded([1, 2, 3, 4], 5) == False\", \"assert check_threshold_exceeded([-1, -2, -3, -4], -3) == True\", \"assert check_threshold_exceeded([-1, -2, -3, -4], -1) == True\", \"assert... | {
"split": "train",
"index": 70597,
"acecode_id": "bigcode_python_fns_11091",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of numbers, implement a function `multiply_largest_integers(lst)` that multiplies the largest integers (floors of the absolute values) found in the list. If the list is empty or contains no valid integers, return 0. If the list contains non-numerical values, issue ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_largest_integers([1.5, 4.8, -2.2]) == 4\", \"assert multiply_largest_integers([1, -5, 9, -3]) == 9\", \"assert multiply_largest_integers([3.2, -2.7, 0]) == 3\", \"assert multiply_largest_integers([-1.7, 2, 2]) == 4\", \"assert multiply_largest_integ... | {
"split": "train",
"index": 70598,
"acecode_id": "evol_16482",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a system that manages employee profiles for a company. Each employee profile should store the following information: the employee's name, email, department, and the date they joined the company. Your task is to implement a function named `create_emp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_employee_profile('Alice Smith', 'alice@example.com', 'Engineering', '2023-01-15') == {'name': 'Alice Smith', 'email': 'alice@example.com', 'department': 'Engineering', 'date_of_joining': '2023-01-15'}\", \"assert create_employee_profile('Bob Johnson',... | {
"split": "train",
"index": 70599,
"acecode_id": "oss_10564",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.