data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "Given a singly linked list, implement a function `find_min_value(head)` that returns the lowest numerical value found in the linked list. Each node in the linked list is represented by a `Node` class which has a `value` and a `next` pointer. The function should return the minim...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_min_value(Node(5, Node(9, Node(3, Node(12))))) == 3\", \"assert find_min_value(Node(10, Node(20, Node(30, Node(1))))) == 1\", \"assert find_min_value(Node(100, Node(200, Node(300, Node(400))))) == 100\", \"assert find_min_value(Node(-10, Node(-20, Node(...
{ "split": "train", "index": 5900, "acecode_id": "evol_30979", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that applies a random rotation to a given image represented as a 2D list of pixel values. The function should take an image, an angle range (as a tuple of two integers), and a boolean indicating whether the image should be expanded. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotate_image([[1, 2], [3, 4]], (0, 0), False) == [[1, 2], [3, 4]]\", \"assert rotate_image([[1]], (0, 0), True) == [[1]]\", \"assert rotate_image([[0, 0], [0, 0]], (0, 360), False) == [[0, 0], [0, 0]]\", \"assert rotate_image([[255]], (0, 0), True) == [[255]...
{ "split": "train", "index": 5901, "acecode_id": "oss_34901", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Write a function that checks if a given string is a sub-anagram of any palindrome in a provided list. A sub-anagram is defined as a string that can be rearranged to form a part or whole of another string, considering case insensitivity. The function should return a list of all ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sub_anagram('ace', ['racecar', 'level', 'rotator']) == ['racecar']\", \"assert sub_anagram('abc', ['a', 'b', 'c', 'd']) == []\", \"assert sub_anagram('a', ['A', 'B', 'C']) == ['A']\", \"assert sub_anagram('noon', ['noon', 'moon', 'soon']) == ['noon']\", \"as...
{ "split": "train", "index": 5902, "acecode_id": "evol_28305", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that filters log messages based on a predefined list of endpoints. Given a list of log messages and a list of endpoints to filter out, your goal is to return a new list that only includes log messages which do not contain any of the s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_log_messages(['User accessed /home', 'User accessed /set_pixel', 'User logged in'], ['/set_pixel']) == ['User accessed /home', 'User logged in']\", \"assert filter_log_messages(['Error occurred at /api/data', 'Request to /set_pixel failed', 'User acce...
{ "split": "train", "index": 5903, "acecode_id": "oss_7492", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that represents a CSV (Comma-Separated Values) record. Each record contains fields separated by commas. Your task is to parse this string and return a dictionary representing the last valid record while also capturing any errors from previous records that...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_csv_record('Name,Position\\\\nAlex,Developer,1\\\\nXavi,Developer') == ({'Name': 'Xavi', 'Position': 'Developer'}, [{'columns': ['Alex', 'Developer', '1'], 'headers': ['Name', 'Position']}])\", \"assert parse_csv_record('Name,Position\\\\nBob,Manager\\...
{ "split": "train", "index": 5904, "acecode_id": "bigcode_python_fns_40590", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a browser opening a specific URL. The function takes a string as input, representing the URL to be opened. If the URL is valid (it starts with 'http://' or 'https://'), the function should return the string 'Opening URL: ' ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert open_browser('http://example.com') == 'Opening URL: http://example.com'\", \"assert open_browser('https://example.com') == 'Opening URL: https://example.com'\", \"assert open_browser('ftp://example.com') == 'Invalid URL'\", \"assert open_browser('example.com...
{ "split": "train", "index": 5905, "acecode_id": "bigcode_python_fns_31870", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function in Python that takes two integers, num1 and num2, as inputs and returns a dictionary with all the prime numbers between num1 and num2 (inclusive) as keys, and their corresponding values set to True. If there are no prime numbers in that range, return an empty ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prime_dict(8, 20) == {11: True, 13: True, 17: True, 19: True}\", \"assert prime_dict(0, 1) == {}\", \"assert prime_dict(2, 2) == {2: True}\", \"assert prime_dict(10, 10) == {}\", \"assert prime_dict(1, 10) == {2: True, 3: True, 5: True, 7: True}\", \"assert ...
{ "split": "train", "index": 5906, "acecode_id": "evol_4178", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a SQL SELECT query based on the provided model and fields. The function should take two parameters: a string representing the model and a list of strings representing the fields to be included in the SELECT query. The f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_sql_query('Permission', ['id', 'name', 'content_type']) == 'SELECT id, name, content_type FROM Permission;'\", \"assert generate_sql_query('User', ['id', 'username', 'email']) == 'SELECT id, username, email FROM User;'\", \"assert generate_sql_query...
{ "split": "train", "index": 5907, "acecode_id": "oss_34367", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers as input and returns a tuple containing three values: a sorted list of unique elements from the input list, the mean value of these unique elements, and a list of unique elements that are less than or equal to the mean. The fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique([1, 2, 3, 4, 5]) == ([1, 2, 3, 4, 5], 3.0, [1, 2, 3])\", \"assert unique([5, 3, 1, 4, 2]) == ([1, 2, 3, 4, 5], 3.0, [1, 2, 3])\", \"assert unique([10, 20, 30, 40, 50]) == ([10, 20, 30, 40, 50], 30.0, [10, 20, 30])\", \"assert unique([1, 1, 1, 1, 1]) =...
{ "split": "train", "index": 5908, "acecode_id": "evol_18960", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the misclassification rate for a set of predictions. The misclassification rate is a measure of how often a classifier makes a mistake when predicting the class of a sample. It is calculated as the ratio of the number of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert misclassificationRate([1, 0, 1], [1, 0, 0]) == 0.3333333333333333\", \"assert misclassificationRate([1, 1, 1], [1, 1, 1]) == 0.0\", \"assert misclassificationRate([0, 0, 0], [1, 1, 1]) == 1.0\", \"assert misclassificationRate([1, 0, 1, 0], [0, 0, 1, 1]) == 0...
{ "split": "train", "index": 5909, "acecode_id": "oss_10437", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, `list1` and `list2`. Your task is to implement a function that counts the number of positions at which the corresponding elements in the two lists are different. The function should return this count. If the two lists have different lengths,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_differences([1, 2, 3], [1, 2, 4]) == 1\", \"assert count_differences([1, 2, 3], [1, 2, 3]) == 0\", \"assert count_differences([1, 2, 3], [4, 5, 6]) == 3\", \"assert count_differences([], []) == 0\", \"assert count_differences([1], []) == 0\", \"assert ...
{ "split": "train", "index": 5910, "acecode_id": "bigcode_python_fns_11926", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `launch_application(platform: str, app_bundle_id: str, app_package: str) -> str` that simulates launching a mobile application based on the operating system. The function should take three parameters: a string `platform` which can be ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert launch_application('iOS', 'com.example.app', '') == 'Launching app with bundle ID: com.example.app'\", \"assert launch_application('Android', '', 'com.example.app') == 'Launching app with package name: com.example.app'\", \"assert launch_application('iOS', '...
{ "split": "train", "index": 5911, "acecode_id": "bigcode_python_fns_15198", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates downloading data from a URL in chunks. Given a total 'content_length' in bytes and a 'chunk_size', your function should return the number of chunks required to download the entire content. If the last chunk is smaller than ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_chunks(1000, 300) == 4\", \"assert calculate_chunks(500, 200) == 3\", \"assert calculate_chunks(0, 50) == 0\", \"assert calculate_chunks(1, 1) == 1\", \"assert calculate_chunks(100, 25) == 4\", \"assert calculate_chunks(250, 100) == 3\", \"assert c...
{ "split": "train", "index": 5912, "acecode_id": "bigcode_python_fns_2258", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of file paths that represent raw profile data files. Your task is to create a function that simulates the merging of these files into a single target profile data file path. The function should take in a target name and a list of raw file paths, then return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_profile_data('my_target', ['file1.profraw', 'file2.profraw']) == 'my_target.profdata'\", \"assert merge_profile_data('another_target', []) == 'another_target.profdata'\", \"assert merge_profile_data('test_case_1', ['test1.profraw']) == 'test_case_1.pro...
{ "split": "train", "index": 5913, "acecode_id": "bigcode_python_fns_32396", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to sort them in ascending order without using any built-in Python sort methods. Implement a function that takes a list of integers as input and returns a new list with the integers sorted in ascending order. You may not use any sor...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_list([3, 1, 2]) == [1, 2, 3]\", \"assert sort_list([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert sort_list([1]) == [1]\", \"assert sort_list([]) == []\", \"assert sort_list([2, 2, 2]) == [2, 2, 2]\", \"assert sort_list([1, 2, 3, 4, 5]) == [1, 2, 3, 4,...
{ "split": "train", "index": 5914, "acecode_id": "evol_29985", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of vertices representing the corners of a polygon in a 2D plane. Each vertex is represented as a tuple of (x, y) coordinates. Your task is to calculate the area enclosed by the polygon formed by these vertices. The vertices are given in the order they conne...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_polygon_area([(0, 0), (1, 0), (1, 1), (0, 1)]) == 1.00\", \"assert calculate_polygon_area([(0, 0), (2, 0), (2, 2), (0, 2)]) == 4.00\", \"assert calculate_polygon_area([(1, 1), (4, 1), (4, 5), (1, 5)]) == 12.00\", \"assert calculate_polygon_area([(0...
{ "split": "train", "index": 5915, "acecode_id": "oss_28980", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that returns a list of all prime numbers that are less than or equal to a given integer 'n'. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Your function should take an integer 'n' as inpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert perfect_square_and_prime(1) == []\", \"assert perfect_square_and_prime(4) == [2, 3]\", \"assert perfect_square_and_prime(5) == [2, 3, 5]\", \"assert perfect_square_and_prime(6) == [2, 3, 5]\", \"assert perfect_square_and_prime(7) == [2, 3, 5, 7]\", \"assert ...
{ "split": "train", "index": 5916, "acecode_id": "evol_4109", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the nth Fibonacci number. The Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding ones, usually starting with 0 and 1. The sequence goes: 0, 1, 1, 2, 3, 5, 8, 13, 21, and so on. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert nth_fib(0) is None\", \"assert nth_fib(1) == 0\", \"assert nth_fib(2) == 1\", \"assert nth_fib(3) == 1\", \"assert nth_fib(4) == 2\", \"assert nth_fib(5) == 3\", \"assert nth_fib(6) == 5\", \"assert nth_fib(7) == 8\", \"assert nth_fib(8) == 13\", \"assert nt...
{ "split": "train", "index": 5917, "acecode_id": "oss_32398", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a Redis connection string as input and parses it into a dictionary containing the connection details. The connection string follows the format 'redis://:password@hostname:port/db_number'. Your function should extract the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_redis_connection_string('redis://:mypassword@localhost:6379/0') == {'password': 'mypassword', 'hostname': 'localhost', 'port': 6379, 'db_number': 0}\", \"assert parse_redis_connection_string('redis://:secret@127.0.0.1:6380/1') == {'password': 'secret',...
{ "split": "train", "index": 5918, "acecode_id": "oss_13898", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function `createMinHeap(arr)` that checks if the array is already a min-heap. If it is not, transform the array into a min-heap and return the modified array along with the number of swaps made during the transformation. If the array is a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert createMinHeap([1, 2, 3, 4, 5]) == ([1, 2, 3, 4, 5], 0)\", \"assert createMinHeap([1]) == ([1], 0)\", \"assert createMinHeap([]) == ([], 0)\", \"assert createMinHeap([2, 3, 4, 5, 6, 7]) == ([2, 3, 4, 5, 6, 7], 0)\", \"assert createMinHeap([1, 3, 2, 7, 6]) == ...
{ "split": "train", "index": 5919, "acecode_id": "evol_8963", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Write a recursive function to sort a list in descending order. The function should take a list of integers as input and return a new list containing the elements sorted in descending order. You cannot use the built-in sort() function or any sorting algorithms that rely on built...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_descending([1, 3, 5, 7, 8, 6, 4, 2, 9, 7]) == [9, 8, 7, 7, 6, 5, 4, 3, 2, 1]\", \"assert sort_descending([10, 5, 8, 3, 2]) == [10, 8, 5, 3, 2]\", \"assert sort_descending([0, -1, -5, 3, 2]) == [3, 2, 0, -1, -5]\", \"assert sort_descending([]) == []\", \...
{ "split": "train", "index": 5920, "acecode_id": "evol_13737", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a string as input and performs the following operations: \n1. Isolate all numerical values in the string and return the total count of these numbers. \n2. Calculate and return the sum of all the isolated numbers. \n3. Calculate and return the average...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_text('1 1 1 1 1') == (5, 5, 1.0, 5, '1')\", \"assert analyze_text('') == (0, 0, 0.0, 0, '')\", \"assert analyze_text('Python is fun 2 times 3 times 4') == (3, 9, 3.0, 8, 'times')\", \"assert analyze_text('Hello 10 world 10') == (2, 20, 10.0, 4, '10')...
{ "split": "train", "index": 5921, "acecode_id": "evol_34227", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a string `proposed_name`, implement a function that returns a unique slug name for a service. The slug name should be generated by converting the `proposed_name` to a URL-friendly format (i.e., lowercased, spaces replaced with hyphens, and special characters removed). Add...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_valid_name('Hello World!') == 'hello-world'\", \"assert get_valid_name('Python Programming 101') == 'python-programming-101'\", \"assert get_valid_name('Slugify Me!') == 'slugify-me'\", \"assert get_valid_name('Simple') == 'simple'\", \"assert get_valid_...
{ "split": "train", "index": 5922, "acecode_id": "bigcode_python_fns_42489", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of virtual machine (VM) details and returns a dictionary containing the total resources for each flavor. Each VM detail is represented as a list containing the following information in order: ID (int), Name (s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert aggregate_resources([[1, 'Small', 1, 2, 20], [2, 'Medium', 2, 4, 40], [3, 'Small', 1, 2, 20], [4, 'Large', 4, 8, 80], [5, 'Medium', 2, 4, 40]]) == {'Small': [2, 4, 40], 'Medium': [4, 8, 80], 'Large': [4, 8, 80]}\", \"assert aggregate_resources([[1, 'Tiny', 1...
{ "split": "train", "index": 5923, "acecode_id": "oss_4461", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a user has access to a specific page on a web application after logging in. The function should take two parameters: the URL of the web server and the URL of the page the user wants to visit. The function should return True...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_access('http://example.com', 'http://example.com/test_authenticated') == True\", \"assert check_access('http://example.com', 'http://example.com/test_public') == False\", \"assert check_access('http://example.com', 'http://example.com/authenticated/hom...
{ "split": "train", "index": 5924, "acecode_id": "bigcode_python_fns_43914", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of indices representing the top categories (top_k), a list of probabilities corresponding to those indices (probs), and a dictionary (cache_dict) where keys are filenames and values are tuples containing lists of indices and their corresponding probabilities, retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_most_similar([0], [0.5], {'file3': ([0], [0.5]), 'file4': ([1], [0.7])}, 1) == [('file3', 0.0)]\", \"assert find_most_similar([0], [0.1], {'file11': ([0], [0.1]), 'file12': ([1], [0.3])}, 1) == [('file11', 0.0)]\", \"assert find_most_similar([0, 1], [0....
{ "split": "train", "index": 5925, "acecode_id": "bigcode_python_fns_11452", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that retrieves a specified number of items from a list based on a provided index. The function, named `get_items`, should take three parameters: a list of integers `items`, an integer `start_index`, and an integer `count`. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_items([1, 2, 3, 4, 5], 0, 2) == [1, 2]\", \"assert get_items([10, 20, 30, 40], 1, 2) == [20, 30]\", \"assert get_items([1, 3, 5, 7], 3, 1) == [7]\", \"assert get_items([1, 2, 3, 4, 5], 5, 1) == []\", \"assert get_items([1, 2, 3, 4, 5], -1, 2) == []\", \"...
{ "split": "train", "index": 5926, "acecode_id": "oss_22763", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes an array of integers and returns an array containing the absolute values of the input elements, sorted in ascending order. The function should ensure that the input is a list containing between 5 and 100 integers. If the input is invalid, the fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sorted_absolute_values([-5, 3, -2, 2, 3, -3, 9, 0, -123]) == [0, 2, 2, 3, 3, 3, 5, 9, 123]\", \"assert sorted_absolute_values([1, -1, 2, -2, 3]) == [1, 1, 2, 2, 3]\", \"assert sorted_absolute_values([-10, -20, -5, -15, 0]) == [0, 5, 10, 15, 20]\", \"assert s...
{ "split": "train", "index": 5927, "acecode_id": "evol_14033", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that determines if a given string is a valid palindrome. A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward as forward, ignoring spaces, punctuation, and capitalization. Write a funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal, Panama') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('hello') == False\", \"assert is_pali...
{ "split": "train", "index": 5928, "acecode_id": "bigcode_python_fns_729", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that performs a binary search on a sorted list of distinct integers (which can include negative numbers). The function should return the index of the target integer if it is found in the list, or -1 if the target integer is not found. The input list will al...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_search([-10, -5, 0, 3, 7, 15], 3) == 3\", \"assert binary_search([-10, -5, 0, 3, 7, 15], -10) == 0\", \"assert binary_search([-10, -5, 0, 3, 7, 15], 15) == 5\", \"assert binary_search([-10, -5, 0, 3, 7, 15], 100) == -1\", \"assert binary_search([-10, ...
{ "split": "train", "index": 5929, "acecode_id": "evol_32899", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a network based on a block model matrix. The network is defined by a block model matrix represented as a 2D list, where each entry indicates the connection strength between nodes in different blocks. You need to implement a function `generate_netw...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_network([[0, 1], [1, 0]], 10, 0.5, 3) == [('output_s_0_network.tsv', 'output_s_0_genes.gmt'), ('output_s_1_network.tsv', 'output_s_1_genes.gmt'), ('output_s_2_network.tsv', 'output_s_2_genes.gmt')]\", \"assert generate_network([[1, 0, 0], [0, 1, 1],...
{ "split": "train", "index": 5930, "acecode_id": "bigcode_python_fns_16087", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with manipulating color ramps in a node-based shader editor. Implement a function that takes a list of color ramp elements and returns a new list with the order of the elements reversed. Each element is a dictionary containing two properties: 'color' (a list repr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_color_ramp([{'color': [1.0, 0.0, 0.0, 1.0], 'position': 0.0}, {'color': [0.0, 1.0, 0.0, 1.0], 'position': 0.5}, {'color': [0.0, 0.0, 1.0, 1.0], 'position': 1.0}]) == [{'color': [0.0, 0.0, 1.0, 1.0], 'position': 1.0}, {'color': [0.0, 1.0, 0.0, 1.0], '...
{ "split": "train", "index": 5931, "acecode_id": "oss_17258", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that initializes a user object. The function should check if a user already exists in the system. If no user exists, it should create a new user with the name 'BL00D'. The function should return the user object. Your function should be de...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_user() == {'name': 'BL00D'}\", \"assert initialize_user() == {'name': 'BL00D'}\", \"assert initialize_user() == {'name': 'BL00D'}\", \"assert initialize_user() == {'name': 'BL00D'}\", \"assert initialize_user() == {'name': 'BL00D'}\", \"assert ini...
{ "split": "train", "index": 5932, "acecode_id": "bigcode_python_fns_9653", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_urls(string: str) -> List[str]` that extracts all web addresses (both HTTP and HTTPS) from a given Unicode character string. The function should return a list of unique URLs found in the string, regardless of their structural composition and length.\n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_urls('Check out https://www.example.com for more info.') == ['https://www.example.com']\", \"assert find_urls('No URLs here!') == []\", \"assert find_urls('Check this out: https://example.com/path?query=123&other=abc') == ['https://example.com/path?quer...
{ "split": "train", "index": 5933, "acecode_id": "evol_11219", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the outcomes of a series of measurements from a quantum system. Your task is to compute the expectation value of these outcomes. The expectation value is defined as the mean of the given outcomes. Implement a function `compute_expec...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_expectation_value([1, 2, 3, 4, 5]) == 3.0\", \"assert compute_expectation_value([10, 20, 30]) == 20.0\", \"assert compute_expectation_value([-1, -2, -3]) == -2.0\", \"assert compute_expectation_value([0, 0, 0]) == 0.0\", \"assert compute_expectation_...
{ "split": "train", "index": 5934, "acecode_id": "bigcode_python_fns_42516", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two strings s1 and s2, write a function to determine the longest common subsequence present in both strings. The function should return the longest common subsequence as a string. A subsequence is a sequence that appears in the same relative order, but not necessarily con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_common_subsequence('abcde', 'ace') == 'ace'\", \"assert longest_common_subsequence('abc', 'abc') == 'abc'\", \"assert longest_common_subsequence('abcdef', 'xyzabc') == 'abc'\", \"assert longest_common_subsequence('abc', 'def') == ''\", \"assert longe...
{ "split": "train", "index": 5935, "acecode_id": "evol_7965", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_database_and_tables(db_file: str) -> None` that creates a SQLite database at the specified `db_file` path and creates three tables within that database: `table1`, `table2`, and `table3`. The structure of the tables should be as follows: `table1` sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_database_and_tables('./test_db1.db') is None\", \"assert create_database_and_tables('./test_db2.db') is None\", \"assert create_database_and_tables('./test_db3.db') is None\", \"assert create_database_and_tables('./test_db4.db') is None\", \"assert cr...
{ "split": "train", "index": 5936, "acecode_id": "evol_30319", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with determining if a list of commands is empty. Write a function `check_cmd_length` that takes a list of commands as input and returns `True` if the list is empty and `False` otherwise. The input list will contain strings representing commands. \n\nFunction Sign...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_cmd_length([]) == True\", \"assert check_cmd_length(['command1']) == False\", \"assert check_cmd_length(['command1', 'command2']) == False\", \"assert check_cmd_length(['']) == False\", \"assert check_cmd_length(['command1', '', 'command3']) == False\"...
{ "split": "train", "index": 5937, "acecode_id": "oss_26653", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, a tuple of two limits, and a list of criteria functions, implement a function `can_arrange_v3(arr, limits, criterion)` that identifies a pair of indices in the specified subarray (defined by the limits) that satisfy the criteria. If such a pair is fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_arrange_v3([1, 3, 5, 7], (0, 3), ['is_odd']) == {'index1': 0, 'index2': 1, 'swap_with': -1}\", \"assert can_arrange_v3([2, 4, 6, 8], (0, 2), ['is_even']) == {'index1': 0, 'index2': 1, 'swap_with': -1}\", \"assert can_arrange_v3([1, 5, 9], (0, 2), ['is_od...
{ "split": "train", "index": 5938, "acecode_id": "evol_23806", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that parses a given Matrix server URL and returns the hostname and port number. The Matrix server URL follows the format `https://<hostname>/_matrix`. Your function should take a URL string and an optional port number (defaulting to 8...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_matrix_url('https://example.org/_matrix', 80) == ('example.org', 80)\", \"assert parse_matrix_url('https://example.org/_matrix', 443) == ('example.org', 443)\", \"assert parse_matrix_url('https://test-server.com/_matrix', 80) == ('test-server.com', 80)...
{ "split": "train", "index": 5939, "acecode_id": "oss_13035", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given the name of a database table as a string. Write a function `db_to_df(db_table: str) -> List[Dict[str, Any]]` that simulates reading all the records from a specified table in a database and returns a list of dictionaries, where each dictionary represents a row in t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert db_to_df('board_games') == [{'id': 1, 'name': 'Chess', 'year': 1850}, {'id': 2, 'name': 'Monopoly', 'year': 1935}, {'id': 3, 'name': 'Scrabble', 'year': 1938}, {'id': 4, 'name': 'Settlers of Catan', 'year': 1995}, {'id': 5, 'name': 'Uno', 'year': 1971}]\", \...
{ "split": "train", "index": 5940, "acecode_id": "bigcode_python_fns_31280", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design and implement a function that finds the shortest path and the second shortest path between two nodes in a given directed graph with weighted edges. The graph is represented as an adjacency list, where each node maps to a dictionary of its neighbors and their respective e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_shortest_and_second_shortest_path({0: {1: 2}, 1: {2: 3}, 2: {3: 1}, 3: {}}, 0, 3) == (6, -1)\", \"assert get_shortest_and_second_shortest_path({0: {1: 1}, 1: {2: 2}, 2: {3: 3}, 3: {4: 1}, 4: {}}, 0, 4) == (7, -1)\", \"assert get_shortest_and_second_short...
{ "split": "train", "index": 5941, "acecode_id": "evol_2469", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function `sort_3d_array(array3d)` that takes a three-dimensional array as input and sorts each two-dimensional sub-array based on the third element of their inner arrays. Additionally, the overall three-dimensional array should be sorted based on the third element o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_3d_array([[[1, 2, 3], [7, 8, 9], [4, 5, 6]], [[10, 11, 12], [16, 17, 18], [13, 14, 15]]]) == [[[1, 2, 3], [4, 5, 6], [7, 8, 9]], [[10, 11, 12], [13, 14, 15], [16, 17, 18]]]\", \"assert sort_3d_array([[[1, 0, 3], [2, 1, 2]], [[5, 4, 6], [3, 2, 5]]]) == [...
{ "split": "train", "index": 5942, "acecode_id": "evol_188", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with validating input data. Implement a function called `validate_data(data: dict) -> bool` that checks if all values in the given `data` dictionary are non-empty strings. The function should return `True` if the data is valid (i.e., all values are non-empty stri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_data({'name': 'John', 'age': '30'}) == True\", \"assert validate_data({'name': '', 'age': '30'}) == False\", \"assert validate_data({'name': 'John', 'age': 30}) == False\", \"assert validate_data({'name': 'Alice', 'email': 'alice@example.com'}) == T...
{ "split": "train", "index": 5943, "acecode_id": "oss_6540", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of To-Do items and returns a summary of the open and cancelled items. Each To-Do item is represented as a dictionary with the following keys: 'name' (string), 'reference_type' (string), 'reference_name' (strin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert summarize_todo_status([{'name': '1', 'reference_type': 'Note', 'reference_name': 'note1', 'status': 'Open'}, {'name': '2', 'reference_type': 'Note', 'reference_name': 'note2', 'status': 'Cancelled'}]) == {'Open': 1, 'Cancelled': 1}\", \"assert summarize_todo...
{ "split": "train", "index": 5944, "acecode_id": "oss_17364", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of player objects, where each player has an 'element' (an integer representing the player's ID) and a 'value' (an integer representing the player's budget value). Write a function `fill_session_team(team_id: int, players: List[Dict[str, int]], session_id: i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fill_session_team(1, [{'element': 101, 'value': 50}, {'element': 102, 'value': 60}, {'element': 103, 'value': 70}], 1) == [101, 102, 103]\", \"assert fill_session_team(2, [{'element': 201, 'value': 55}], 2) == [201]\", \"assert fill_session_team(3, [{'elemen...
{ "split": "train", "index": 5945, "acecode_id": "bigcode_python_fns_22442", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that merges two dictionaries, handling cases where the same keys exist in both dictionaries. Your function should take three dictionaries as input: `a`, `b`, and `res`. The function should merge dictionaries `a` and `b`, ensuri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_and_compare({'A': 1}, {'B': 2}, {'A': 1, 'B': 2}) == True\", \"assert merge_and_compare({'A': 1}, {'A': 2}, {'A': 2}) == True\", \"assert merge_and_compare({'A': 1}, {'A': 1}, {'A': 1}) == True\", \"assert merge_and_compare({}, {'A': 1}, {'A': 1}) == T...
{ "split": "train", "index": 5946, "acecode_id": "oss_37324", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a parameter annotation and a default value, implement a function `get_affiliation(annotation: Any, default: Any) -> Optional[str]` that classifies the affiliation of the parameter based on the following rules: \n1. If the annotation is of type `Request`, return the string...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_affiliation(Request, None) == 'request'\", \"assert get_affiliation(None, Form()) == 'form'\", \"assert get_affiliation(None, File()) == 'form'\", \"assert get_affiliation([int], None) == int\", \"assert get_affiliation([str], None) == str\", \"assert ge...
{ "split": "train", "index": 5947, "acecode_id": "bigcode_python_fns_23250", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the creation of a repository object for a version control system. Your function should take the following parameters: `login_or_token` (str), `base_url` (str), `full_name` (str), `name` (str), `completed` (bool). The functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_test_repo('', 'https://github.com/yaleman/github_linter/', 'testuser/test1', 'test1', True) == {'requester': {'login_or_token': '', 'base_url': 'https://github.com/yaleman/github_linter/', 'retry': False, 'password': None, 'jwt': None, 'timeout': 30...
{ "split": "train", "index": 5948, "acecode_id": "bigcode_python_fns_39459", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with constructing a sub-graph for a neural network architecture. Implement a function `build_sub_graph(source: str, num_layers: int) -> List[str]` that takes a source node name as a string and an integer representing the number of layers to be added to the sub-gr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_sub_graph('Input', 3) == ['Input', 'Layer 1', 'Layer 2', 'Layer 3']\", \"assert build_sub_graph('Start', 0) == ['Start']\", \"assert build_sub_graph('Node A', 1) == ['Node A', 'Layer 1']\", \"assert build_sub_graph('Node B', 5) == ['Node B', 'Layer 1',...
{ "split": "train", "index": 5949, "acecode_id": "oss_14710", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a string of words as input, reverses the order of the words, and then reverses each individual word. The function should return a list of strings where each string is a word with its position index in the reversed list. The input string may contain p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_words('Artificial Intelligence!') == ['0 - ecnegilletnI', '1 - laicifitrA']\", \"assert reverse_words('Hello, World!') == ['0 - dlroW', '1 - olleH']\", \"assert reverse_words('Python is fun.') == ['0 - nuf', '1 - si', '2 - nohtyP']\", \"assert revers...
{ "split": "train", "index": 5950, "acecode_id": "evol_6130", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simplified version of a version control system for cherry-picking commits. Given a list of commits represented by their hexadecimal strings, your function should return a list of commands that can be executed to cherr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cherry_pick_commits('new-feature', 'v1.0.0', ['abc123', 'def456', 'ghi789']) == ['git checkout v1.0.0 -b new-feature', 'git cherry-pick abc123', 'git cherry-pick def456', 'git cherry-pick ghi789']\", \"assert cherry_pick_commits('bugfix', 'v2.1.0', ['xyz987'...
{ "split": "train", "index": 5951, "acecode_id": "bigcode_python_fns_26662", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `s` consisting of lowercase English letters, write a function `longest_substring_length` that returns the length of the longest substring without repeating characters. A substring is defined as a contiguous sequence of characters within the string. For example, f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_substring_length('abcabcbb') == 3\", \"assert longest_substring_length('bbbbb') == 1\", \"assert longest_substring_length('pwwkew') == 3\", \"assert longest_substring_length('') == 0\", \"assert longest_substring_length('abcd') == 4\", \"assert longe...
{ "split": "train", "index": 5952, "acecode_id": "oss_34525", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the number of points scored in several games by a player. Your task is to implement a function that calculates the average score of the player, rounded to the nearest integer. If the average score is exactly halfway between two inte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_score([10, 20, 30]) == 20\", \"assert calculate_average_score([1, 2, 3, 4, 5]) == 3\", \"assert calculate_average_score([7, 8, 9]) == 8\", \"assert calculate_average_score([10, 10, 10, 10]) == 10\", \"assert calculate_average_score([1, 2, 3...
{ "split": "train", "index": 5953, "acecode_id": "bigcode_python_fns_25843", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a complex number represented as a tuple (a, b) where a is the real part and b is the imaginary part, implement a function `complex_abs_grad(complex_num: Tuple[float, float], grad: float) -> Tuple[float, float]` that calculates the gradient of the absolute value of the com...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert complex_abs_grad((3, 4), 1) == (0.6, 0.8)\", \"assert complex_abs_grad((0, 0), 10) == (0.0, 0.0)\", \"assert complex_abs_grad((2, 2), 1) == (0.7071067811865475, 0.7071067811865475)\", \"assert complex_abs_grad((5, 12), 1) == (0.38461538461538464, 0.923076923...
{ "split": "train", "index": 5954, "acecode_id": "bigcode_python_fns_8679", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string as input and returns a list of all valid email addresses found in that string. A valid email address is defined by the regex pattern: r'\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Z|a-z]{2,}\\b'. Handle any exceptions that may arise during ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_emails_in_string('test@example.com') == ['test@example.com']\", \"assert find_emails_in_string('Please contact us at support@company.org for assistance.') == ['support@company.org']\", \"assert find_emails_in_string('Invalid emails: test@.com, @example....
{ "split": "train", "index": 5955, "acecode_id": "evol_34049", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Create a function that evaluates the performance of a classification model based on true labels and predicted labels. The function should support weighted classes and allow for multiple scoring methods, specifically 'accuracy', 'precision', and 'recall'. If no weights are provi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_metric([0, 1, 2], [0, 1, 2], None, 'accuracy') == 1.0\", \"assert evaluate_metric([0, 1, 2], [0, 1, 1], None, 'accuracy') == 0.6666666666666666\", \"assert evaluate_metric([0, 0, 1], [1, 0, 1], None, 'accuracy') == 0.6666666666666666\", \"assert eva...
{ "split": "train", "index": 5956, "acecode_id": "evol_512", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a directed acyclic graph represented as an adjacency matrix, determine if there is a path from a source node to a destination node. The graph is represented as a 2D list where the element at row i and column j is 1 if there is a directed edge from node i to node j, and 0 ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert path_exists([[0, 1], [0, 0]], 0, 1) == True\", \"assert path_exists([[0, 1], [0, 0]], 1, 0) == False\", \"assert path_exists([[0, 0], [0, 0]], 0, 1) == False\", \"assert path_exists([[0, 1, 0], [0, 0, 1], [0, 0, 0]], 0, 2) == True\", \"assert path_exists([[0...
{ "split": "train", "index": 5957, "acecode_id": "bigcode_python_fns_33751", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `find_max_k_numbers(arr, k)` that takes in an array of integers `arr` and an integer `k`, and returns the maximum `k` numbers from the array in descending order. If `k` is greater than the length of the array, return all the numbers sorted in descending order.\...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_k_numbers([1, 2, 3, 4, 5, 6, 7, 8], 4) == [8, 7, 6, 5]\", \"assert find_max_k_numbers([10, 20, 30, 40, 50], 3) == [50, 40, 30]\", \"assert find_max_k_numbers([5, 5, 5, 5, 5], 2) == [5, 5]\", \"assert find_max_k_numbers([], 2) == []\", \"assert find_...
{ "split": "train", "index": 5958, "acecode_id": "evol_23771", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of image paths and returns the average brightness of the images. The brightness of an image is determined by the numerical value found in the file name. The file names follow a specific format: 'image_xxx.jpg'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_brightness(['path/to/image_075.jpg', 'path/to/image_100.jpg', 'path/to/image_050.jpg']) == 75.0\", \"assert average_brightness(['image_001.jpg', 'image_002.jpg', 'image_003.jpg']) == 2.0\", \"assert average_brightness(['image_100.jpg', 'image_100.jpg...
{ "split": "train", "index": 5959, "acecode_id": "oss_25904", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a report based on employee names. The function `generate_report(name_prefix)` takes a string `name_prefix` as input and returns the count of names that start with the given prefix from a predefined list of employee n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_report('Ja') == 2\", \"assert generate_report('Micha') == 1\", \"assert generate_report('A') == 0\", \"assert generate_report('K') == 0\", \"assert generate_report('') == 5\", \"assert generate_report('Michael') == 1\", \"assert generate_report('Jes...
{ "split": "train", "index": 5960, "acecode_id": "oss_33117", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that rearranges the list such that the values at the even indices are sorted in ascending order, while the values at the odd indices remain unchanged. The function should return the modified list. For example, if the input is [5, 6, 3,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_even([1]) == [1]\", \"assert sort_even([1, 2]) == [1, 2]\", \"assert sort_even([2, 1]) == [2, 1]\", \"assert sort_even([]) == []\", \"assert sort_even([4, 3, 2, 1]) == [2, 3, 4, 1]\", \"assert sort_even([10, 20, 30, 40]) == [10, 20, 30, 40]\", \"assert ...
{ "split": "train", "index": 5961, "acecode_id": "bigcode_python_fns_39376", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `show_employee_details(occupation: str, tenure: int) -> str` that takes an employee's occupation and tenure (in years) as parameters and returns a string displaying the employee's details in the format: 'Occupation: {occupation}, Tenure: {tenure} years'.\nP...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert show_employee_details('Software Engineer', 5) == 'Occupation: Software Engineer, Tenure: 5 years'\", \"assert show_employee_details('Data Scientist', 3) == 'Occupation: Data Scientist, Tenure: 3 years'\", \"assert show_employee_details('Product Manager', 7) ...
{ "split": "train", "index": 5962, "acecode_id": "evol_33395", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a function `f(n)`, implement it to take a single integer argument 'n' and return a list of length 'n'. For each index 'i' in the list (where the index starts from 1), if 'i' is even, the function should return the factorial of 'i'. If 'i' is odd, the function should retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert f(1) == [1]\", \"assert f(2) == [1, 2]\", \"assert f(3) == [1, 2, 6]\", \"assert f(4) == [1, 2, 6, 24]\", \"assert f(5) == [1, 2, 6, 24, 15]\", \"assert f(6) == [1, 2, 6, 24, 15, 720]\", \"assert f(7) == [1, 2, 6, 24, 15, 720, 28]\", \"assert f(8) == [1, 2, ...
{ "split": "train", "index": 5963, "acecode_id": "evol_15162", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `flip_box` that takes a 2D list representing a box of characters and returns the box flipped vertically. The input box is represented as a list of strings, where each string represents a row in the box. Flipping the box vertically mea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flip_box(['abc', 'def', 'ghi']) == ['ghi', 'def', 'abc']\", \"assert flip_box(['hello', 'world']) == ['world', 'hello']\", \"assert flip_box(['a', 'b', 'c', 'd']) == ['d', 'c', 'b', 'a']\", \"assert flip_box(['one', 'two', 'three', 'four']) == ['four', 'thre...
{ "split": "train", "index": 5964, "acecode_id": "oss_28864", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the creation of a new employee in a system. The function should take the following parameters: an employee ID (idir), a status (status), a location (location), and a phone number (phone). The function should return a dictio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_employee('E123', 'active', 'New York', '123-456-7890') == {'idir': 'E123', 'status': 'active', 'location': 'New York', 'phone': '123-456-7890'}\", \"assert create_employee('E456', 'inactive', 'Los Angeles', '987-654-3210') == {'idir': 'E456', 'status'...
{ "split": "train", "index": 5965, "acecode_id": "bigcode_python_fns_22621", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing a list of life satisfaction scores for different countries. Given a list of tuples where each tuple contains a country name and its corresponding life satisfaction score, write a function that calculates the average life satisfaction score for each...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_life_satisfaction([('Country A', 7.5), ('Country A', 6.5), ('Country B', 8.0)]) == {'Country B': 8.0, 'Country A': 7.0}\", \"assert average_life_satisfaction([('Country X', 5.0), ('Country Y', 6.0), ('Country X', 7.0)]) == {'Country X': 6.0, 'Country...
{ "split": "train", "index": 5966, "acecode_id": "oss_37578", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of tuples, where each tuple contains a person's unique identifier followed by their scores in three distinct subjects, write a Python function named `average_score` that calculates the average score for each individual. The function should return a dictionary where...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_score([(1, 90, 80, 70), (2, 60, 70, 80)]) == {1: 80.0, 2: 70.0}\", \"assert average_score([(1, 100, 100, 100), (2, 50, 50, 50), (3, 90, 90, 90)]) == {1: 100.0, 2: 50.0, 3: 90.0}\", \"assert average_score([(1, 0, 0, 0), (2, 10, 20, 30)]) == {1: 0.0, 2...
{ "split": "train", "index": 5967, "acecode_id": "evol_26266", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that parses a command message string into a target and a list of arguments. The command message follows a specific format: it starts with a command, followed by a target, and then optional arguments. Your function should take a string...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_command('/status target1 arg1 arg2') == ('target1', ['arg1', 'arg2'])\", \"assert parse_command('/status target2') == ('target2', [])\", \"assert parse_command('/status target3 arg1') == ('target3', ['arg1'])\", \"assert parse_command('/status target4 ...
{ "split": "train", "index": 5968, "acecode_id": "bigcode_python_fns_12538", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a 2D array of integers representing pixel values. Your task is to implement a function that calculates the aperture sum of each pixel in the array. The aperture sum of a pixel is defined as the sum of the values within a square-shaped aperture centered at that pix...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert aperture_sum([[1, 1, 1], [1, 1, 1], [1, 1, 1]], 1) == [[1, 1, 1], [1, 1, 1], [1, 1, 1]]\", \"assert aperture_sum([[5, 5], [5, 5]], 2) == [[20, 20], [20, 20]]\", \"assert aperture_sum([[1, 2], [3, 4]], 1) == [[1, 2], [3, 4]]\", \"assert aperture_sum([[1]], 1)...
{ "split": "train", "index": 5969, "acecode_id": "oss_33526", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates an external API call using a given API ID. Your function should take a string parameter representing the API ID, construct a URL based on that ID, and return a mock response that includes the URL used for the request. The U...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert call_api('12345') == 'https://api.example.com/12345/endpoint'\", \"assert call_api('abcde') == 'https://api.example.com/abcde/endpoint'\", \"assert call_api('xyz987') == 'https://api.example.com/xyz987/endpoint'\", \"assert call_api('testApi') == 'https://ap...
{ "split": "train", "index": 5970, "acecode_id": "oss_21200", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that counts the number of consonants in a given input string. Consonants are defined as the letters 'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', and 'z', both in uppercase and lowercase. The function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert consonant_count('') == 0\", \"assert consonant_count('AEIOU') == 0\", \"assert consonant_count('Hello, World!') == 7\", \"assert consonant_count('Python 3.9') == 5\", \"assert consonant_count('The quick brown fox jumps over the lazy dog') == 24\", \"assert c...
{ "split": "train", "index": 5971, "acecode_id": "evol_18290", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a string `mode`, an integer `valid_id`, an integer `pred_id`, an integer `overlap_step`, and an integer `patch_size`. Your task is to generate a list of filenames based on the given `mode`. If the `mode` is 'train', return a list of filenames for subjects 1 to 10,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_filenames('train', 3, 5, 7, 2) == ['subject-1.tfrecords', 'subject-2.tfrecords', 'subject-4.tfrecords', 'subject-5.tfrecords', 'subject-6.tfrecords', 'subject-7.tfrecords', 'subject-8.tfrecords', 'subject-9.tfrecords', 'subject-10.tfrecords']\", \"a...
{ "split": "train", "index": 5972, "acecode_id": "bigcode_python_fns_17678", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a 2D array of integers, compute the standard deviation of all the values in the array. The array contains 'n' rows and 'm' columns, where each value ranges from -10^6 to 10^6. You need to implement a function `find_std_dev(arr: List[List[int]]) -> float` that returns the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_std_dev([[1, 2], [3, 4], [5, 6]]) == 1.707825127659933\", \"assert find_std_dev([[0, 0], [0, 0], [0, 0]]) == 0.0\", \"assert find_std_dev([[-1, -2], [-3, -4], [-5, -6]]) == 1.707825127659933\", \"assert find_std_dev([[1]]) == 0.0\", \"assert find_std_de...
{ "split": "train", "index": 5973, "acecode_id": "evol_8200", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a Python dictionary representing a hierarchical structure of geographical locations and their corresponding numeric codes. The keys in the dictionary represent the names of the locations, and the values represent the numeric codes assigned to them. The higher the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_location({'world': 1, 'continent': 2, 'country': 3, 'province': 4, 'district': 5, 'city': 6, 'market': 7, 'other': 8, 'coordinate': 9}, 'world') == 1\", \"assert find_location({'world': 1, 'continent': 2, 'country': 3, 'province': 4, 'district': 5, 'cit...
{ "split": "train", "index": 5974, "acecode_id": "oss_14363", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `process_numbers` that takes a list of integers as input and returns a list of integers where each integer is doubled if it is even, and tripled if it is odd. The output list should maintain the original order of the integers. Your fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_numbers([]) == []\", \"assert process_numbers([1]) == [3]\", \"assert process_numbers([2]) == [4]\", \"assert process_numbers([1, 2]) == [3, 4]\", \"assert process_numbers([2, 3]) == [4, 9]\", \"assert process_numbers([4, 5, 6]) == [8, 15, 12]\", \"a...
{ "split": "train", "index": 5975, "acecode_id": "bigcode_python_fns_3279", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates selecting and executing different training methods for agents in a reinforcement learning environment. The function should take a string input representing a training method and return a corresponding message indicating whe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert select_training_method('train_agent') == 'Executing train_agent...'\", \"assert select_training_method('train_agent_with_evaluation') == 'Executing train_agent_with_evaluation...'\", \"assert select_training_method('train_agent_async') == 'Executing train_ag...
{ "split": "train", "index": 5976, "acecode_id": "oss_10696", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `construct_user_profile` that takes the following parameters: `name` (a string), `age` (a non-negative integer), `address` (an optional string), `job_title` (an optional string), and `contact_details` (an optional string). The function should return a JSON ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_user_profile('John', 25) == '{\\\"Name\\\": \\\"John\\\", \\\"Age\\\": 25, \\\"Address\\\": \\\"Not provided\\\", \\\"Job Title\\\": \\\"Not provided\\\", \\\"Contact Details\\\": \\\"Not provided\\\"}'\", \"assert construct_user_profile('Alice', 3...
{ "split": "train", "index": 5977, "acecode_id": "evol_13661", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `manage_notes` that simulates the basic operations of a note-taking application. The function should take three parameters: `operation`, `note_id`, and `note_content`. The `operation` can be one of the following strings: 'create', 'read',...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_notes('create', 1, 'First note') == 'Note created'\", \"assert manage_notes('create', 2, 'Second note') == 'Note created'\", \"assert manage_notes('read', 3, '') == 'Note not found'\", \"assert manage_notes('read', 1, '') == 'Note not found'\", \"asse...
{ "split": "train", "index": 5978, "acecode_id": "oss_13683", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of user profiles and returns their string representations based on their confirmation status. Each user profile is represented as a dictionary with the following keys: 'full_name', 'username', 'email', and 'is_confir...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert represent_user_profiles([{'full_name': 'John Doe', 'username': 'jdoe', 'email': 'jdoe@example.com', 'is_confirmed': True}]) == ['John Doe (jdoe)']\", \"assert represent_user_profiles([{'full_name': 'Jane Smith', 'username': 'jsmith', 'email': 'jsmith@example...
{ "split": "train", "index": 5979, "acecode_id": "oss_4368", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of 3D points representing the vertices of a surface. Each point is defined by its (x, y, z) coordinates. Your task is to create a function that takes in this list of points and returns a new list of points where each coordinate of every point is increased b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert translate_surface([(1, 2, 3)], 1) == [(2, 3, 4)]\", \"assert translate_surface([(0, 0, 0)], 5) == [(5, 5, 5)]\", \"assert translate_surface([(1, 1, 1), (2, 2, 2)], 2) == [(3, 3, 3), (4, 4, 4)]\", \"assert translate_surface([], 3) == []\", \"assert translate_...
{ "split": "train", "index": 5980, "acecode_id": "bigcode_python_fns_24880", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, `y_pred` and `y_true`, representing predicted and true class labels, respectively. Your task is to implement a function `false_prediction_pairs(y_pred: List[int], y_true: List[int]) -> Tuple[List[Tuple[int, int]], List[int]]` that identifies...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert false_prediction_pairs([1, 2, 3], [1, 2, 3]) == ([], [])\", \"assert false_prediction_pairs([1, 1, 1], [2, 2, 2]) == ([(1, 2)], [3])\", \"assert false_prediction_pairs([5, 5, 5, 5], [5, 5, 5, 5]) == ([], [])\", \"assert false_prediction_pairs([10, 20, 30, 40...
{ "split": "train", "index": 5981, "acecode_id": "bigcode_python_fns_16899", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given two arrays of integers, determine if every element in the first array is less than the corresponding element in the second array. Implement a function that takes two arrays as input and returns True if all elements in the first array are less than those in the second arra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_arrays([1, 2, 3], [2, 3, 4]) == True\", \"assert compare_arrays([3, 6, 9], [2, 4, 8]) == False\", \"assert compare_arrays([0, 0, 0], [1, 1, 1]) == True\", \"assert compare_arrays([-1, -2, -3], [0, 0, 0]) == True\", \"assert compare_arrays([5, 6, 7], ...
{ "split": "train", "index": 5982, "acecode_id": "evol_28239", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that checks which numbers in the list are Armstrong numbers. An Armstrong number is defined as a number where the sum of its own digits each raised to the power of the number of digits equals the number itself. The function should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_armstrong_numbers([371, 123, 153, 9474]) == [371, 153, 9474]\", \"assert find_armstrong_numbers([5, 6, 7, 8]) == [5, 6, 7, 8]\", \"assert find_armstrong_numbers([0, 1, 2, 3, 4]) == [0, 1, 2, 3, 4]\", \"assert find_armstrong_numbers([10, 20, 30]) == 'No ...
{ "split": "train", "index": 5983, "acecode_id": "evol_14711", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating a list of dictionaries representing data entries for a specific data model. Each dictionary can contain various keys corresponding to different attributes, including 'file_type', 'criteria_definition', 'pmag_result_name', and others. Your function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_data_entries([{'file_type': 'er_locations', 'er_location_name': 'Location1'}], {'er_locations': {'er_location_name': 'string'}}) == True\", \"assert validate_data_entries([{'file_type': 'er_locations', 'er_location_name': ''}], {'er_locations': {'er...
{ "split": "train", "index": 5984, "acecode_id": "bigcode_python_fns_47196", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with extracting specific information from a given configuration represented as a dictionary in Python. The configuration dictionary has the following structure: \n\n```python\nconfig = {\n 'system_name': 'MySystem',\n 'version': '1.0',\n 'settings': {\n 'ma...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_config_info({'system_name': 'MySystem', 'settings': {'max_connections': 100, 'timeout_seconds': 30, 'log_level': 'info', 'enabled_features': ['feature1', 'feature2', 'feature3']}}) == {'system_name': 'MySystem', 'max_connections': 100, 'timeout_secon...
{ "split": "train", "index": 5985, "acecode_id": "oss_22094", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that computes a health score based on a patient's platelet count measured in number per microliter. The scoring system is as follows: if the platelet count is less than 20,000, the score is 4; if it is between 20,000 and 49,999, the score...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_health_score(19999) == 4\", \"assert compute_health_score(20000) == 3\", \"assert compute_health_score(49999) == 3\", \"assert compute_health_score(50000) == 2\", \"assert compute_health_score(99999) == 2\", \"assert compute_health_score(100000) == 1...
{ "split": "train", "index": 5986, "acecode_id": "bigcode_python_fns_26053", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing doses and a target dose, write a function that calculates the average of the doses that match the target dose. If there are no matching doses, return 0. The function should take in two parameters: a list of integers `doses` and an integer `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_dose([10, 20, 10, 30, 40], 10) == 10.0\", \"assert calculate_average_dose([5, 15, 5, 25, 35], 5) == 5.0\", \"assert calculate_average_dose([1, 2, 3, 4, 5], 6) == 0.0\", \"assert calculate_average_dose([2, 2, 2, 2, 2], 2) == 2.0\", \"assert ...
{ "split": "train", "index": 5987, "acecode_id": "bigcode_python_fns_38689", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a URL as input, retrieves the data from that URL, and parses it into JSON format. The function should return the parsed JSON data. You may use the 'urllib' library to fetch the data and the 'json' library to parse it. The function should handle any e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_and_process_json('https://www.example-api.com/404') is None\", \"assert get_and_process_json('https://www.example-api.com/timeout') is None\", \"assert get_and_process_json('https://www.example-api.com/badjson') is None\", \"assert get_and_process_json('...
{ "split": "train", "index": 5988, "acecode_id": "evol_22357", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates loading a model configuration from a given dictionary. The function should take a configuration dictionary, a dictionary of hyperparameter overrides, a vocabulary file name, and a mode string as input. It should return a ne...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_model({'model': 'MyModel', 'model_params': {}}, {}, 'vocab.txt', 'training') == {'model': 'MyModel', 'model_params': {'decoder.params': {'max_decode_length': 5}}, 'vocab_source': 'vocab.txt', 'vocab_target': 'vocab.txt'}\", \"assert load_model({'model':...
{ "split": "train", "index": 5989, "acecode_id": "bigcode_python_fns_6684", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `count_unique_primes_below(n: int) -> int` that returns the total number of unique prime numbers that exist below the given number `n`. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_primes_below(10) == 4\", \"assert count_unique_primes_below(20) == 8\", \"assert count_unique_primes_below(30) == 10\", \"assert count_unique_primes_below(50) == 15\", \"assert count_unique_primes_below(100) == 25\", \"assert count_unique_primes...
{ "split": "train", "index": 5990, "acecode_id": "evol_19430", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of predictions and a corresponding list of actual labels. Each prediction is a floating-point number between 0.0 and 1.0, and each label is a floating-point number. Your task is to implement a function that calculates the true positive rate (TPR), which is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert tpr([0.1, 0.2, 0.3, 0.4], [0.0, 0.0, 0.0, 0.0]) == 0.0\", \"assert tpr([0.5, 0.9, 0.8], [0.6, 0.7, 0.9]) == 1.0\", \"assert tpr([], []) == 0.0\", \"assert tpr([0.6, 0.6, 0.5], [0.6, 0.6, 0.5]) == 1.0\", \"assert tpr([0.7, 0.6, 0.5], [0.8, 0.8, 0.7]) == 1.0\"...
{ "split": "train", "index": 5991, "acecode_id": "bigcode_python_fns_45262", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `generate_fibonacci(n: int) -> List[int]` that generates the first `n` numbers in the Fibonacci sequence, where `n` is a positive integer. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_fibonacci(1) == [0]\", \"assert generate_fibonacci(2) == [0, 1]\", \"assert generate_fibonacci(3) == [0, 1, 1]\", \"assert generate_fibonacci(4) == [0, 1, 1, 2]\", \"assert generate_fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert generate_fibonacci(6) =...
{ "split": "train", "index": 5992, "acecode_id": "evol_16286", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple user profile system for a social media platform. Your goal is to create a function called `manage_user_profile` that accepts a list of actions and returns the corresponding user profile information based on those actions. Each action is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_user_profile([('set', 0, 'Male'), ('set', 1, 'profile.jpg'), ('set', 2, 'New York'), ('set', 3, 'Software engineer'), ('get', 0)]) == ['Male']\", \"assert manage_user_profile([('set', 0, 'Female'), ('get', 1), ('set', 1, 'avatar.png'), ('get', 1)]) ==...
{ "split": "train", "index": 5993, "acecode_id": "oss_14105", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with logging warning messages for unknown skill classes that are not declared in a configuration file. Write a function `log_warning_messages(unknown_classes: Set[str], skill_type: str, config_path: str) -> List[str]` that takes a set of unknown class names, a st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_warning_messages({'unknown_class_1', 'unknown_class_2'}, 'type', 'path') == [\\\"Class unknown_class_1 of type type found but not declared in the configuration file path.\\\", \\\"Class unknown_class_2 of type type found but not declared in the configura...
{ "split": "train", "index": 5994, "acecode_id": "bigcode_python_fns_7498", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a string representing a line of code that may contain comments in the form of '//' (single-line comments). Your task is to analyze the string and identify potential formatting issues with the comments. Specifically, you need to check for the following conditions: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_comments('int main() { //TODO: Implement this function') == 'No errors found'\", \"assert check_comments('int a = 1; // This is a comment') == 'No errors found'\", \"assert check_comments('float c = 3.14; //TODO: Implement the calculation') == 'No erro...
{ "split": "train", "index": 5995, "acecode_id": "bigcode_python_fns_23840", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of metadata items as input and returns a list of these items iterated through one by one. The function should simulate the behavior of an iterator by yielding each metadata item until all items have been returned. If...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert iterate_metadata([]) == []\", \"assert iterate_metadata(['a', 'b', 'c']) == ['a', 'b', 'c']\", \"assert iterate_metadata(['apple', 'banana', 'cherry']) == ['apple', 'banana', 'cherry']\", \"assert iterate_metadata(['item1']) == ['item1']\", \"assert iterate_...
{ "split": "train", "index": 5996, "acecode_id": "oss_31439", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_inventory()` that constructs a linked list containing alphanumeric characters starting from 'A' to 'J'. The function should return the head of the linked list, where each node contains a single character from 'A' to 'J'.\nPlease reason step by step,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_inventory().data == 'A'\", \"assert create_inventory().next.data == 'B'\", \"assert create_inventory().next.next.data == 'C'\", \"assert create_inventory().next.next.next.data == 'D'\", \"assert create_inventory().next.next.next.next.data == 'E'\", \"...
{ "split": "train", "index": 5997, "acecode_id": "evol_14616", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given two endpoints of a line represented by their coordinates in the format of tuples (x1, y1) and (x2, y2). You also have a third coordinate (x, y) where you need to find the corresponding y-coordinate on the line defined by the two endpoints using linear interpolatio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert interpolate_point((0, 0), (2, 2), (1, 0)) == (1, 1.0)\", \"assert interpolate_point((1, 3), (4, 3), (2, 0)) == (2, 3.0)\", \"assert interpolate_point((-1, -1), (1, 1), (0, 0)) == (0, 0.0)\", \"assert interpolate_point((0, 0), (10, 10), (5, 0)) == (5, 5.0)\",...
{ "split": "train", "index": 5998, "acecode_id": "oss_18112", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a string representing a valid YAML document and returns its contents as a dictionary. The function should raise a RuntimeError if the YAML is invalid or cannot be parsed. Implement a function called `parse_yaml(yaml_string: str)...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_yaml('key: value') == {'key': 'value'}\", \"assert parse_yaml('key1: value1\\\\nkey2: value2') == {'key1': 'value1', 'key2': 'value2'}\", \"assert parse_yaml('list:\\\\n - item1\\\\n - item2') == {'list': ['item1', 'item2']}\", \"assert parse_yaml('n...
{ "split": "train", "index": 5999, "acecode_id": "bigcode_python_fns_26602", "num_tests": 16 }