data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes in one or two string arguments representing the name of an \"Orb\" and its permission level. The function should return a dictionary with two keys: 'orbname' and 'perm'. If the first argument is a string, it should be assig... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_orb('Fire Orb') == {'orbname': 'Fire Orb', 'perm': None}\", \"assert create_orb('Water Orb', 'Read') == {'orbname': 'Water Orb', 'perm': 'Read'}\", \"assert create_orb('Earth Orb', 'Write') == {'orbname': 'Earth Orb', 'perm': 'Write'}\", \"assert crea... | {
"split": "train",
"index": 2300,
"acecode_id": "oss_28914",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates loading weights into a model from a specified file. Your function should take in a model represented as a string (the model name), a filename (the name of the weights file), an optional verbosity flag, and an optional f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_model_weights('ResNet', 'weights.pth') == 'Weights loaded successfully.'\", \"assert load_model_weights('VGG', 'model_weights.pth', 1) == 'Weights loaded successfully.'\", \"assert load_model_weights('Inception', 'inception_weights.pth', 0) == 'Weights ... | {
"split": "train",
"index": 2301,
"acecode_id": "bigcode_python_fns_12321",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing configuration arguments for a build system. Your task is to validate these arguments based on certain criteria. Implement a function `validate_args(args: Dict[str, Union[str, bool]]) -> Tuple[str, str, str, str, str, str, bool, bool, str,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_args({'base_root': 'C:/project', 'diff_root': 'C:/project/diff', 'scratch_root': 'C:/project/scratch', 'skip_baseline_build': False, 'skip_diffs': True, 'target_branch': 'main', 'commit_hash': 'abc123', 'ci_arch': 'x64'}) == ('x64', 'C:/project', 'C... | {
"split": "train",
"index": 2302,
"acecode_id": "bigcode_python_fns_9474",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates autocomplete suggestions based on a given input text. The function will take an input string and return a list of suggested completions by appending predefined suffixes to the input text. The function signature is as fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_autocomplete_suggestions('test') == ['test suggestion 1', 'test suggestion 2', 'test suggestion 3']\", \"assert generate_autocomplete_suggestions('hello') == ['hello suggestion 1', 'hello suggestion 2', 'hello suggestion 3']\", \"assert generate_aut... | {
"split": "train",
"index": 2303,
"acecode_id": "oss_36280",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with manipulating a 2D grid that represents a schematic structure in a game. The grid consists of elements that can either be empty (0) or filled (1). Your goal is to write a function `manipulate_grid(grid, operation)` that takes in a 2D list `grid` and a string ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manipulate_grid([[1, 0], [0, 1]], 'rotate') == [[0, 1], [1, 0]]\", \"assert manipulate_grid([[1, 1], [0, 0]], 'rotate') == [[0, 1], [0, 1]]\", \"assert manipulate_grid([[1, 0, 1], [0, 1, 0]], 'mirror') == [[1, 0, 1], [0, 1, 0]]\", \"assert manipulate_grid([[... | {
"split": "train",
"index": 2304,
"acecode_id": "oss_6711",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given three integers a, b, and c, write a function called swap_circular that swaps their values in a circular pattern. The value of a should go to b, the value of b should go to c, and the value of c should go to a. The function should return the new values of a, b, and c as a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert swap_circular(1, 2, 3) == (2, 3, 1)\", \"assert swap_circular(5, 8, 12) == (8, 12, 5)\", \"assert swap_circular(-1, 0, 1) == (0, 1, -1)\", \"assert swap_circular(10, 20, 30) == (20, 30, 10)\", \"assert swap_circular(100, 200, 300) == (200, 300, 100)\", \"ass... | {
"split": "train",
"index": 2305,
"acecode_id": "evol_14271",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function `get_data` that processes input parameters for a natural language processing (NLP) task. The function takes the following parameters: `task` (a string representing the NLP task), `subtask` (a string representing the specific subtask), `num... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_data('imdb', 'german', 2, '/data', 'tokenizer', 128, 0.2) == 'Preprocessing IMDb dataset...'\", \"assert get_data('imdb', 'multi', 3, '/data', 'tokenizer', 256, 0.3) == 'Preprocessing IMDb dataset...'\", \"assert get_data('imdb', 'german', 2, '/data', 't... | {
"split": "train",
"index": 2306,
"acecode_id": "oss_6303",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats a user ID string for use in a messaging application. The format should wrap the user ID in special tags that are specific to the application. Write a function `format_user_id(user_id: str) -> str` that takes a string `user_id... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_user_id('U12345') == '<@U12345>'\", \"assert format_user_id('ABC123') == '<@ABC123>'\", \"assert format_user_id('user_001') == '<@user_001>'\", \"assert format_user_id('john_doe') == '<@john_doe>'\", \"assert format_user_id('') == '<@>'\", \"assert fo... | {
"split": "train",
"index": 2307,
"acecode_id": "bigcode_python_fns_32164",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integer predictions made by a neural network model, where each prediction is an integer representing a class index. You need to implement a function that takes this list of predictions and maps them to their corresponding labels based on a provided mappi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_predicted_labels([0, 1, 2], {0: 'label_0', 1: 'label_1', 2: 'label_2'}) == ['label_0', 'label_1', 'label_2']\", \"assert get_predicted_labels([0, 1, 3], {0: 'label_0', 1: 'label_1', 2: 'label_2'}) == ['label_0', 'label_1', 'unknown']\", \"assert get_pred... | {
"split": "train",
"index": 2308,
"acecode_id": "oss_14157",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a nested JSON string and a list of keys, write a Python function that takes the JSON string and the list of keys as input, and returns the value associated with the last key in the list. The keys represent the nested levels in the JSON string.\nPlease reason step by step,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_nested_value('{\\\"employee\\\":{\\\"name\\\":\\\"John\\\", \\\"department\\\":\\\"Sales\\\", \\\"salary\\\":4000}}', [\\\"employee\\\", \\\"salary\\\"]) == 4000\", \"assert get_nested_value('{\\\"person\\\":{\\\"age\\\":30, \\\"city\\\":\\\"New York\\\"... | {
"split": "train",
"index": 2309,
"acecode_id": "evol_6110",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a floating-point number `t` and a 1D array `operator`. Your task is to implement a function `perform_operation` that performs the following operations based on an optional parameter: If an optional 1D array `op_to_add_in_fb` is provided, return the element-wise su... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert perform_operation(2.0, [1.0, 2.0, 3.0]) == [2.0, 4.0, 6.0]\", \"assert perform_operation(1.5, [4.0, 5.0, 6.0], [1.0, 1.0, 1.0]) == [5.5, 6.5, 7.5]\", \"assert perform_operation(0.0, [7.0, 8.0]) == [0.0, 0.0]\", \"assert perform_operation(3.0, [2.0, 2.0, 2.0]... | {
"split": "train",
"index": 2310,
"acecode_id": "oss_29841",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function that returns a new array containing the elements arranged in descending order. The original array should remain unchanged.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_descending([30, 50, 10, 40]) == [50, 40, 30, 10]\", \"assert sort_descending([5, 1, 3, 2, 4]) == [5, 4, 3, 2, 1]\", \"assert sort_descending([-1, -3, -2, -4]) == [-1, -2, -3, -4]\", \"assert sort_descending([0, 0, 0, 0]) == [0, 0, 0, 0]\", \"assert sort... | {
"split": "train",
"index": 2311,
"acecode_id": "evol_4912",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the definition of a singly linked list node, write a function `hasCycle(head: ListNode) -> bool` that determines whether a cycle exists in the linked list. A cycle occurs when a node's next points back to a previously visited node. The function should return `True` if the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hasCycle(ListNode(1, ListNode(2, ListNode(3, ListNode(4, ListNode(5, None))))) ) == False\", \"assert hasCycle(ListNode(1, ListNode(2, None)) ) == False\", \"assert hasCycle(ListNode(1) ) == False\", \"assert hasCycle(ListNode(1, ListNode(2, ListNode(3, List... | {
"split": "train",
"index": 2312,
"acecode_id": "oss_22647",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of numeric IRC codes and returns a list of corresponding messages. The function should map the following codes to their messages: \n- 375: 'Received start of MOTD'\n- 376: 'Received end of MOTD'\n- 403: 'No such ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_numeric_codes([375, 376, 403]) == ['Received start of MOTD', 'Received end of MOTD', 'No such channel exists']\", \"assert process_numeric_codes([375]) == ['Received start of MOTD']\", \"assert process_numeric_codes([403]) == ['No such channel exists... | {
"split": "train",
"index": 2313,
"acecode_id": "oss_14645",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a payment processing system in Python. Your goal is to create a function `process_payment` that simulates the payment processing logic of a specific payment gateway. The function takes two parameters: `endpoint` (a string representing the paymen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_payment('https://api.example.com/payments', {'amount': 100, 'currency': 'USD', 'card_number': '1234 5678 9012 3456'}) == 'Payment processed successfully'\", \"assert process_payment('https://api.example.com/payments', {'amount': 0, 'currency': 'USD',... | {
"split": "train",
"index": 2314,
"acecode_id": "oss_19065",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a representation for travel package offerings for a travel agency. Each package should include the following details: name, description, image, slug, price, features, and associated places. Your task is to implement a function that takes the package... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_travel_package('Adventure in the Mountains', 'A thrilling mountain adventure package.', 'image1.jpg', 'adventure-mountains', 500, 'Hiking, Camping, Sightseeing') == {'packageName': 'Adventure in the Mountains', 'packageDesc': 'A thrilling mountain adv... | {
"split": "train",
"index": 2315,
"acecode_id": "oss_20063",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a python function named 'find_median' that accepts a list of integers as input and returns their median. If the input is not a list or it contains elements which are not integers, the function should raise a TypeError.\nPlease reason step by step, then write a self-contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_median([1, 3, 2]) == 2\", \"assert find_median([1, 2, 3, 4]) == 2.5\", \"assert find_median([5]) == 5\", \"assert find_median([1, 1, 1]) == 1\", \"assert find_median([-1, 0, 1]) == 0\", \"assert find_median([2, 4, 6, 8]) == 5.0\", \"assert find_median([... | {
"split": "train",
"index": 2316,
"acecode_id": "evol_20701",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a square matrix represented as a list of lists, write a function `get_diagonal_elements(matrix)` that returns a list containing the diagonal elements of the matrix. The diagonal elements are those that run from the top-left corner to the bottom-right corner of the matrix.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_diagonal_elements([[1]]) == [1]\", \"assert get_diagonal_elements([[1, 2], [3, 4]]) == [1, 4]\", \"assert get_diagonal_elements([[5, 6, 7], [8, 9, 10], [11, 12, 13]]) == [5, 9, 13]\", \"assert get_diagonal_elements([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) == [... | {
"split": "train",
"index": 2317,
"acecode_id": "bigcode_python_fns_38585",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a given list of tuples representing CSS class names and their corresponding properties. Each tuple contains the class name as the first element and a variable number of property names as the subsequent elements. Your go... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_css_classes([('class1', 'prop1', 'prop2'), ('class2', 'prop3')]) == {'class1': ['prop1', 'prop2'], 'class2': ['prop3']}\", \"assert process_css_classes([]) == {}\", \"assert process_css_classes([('class1', 'prop1')]) == {'class1': ['prop1']}\", \"ass... | {
"split": "train",
"index": 2318,
"acecode_id": "oss_30019",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of connections representing a set of transformations between input and output parameters in a data processing system. Each connection has a source and a target, and certain rules must be adhered to when making these connections. You need to implement a func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_connect([('C', 'D'), ('E', 'C')], ('C', 'G')) == False\", \"assert can_connect([], ('A', 'B')) == True\", \"assert can_connect([('A', 'B')], ('B', 'C')) == False\", \"assert can_connect([('A', 'B'), ('C', 'D')], ('B', 'E')) == False\", \"assert can_conne... | {
"split": "train",
"index": 2319,
"acecode_id": "bigcode_python_fns_10703",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function named 'create_employee' that takes three parameters: employeeID (string), name (string), and tenure (string). The function should return a dictionary representing an employee with the keys 'employeeID', 'name', and 'tenure' mapped to the corresponding input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_employee('001', 'John Doe', '2 years') == {'employeeID': '001', 'name': 'John Doe', 'tenure': '2 years'}\", \"assert create_employee('002', 'Jane Smith', '3 years') == {'employeeID': '002', 'name': 'Jane Smith', 'tenure': '3 years'}\", \"assert create... | {
"split": "train",
"index": 2320,
"acecode_id": "evol_1286",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `are_anagrams(str1: str, str2: str) -> bool` that takes two strings as input and returns True if they are anagrams of each other, and False otherwise. Two strings are considered anagrams if they can be rearranged to form the same string. For example, 'listen' a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_anagrams('listen', 'silent') == True\", \"assert are_anagrams('triangle', 'integral') == True\", \"assert are_anagrams('apple', 'pale') == False\", \"assert are_anagrams('anagram', 'nagaram') == True\", \"assert are_anagrams('rat', 'car') == False\", \"a... | {
"split": "train",
"index": 2321,
"acecode_id": "evol_29134",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of 2D points represented by their x and y coordinates, write a function `reconstruct_points(points: List[Tuple[int, int]]) -> List[Tuple[int, int]]` that reconstructs the original points by applying a transformation that reflects the points across the x-axis. The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reconstruct_points([(1, 2), (3, 4)]) == [(1, -2), (3, -4)]\", \"assert reconstruct_points([(0, 0), (1, 1), (2, 2)]) == [(0, 0), (1, -1), (2, -2)]\", \"assert reconstruct_points([(5, -5), (-3, 3)]) == [(5, 5), (-3, -3)]\", \"assert reconstruct_points([(10, 10... | {
"split": "train",
"index": 2322,
"acecode_id": "bigcode_python_fns_24317",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of integers and returns the count of elements that are less than or equal to a given threshold. Your function should be named `count_elements_less_than_or_equal_to_threshold`. It should take in a list of integ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_elements_less_than_or_equal_to_threshold([5, 8, 3, 10, 2], 5) == 3\", \"assert count_elements_less_than_or_equal_to_threshold([1, 2, 3, 4, 5], 3) == 3\", \"assert count_elements_less_than_or_equal_to_threshold([10, 20, 30, 40, 50], 25) == 2\", \"assert... | {
"split": "train",
"index": 2323,
"acecode_id": "oss_23779",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that calculates the cumulative product of all integers in the list. The function should take a single argument, a list of integers, and return the cumulative product as an integer. If the list is empty, the function should return 1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_list([]) == 1\", \"assert product_list([1]) == 1\", \"assert product_list([2]) == 2\", \"assert product_list([1, 2, 3]) == 6\", \"assert product_list([4, 5]) == 20\", \"assert product_list([-1, -2, -3]) == -6\", \"assert product_list([0, 1, 2]) == 0\... | {
"split": "train",
"index": 2324,
"acecode_id": "evol_27094",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a dictionary where keys are personal names and values are their occurrence frequencies. The function should return a list of names that have the lowest occurrence frequency. If there is more than one name with the lowest frequency, sort these nam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert names_with_lowest_frequency({'Jon': 3, 'Arya': 1, 'Tyrion': 1, 'Cersei': 1}) == ['Arya', 'Cersei', 'Tyrion']\", \"assert names_with_lowest_frequency({'Alice': 2, 'Bob': 2, 'Charlie': 2}) == ['Alice', 'Bob', 'Charlie']\", \"assert names_with_lowest_frequency(... | {
"split": "train",
"index": 2325,
"acecode_id": "evol_28418",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a given code snippet to identify the first occurrence of specific keywords in the code. Your function should take two parameters: a string `code` representing multiple lines of code, and a list of strings `keywords` rep... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_keyword_index('def my_function():\\\\n print(\\\"Hello, World!\\\")\\\\n', ['print']) == 1\", \"assert find_keyword_index('x = 5\\\\ny = 10\\\\nprint(x + y)\\\\n', ['print']) == 2\", \"assert find_keyword_index('for i in range(10):\\\\n print(i)\\... | {
"split": "train",
"index": 2326,
"acecode_id": "oss_5830",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating full path names for various data files based on input parameters that specify directory and file information. Write a function `get_data_file_paths` that takes the following parameters: `maindir` (str), `sessid` (int), `expid` (str), `segid` (str)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_data_file_paths('/data', 123456789, 'EXP001', 'SEG123', '20230101', 'MOUSE01') == {'dirpaths': {'expdir': '/data/EXP001', 'procdir': '/data/processed', 'segdir': '/data/segmentation', 'demixdir': '/data/demixed'}, 'filepaths': {'behav_video_h5': '/data/1... | {
"split": "train",
"index": 2327,
"acecode_id": "bigcode_python_fns_9672",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a logging mechanism for an application. Your goal is to create a function named `handle_specific_error` that takes two parameters: `error_type` (string) and `error_message` (string). The function should perform the following actions based on the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_specific_error('CriticalError', 'System failure') == 'CRITICAL: System failure'\", \"assert handle_specific_error('WarningError', 'Low disk space') == 'WARNING: Low disk space'\", \"assert handle_specific_error('InfoError', 'User logged in') == 'INFO:... | {
"split": "train",
"index": 2328,
"acecode_id": "oss_19002",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `is_isomorphic(s: str, t: str) -> bool` that determines if two strings are isomorphic. Two strings are considered isomorphic if there is a one-to-one mapping between every character in the first string and every character in the second string. No character in t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_isomorphic('paper', 'title') == True\", \"assert is_isomorphic('foo', 'bar') == False\", \"assert is_isomorphic('egg', 'add') == True\", \"assert is_isomorphic('ab', 'aa') == False\", \"assert is_isomorphic('aa', 'ab') == False\", \"assert is_isomorphic('... | {
"split": "train",
"index": 2329,
"acecode_id": "evol_17010",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `login_to_website(username: str, password: str, csrf_token: str) -> str` that simulates the login process for a website. The function should accept three parameters: a username (string), a password (string), and a CSRF token (string).... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert login_to_website('user123', 'mypasswordpass', 'valid_token') == 'Login successful!'\", \"assert login_to_website('admin', 'mypasswordpass', 'valid_token') == 'Login failed!'\", \"assert login_to_website('user789', 'mypasswordpass', '') == 'Login failed!'\", ... | {
"split": "train",
"index": 2330,
"acecode_id": "oss_25024",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sort_method(lst)` that takes a list of integers and floats, and returns the list in a strange sorted order using a heap-based approach. The strange order should be processed as follows: Start with the lowest value, then find the remaining highest value, th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_method([1, 2, 3, 4]) == [1, 4, 2, 3]\", \"assert sort_method([5, 5, 5, 5]) == [5, 5, 5, 5]\", \"assert sort_method([]) == []\", \"assert sort_method([-2, 1.5, 3.5, -1]) == [-2, 3.5, -1, 1.5]\", \"assert sort_method([10, 20, 30]) == [10, 30, 20]\", \"ass... | {
"split": "train",
"index": 2331,
"acecode_id": "evol_20062",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that reverses an array up to a given position and sorts the remaining part of the array in ascending order. The function should handle edge cases such as an empty array, a single element array, or a position that is out of the array's bounds. If the posi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_and_sort([], 0) == []\", \"assert reverse_and_sort([1], 0) == [1]\", \"assert reverse_and_sort([1], -1) == [1]\", \"assert reverse_and_sort([1, 2, 3], 2) == [2, 1, 3]\", \"assert reverse_and_sort([3, 1, 2], 3) == [2, 1, 3]\", \"assert reverse_and_sor... | {
"split": "train",
"index": 2332,
"acecode_id": "evol_13697",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a user's preferred programming language and the language of a submission against a predefined set of programming language choices. The valid languages are 'python3', 'java8', 'cpp17', 'haskell', 'brainfuck', 'c18', 'java11'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_languages('python3', 'java8') == True\", \"assert validate_languages('java11', 'cpp17') == True\", \"assert validate_languages('brainfuck', 'haskell') == True\", \"assert validate_languages('c18', 'text') == True\", \"assert validate_languages('scra... | {
"split": "train",
"index": 2333,
"acecode_id": "oss_36900",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of data points that represent network transmissions. Each data point is a list consisting of three values: a transmission indicator (1 if it is a transmission, 0 otherwise), a retransmission indicator (1 if it is a retransmission, 0 otherwise), and the time... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_retransmission_percent([[1, 1, 0], [0, 0, 1], [1, 0, 2]], 1) == [[100.0, 0.0], [0.0, 1.0]]\", \"assert calculate_retransmission_percent([[0, 0, 0], [0, 0, 1]], 1) == [[0.0, 0.0]]\", \"assert calculate_retransmission_percent([[1, 0, 0], [0, 0, 0.5]]... | {
"split": "train",
"index": 2334,
"acecode_id": "bigcode_python_fns_36625",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `third_from_end(txt: str) -> str` that determines the character that appears third from the end of a given text string, ignoring whitespace and punctuation. If the string contains fewer than three alphabetic characters, the function should return a message ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert third_from_end('Oh!') == 'There are less than three alphabetic characters in the string.'\", \"assert third_from_end(' ') == 'There are less than three alphabetic characters in the string.'\", \"assert third_from_end('!!@#') == 'There are less than three a... | {
"split": "train",
"index": 2335,
"acecode_id": "evol_27694",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the exponent of a given number. The function should take two parameters: the base (an integer) and the exponent (a non-negative integer), and return the result of raising the base to the power of the exponent. You need... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_exponent(2, 3) == 8\", \"assert calculate_exponent(5, 0) == 1\", \"assert calculate_exponent(3, 2) == 9\", \"assert calculate_exponent(7, 1) == 7\", \"assert calculate_exponent(1, 100) == 1\", \"assert calculate_exponent(0, 5) == 0\", \"assert calc... | {
"split": "train",
"index": 2336,
"acecode_id": "oss_5165",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that accepts a list of integers. The function should return True if the cubic root of every integer in the list is an odd number, including handling negative integers for which the cubic root should also be an odd negative number. You must not use any bu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cubicroot_odd([8, -8]) == False\", \"assert cubicroot_odd([0]) == False\", \"assert cubicroot_odd([-64, -729, -512]) == False\", \"assert cubicroot_odd([27, 343, 729]) == True\", \"assert cubicroot_odd([64, -27, 343]) == False\", \"assert cubicroot_odd([8, 1... | {
"split": "train",
"index": 2337,
"acecode_id": "evol_1203",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a sequence of integers and a specified chunk size, and returns a list of non-overlapping chunks of the given size. Each chunk should contain exactly the number of elements specified by the chunk size, and the chunks should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert non_overlapping_chunks([1, 2, 3, 4, 5, 6, 7], 3) == [[1, 2, 3], [4, 5, 6]]\", \"assert non_overlapping_chunks([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4]]\", \"assert non_overlapping_chunks([1, 2, 3, 4, 5], 5) == [[1, 2, 3, 4, 5]]\", \"assert non_overlapping_chun... | {
"split": "train",
"index": 2338,
"acecode_id": "bigcode_python_fns_39325",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that returns the current timestamp if no previous timestamp exists. If a timestamp exists, the function should return that existing timestamp. Implement the function `get_last_timestamp(existing_timestamp: Optional[float]) -> float:` wher... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_last_timestamp(None) == 1672531199.0\", \"assert get_last_timestamp(1672531198.0) == 1672531198.0\", \"assert get_last_timestamp(0.0) == 0.0\", \"assert get_last_timestamp(1650000000.0) == 1650000000.0\", \"assert get_last_timestamp(1610000000.0) == 1610... | {
"split": "train",
"index": 2339,
"acecode_id": "bigcode_python_fns_40944",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers: `predicted` and `actual`. Your task is to implement a function that calculates the accuracy of the predictions using the formula: Accuracy = (Number of correct predictions) / (Total number of predictions). The function should then return the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_accuracy([1, 0, 1, 1, 0, 1], [1, 1, 0, 1, 0, 1]) == 0.6666666666666666\", \"assert calculate_accuracy([1, 1, 1, 1], [1, 1, 1, 1]) == 1.0\", \"assert calculate_accuracy([0, 0, 0], [0, 0, 1]) == 0.6666666666666666\", \"assert calculate_accuracy([], [... | {
"split": "train",
"index": 2340,
"acecode_id": "oss_12356",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a record ID and processes it using a hypothetical analyzer. Implement a function called `process_record` that accepts a keyword argument `record_id` (an integer) and returns a string indicating the status of the record proc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_record(record_id=1) == 'Processing completed for record ID: 1'\", \"assert process_record(record_id=10) == 'Processing completed for record ID: 10'\", \"assert process_record(record_id=5) == 'Processing completed for record ID: 5'\", \"assert process... | {
"split": "train",
"index": 2341,
"acecode_id": "bigcode_python_fns_20202",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `extract_emails(content: str) -> List[str]` that takes a string `content` as input and returns a list of all unique email addresses found within the string. An email address is defined as a string that matches the pattern of local part followed by '@' and a dom... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_emails('My electronic mail label is john@doe.com while your electronic mail label is jane@doe.com') == ['john@doe.com', 'jane@doe.com']\", \"assert extract_emails('Contact us at support@example.com and sales@example.com') == ['support@example.com', '... | {
"split": "train",
"index": 2342,
"acecode_id": "evol_33525",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `sum_of_evens` that returns the sum of all even numbers in the list. If there are no even numbers, the function should return 0. Note that the input list can include negative numbers and zero. \n\nFunction Signature: `def sum_of_evens(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([0, 1, 2, 3, 4]) == 6\", \"assert sum_of_evens([-2, -1, 0, 1, 2]) == 0\", \"assert sum_of_evens([1, 3, 5, 7, 9]) == 0\", \"assert sum_of_evens([2, 4, 6, 8, 10]) == 30\", \"assert sum_of_evens([-2, -... | {
"split": "train",
"index": 2343,
"acecode_id": "bigcode_python_fns_25961",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary that may contain a list of 'attachments', write a function called `get_filenames(data: dict) -> list` that retrieves all the filenames from the 'attachments' list. If the 'attachments' key is not present in the input dictionary, return an empty list. If the '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_filenames({'attachments': ['file1.txt', 'file2.txt']}) == ['file1.txt', 'file2.txt']\", \"assert get_filenames({'attachments': []}) == []\", \"assert get_filenames({'attachments': ['document.pdf']}) == ['document.pdf']\", \"assert get_filenames({'data': ... | {
"split": "train",
"index": 2344,
"acecode_id": "bigcode_python_fns_8590",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that updates a list of plugin IDs in a default configuration. The function should take two parameters: a list of existing plugin IDs representing the default configuration and a list of all available plugin IDs. The goal is to modify ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_plugin_ids([1, 2, 3], [2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert update_plugin_ids([10, 20, 30], [20, 30, 40, 50]) == [10, 20, 30, 40, 50]\", \"assert update_plugin_ids([], [1, 2, 3]) == [1, 2, 3]\", \"assert update_plugin_ids([1], [1, 2]) == [1, 2]... | {
"split": "train",
"index": 2345,
"acecode_id": "oss_27263",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function `decode_sources` that takes a list of strings `sargs` representing arguments and extracts the keys from these arguments. Your function should identify any duplicate keys and calculate a list of sources for ligands based on these keys. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode_sources(['a=1', 'b=2', 'a=3']) == [0.0, 0.0]\", \"assert decode_sources(['x=10', 'y=20', 'x=30', 'z=40']) == [0.0, 0.0, 0.0]\", \"assert decode_sources(['key1=value1', 'key2=value2']) == [0.0, 0.0]\", \"assert decode_sources(['foo=bar', 'foo=baz']) ==... | {
"split": "train",
"index": 2346,
"acecode_id": "oss_24627",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with splitting a collection of data entries into labeled and unlabeled subsets based on a specified labeled ratio. Each data entry is represented as a dictionary that may or may not contain an 'annos' key, indicating whether it is labeled or not. Implement a func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_data([{'id': 1}, {'id': 2}, {'id': 3}], 0.67) == ([], [{'id': 1}, {'id': 2}, {'id': 3}])\", \"assert split_data([{'id': 1, 'annos': 'label1'}, {'id': 2}], 1.0) == ([{'id': 1, 'annos': 'label1'}], [{'id': 2}])\", \"assert split_data([{'id': 1, 'annos': ... | {
"split": "train",
"index": 2347,
"acecode_id": "oss_6724",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `validate_string(s: str) -> str` that checks if the input string `s` meets the following conditions: it must be at least 10 characters long, contain at least one alphabetical letter, at least one numerical digit, and at least one special character (from the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_string('hello123!!') == 'Valid input'\", \"assert validate_string('short!1') == 'String is too short'\", \"assert validate_string('hello123') == 'String is too short'\", \"assert validate_string('abcd1234!!') == 'Valid input'\", \"assert validate_st... | {
"split": "train",
"index": 2348,
"acecode_id": "evol_32463",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `synchronize_multimedia_content(clients: List[str], content: str) -> List[str]` that takes a list of client identifiers (strings) and a multimedia content string. The function should return a list of strings representing the successful delivery of the multi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert synchronize_multimedia_content(['client1', 'client2'], 'video.mp4') == ['Content delivered to client1: video.mp4', 'Content delivered to client2: video.mp4']\", \"assert synchronize_multimedia_content(['clientA'], 'audio.mp3') == ['Content delivered to clien... | {
"split": "train",
"index": 2349,
"acecode_id": "evol_23081",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to manage a simple in-memory file system. The function should take a list of operations to perform on the file system. Each operation is a tuple where the first element is the operation type (either 'write', 'read', or 'exists') and the r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_file_operations([('write', 'afolder/anotherfile', 'test2'), ('exists', 'afile')]) == [False]\", \"assert manage_file_operations([('write', 'afolder/anotherfile', 'test2'), ('read', 'afolder/anotherfile')]) == ['test2']\", \"assert manage_file_operatio... | {
"split": "train",
"index": 2350,
"acecode_id": "oss_16933",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program to determine the eligibility for military service based on a person's age in Brazil. Military service is mandatory for all male citizens at the age of 18. You are given two inputs: `ano_atual`, which represents the current year, and `idade... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert military_service_eligibility(2022, 18) == '\\u00c9 a hora de se alistar no servi\\u00e7o militar, IMEDIATAMENTE!'\", \"assert military_service_eligibility(2022, 17) == 'Voc\\u00ea deve se alistar no servi\\u00e7o militar em 2023.'\", \"assert military_servic... | {
"split": "train",
"index": 2351,
"acecode_id": "oss_26939",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to configure logging settings for an application. The function should take three parameters: a log level, a log file path, and a boolean indicating whether to use simplified console logs. The function should return a string that describes... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_logging('DEBUG', '/var/log/app.log', True) == 'Log level set to DEBUG. Logging to /var/log/app.log is enabled. Simplified console logs are being used.'\", \"assert configure_logging('INFO', None, False) == 'Log level set to INFO. Default logging fi... | {
"split": "train",
"index": 2352,
"acecode_id": "bigcode_python_fns_28618",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates user data based on a predefined list of users. The function should take in a dictionary of user data, which contains a user ID and a username. You need to perform the following checks: 1. If the user ID is not in the predef... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_user_data({'id': 1, 'username': 'alice'}) == 'Username does not match'\", \"assert validate_user_data({'id': 1, 'username': 'alice'}) == 'Username does not match'\", \"assert validate_user_data({'id': 3, 'username': 'dave'}) == 'Username does not ma... | {
"split": "train",
"index": 2353,
"acecode_id": "oss_17438",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that calculates the total number of times a specific character appears in a given string. The function should take two parameters: `input_string`, which is the string to be analyzed, and `character`, which is the character to c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_character('hello world', 'o') == 2\", \"assert count_character('banana', 'a') == 3\", \"assert count_character('abcdefg', 'h') == 0\", \"assert count_character('123321', '2') == 2\", \"assert count_character('ababab', 'b') == 3\", \"assert count_charac... | {
"split": "train",
"index": 2354,
"acecode_id": "oss_35131",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `sum_all_elements(my_list)` that returns the sum of all elements in the list. The function should handle both positive and negative integers. If the list is empty, the function should return 0.\nPlease reason step by step, then wri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_all_elements([1, 2, 3, 4]) == 10\", \"assert sum_all_elements([-1, -2, -3, -4]) == -10\", \"assert sum_all_elements([0, 0, 0, 0]) == 0\", \"assert sum_all_elements([1, -1]) == 0\", \"assert sum_all_elements([]) == 0\", \"assert sum_all_elements([5, 5, 5]... | {
"split": "train",
"index": 2355,
"acecode_id": "evol_25148",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a unique identifier for an item in a collection. Your task is to implement a function `collect_item_dict(items: List[str]) -> Tuple[Dict[str, int], Dict[str, int], Dict[str, int]]` that will return three dictionaries... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert collect_item_dict(['apple', 'banana', 'apple', 'banana', 'cherry']) == ({'apple': 2, 'banana': 2, 'cherry': 1}, {'a': 2, 'b': 2, 'c': 1}, {'a_apple': 2, 'b_banana': 2, 'c_cherry': 1})\", \"assert collect_item_dict(['abc', 'def', 'abc', 'ghi', 'def', 'abc']) ... | {
"split": "train",
"index": 2356,
"acecode_id": "bigcode_python_fns_34291",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given two distinct integer arrays `nums1` and `nums2`, implement a function `intersection(nums1, nums2)` that returns an array containing the unique elements that are present in both arrays. The order of elements in the result does not matter. You may assume that `nums1` and `n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert intersection([1, 2, 2, 1], [2, 2]) == [2] or intersection([1, 2, 2, 1], [2, 2]) == [2]\", \"assert intersection([4, 9, 5], [9, 4, 9, 8, 4]) == [9, 4] or intersection([4, 9, 5], [9, 4, 9, 8, 4]) == [4, 9]\", \"assert intersection([1, 3, 5], [2, 3, 4]) == [3]\... | {
"split": "train",
"index": 2357,
"acecode_id": "evol_5390",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an amount in satoshis. Write a function `convert_satoshis_to_btc(satoshis: int) -> float` that converts this amount to bitcoins. The conversion rate is 1 BTC = 100,000,000 Satoshis. Return the equivalent amount in bitcoins as a float, rounded to 8 decimal places.\... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_satoshis_to_btc(10000) == 0.0001\", \"assert convert_satoshis_to_btc(0) == 0.0\", \"assert convert_satoshis_to_btc(100000000) == 1.0\", \"assert convert_satoshis_to_btc(50000000) == 0.5\", \"assert convert_satoshis_to_btc(25000000) == 0.25\", \"asser... | {
"split": "train",
"index": 2358,
"acecode_id": "bigcode_python_fns_42813",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of milestones for a project. Each milestone is represented as a dictionary containing a name, a due date (string in the format 'YYYY-MM-DD'), and an active status (boolean). Your function should take a list of such m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_milestones([{'name': 'Milestone 1', 'date': '2023-10-01', 'active': True}, {'name': 'Milestone 2', 'date': '2023-10-02', 'active': False}]) == {'Milestone 1': {'date': '2023-10-01', 'active': True}, 'Milestone 2': {'date': '2023-10-02', 'active': Fals... | {
"split": "train",
"index": 2359,
"acecode_id": "bigcode_python_fns_11727",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `execute_commands(commands: List[str]) -> List[str]` that simulates executing a list of commands in a local environment. Each command is a string, and your function should return a list of results for each command executed. The comman... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_commands(['print Hello, World!', 'print Test']) == ['Hello, World!', 'Test']\", \"assert execute_commands(['print 123', 'print True']) == ['123', 'True']\", \"assert execute_commands(['print Hello', 'unknown_command', 'print World']) == ['Hello', 'Wo... | {
"split": "train",
"index": 2360,
"acecode_id": "bigcode_python_fns_45003",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs shell sort on a given list of integers. The function should take a list of integers as input and return the sorted list. The shell sort algorithm allows for efficient sorting by progressively sorting sublists using a gap sequence. You need to ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shell_sort([14, 52, 7, 1, 9, 75, 3]) == [1, 3, 7, 9, 14, 52, 75]\", \"assert shell_sort([5, 2, 9, 1, 5, 6]) == [1, 2, 5, 5, 6, 9]\", \"assert shell_sort([12, 11, 13, 5, 6]) == [5, 6, 11, 12, 13]\", \"assert shell_sort([3, 0, 2, 5, -1, 4, 1]) == [-1, 0, 1, 2,... | {
"split": "train",
"index": 2361,
"acecode_id": "evol_1825",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given boolean value is `True` or `False`. Your function should take a boolean as input and return the same boolean value. The input will be a single boolean value. Implement the function `check_boolean(value: bool) ->... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_boolean(True) == True\", \"assert check_boolean(False) == False\", \"assert check_boolean(True) == True\", \"assert check_boolean(False) == False\", \"assert check_boolean(True) == True\", \"assert check_boolean(False) == False\", \"assert check_boolea... | {
"split": "train",
"index": 2362,
"acecode_id": "oss_33265",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a logging function for a media streaming service. This function should log different types of events triggered by various sensors. Your goal is to create a function called `log_event` that takes two parameters: `event_type` (a string that indica... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_event('recently_added_tvshow', 'New episode of Game of Thrones added') == '[recently_added_tvshow] - New episode of Game of Thrones added'\", \"assert log_event('recently_added_movie', 'New movie Inception added') == '[recently_added_movie] - New movie I... | {
"split": "train",
"index": 2363,
"acecode_id": "oss_18439",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that calculates the determinant of a given n x n matrix. If the input matrix is not square (i.e., the number of rows does not equal the number of columns), the function should return an appropriate error message. The function should handle matrices of any size ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert determinant([[1]]) == 1\", \"assert determinant([[1, 2], [3, 4]]) == -2\", \"assert determinant([[1, 2, 3], [0, 1, 4], [5, 6, 0]]) == 1\", \"assert determinant([[0, 2], [1, 0]]) == -2\", \"assert determinant([[1, 2, 1], [1, 3, 1], [1, 1, 1]]) == 0\", \"asser... | {
"split": "train",
"index": 2364,
"acecode_id": "evol_5344",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a custom dictionary behavior. The function should accept a list of operations that modify and access a dictionary with a default value for missing keys. The function should take two parameters: a list of operations (whe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_dict_operations([('set', 'a', 1), ('set', 'b', 2), ('get', 'a')], 0) == [1]\", \"assert custom_dict_operations([('set', 'a', 1), ('set', 'b', 2), ('get', 'b')], 0) == [2]\", \"assert custom_dict_operations([('set', 'a', 1), ('set', 'b', 2), ('get', 'x... | {
"split": "train",
"index": 2365,
"acecode_id": "oss_6206",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of hours in a day, a dictionary of hourly demand for different time periods, and a mapping of time periods to their corresponding hours, write a function to calculate the demand profile for each hour of the day based on the provided weights. You need to implement a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_demand_profile([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23], {'AM': 500, 'Inter peak': 600, 'PM': 700, 'Night': 800}, {(0, 3): 0, (3, 10): 1, (10, 18): 2, (18, 24): 3}) == [500, 500, 500, 600, 600, 600, 600... | {
"split": "train",
"index": 2366,
"acecode_id": "oss_37357",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a software repository. The dictionary contains the following keys: 'path', 'branches', and 'revisions'. The value associated with 'path' is a string representing the path to the repository, while 'branches' and 'revisions' are lists of st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_repository({'path': 'repo1', 'branches': ['master', 'dev'], 'revisions': ['rev1', 'rev2']}) == {'path': 'repo1', 'branches': {'master': None, 'dev': None}, 'revisions': {'rev1': None, 'rev2': None}}\", \"assert process_repository({'path': 'repo2', 'b... | {
"split": "train",
"index": 2367,
"acecode_id": "bigcode_python_fns_42359",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the dimensions for a user interface layout based on the width and height of a window. Given the width and height of the window, you need to compute the dimensions of three frames: the main frame, the sidebar frame, and the terminal stderr frame. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_dimensions(1000, 800) == (700, 680, 200, 720, 104)\", \"assert calculate_dimensions(1600, 900) == (1120, 765, 320, 810, 117)\", \"assert calculate_dimensions(1200, 600) == (840, 510, 240, 540, 78)\", \"assert calculate_dimensions(800, 600) == (560,... | {
"split": "train",
"index": 2368,
"acecode_id": "bigcode_python_fns_48285",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of SNP (Single Nucleotide Polymorphism) data that is provided as a list of strings. Each string contains information in the format 'sampleName,snpPos', where 'sampleName' is the name of the sample and 'snpPos' is the position of the SNP. Yo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_sample_names(['A,100', 'B,200', 'A,150']) == ['A', 'B']\", \"assert extract_sample_names(['snp1,100', 'snp2,200', 'snp3,300', 'snp2,400']) == ['snp1', 'snp2', 'snp3']\", \"assert extract_sample_names(['A,1', 'A,1', 'A,1']) == ['A']\", \"assert extrac... | {
"split": "train",
"index": 2369,
"acecode_id": "oss_21085",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a sequence of characters. Your task is to implement a function `count_characters` that takes in this string as a parameter and returns a dictionary where the keys are the characters in the string and the values are the counts of those charact... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_characters('Hello, World!') == {'h': 1, 'e': 1, 'l': 3, 'o': 2, 'w': 1, 'r': 1, 'd': 1}\", \"assert count_characters('Python 3.9') == {'p': 1, 'y': 1, 't': 1, 'h': 1, 'o': 1, 'n': 1}\", \"assert count_characters('aA') == {'a': 2}\", \"assert count_char... | {
"split": "train",
"index": 2370,
"acecode_id": "oss_34223",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a date and time in the format 'DD-MM-YYYY HH:MM', implement a function that transforms this date and time into a new format 'DD/MM/YYYY HH:MM'. The function should take a single argument, a string representing the date and time, and return the transf... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_date('19-03-2020 17:30') == '19/03/2020 17:30'\", \"assert transform_date('01-01-2023 00:00') == '01/01/2023 00:00'\", \"assert transform_date('31-12-1999 23:59') == '31/12/1999 23:59'\", \"assert transform_date('15-04-2021 12:30') == '15/04/2021 1... | {
"split": "train",
"index": 2371,
"acecode_id": "evol_2303",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that renames a list of files based on a given mapping of old file names to new file names. The function should take in two parameters: a list of old file names and a dictionary mapping the old file names to the new file names. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rename_files(['file1.txt', 'file2.txt', 'document.docx'], {'file1.txt': 'newfile1.txt', 'document.docx': 'newdocument.docx'}) == [('file1.txt', 'newfile1.txt'), ('document.docx', 'newdocument.docx')]\", \"assert rename_files(['file1.txt', 'file2.txt'], {'fil... | {
"split": "train",
"index": 2372,
"acecode_id": "oss_6951",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function rand5() that returns a random integer from 1 to 5 (inclusive) with uniform probability. Your task is to implement a function rand7() that returns a random integer from 1 to 7 (inclusive) using rand5(). You must ensure that the distribution of the number... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert 1 <= rand7() <= 7\", \"assert 1 <= rand7() <= 7\", \"assert 1 <= rand7() <= 7\", \"assert 1 <= rand7() <= 7\", \"assert 1 <= rand7() <= 7\", \"assert 1 <= rand7() <= 7\", \"assert 1 <= rand7() <= 7\", \"assert 1 <= rand7() <= 7\", \"assert 1 <= rand7() <= 7\... | {
"split": "train",
"index": 2373,
"acecode_id": "bigcode_python_fns_24493",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of integers and returns a new list containing only the even numbers from the original list, sorted in ascending order. If there are no even numbers, the function should return an empty list. The function should be na... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25, 30]) == [10, 20, 30]\", \"assert filter_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert filter_even_numbers([5, 7, 9]) == []\", \"assert filter_even_num... | {
"split": "train",
"index": 2374,
"acecode_id": "oss_37397",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that receives the components of a geographic address and needs to validate the postcode. The postcode is considered valid if it consists of exactly 4 digits. Your task is to implement a function named `validate_postcode` that takes the following paramet... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_postcode('Apt', 'B', '123', 'A', '456', 'Main St', 'Ave', 'Suburbia', '1234', 'CA', 37.7749) == True\", \"assert validate_postcode('Floor', 'C', '789', 'B', '1011', 'Oak Ave', 'Rd', 'Cityville', '5678', 'NY', 40.7128) == True\", \"assert validate_po... | {
"split": "train",
"index": 2375,
"acecode_id": "oss_27846",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that parses command-line arguments provided as a list of strings. The function should accept a list of arguments that may include options prefixed with '--' and their corresponding values. Your goal is to extract the value for a specific ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_args(['--bind', '127.0.1.0'], 'bind') == '127.0.1.0'\", \"assert parse_args(['--ssid', 'mySSID'], 'ssid') == 'mySSID'\", \"assert parse_args(['--password', 'mySecret'], 'password') == 'mySecret'\", \"assert parse_args(['--region', 'US'], 'region') == '... | {
"split": "train",
"index": 2376,
"acecode_id": "bigcode_python_fns_48999",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a URL validation function for a video streaming service called Vidio. The function should determine whether a given URL is valid for handling by the Vidio service. The valid URL format for Vidio is \"https://www.vidio.com/watch/{video_id}-{video... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_handle_url('https://www.vidio.com/watch/12345-my-video-title') == True\", \"assert can_handle_url('https://www.vidio.com/watch/9999-another-video') == True\", \"assert can_handle_url('https://www.vidio.com/watch/0-video-title') == True\", \"assert can_ha... | {
"split": "train",
"index": 2377,
"acecode_id": "oss_20196",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages work units and their execution statuses. Each work unit can either be successful or failed. Your function should take a list of tuples, where each tuple contains a work unit's name (a string) and a boolean value indicatin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_work_units([('unit1', True), ('unit2', False)]) == [('unit1', 'SUCCESS'), ('unit2', 'FAILURE')]\", \"assert manage_work_units([('taskA', True), ('taskB', True), ('taskC', False)]) == [('taskA', 'SUCCESS'), ('taskB', 'SUCCESS'), ('taskC', 'FAILURE')]\"... | {
"split": "train",
"index": 2378,
"acecode_id": "oss_30346",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design and implement a function `assign_number` that takes a list of values and validates them. The function should assign the valid integers from the list that are within the range of 1 to 10 to a new list. If any value in the input list is not an integer or is outside the ran... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert assign_number([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert assign_number([1, 2, 15, 4, 5]) == 'Error: Only Integers from 1 to 10 Allowed!'\", \"assert assign_number(['a', 'b', 'c']) == 'Error: Only Integers from 1 to 10 Allowed!'\", \"assert assign_number... | {
"split": "train",
"index": 2379,
"acecode_id": "evol_20349",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D grid represented by a list of strings. Each string represents a row in the grid, and each character in the string represents a cell in the row. The grid contains either a '.' or a character representing an object. Your task is to implement a function `findAdj... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findAdjacentObjects(['....A..', '.B.C.D.', 'E.F.G.H', 'I...J..'], 0, 0) == []\", \"assert findAdjacentObjects(['A....', '.....', '.....', '.....', '....B'], 2, 2) == []\", \"assert findAdjacentObjects(['A', 'B', 'C', 'D'], 0, 0) == ['B']\", \"assert findAdja... | {
"split": "train",
"index": 2380,
"acecode_id": "oss_26579",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `scale_data(data: List[float], min_val: float, max_val: float) -> List[float]` that scales the input list of numerical data values to a specified minimum and maximum range. The function should handle missing values by replacing them with 0, and it should sc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert scale_data([-10, 0, 10, None], -1, 1) == [-1.0, 0.0, 1.0, 0.0]\", \"assert scale_data([None, None, None], 0, 1) == [0.0, 0.0, 0.0]\", \"assert scale_data([3, 6, 9], 1, 2) == [1.0, 1.5, 2.0]\", \"assert scale_data([None, 2, 2, 2], 0, 1) == [0.0, 1.0, 1.0, 1.0... | {
"split": "train",
"index": 2381,
"acecode_id": "evol_27807",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of image file names, write a function `process_images(image_list: List[str]) -> List[str]` that simulates processing each image file by appending the string ' processed' to each image name in the list. The function should return a new list containing the modified i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_images(['cat.jpg', 'dog.png']) == ['cat.jpg processed', 'dog.png processed']\", \"assert process_images(['image1.bmp', 'image2.gif']) == ['image1.bmp processed', 'image2.gif processed']\", \"assert process_images(['photo1.jpeg']) == ['photo1.jpeg pro... | {
"split": "train",
"index": 2382,
"acecode_id": "bigcode_python_fns_27365",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a two-factor authentication code based on a user's input. The function will take a string as input, representing the authentication code that the user enters, and will return a tuple containing the entered code and a boolea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert auth_code('123456') == ('123456', True)\", \"assert auth_code('abcdef') == ('abcdef', True)\", \"assert auth_code('') == ('', False)\", \"assert auth_code('!@#$%^') == ('!@#$%^', True)\", \"assert auth_code('abcd1234') == ('abcd1234', True)\", \"assert auth_... | {
"split": "train",
"index": 2383,
"acecode_id": "bigcode_python_fns_28144",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that categorizes a list of numerical values into two groups: 'data' and 'target'. The function should take a list of integers as input and an optional parameter `step` (default value is 4). For each index in the list, if the index is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_values([1, 2, 3, 4, 5, 6, 7, 8]) == {0: 'target', 1: 'data', 2: 'data', 3: 'data', 4: 'target', 5: 'data', 6: 'data', 7: 'data'}\", \"assert categorize_values([10, 20, 30, 40, 50]) == {0: 'target', 1: 'data', 2: 'data', 3: 'data', 4: 'target'}\", ... | {
"split": "train",
"index": 2384,
"acecode_id": "oss_718",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with designing a function `create_money_object` that simulates the creation of a money object based on user input. The function receives a dictionary `request` that represents an HTTP request. If the request's `method` key is 'POST', the function will check if th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_money_object({'method': 'POST', 'data': {'amount': '100', 'currency': 'USD'}}) == {'owner': 'user_123', 'amount': '100', 'currency': 'USD', 'created_date': '2023-10-11 12:00:00'}\", \"assert create_money_object({'method': 'POST', 'data': {'amount': ''... | {
"split": "train",
"index": 2385,
"acecode_id": "bigcode_python_fns_25531",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple message queuing system. Your task is to write a function `message_queue` that takes a list of messages and a topic as input, and returns a dictionary where each message is associated with the given topic. The function should only includ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert message_queue(['Hello', 'World', ''], 'greetings') == {'greetings': ['Hello', 'World']}\", \"assert message_queue(['', '', ''], 'empty') == {'empty': []}\", \"assert message_queue(['Message 1', 'Message 2'], 'test_topic') == {'test_topic': ['Message 1', 'Mes... | {
"split": "train",
"index": 2386,
"acecode_id": "oss_4936",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats resource limits for a container in a Kubernetes pod specification. The function should take in the following parameters: `cpu` (an optional float representing CPU limits), `memory` (an optional float representing memory in me... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_resources(2.0, 1536, 1) == {'cpu': '2.0', 'memory': '1.5Gi', 'nvidia.com/gpu': 1}\", \"assert format_resources(None, None, None) == {}\", \"assert format_resources(1.5, 2048, None) == {'cpu': '1.5', 'memory': '2.0Gi'}\", \"assert format_resources(0.5,... | {
"split": "train",
"index": 2387,
"acecode_id": "bigcode_python_fns_48561",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of option constants representing configurations for a symbolic execution engine and returns a formatted string that lists the options in a human-readable format. The options should be separated by commas and spaces. Impl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_options([1, 2, 3]) == 'TRACK_ACTION_HISTORY, SIMPLIFY_EXPRS, SIMPLIFY_MEMORY_READS'\", \"assert format_options([4, 5]) == 'USE_UNICORN, ENABLE_DEBUG'\", \"assert format_options([]) == ''\", \"assert format_options([6, 7, 8]) == 'ENABLE_LOGGING, TRACK_... | {
"split": "train",
"index": 2388,
"acecode_id": "oss_16355",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two strings `a` and `b` containing only the characters '0' and '1', implement a function that performs a binary XOR operation on the two strings of equal length. The function should then identify the longest alternating subsequence in the XOR result (a subsequence where n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_xor_alternating_subseq_indices('0000', '0000') == ('', -1, -1)\", \"assert string_xor_alternating_subseq_indices('0101', '1100') == ('10', 0, 1)\", \"assert string_xor_alternating_subseq_indices('1100', '1100') == ('', -1, -1)\", \"assert string_xor_a... | {
"split": "train",
"index": 2389,
"acecode_id": "evol_27017",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a string S, implement a function that finds the longest substring that occurs more than once in the string. The function should return the longest duplicated substring. If there are no duplicated substrings, return an empty string. The function signature is: def longestDu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longestDupSubstring('banana') == 'ana'\", \"assert longestDupSubstring('abcd') == ''\", \"assert longestDupSubstring('abab') == 'ab'\", \"assert longestDupSubstring('a') == ''\", \"assert longestDupSubstring('') == ''\", \"assert longestDupSubstring('abcdeab... | {
"split": "train",
"index": 2390,
"acecode_id": "evol_7767",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples where each tuple represents an atom in a crystal structure. Each tuple contains the atom's species (a string) and its coordinates (a tuple of three floats). Your task is to write a function `extract_species_and_coordinates(atom_list)` that takes t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_species_and_coordinates([('H', (0.0, 0.0, 0.0)), ('O', (0.5, 0.5, 0.5))]) == (['H', 'O'], [(0.0, 0.0, 0.0), (0.5, 0.5, 0.5)])\", \"assert extract_species_and_coordinates([('C', (1.0, 1.0, 1.0)), ('N', (1.1, 1.1, 1.1)), ('O', (1.2, 1.2, 1.2))]) == (['... | {
"split": "train",
"index": 2391,
"acecode_id": "bigcode_python_fns_37170",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a series of banking transactions. The function should take a list of tuples representing transactions, where each tuple contains the transaction type ('deposit' or 'withdraw') and the amount for that transaction. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_transactions([('deposit', 100), ('withdraw', 50), ('deposit', 200)]) == (250, 3)\", \"assert bank_transactions([]) == (0, 0)\", \"assert bank_transactions([('deposit', 100), ('deposit', 100), ('withdraw', 50)]) == (150, 3)\", \"assert bank_transactions(... | {
"split": "train",
"index": 2392,
"acecode_id": "oss_20834",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a date represented as a string in the format 'YYYY-MM-DD HH:MM:SS.ssssss', write a function that returns a new date string set to midnight (00:00:00.000000) of the same day. The output should also be in the same format. You can assume the input date string is always valid... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_midnight('2023-10-05 14:45:30.123456') == '2023-10-05 00:00:00.000000'\", \"assert set_midnight('2023-01-01 00:00:00.000000') == '2023-01-01 00:00:00.000000'\", \"assert set_midnight('2021-12-31 23:59:59.999999') == '2021-12-31 00:00:00.000000'\", \"asse... | {
"split": "train",
"index": 2393,
"acecode_id": "bigcode_python_fns_25808",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary represents a key with its associated actions and indexes. Implement a function `get_keys_info(keys: List[Dict[str, Any]]) -> Dict[str, Any]` that processes this list and returns a dictionary containing the count of key... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_keys_info([{'key': 'key1', 'actions': 'action1', 'indexes': 'index1'}, {'key': 'key2', 'actions': 'action2', 'indexes': 'index2'}]) == {'count': 2, 'valid_keys': ['key1', 'key2']}\", \"assert get_keys_info([{'key': 'key1', 'actions': 'action1'}, {'key': ... | {
"split": "train",
"index": 2394,
"acecode_id": "bigcode_python_fns_31921",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `validate_password(password: str) -> bool` that checks if a given password meets the following criteria:\n\n1. It should contain at least 12 characters.\n2. It should contain at least one uppercase letter.\n3. It should contain at least one lowercase letter... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_password('Abcdefghij1!') == False\", \"assert validate_password('Aa123456789!') == False\", \"assert validate_password('AaaBbbCc!12') == False\", \"assert validate_password('Password12!') == False\", \"assert validate_password('ValidPass12!') == Tru... | {
"split": "train",
"index": 2395,
"acecode_id": "evol_13429",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing Helm charts for a deployment tool. Your goal is to implement a single function, `process_helm_chart(chart_name: str, chart_version: str, mutator: str, processor: str, filter: bool) -> None`, which performs the following steps: First, initialize a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_helm_chart('chartA', '1.0.0', 'mutatorA', 'processorA', True) is None\", \"assert process_helm_chart('chartB', '1.2.0', 'mutatorB', 'processorB', False) is None\", \"assert process_helm_chart('chartC', '2.0.0', 'mutatorC', 'processorC', True) is None... | {
"split": "train",
"index": 2396,
"acecode_id": "oss_6542",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of movie titles and a string representing a stop word. Your task is to create a function that counts how many of the movie titles contain the given stop word. The function should be case-insensitive and should return the count as an integer. Write a functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_movies_with_stop_word(['The Lion King', 'Finding Nemo', 'The Incredibles'], 'the') == 2\", \"assert count_movies_with_stop_word(['Inception', 'Interstellar', 'Dunkirk'], 'the') == 0\", \"assert count_movies_with_stop_word(['Avatar', 'Titanic', 'The Ave... | {
"split": "train",
"index": 2397,
"acecode_id": "bigcode_python_fns_47173",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a default mapping for a container image builder. Write a function named `generate_default_mapping` that takes no parameters and returns a dictionary representing the default container images mapping. The keys of the diction... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_default_mapping() == {'web_server': ['nginx:latest', 'apache:latest'], 'database': ['mysql:5.7', 'postgres:latest'], 'cache': ['redis:latest'], 'message_queue': ['rabbitmq:3-management', 'kafka:latest']}\", \"assert len(generate_default_mapping()) =... | {
"split": "train",
"index": 2398,
"acecode_id": "bigcode_python_fns_34962",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes XML ticket data and extracts specific information from it. Write a function `process_xml_ticket(xml_data: str) -> dict` that takes in the XML ticket data as a string and returns a dictionary containing the extracted ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_xml_ticket('<ticket><id>10001</id><customer>John Doe</customer><issue>Login issue</issue><priority>Medium</priority></ticket>') == {'ticket_id': '10001', 'customer_name': 'John Doe', 'issue_description': 'Login issue', 'priority': 'Medium'}\", \"asse... | {
"split": "train",
"index": 2399,
"acecode_id": "oss_36880",
"num_tests": 11
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.