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": "Write a function `generate_graphviz_command(title: str, model_id: str, mojo_path: str) -> str` that constructs a command to generate a Graphviz dot file for a decision tree model based on the provided parameters. The command should follow the format: 'java -cp <h2o_jar_path> he...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_graphviz_command('My Decision Tree', 'model_1', '/path/to/model.mojo') == 'java -cp <h2o_jar_path> hex.genmodel.tools.PrintMojo --tree 0 -i /path/to/model.mojo -o model_1.gv --title My Decision Tree'\", \"assert generate_graphviz_command(None, 'mode...
{ "split": "train", "index": 81800, "acecode_id": "bigcode_python_fns_36947", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `days_between(d1: str, d2: str) -> int` that takes two dates in the format 'YYYY-MM-DD' as strings and returns the number of days between them. The function should return a non-negative integer representing the absolute difference in days between the two dates....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert days_between('2023-01-01', '2023-01-10') == 9\", \"assert days_between('2023-01-10', '2023-01-01') == 9\", \"assert days_between('2023-02-01', '2023-02-01') == 0\", \"assert days_between('2023-03-01', '2023-03-05') == 4\", \"assert days_between('2023-12-31',...
{ "split": "train", "index": 81801, "acecode_id": "evol_19109", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with determining all possible moves for a given chess piece on a standard 8x8 chess board based on its current position. The chess pieces are represented by their respective characters: 'K' for king, 'Q' for queen, 'R' for rook, 'B' for bishop, 'N' for knight, an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert possible_moves('K', 'e4') == ['d3', 'd4', 'd5', 'e3', 'e5', 'f3', 'f4', 'f5']\", \"assert possible_moves('N', 'b1') == ['a3', 'c3', 'd2']\", \"assert possible_moves('N', 'd5') == ['b4', 'b6', 'c3', 'c7', 'e3', 'e7', 'f4', 'f6']\", \"assert possible_moves('K'...
{ "split": "train", "index": 81802, "acecode_id": "oss_8584", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Develop a Python function that takes a list of integers and returns a tuple containing two lists. The first list should contain the sums of each successive pair of integers (duos) in the provided list. The second list should contain the duos that have a numerical variance great...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyse_duos([10, 20, 30]) == ([30, 50], [(10, 20), (20, 30)])\", \"assert analyse_duos([1, 2, 3]) == ([3, 5], [])\", \"assert analyse_duos([1]) == ([], [])\", \"assert analyse_duos([5, 5, 5]) == ([10, 10], [])\", \"assert analyse_duos([-1, 0, 1, 5]) == ([ -...
{ "split": "train", "index": 81803, "acecode_id": "evol_5831", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple operation manager. The function should allow for the addition of operations, the removal of operations, and the execution of a specified operation with given arguments. Implement a function named `operation_manager...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert operation_manager([('add', 'npop', lambda arr: arr.pop()), ('add', 'hypervolume', lambda a, b, c: a * b * c), ('execute', 'npop', [1, 2, 3, 4, 5]), ('remove', 'npop'), ('execute', 'npop', [1, 2, 3, 4, 5])]) == [5, 'Operation not found']\", \"assert operation...
{ "split": "train", "index": 81804, "acecode_id": "oss_10302", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of words and an integer k, write a function that randomly assigns each word to one of k clusters. The function should return a dictionary where the keys are the cluster IDs (from 0 to k-1) and the values are lists containing the words assigned to each cluster. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert random_k(['apple', 'banana', 'cherry'], 2) in [{0: ['apple'], 1: ['banana', 'cherry']}, {0: ['banana'], 1: ['apple', 'cherry']}, {0: ['cherry'], 1: ['apple', 'banana']}, {0: ['apple', 'banana'], 1: ['cherry']}, {0: ['banana', 'cherry'], 1: ['apple']}, {0: ['...
{ "split": "train", "index": 81805, "acecode_id": "bigcode_python_fns_37918", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a 2D list representing the probability mass function (PMF) of a categorical distribution, where each row represents a different sample and contains floating-point numbers that sum to 1, write a function `sample_categorical(pmf: List[List[float]]) -> List[int]` that return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sample_categorical([[0.1, 0.9]]) == [1] or sample_categorical([[0.9, 0.1]]) == [0]\", \"assert sample_categorical([[0.5, 0.5], [0.2, 0.8], [0.3, 0.7]]) in [[0],[1],[0]] or [[1],[0],[1]] or [[0],[1],[1]] or [[1],[1],[0]]\", \"assert sample_categorical([[0.2, ...
{ "split": "train", "index": 81806, "acecode_id": "bigcode_python_fns_32059", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function to return a new list that contains every nth element from the original list, where n is a positive integer provided as an argument to the function. If n is larger than the length of the list, return an empty list. The elements in the n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert select_nth_element([1, 2, 3, 4, 5], 2) == [2, 4]\", \"assert select_nth_element([10, 20, 30, 40, 50], 1) == [10, 20, 30, 40, 50]\", \"assert select_nth_element([5, 15, 25, 35], 3) == [25]\", \"assert select_nth_element([], 3) == []\", \"assert select_nth_ele...
{ "split": "train", "index": 81807, "acecode_id": "bigcode_python_fns_17302", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that finds the first two distinct elements in the list that sum up to a given target number. If no such elements exist, return None. Your function should return the first pair it encounters that meets the criteria. If there are mul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_sum_pair([2, 45, 7, 9, 15], 16) == (7, 9)\", \"assert find_sum_pair([1, 2, 3, 4, 5], 9) == (4, 5)\", \"assert find_sum_pair([10, 15, 3, 7], 17) == (10, 7)\", \"assert find_sum_pair([0, -1, 2, -2, 1], 0) == (2, -2)\", \"assert find_sum_pair([], 5) == Non...
{ "split": "train", "index": 81808, "acecode_id": "evol_6265", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of timestamps in the format 'HH:MM' representing trading data. Your task is to divide this data into three segments based on the following time intervals: '09:30' to '10:30' for pre-market, '10:31' to '15:59' for market hours, and '16:00' to '17:00' for aft...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_trading_segments(['10:30', '10:31', '15:59', '16:00']) == {'premkt': ['10:30'], 'market': ['10:31', '15:59'], 'aftermkt': ['16:00']}\", \"assert split_trading_segments(['09:30', '10:31', '11:00', '15:59', '16:00', '17:00']) == {'premkt': ['09:30'], 'ma...
{ "split": "train", "index": 81809, "acecode_id": "bigcode_python_fns_44765", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a list of keywords, write a function that generates a string of HTML code that displays these keywords in a specific format. The HTML string should start with '<strong>Keywords:</strong> ' and list all the keywords separated by commas. The last keyword should not be follo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_keywords_html(['Python', 'Java', 'C++']) == '<strong>Keywords:</strong> Python, Java, C++'\", \"assert generate_keywords_html(['HTML', 'CSS']) == '<strong>Keywords:</strong> HTML, CSS'\", \"assert generate_keywords_html(['JavaScript']) == '<strong>K...
{ "split": "train", "index": 81810, "acecode_id": "bigcode_python_fns_37246", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two parent genomes, genom1 and genom2, represented as lists of floats. You are also given a mutation rate (a float between 0 and 1), a list of widths (integers) that determines the range of possible mutations for each gene, and a list of bounds, where each element...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cross([1.0, 5.0], [2.0, 6.0], 0.0, [0, 0], [(0, 10), (0, 10)]) == [1.0, 5.0]\", \"assert cross([1.0, 2.0], [3.0, 4.0], 1.0, [1, 1], [(0, 10), (0, 10)]) != [1.0, 2.0]\", \"assert cross([1.0, 2.0], [3.0, 4.0], 0.5, [1, 1], [(1, 5), (2, 6)]) != [1.0, 2.0]\", \"...
{ "split": "train", "index": 81811, "acecode_id": "bigcode_python_fns_26790", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integers, `a` and `b`, write a function `add_integers(a: int, b: int) -> int` that returns the sum of these two integers. The function should be able to handle both positive and negative integers. The input values will be within the range of -10^6 to 10^6.\nPlease rea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_integers(1, 2) == 3\", \"assert add_integers(-1, 1) == 0\", \"assert add_integers(-5, -10) == -15\", \"assert add_integers(0, 0) == 0\", \"assert add_integers(100, 200) == 300\", \"assert add_integers(-100, 100) == 0\", \"assert add_integers(-500, 200) =...
{ "split": "train", "index": 81812, "acecode_id": "bigcode_python_fns_15228", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `array_to_set(array)` that takes an array as input and transforms it into a set data structure. The function should handle nested arrays, converting them into nested sets. Additionally, the function should be capable of managing a mix of arrays and other da...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert array_to_set([1, 2, 3]) == frozenset({1, 2, 3})\", \"assert array_to_set([1, [2, 3]]) == frozenset({1, frozenset({2, 3})})\", \"assert array_to_set([[1, 2], [3, 4]]) == frozenset({frozenset({1, 2}), frozenset({3, 4})})\", \"assert array_to_set([[1, 2], 3]) =...
{ "split": "train", "index": 81813, "acecode_id": "evol_385", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates email addresses based on certain criteria. The function should take an email address as input and return a boolean value indicating whether the email address is valid or not. The criteria for a valid email address are a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_email('john.doe@example.com') == True\", \"assert validate_email('user@domain.co.uk') == True\", \"assert validate_email('first.last@subdomain.domain.com') == True\", \"assert validate_email('@example.com') == False\", \"assert validate_email('examp...
{ "split": "train", "index": 81814, "acecode_id": "oss_21224", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `magnitude(x: float, y: float, z: float) -> float` that calculates the magnitude of a vector in 3-dimensional space given its components x, y, and z. The magnitude is defined as the square root of the sum of the squares of its components.\nPlease reason ste...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert magnitude(1, 2, 2) == 3.0\", \"assert magnitude(0, 0, 0) == 0.0\", \"assert magnitude(-1, -1, -1) == 1.7320508075688772\", \"assert magnitude(3, 4, 0) == 5.0\", \"assert magnitude(5, 12, 0) == 13.0\", \"assert magnitude(1, 1, 1) == 1.7320508075688772\", \"as...
{ "split": "train", "index": 81815, "acecode_id": "evol_23686", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a class called 'Person' with the following attributes: 'name', 'age', 'email', and 'location'. The class should have a constructor that initializes these attributes. Additionally, implement the following methods: 'getName()' which returns a string that includes a poli...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert Person('Alice', 25, 'alice@example.com', 'New York').getName() == 'Hello, my name is: Alice'\", \"assert Person('Bob', 30, 'bob@example.com', 'Los Angeles').getName() == 'Hello, my name is: Bob'\", \"assert Person('Charlie', 19, 'charlie@example.com', 'Chica...
{ "split": "train", "index": 81816, "acecode_id": "evol_5381", "num_tests": 3 }
acecode
[ { "role": "user", "content": "You are given a dictionary where the keys are job identifiers and the values are dictionaries containing job details. Each job detail dictionary can contain the keys 'script', 'before_script', and 'after_script', each associated with a string or a list of strings. Your task is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_flattened_scripts({'job1': {'script': 'echo Hello', 'before_script': ['echo Before', 'echo Step 1'], 'after_script': 'echo After'}}) == {'job1/script': 'echo Hello', 'job1/before_script': 'echo Before\\\\necho Step 1', 'job1/after_script': 'echo After'}\...
{ "split": "train", "index": 81817, "acecode_id": "bigcode_python_fns_17041", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a list of integers and returns a new list containing only the even numbers from the input list. The function should maintain the order of the original list. Implement the function `filter_even_numbers(nums: List[int]) ->...
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([0, 2, 4, 6]) == [0, 2, 4, 6]\", \"assert filter_even_numbers([-1...
{ "split": "train", "index": 81818, "acecode_id": "oss_30440", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings that represent file paths. Write a function `create_testcase_list_file(testcase_file_paths: List[str], input_directory: str) -> str` that takes in this list of file paths and an input directory. The function should return a string indicating whet...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_testcase_list_file(['path/to/testcase1', 'path/to/testcase2'], 'input_directory') == 'Successfully created test case list file.'\", \"assert create_testcase_list_file([], 'input_directory') == 'No testcases found, skipping list file.'\", \"assert crea...
{ "split": "train", "index": 81819, "acecode_id": "bigcode_python_fns_13871", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a rate-limiting logic for an API endpoint. The rate-limiting mechanism should restrict the number of requests made with the same key within a specified time frame. You need to implement a function `rate_limit_request(key: str, current_time: int,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rate_limit_request('user1', 1000, {'user1': [995, 996, 997, 998]}, 5, 4) == True\", \"assert rate_limit_request('user1', 1000, {'user1': [995, 996, 997, 998]}, 5, 3) == False\", \"assert rate_limit_request('user2', 1000, {'user2': [995, 996, 997]}, 5, 5) == ...
{ "split": "train", "index": 81820, "acecode_id": "oss_8439", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates sending messages over a radio channel. The function should take in two parameters: a message as a string and a channel number as a non-negative integer. The function should return a string in the following format: 'Sending ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_message('Hello World', 17) == \\\"Sending message 'Hello World' on channel 17\\\"\", \"assert send_message('Test Message', 5) == \\\"Sending message 'Test Message' on channel 5\\\"\", \"assert send_message('Radio Check', 0) == \\\"Sending message 'Radio...
{ "split": "train", "index": 81821, "acecode_id": "oss_24672", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of integers and returns a dictionary containing the count of even and odd numbers in the list. Your function should take a list of integers as input and return a dictionary with two keys: 'even' and 'odd', whe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_even_odd([1, 2, 3, 4, 5]) == {'even': 2, 'odd': 3}\", \"assert count_even_odd([0, 1, 2, 3]) == {'even': 2, 'odd': 2}\", \"assert count_even_odd([]) == {'even': 0, 'odd': 0}\", \"assert count_even_odd([2, 4, 6, 8]) == {'even': 4, 'odd': 0}\", \"assert c...
{ "split": "train", "index": 81822, "acecode_id": "oss_29014", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a queue data structure represented as a list of integers and an integer `steps` indicating the number of rotations to perform on the queue. Each rotation involves removing the front element of the queue and appending it to the back of the queue. Your task is to wr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotate_queue([1], 5) == [1]\", \"assert rotate_queue([], 5) == []\", \"assert rotate_queue([5, 6, 7, 8], 0) == [5, 6, 7, 8]\", \"assert rotate_queue([1, 2, 3], 6) == [1, 2, 3]\", \"assert rotate_queue([1, 2], 1) == [2, 1]\", \"assert rotate_queue([1, 2, 3, 4...
{ "split": "train", "index": 81823, "acecode_id": "oss_14628", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents a node in a knowledge graph. Each node object has several attributes, including an 'id' field. Your goal is to write a Python function that takes this list as input and returns a list of strings, where each ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_nodes([{'id': 1, 'name': 'Node1'}, {'id': 2, 'name': 'Node2'}]) == ['Type: <class \\\"dict\\\">, Keys: id, name, ID: 1', 'Type: <class \\\"dict\\\">, Keys: id, name, ID: 2']\", \"assert process_nodes([{'id': 3}, {'name': 'Node3'}]) == ['Type: <class ...
{ "split": "train", "index": 81824, "acecode_id": "oss_16557", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing cell IDs and their associated data in a specific format. Each string in the list has the format: 'Cell_ID\tFrm[0]\tFrm[-1]\tCCT[m]\tCCT[h]\tGen_#\tIsRoot\tIsLeaf'. Your task is to process this list and transform each cell ID by appen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_cell_ids(['1\\\\tdata1\\\\tdata2\\\\tdata3', '2\\\\tdata4\\\\tdata5\\\\tdata6']) == ['1-pos0-17_07_31\\\\tdata1\\\\tdata2\\\\tdata3', '2-pos1-17_07_31\\\\tdata4\\\\tdata5\\\\tdata6']\", \"assert transform_cell_ids(['3\\\\tdataA\\\\tdataB\\\\tdataC'...
{ "split": "train", "index": 81825, "acecode_id": "bigcode_python_fns_46133", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a list of events and extracts relevant information from them. Each event is represented as a dictionary with various attributes. Your goal is to create a function that takes a list of such event dictionaries as i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_events([]) == []\", \"assert process_events([{'name': 'event1', 'date': '2023-01-01'}]) == [{'name': 'Event1', 'date': 'January 01, 2023'}]\", \"assert process_events([{'name': 'event2', 'date': '2023-02-15'}]) == [{'name': 'Event2', 'date': 'Februar...
{ "split": "train", "index": 81826, "acecode_id": "oss_22276", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function that converts a measurement of pressure from atmospheres (atm) to its equivalent in pascals (Pa). The function should take a single argument, `atm`, which represents the pressure in atmospheres, and return the equivalent pressure in pascals. Use the convers...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert atm_to_pa(0) == 0\", \"assert atm_to_pa(1) == 101325\", \"assert atm_to_pa(2) == 202650\", \"assert atm_to_pa(0.5) == 50662.5\", \"assert atm_to_pa(10) == 1013250\", \"assert atm_to_pa(-1) == -101325\", \"assert atm_to_pa(0.1) == 10132.5\", \"assert atm_to_p...
{ "split": "train", "index": 81827, "acecode_id": "evol_34644", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an alphanumeric string, implement a function `is_ambigram(input_string: str) -> bool` to determine if the string exhibits the properties of an ambigram. An ambigram is a word or phrase that appears the same when viewed from different orientations. The valid characters for...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_ambigram('sos') == True\", \"assert is_ambigram('bq') == True\", \"assert is_ambigram('u') == False\", \"assert is_ambigram('1') == True\", \"assert is_ambigram('808') == True\", \"assert is_ambigram('hannah') == False\", \"assert is_ambigram('zoo') == Fa...
{ "split": "train", "index": 81828, "acecode_id": "evol_3775", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the behavior of a Merkle Tree update. The function should raise a `LeafConstructionError` if both a `record` and a `digest` are provided as arguments. If only one of them is provided or if neither is provided, the funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_merkle_tree('some record', None) == 'Update successful'\", \"assert update_merkle_tree(None, '540ef8fc9eefa3ec0fbe55bc5d10dbea03d5bac5591b3d7db3af79ec24b3f74c') == 'Update successful'\", \"assert update_merkle_tree(None, None) == 'Update successful'\"...
{ "split": "train", "index": 81829, "acecode_id": "bigcode_python_fns_28478", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `smallest_prime(array)` that takes an array of natural numbers and returns the smallest prime number from that array. If there are no prime numbers in the array, the function should return -1.\nPlease reason step by step, then write a self-contained Python ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert smallest_prime([23, 7, 2, 11, 17]) == 2\", \"assert smallest_prime([4, 6, 8, 10]) == -1\", \"assert smallest_prime([5, 9, 15, 22]) == 5\", \"assert smallest_prime([10, 3, 5, 7]) == 3\", \"assert smallest_prime([29, 25, 15, 2]) == 2\", \"assert smallest_prime...
{ "split": "train", "index": 81830, "acecode_id": "evol_4374", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `generate_password()` that generates a secure password of exactly 16 characters. The password must meet the following criteria: it should contain at least 2 uppercase letters, 2 lowercase letters, 2 digits, 2 punctuation characters, and 2 special characters...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_password()) == 16\", \"assert sum(1 for c in generate_password() if c.isupper()) >= 2\", \"assert sum(1 for c in generate_password() if c.islower()) >= 2\", \"assert sum(1 for c in generate_password() if c.isdigit()) >= 2\", \"assert sum(1 for c...
{ "split": "train", "index": 81831, "acecode_id": "evol_1726", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a string representation based on three input parameters: `padding`, `par`, and `value_ram_size`. The function should construct a string according to the following rules: If `padding` is not None, it should be included in th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_string_representation(5, 3, 1024) == '5 par:3 value_ram_size:1024'\", \"assert generate_string_representation(10, 1, 512) == '10 value_ram_size:512'\", \"assert generate_string_representation(0, 5, 2048) == '0 par:5 value_ram_size:2048'\", \"assert ...
{ "split": "train", "index": 81832, "acecode_id": "oss_36593", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Design a function that uses regular expressions to search through a list of strings. Your function should find and count all occurrences of words starting with 'Foo' followed by any alphanumeric characters. Additionally, it should identify and output words that end with the pat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_occurrences_and_find_specific_endings(['Foo456 Foo789', 'Test Foo123']) == (Counter({'Foo456': 1, 'Foo789': 1, 'Foo123': 1}), ['Foo123'])\", \"assert count_occurrences_and_find_specific_endings(['Nothing to see here']) == (Counter(), [])\", \"assert co...
{ "split": "train", "index": 81833, "acecode_id": "evol_12305", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks for violations of a specific policy related to the usage of 'autocmd' commands in Vim script files. The function should identify lines in the provided Vim script content that contain the 'autocmd' command without being enc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_autocmd_violations('autocmd BufRead *.py') == [(1, 'autocmd BufRead *.py')]\", \"assert check_autocmd_violations('augroup mygroup\\\\nautocmd BufRead *.py\\\\naugroup END') == []\", \"assert check_autocmd_violations('autocmd!') == [(1, 'autocmd!')]\", ...
{ "split": "train", "index": 81834, "acecode_id": "oss_6916", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers and returns a list containing only the even numbers from the original list.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block." } ]
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert even_numbers([0, -2, -4, 3, 5]) == [0, -2, -4]\", \"assert even_numbers([]) == []\", \"assert even_numbers([7, 9, 11]) == []\", \"assert even_numbers([...
{ "split": "train", "index": 81835, "acecode_id": "evol_22498", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that calculates the product of all prime numbers in a given range, inclusive. The function should take two integers, `start` and `end`, as parameters, and return the product of all prime numbers between `start` and `end`. If there are no prime numbers in the ra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert product_of_primes(2, 10) == 210\", \"assert product_of_primes(1, 1) == 1\", \"assert product_of_primes(2, 2) == 2\", \"assert product_of_primes(2, 100) == 2305567963945518424753102147331756070\", \"assert product_of_primes(3, 5) == 15\", \"assert product_of_...
{ "split": "train", "index": 81836, "acecode_id": "evol_28165", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function `create_node(label: str, properties: dict) -> str` that simulates the creation of a node in a Neo4j database. The function should take a string `label` representing the label of the node and a dictionary `properties` representing the properties of the node....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_node('Person', {'name': 'John', 'age': 25}) == \\\"Node created with label: Person and properties: {'name': 'John', 'age': 25}\\\"\", \"assert create_node('Car', {'make': 'Toyota', 'model': 'Camry', 'year': 2020}) == \\\"Node created with label: Car a...
{ "split": "train", "index": 81837, "acecode_id": "evol_22529", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, each representing a setting with a schema that includes a title, description, and properties. Your task is to create a summary dictionary that collects all settings that are not fully excluded based on a 'preferences_exclude' key. Each entr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_preferences_summary([{'schema': {'title': 'Setting A', 'description': 'Description A', 'properties': {'field1': {}, 'field2': {}}}, 'NapariConfig': {'preferences_exclude': []}, '__fields__': {'field1': {'field_info': {'title': 'Field 1', 'description'...
{ "split": "train", "index": 81838, "acecode_id": "bigcode_python_fns_5925", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a dictionary where the keys are blob names and the values are lists of blobs. Your task is to implement a function `create_batches(blobs: Dict[str, List[List[float]]], batch_size: int) -> List[Dict[str, List[List[float]]]]` that returns a list of batches. Each bat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_batches({'blob1': [[1.0, 2.0], [3.0, 4.0]], 'blob2': [[5.0, 6.0], [7.0, 8.0]]}, 1) == [{'blob1': [[1.0, 2.0]], 'blob2': [[5.0, 6.0]]}, {'blob1': [[3.0, 4.0]], 'blob2': [[7.0, 8.0]]}]\", \"assert create_batches({'blob1': [[1.0]], 'blob2': [[2.0]]}, 1) ...
{ "split": "train", "index": 81839, "acecode_id": "bigcode_python_fns_6754", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a class `AdapTrajStorage` that has an attribute `aux`, which is a list of lists containing tuples. Implement a function `list_aux_pop()` that retrieves the last list from the `aux` attribute and returns it as a list of tuples. If `aux` is empty, the function shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert AdapTrajStorage().list_aux_pop() == []\", \"assert AdapTrajStorage(aux=[[(0,1), (2,3)], [(0, 1)], [(2, 3)]]).list_aux_pop() == [(2, 3)]\", \"assert AdapTrajStorage(aux=[[(1,2)], [(3,4), (5,6)]]).list_aux_pop() == [(3, 4), (5, 6)]\", \"assert AdapTrajStorage(...
{ "split": "train", "index": 81840, "acecode_id": "bigcode_python_fns_6670", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer n, write a function that returns a multiplication table for that number from 1 to 10 as a list of strings. Each string should represent one line of the multiplication table in the format 'n x i = result', where i ranges from 1 to 10. If n is less than o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_multiplication_table(5) == ['5 x 1 = 5', '5 x 2 = 10', '5 x 3 = 15', '5 x 4 = 20', '5 x 5 = 25', '5 x 6 = 30', '5 x 7 = 35', '5 x 8 = 40', '5 x 9 = 45', '5 x 10 = 50']\", \"assert generate_multiplication_table(1) == ['1 x 1 = 1', '1 x 2 = 2', '1 x 3...
{ "split": "train", "index": 81841, "acecode_id": "oss_22482", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the process of loading an image represented as a 2D array of pixel values. The function should take a 2D list of integers (representing grayscale pixel values ranging from 0 to 255) and a boolean parameter `grayscale`. If `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_image_representation([[0]], True) == [[[0.0, 0.0, 0.0]]]\", \"assert load_image_representation([[255]], False) == [[[1.0, 1.0, 1.0]]]\", \"assert load_image_representation([[255, 255], [255, 255]], True) == [[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]], [[1.0, 1....
{ "split": "train", "index": 81842, "acecode_id": "bigcode_python_fns_38705", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a string representing a time in either 24-hour format (hh:mm) or 12-hour format (hh:mmam/pm) and converts it into a well-structured datetime object in UTC format. The function should handle the following input formats: \n\n- Fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_time('01:00') == datetime(2023, 10, 1, 1, 0)\", \"assert parse_time('23:59') == datetime(2023, 10, 1, 23, 59)\", \"assert parse_time('12:00am') == datetime(2023, 10, 1, 0, 0)\", \"assert parse_time('12:00pm') == datetime(2023, 10, 1, 12, 0)\", \"assert...
{ "split": "train", "index": 81843, "acecode_id": "bigcode_python_fns_38797", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates the activation of a version in a content delivery network (CDN) system. The function should activate a specified version and return a message indicating the activation status. If an error occurs during the activation...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert activate_and_print(MockClient(success=True), 'v1.0') == 'Reactivated original version v1.0'\", \"assert activate_and_print(MockClient(success=True), 'v2.1') == 'Reactivated original version v2.1'\", \"assert activate_and_print(MockClient(success=True), 'v3.5...
{ "split": "train", "index": 81844, "acecode_id": "oss_36780", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function named \"is_even\" that takes a single parameter, \"num\". The function should return True if \"num\" is an even integer and False if it is an odd integer. If \"num\" is not an integer, the function should raise a ValueError with the message \"Input must be ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_even(2) == True\", \"assert is_even(3) == False\", \"assert is_even(0) == True\", \"assert is_even(-2) == True\", \"assert is_even(-3) == False\", \"assert is_even(100) == True\", \"assert is_even(101) == False\", \"assert is_even(-100) == True\", \"asser...
{ "split": "train", "index": 81845, "acecode_id": "evol_6801", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `sieve_of_eratosthenes` that takes an integer 'n' as input and returns a list of all prime numbers up to 'n'. The function should utilize the Sieve of Eratosthenes algorithm to efficiently find the prime numbers. The input 'n' will be a positive inte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sieve_of_eratosthenes(10) == [2, 3, 5, 7]\", \"assert sieve_of_eratosthenes(20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert sieve_of_eratosthenes(30) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]\", \"assert sieve_of_eratosthenes(50) == [2, 3, 5, 7, 11, 13, 17, 19...
{ "split": "train", "index": 81846, "acecode_id": "evol_29711", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given three lists of integers, write a function `common(l1: list, l2: list, l3: list) -> list` that returns a sorted list of unique integers that are present in all three lists. The function must not use any built-in Python list functions for operations such as sorting, appendi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert common([1, 2, 3], [3, 2, 1], [2, 1, 3]) == [1, 2, 3]\", \"assert common([1, 2, 3], [4, 5, 6], [7, 8, 9]) == []\", \"assert common([], [1, 2, 3], [1, 2, 3]) == []\", \"assert common([1, 1, 1], [1, 1, 1], [1, 1, 1]) == [1]\", \"assert common([10, 20, 30], [30,...
{ "split": "train", "index": 81847, "acecode_id": "evol_19498", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a custom `map_default` function in Python that behaves similarly to the built-in `map` function, but with the addition of default values for missing keys in the input dictionary. The `map_default` function should take four parameters: a function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert map_default(lambda x: x + 1, 'd', 0, {'a': 1, 'b': 2}) == {'a': 2, 'b': 3, 'd': 0}\", \"assert map_default(lambda x: x * 3, 'x', 10, {'m': 4}) == {'m': 12, 'x': 10}\", \"assert map_default(lambda x: x ** 2, 'z', -1, {'y': 5, 'a': 3}) == {'y': 25, 'a': 9, 'z'...
{ "split": "train", "index": 81848, "acecode_id": "oss_3081", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing an autoscaler with a name and a nested dictionary of properties. Your task is to implement a function that sets the location-dependent properties of the autoscaler based on whether the autoscaler is regional or zonal. The input to the fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_autoscaler_location({'name': 'my-autoscaler', 'properties': {}}, True, 'us-central1') == {'name': 'region', 'value': '$(ref.my-autoscaler.region)'}\", \"assert set_autoscaler_location({'name': 'my-autoscaler', 'properties': {}}, False, 'us-central1-a') =...
{ "split": "train", "index": 81849, "acecode_id": "bigcode_python_fns_35630", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating a sitemap for a web application that manages information about passengers and drivers. Implement a function `generate_sitemap` that takes a list of passenger and driver objects as input and returns a dictionary where the keys are the object types ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_sitemap([]) == {'passenger': [], 'driver': []}\", \"assert generate_sitemap([Passenger(1)]) == {'passenger': ['/persons/passenger_detail/1'], 'driver': []}\", \"assert generate_sitemap([Driver(1)]) == {'passenger': [], 'driver': ['/persons/driver_de...
{ "split": "train", "index": 81850, "acecode_id": "oss_31310", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function named `create_introduction` that takes in a human's name, age, and gender as parameters and returns a string introducing the person in the format: 'Hello, my name is {name}. I am a {age} years old {gender}.'\nPlease reason step by step, then write a self-co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_introduction('Alice', 30, 'female') == 'Hello, my name is Alice. I am a 30 years old female.'\", \"assert create_introduction('Bob', 22, 'male') == 'Hello, my name is Bob. I am a 22 years old male.'\", \"assert create_introduction('Charlie', 45, 'non-...
{ "split": "train", "index": 81851, "acecode_id": "evol_18988", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string s that may contain multiple consecutive spaces, write a function that returns a new string where all consecutive spaces are replaced by a single space. The resulting string should not have leading or trailing spaces.\nPlease reason step by step, then write a self...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_consecutive_spaces('Hello World') == 'Hello World'\", \"assert replace_consecutive_spaces(' Leading spaces') == 'Leading spaces'\", \"assert replace_consecutive_spaces('Trailing spaces ') == 'Trailing spaces'\", \"assert replace_consecutive_sp...
{ "split": "train", "index": 81852, "acecode_id": "bigcode_python_fns_3616", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a server response. The function, `get_response_status`, should return an HTTP status code based on the input action. Implement the function such that it returns: 200 for 'success', 400 for 'bad request', 404 for 'not found'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_response_status('success') == 200\", \"assert get_response_status('bad request') == 400\", \"assert get_response_status('not found') == 404\", \"assert get_response_status('server error') == 500\", \"assert get_response_status('unknown action') == 409\",...
{ "split": "train", "index": 81853, "acecode_id": "bigcode_python_fns_25967", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python package for a data science and machine learning platform called 'Deep Learning Workbench' (DLW). Your goal is to complete a setup.py file for the DLW package by adding the necessary dependencies and command-line interface entry point. The p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert complete_setup()['install_requires'] == ['numpy', 'scipy', 'python-csv', 'flask', 'flask-restful', 'pandas', 'scikit-learn', 'tensorflow']\", \"assert 'start-dlw' in complete_setup()['entry_points']['console_scripts']\", \"assert complete_setup()['version'] ...
{ "split": "train", "index": 81854, "acecode_id": "oss_32188", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_ellipse_area(a: float, b: float) -> float` that calculates the area of an ellipse given its semi-major axis `a` and semi-minor axis `b`. The function should validate the inputs to ensure both axes are non-negative. If either of the axes is negati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_ellipse_area(3, 4) == 37.69911184307752\", \"assert calculate_ellipse_area(0, 0) == 0.0\", \"assert calculate_ellipse_area(1, 1) == 3.141592653589793\", \"assert calculate_ellipse_area(2.5, 4.0) == 31.41592653589793\", \"assert calculate_ellipse_ar...
{ "split": "train", "index": 81855, "acecode_id": "evol_18974", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing filenames. Write a function that takes this list of filenames and returns a dictionary containing the following keys: 'dependencies_fn' which should always return 'no_dependencies', 'compiler_fn' which should return 'concatenate_inpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert concatenate(['file1.txt', 'file2.txt', 'file3.txt'], 'output_file') == {'dependencies_fn': 'no_dependencies', 'compiler_fn': 'concatenate_input_files', 'input': ['file1.txt', 'file2.txt', 'file3.txt'], 'output': 'output_file'}\", \"assert concatenate(['a.txt...
{ "split": "train", "index": 81856, "acecode_id": "bigcode_python_fns_44596", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the creation of an alert source in a system. The function should take in two parameters: a string 'context' representing the context in which the alert is created, and a dictionary 'values' containing key-value pairs that r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert alert_source_create('System A', {'type': 'error', 'level': 'high'}) == 'Alert source created in System A with properties type: error, level: high'\", \"assert alert_source_create('System B', {'type': 'warning'}) == 'Alert source created in System B with prop...
{ "split": "train", "index": 81857, "acecode_id": "bigcode_python_fns_14564", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two author names and a dictionary representing a graph of authors and their co-authors with associated weights. Your task is to implement a function `compare_authors(author1, author2, G)` that performs the following steps: 1. If `author1` is equal to `author2`, th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_authors('Alice Smith', 'Alice Smith', {}) is None\", \"assert compare_authors('John Doe', 'John Doe', {}) is None\", \"assert compare_authors('Emily Brown', 'Emily Brown', {}) is None\", \"assert compare_authors('Emily Brown', 'Emilia Browne', {}) ==...
{ "split": "train", "index": 81858, "acecode_id": "oss_22848", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of numbers, implement a function that normalizes the list such that all values are scaled to be between 0 and 1. The normalization should be done according to the formula: normalized_value = (value - min_value) / (max_value - min_value), where min_value and max_val...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize([1, 2, 3]) == [0.0, 0.5, 1.0]\", \"assert normalize([10, 20, 30, 40]) == [0.0, 0.3333333333333333, 0.6666666666666666, 1.0]\", \"assert normalize([5, 5, 5]) == [0.0, 0.0, 0.0]\", \"assert normalize([]) == []\", \"assert normalize([1.5, 2.5, 3.5]) =...
{ "split": "train", "index": 81859, "acecode_id": "bigcode_python_fns_22445", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the launch and closure of an application. The function should take a boolean parameter indicating whether the application should launch successfully or not, and it should also handle the closure of the application. If t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_application(True, False) == 'Application Running'\", \"assert manage_application(False, False) == 'Launch Failed'\", \"assert manage_application(False, True) == 'Launch Failed'\", \"assert manage_application(True, False) == 'Application Running'\", \"...
{ "split": "train", "index": 81860, "acecode_id": "oss_16898", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given two rectangles represented by their top-left corner coordinates (x1, y1), width1, height1 for the first rectangle, and (x2, y2), width2, height2 for the second rectangle, write a function `collide_rect(x1: int, y1: int, width1: int, height1: int, x2: int, y2: int, width2:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert collide_rect(0, 0, 2, 2, 1, 1, 2, 2) == True\", \"assert collide_rect(0, 0, 2, 2, 3, 3, 2, 2) == False\", \"assert collide_rect(0, 0, 2, 2, 2, 2, 2, 2) == False\", \"assert collide_rect(0, 0, 2, 2, 0, 0, 2, 2) == True\", \"assert collide_rect(1, 1, 2, 2, 1, ...
{ "split": "train", "index": 81861, "acecode_id": "bigcode_python_fns_10450", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function named `perform_operation` that takes two integers, `num1` and `num2`, and a string `operation`. The `operation` can be one of the following: '+', '-', '*', '/'. The function should return the result of the arithmetic operation performed on `num1` and `num2`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert perform_operation(1000000000000000000, 999999999999999999, '-') == 1\", \"assert perform_operation(1000000000000000000, 1000000000000000000, '/') == 1.0\", \"assert perform_operation(100, 50, '+') == 150\", \"assert perform_operation(100, 50, '-') == 50\", \...
{ "split": "train", "index": 81862, "acecode_id": "evol_3674", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given two groups of points where the first group has `size1` points and the second group has `size2` points, with the condition that `size1 >= size2`. The cost of connecting points from the first group to the second group is given in a `size1 x size2` matrix, where `cos...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert connectTwoGroups([[15, 96], [36, 2]]) == 17\", \"assert connectTwoGroups([[1, 3, 5], [4, 1, 1], [1, 5, 3]]) == 4\", \"assert connectTwoGroups([[2, 5, 1], [3, 4, 7], [8, 1, 2], [6, 2, 4], [3, 8, 8]]) == 10\", \"assert connectTwoGroups([[0, 0], [0, 0]]) == 0\"...
{ "split": "train", "index": 81863, "acecode_id": "evol_26247", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given username already exists in a predefined list of usernames. The function should take a string input representing the username and return a boolean value indicating whether the username exists in the list. Implement a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_username_exists('alice') == True\", \"assert check_username_exists('bob') == True\", \"assert check_username_exists('charlie') == True\", \"assert check_username_exists('david') == True\", \"assert check_username_exists('eve') == True\", \"assert check...
{ "split": "train", "index": 81864, "acecode_id": "bigcode_python_fns_15841", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a backup and restore operation for a system. The function `restore_backup` takes in two parameters: a backup ID (a string) and a volume ID (a string). The goal is to implement the restore operation, which should return a me...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert restore_backup('backup_id_123', 'backup_id_123') == 'Restore successful'\", \"assert restore_backup('backup_id_1', 'backup_id_1') == 'Restore successful'\", \"assert restore_backup('backup_id_abc', 'backup_id_abc') == 'Restore successful'\", \"assert restore...
{ "split": "train", "index": 81865, "acecode_id": "oss_21639", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates loading a point cloud from a specific source based on a given condition. You need to create a function named `load_point_cloud` that takes a boolean parameter `use_partial_pc`, a dictionary `pc_urdf_h` representing file...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_point_cloud(False, {'pc': 'file_1.npy'}, {}) == 'file_1.npy'\", \"assert load_point_cloud(True, {}, {'result_1': {'hook': 'partial_file_1.npy'}}) == 'partial_file_1.npy'\", \"assert load_point_cloud(False, {'pc': 'file_2.npy'}, {}) == 'file_2.npy'\", \"...
{ "split": "train", "index": 81866, "acecode_id": "oss_31151", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating a statistic value against a predefined set of acceptable statistics. Write a function `validate_statistic(value: str) -> None` that checks if the provided `value` is part of a set of supported statistics. If the `value` is not supported, the funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_statistic('mean') is None\", \"assert validate_statistic('median') is None\", \"assert validate_statistic('mode') is None\", \"assert validate_statistic('variance') is None\", \"assert validate_statistic('standard deviation') is None\", \"assert val...
{ "split": "train", "index": 81867, "acecode_id": "bigcode_python_fns_46933", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats a list of defense challenge records into a specific string output. Each record has a challenge name, a result status, and two additional attributes: the year and a score. Your function should take an integer `n` representing ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_defense_history(3, [('Challenge1', True, 2021, 85), ('Challenge2', False, 2020, 70), ('Challenge3', True, 2022, 90)]) == ['[Challenge1] .... Success (2021, 85)', '[Challenge2] .... Failure (2020, 70)', '[Challenge3] .... Success (2022, 90)']\", \"asse...
{ "split": "train", "index": 81868, "acecode_id": "bigcode_python_fns_20081", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `square(n)` that takes an integer `n` as input and returns the square of `n`. The function should handle both positive and negative integers as well as zero.\nPlease reason step by step, then write a self-contained Python solution. Give your final program i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert square(0) == 0\", \"assert square(1) == 1\", \"assert square(-1) == 1\", \"assert square(2) == 4\", \"assert square(-2) == 4\", \"assert square(3) == 9\", \"assert square(-3) == 9\", \"assert square(10) == 100\", \"assert square(-10) == 100\", \"assert squar...
{ "split": "train", "index": 81869, "acecode_id": "evol_7700", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of lists of strings, where each string may contain leading or trailing whitespace characters (spaces, tabs, newlines). Your task is to write a function that takes this list of lists as input and returns a new list of lists, where each string is stripped of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_whitespace([[' hello ', ' world '], [' python ', ' coding ']]) == [['hello', 'world'], ['python', 'coding']]\", \"assert remove_whitespace([[' leading space', 'trailing space '], [' both ', 'none']]) == [['leading space', 'trailing space'], ['...
{ "split": "train", "index": 81870, "acecode_id": "bigcode_python_fns_46423", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with merging information about countries based on their elevation and life expectancy. You are provided with two lists of dictionaries. The first list contains information about the elevation of each country, while the second list contains information about the l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_country_data([{'name': 'Country1', 'elevation': 1000}, {'name': 'Country2', 'elevation': 500}], [{'name': 'Country1', 'life_expectancy': 75}, {'name': 'Country2', 'life_expectancy': 80}]) == [{'name': 'Country1', 'elevation': 1000, 'life_expectancy': 7...
{ "split": "train", "index": 81871, "acecode_id": "oss_6416", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a list of service statements and returns a list of executed actions based on the type of statement. Each service statement is represented as a tuple where the first element is the action and any additional parame...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_service_statements([('save_env',)]) == ['save_env']\", \"assert process_service_statements([('auto_provision', 'param1', 'param2')]) == ['auto_provision']\", \"assert process_service_statements([('setup_dialog', 'param3')]) == ['setup_dialog']\", \"a...
{ "split": "train", "index": 81872, "acecode_id": "oss_19586", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that accepts a list of three whole numbers. The function should categorize the numbers as either prime or composite and return the smallest prime and smallest composite number. If there are no prime or composite numbers in the list, the function should retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert smallest_prime_composite([3, 5, 7]) == (3, 'No composite numbers')\", \"assert smallest_prime_composite([4, 6, 8]) == ('No prime numbers', 4)\", \"assert smallest_prime_composite([2, 3, 5]) == (2, 'No composite numbers')\", \"assert smallest_prime_composite(...
{ "split": "train", "index": 81873, "acecode_id": "evol_203", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a URL routing system for managing blog comments in a web application. Your goal is to define a function `generate_urlpatterns` that returns a list of URL patterns for handling various comment-related views. The function should return a list of dicti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_urlpatterns() == [{'path': 'post/<int:post_id>/comments/', 'view': 'post_comments'}, {'path': 'post/<int:post_id>/add_comment/', 'view': 'add_comment'}, {'path': 'comment/<int:comment_id>/edit/', 'view': 'edit_comment'}, {'path': 'comment/<int:comme...
{ "split": "train", "index": 81874, "acecode_id": "oss_15571", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `s`, return the indices of the first and last non-repeating characters in it as a list. If there are no non-repeating characters, return `[-1, -1]`. The function should be implemented as `def firstAndLastUnique(s: str) -> List[int]:`. The input string `s` consist...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert firstAndLastUnique('aabb') == [-1, -1]\", \"assert firstAndLastUnique('abcde') == [0, 4]\", \"assert firstAndLastUnique('xyzxyz') == [-1, -1]\", \"assert firstAndLastUnique('xxyyzz') == [-1, -1]\", \"assert firstAndLastUnique('aabbccddeeffgg') == [-1, -1]\",...
{ "split": "train", "index": 81875, "acecode_id": "evol_8603", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple banking operation. Write a function named `bank_operations` that takes the account holder's name, a list of deposit amounts, a list of withdrawal amounts, and returns the final account balance after performing all operations. If a withdra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_operations('Alice', [100, 200], [150]) == 150\", \"assert bank_operations('Bob', [500], [600]) == 500\", \"assert bank_operations('Charlie', [300, 100], [200, 50]) == 150\", \"assert bank_operations('David', [], [100]) == 0\", \"assert bank_operations('...
{ "split": "train", "index": 81876, "acecode_id": "oss_11287", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to validate an email address. An email address is considered valid if it contains a username, followed by the '@' symbol, and then a domain. Your function should take a string as input and return a boolean indicating whether the email add...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_email('example@email.com') == True\", \"assert is_valid_email('user.name+tag@domain.co.uk') == True\", \"assert is_valid_email('user@sub.domain.com') == True\", \"assert is_valid_email('username@domain.com') == True\", \"assert is_valid_email('user@...
{ "split": "train", "index": 81877, "acecode_id": "oss_181", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `queue_operations(operations: List[Tuple[str, Optional[int]]]) -> List[Union[int, str]]` that simulates a queue using two stacks. The function should take a list of operations where each operation is a tuple. The first element of the tuple is a string repre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert queue_operations([('enqueue', 1), ('enqueue', 2), ('dequeue', None), ('peek', None), ('isEmpty', None)]) == [None, None, 1, 2, False]\", \"assert queue_operations([('enqueue', 4), ('isEmpty', None), ('peek', None), ('dequeue', None), ('isEmpty', None)]) == [...
{ "split": "train", "index": 81878, "acecode_id": "evol_3005", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a custom exception class and implementing a function that simulates searching for a package in a package management system. Your custom exception class, named `PackageNotFoundError`, should inherit from the `Exception` class and accept a package nam...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_package(['numpy', 'scipy', 'matplotlib'], 'numpy') == 'numpy'\", \"assert find_package(['numpy', 'scipy', 'matplotlib'], 'scipy') == 'scipy'\", \"assert find_package(['numpy', 'scipy', 'matplotlib'], 'matplotlib') == 'matplotlib'\", \"assert find_packag...
{ "split": "train", "index": 81879, "acecode_id": "oss_19446", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a dataset. Write a function `calibrate_dataset(data: List[int], calibration_type: str) -> List[float]` that performs a simple calibration on the dataset based on the specified calibration type. The calibration types are as follows: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calibrate_dataset([0, 0, 0], 'pass1') == [0.0, 0.0, 0.0]\", \"assert calibrate_dataset([0, 0, 0], 'pass2') == [0.0, 0.0, 0.0]\", \"assert calibrate_dataset([10, 20, 30], 'pass1') == [11.0, 22.0, 33.0]\", \"assert calibrate_dataset([5, 10, 15, 20], 'pass1') =...
{ "split": "train", "index": 81880, "acecode_id": "bigcode_python_fns_31255", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a dictionary containing keys representing different tasks and their corresponding boolean values indicating whether the task is completed or not. Your task is to write a function that returns the percentage of completed tasks in the dictionary, rounded to two deci...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_completion_percentage({'k1': True, 'k2': False, 'k3': True}) == 66.67\", \"assert calculate_completion_percentage({'k1': True}) == 100.00\", \"assert calculate_completion_percentage({'k1': False}) == 0.00\", \"assert calculate_completion_percentage...
{ "split": "train", "index": 81881, "acecode_id": "oss_18635", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two ranges represented as tuples (start, end), determine if the first range is completely within the second range. A range is considered to be within another range if the start of the first range is greater than or equal to the start of the second range, and the end of th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_range_within((1, 3), (0, 5)) == True\", \"assert is_range_within((1, 5), (1, 5)) == True\", \"assert is_range_within((2, 4), (1, 5)) == True\", \"assert is_range_within((0, 6), (1, 5)) == False\", \"assert is_range_within((3, 7), (1, 5)) == False\", \"ass...
{ "split": "train", "index": 81882, "acecode_id": "bigcode_python_fns_15102", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that checks if the parentheses in a given input string are balanced. A string is considered balanced if every opening parenthesis has a corresponding closing parenthesis in the correct order. The function should return True if the parentheses are balanced a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_parentheses_balanced('()') == True\", \"assert is_parentheses_balanced('[]') == True\", \"assert is_parentheses_balanced('{}') == True\", \"assert is_parentheses_balanced('({[]})') == True\", \"assert is_parentheses_balanced('((()))') == True\", \"assert ...
{ "split": "train", "index": 81883, "acecode_id": "evol_27014", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers and your task is to implement a function that takes this list as input and returns a new list where each element is the result of applying a specific denoising operation. The denoising operation is defined as follows: for each element in the inp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert denoise([]) == []\", \"assert denoise([1]) == [1.4]\", \"assert denoise([2]) == [2.3]\", \"assert denoise([-10]) == [-8.5]\", \"assert denoise([0]) == [0.5]\", \"assert denoise([0, 1, 2]) == [0.5, 1.4, 2.3]\", \"assert denoise([-2, -3, -4]) == [-1.3, -2.2, -...
{ "split": "train", "index": 81884, "acecode_id": "oss_34547", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function `convert(unit: str, distance: float) -> float` that converts a given distance from kilometers to miles or from miles to kilometers based on the specified unit. If the input unit is 'km', the function should convert the distance to miles (1 km = 0.621371 mil...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert('km', 0) == 0.0\", \"assert convert('km', 1) == 0.621371\", \"assert convert('km', 10) == 6.21371\", \"assert convert('mi', 0) == 0.0\", \"assert convert('mi', 1) == 1.60934\", \"assert convert('mi', 10) == 16.0934\", \"assert convert('mi', 100) == 1...
{ "split": "train", "index": 81885, "acecode_id": "evol_18242", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing file paths. Each path may represent a Jupyter notebook file with a '.ipynb' extension. Your task is to write a function that filters out all the notebook paths that are located in directories that should be excluded from processing. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_notebook_paths(['doc/notebook1.ipynb', 'doc/_build/notebook2.ipynb', 'doc/.ipynb_checkpoints/notebook3.ipynb', 'doc/folder/notebook4.ipynb']) == ['doc/notebook1.ipynb', 'doc/folder/notebook4.ipynb']\", \"assert filter_notebook_paths(['doc/_build/test....
{ "split": "train", "index": 81886, "acecode_id": "bigcode_python_fns_49742", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a floating-point number 'a' and a polynomial represented as a list of coefficients, implement a function 'sin_poly(a: float, coeffs: List[float]) -> float' that calculates the value of the sine of the polynomial at 'a' using the Taylor series expansion. The coefficients o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(sin_poly(0.5, [0, 1]) - 0.479425538604203) < 1e-9\", \"assert abs(sin_poly(1.0, [0, 1]) - 0.8414709848078965) < 1e-9\", \"assert abs(sin_poly(1.5708, [0, 1]) - 1.0) < 1e-9\", \"assert abs(sin_poly(0.0, [0, 0, 1]) - 0.0) < 1e-9\", \"assert abs(sin_poly(-1...
{ "split": "train", "index": 81887, "acecode_id": "bigcode_python_fns_15484", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string as input and returns a dictionary representing the count of each unique alphabetical character in the string. The characters should be treated in a case-insensitive manner, meaning 'A' and 'a' are considered the same. Non-alphabetical ch...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_alpha_chars('Hello World') == {'h': 1, 'e': 1, 'l': 3, 'o': 2, 'w': 1, 'r': 1, 'd': 1}\", \"assert count_alpha_chars('OpenAI GPT') == {'o': 1, 'p': 2, 'e': 1, 'n': 1, 'a': 1, 'i': 1, 'g': 1, 't': 1}\", \"assert count_alpha_chars('Python 3.9') == {'p': ...
{ "split": "train", "index": 81888, "acecode_id": "evol_16758", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function named `calculate_tax` that takes an annual income as input and returns the amount of tax to be paid based on the following tax rates: 0% for income less than 50,000, 10% for income between 50,000 and 100,000, and 20% for income exceeding 100,000. The functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_tax(30000) == 0.0\", \"assert calculate_tax(50000) == 0.0\", \"assert calculate_tax(0) == 0.0\", \"assert calculate_tax(-5000) == 0.0\", \"assert calculate_tax('invalid') == 0.0\", \"assert calculate_tax(None) == 0.0\", \"assert calculate_tax(45000...
{ "split": "train", "index": 81889, "acecode_id": "evol_14977", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Write a Python function that takes an ASCII input string and returns a list of all distinct permutations of the characters in the string. The function should maintain the order of characters as per their occurrence in the input string, taking into account the frequency of each ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert string_permutations('abc') == ['abc', 'acb', 'bac', 'bca', 'cab', 'cba']\", \"assert string_permutations('a') == ['a']\", \"assert string_permutations('aa') == ['aa']\", \"assert string_permutations('ab') == ['ab', 'ba']\", \"assert string_permutations('aab'...
{ "split": "train", "index": 81890, "acecode_id": "evol_24461", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given an array of integers, write a Python function that returns a tuple containing the smallest and greatest values from the array. The function should be named `find_min_max` and take one parameter: a list of integers. It should return a tuple where the first element is the s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_min_max([3, 4, 2, 8, 15, 6]) == (2, 15)\", \"assert find_min_max([-1, -5, -3, -2, -4]) == (-5, -1)\", \"assert find_min_max([0, 0, 0, 0]) == (0, 0)\", \"assert find_min_max([1]) == (1, 1)\", \"assert find_min_max([10, 20, 30, 40, 50]) == (10, 50)\", \"a...
{ "split": "train", "index": 81891, "acecode_id": "evol_25165", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples representing connections between people based on the papers they have authored. Each tuple contains two elements, where each element is a string representing the name of a person. Your task is to create a function that takes this list of connectio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert graph_papers([('Alice', 'Bob'), ('Alice', 'Charlie'), ('Bob', 'David')]) == {'Alice': {'name': 'Alice', 'imports': ['Bob', 'Charlie']}, 'Bob': {'name': 'Bob', 'imports': ['Alice', 'David']}, 'Charlie': {'name': 'Charlie', 'imports': ['Alice']}, 'David': {'na...
{ "split": "train", "index": 81892, "acecode_id": "bigcode_python_fns_38175", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a 2D list of integers representing the L channel of an image, where each value is in the range of -1 to 1, write a function `l_to_rgb(img_l)` that converts this L channel into an RGB image representation. The output should be a 3D list where each pixel is represented as a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert l_to_rgb([[0]]) == [[[127, 127, 127]]]\", \"assert l_to_rgb([[1]]) == [[[255, 255, 255]]]\", \"assert l_to_rgb([[-1]]) == [[[0, 0, 0]]]\", \"assert l_to_rgb([[0, 0], [0, 0]]) == [[[127, 127, 127], [127, 127, 127]], [[127, 127, 127], [127, 127, 127]]]\", \"as...
{ "split": "train", "index": 81893, "acecode_id": "bigcode_python_fns_22245", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to clean and format DICOM (Digital Imaging and Communications in Medicine) tag names. The DICOM tag name is represented as a hexadecimal number in the format '(XXXX,XXXX)' where each 'X' represents a hexadecimal digit. Your task is to...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_dicom_tag('(0010,0010)') == '(10,10)'\", \"assert clean_dicom_tag('(0020,000D)') == '(20,D)'\", \"assert clean_dicom_tag('(0001,0002)') == '(1,2)'\", \"assert clean_dicom_tag('(0000,0000)') == '(0,0)'\", \"assert clean_dicom_tag('(000F,0010)') == '(F,1...
{ "split": "train", "index": 81894, "acecode_id": "oss_36942", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `find_positions` that takes a string `text` and a substring `substring` as inputs, and returns a list of all starting indices of occurrences of `substring` in `text`. The function should consider overlapping occurrences of the substring. If the substring is not...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_positions('abababab', 'aba') == [0, 2, 4]\", \"assert find_positions('hello world', 'lo') == [3]\", \"assert find_positions('aaa', 'aa') == [0, 1]\", \"assert find_positions('abcabcabc', 'abc') == [0, 3, 6]\", \"assert find_positions('testing substring'...
{ "split": "train", "index": 81895, "acecode_id": "evol_6915", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given list of integers is non-empty. The function should take a list of integers as input and return a boolean value indicating whether the list contains any elements. Implement the function `is_list_non_empty(nums: List[...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_list_non_empty([]) == False\", \"assert is_list_non_empty([1]) == True\", \"assert is_list_non_empty([0]) == True\", \"assert is_list_non_empty([1, 2, 3]) == True\", \"assert is_list_non_empty([-1, -2, -3]) == True\", \"assert is_list_non_empty([100]) == ...
{ "split": "train", "index": 81896, "acecode_id": "bigcode_python_fns_38806", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function named `intersperse` that accepts a list of integers `numbers` and an integer `delimeter`. Construct a list where the `delimeter` is placed between every pair of consecutive elements from the `numbers` list. If `delimeter` is negative, use the absolute value as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert intersperse([], 4) == []\", \"assert intersperse([1, 2, 3], 4) == [1, 4, 2, 4, 3]\", \"assert intersperse([5, 6, 7, 8], 3) == [5, 3, 6, 3, 7, 3, 8]\", \"assert intersperse([1], 5) == [1]\", \"assert intersperse([4, 5, 6], 2) == [4, 2, 5, 2, 6]\", \"assert in...
{ "split": "train", "index": 81897, "acecode_id": "evol_26422", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function that computes the n-th element of a modified FibFib sequence defined as follows: fibfib(0) returns a, fibfib(1) returns b, fibfib(2) returns c, and for n >= 3, fibfib(n) returns the sum of the three preceding elements: fibfib(n-1) + fibfib(n-2) + fibfib(n-3...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibfib_sequence(0, 2, 3, 5) == 2\", \"assert fibfib_sequence(1, 2, 3, 5) == 3\", \"assert fibfib_sequence(2, 2, 3, 5) == 5\", \"assert fibfib_sequence(3, 2, 3, 5) == 10\", \"assert fibfib_sequence(4, 2, 3, 5) == 18\", \"assert fibfib_sequence(5, 2, 3, 5) == ...
{ "split": "train", "index": 81898, "acecode_id": "evol_6566", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a 2D list `traj` representing a trajectory with shape [nspokes, 3], an integer `npoints` representing the number of readout points along the spokes, and an integer `OS` representing the oversampling factor, implement a function `transform_trajectory(traj: List[List[float]...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_trajectory([[1, 2, 3], [4, 5, 6]], 2, 1) == [[[0.0, 0.0, 0.0], [1, 2, 3]], [[0.0, 0.0, 0.0], [4, 5, 6]]]\", \"assert transform_trajectory([[1, 0, 0], [0, 1, 1]], 1, 3) == [[[0.0, 0.0, 0.0]], [[0.0, 0.0, 0.0]]]\", \"assert transform_trajectory([[3, ...
{ "split": "train", "index": 81899, "acecode_id": "bigcode_python_fns_19487", "num_tests": 6 }