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 list of 2D coordinates representing points on a plane, write a function `plot_points(points: List[Tuple[float, float]], color: str, size: int) -> None` that simulates plotting these points by returning a string representation of the plot command with the given color and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert plot_points([(1.0, 2.0), (3.0, 4.0)], 'red', 10) == 'Plotting point at (1.0, 2.0) with color red and size 10. Plotting point at (3.0, 4.0) with color red and size 10.'\", \"assert plot_points([(0.0, 0.0), (1.5, 2.5)], 'blue', 5) == 'Plotting point at (0.0, 0...
{ "split": "train", "index": 70600, "acecode_id": "bigcode_python_fns_723", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the retrieval of the current gas price from a network. The gas price is given as a hexadecimal string, and your function should convert it into an integer. Write a function named `get_gas_price` that takes in a hexadeci...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_gas_price('0x1a') == 26\", \"assert get_gas_price('0x2f') == 47\", \"assert get_gas_price('0x0') == 0\", \"assert get_gas_price('0x10') == 16\", \"assert get_gas_price('0xFF') == 255\", \"assert get_gas_price('0x100') == 256\", \"assert get_gas_price('0x...
{ "split": "train", "index": 70601, "acecode_id": "bigcode_python_fns_37128", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates user input for a number and handles potential errors gracefully. Your function should take a string as input, which represents the user's input. If the input is 'exit', it should return 0, indicating the user chose n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_number_input('10') == 10.0\", \"assert get_number_input('3.14') == 3.14\", \"assert get_number_input('exit') == 0\", \"assert get_number_input('abc') == 0\", \"assert get_number_input('@!$') == 0\", \"assert get_number_input('5.67e2') == 567.0\", \"asser...
{ "split": "train", "index": 70602, "acecode_id": "oss_2894", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a configuration dictionary for a REST scaffold based on provided model metadata and additional parameters. The function should accept the following arguments: 'context' (a dictionary), 'model' (a string representing the mod...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_scaffold_configuration({}, 'Invoice', 'billing', 'api', fields='amount,date', exclude_from_form='date') == '{\\\"configuration\\\": {\\\"title\\\": \\\"Invoices\\\", \\\"subtitle\\\": \\\"billing / Invoice\\\", \\\"recordTitle\\\": \\\"Invoice\\\", ...
{ "split": "train", "index": 70603, "acecode_id": "bigcode_python_fns_40289", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, each representing an activity with a name. Your task is to implement a function that returns the first activity that contains the word 'cube' (case insensitive) in its name. If no such activity exists, return None. Each activity is represen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_cube_activity([{'name': 'soccer'}, {'name': 'basketball'}, {'name': 'Cube Game'}]) == {'name': 'Cube Game'}\", \"assert find_cube_activity([{'name': 'swimming'}, {'name': 'volleyball'}, {'name': 'puzzle cube'}]) == {'name': 'puzzle cube'}\", \"assert fi...
{ "split": "train", "index": 70604, "acecode_id": "bigcode_python_fns_46977", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a given mathematical expression and replaces specific symbols with their corresponding textual representations. The function should take a string representing a mathematical expression as input and return a modified ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_math_symbols('5 \\u00d7 3 \\u2192 2 \\u2211 4 \\u00f7 2 \\u03bb') == '5 multiplication 3 right 2 sum 4 division 2 lambda'\", \"assert replace_math_symbols('1 + 2 \\u00d7 3') == '1 + 2 multiplication 3'\", \"assert replace_math_symbols('\\u2211 1 to 1...
{ "split": "train", "index": 70605, "acecode_id": "oss_29895", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with configuring a logging system for a hypothetical library called 'libyang'. You need to implement a function called `configure_logging` which takes two parameters: a boolean `enable_py_logger` and an integer `level`. The function should determine the logging b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert configure_logging(True, 10) == 'Logging enabled with level 10'\", \"assert configure_logging(True, 20) == 'Logging enabled with level 20'\", \"assert configure_logging(True, 30) == 'Logging enabled with level 30'\", \"assert configure_logging(False, 10) == '...
{ "split": "train", "index": 70606, "acecode_id": "bigcode_python_fns_10561", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function that generates a 5 by 5 matrix filled with distinct prime numbers. The function should return this matrix as a list of lists, where each inner list represents a row of the matrix.\nPlease reason step by step, then write a self-contained Python solution. Give yo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prime_matrix(5, 5) == [[2, 3, 5, 7, 11], [13, 17, 19, 23, 29], [31, 37, 41, 43, 47], [53, 59, 61, 67, 71], [73, 79, 83, 89, 97]]\", \"assert prime_matrix(5, 5)[0][0] == 2\", \"assert prime_matrix(5, 5)[1][1] == 17\", \"assert prime_matrix(5, 5)[2][2] == 41\"...
{ "split": "train", "index": 70607, "acecode_id": "evol_15341", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that organizes news articles from a specified source. The function should take a list of articles, where each article is represented as a dictionary containing a title, description, and image URL. Your goal is to extract this information ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert organize_news_articles([]) == []\", \"assert organize_news_articles([{'title': 'Title 1', 'description': 'Description 1', 'urlToImage': 'http://image1.com'}, {'title': 'Title 2', 'description': 'Description 2', 'urlToImage': 'http://image2.com'}]) == [('Titl...
{ "split": "train", "index": 70608, "acecode_id": "oss_19516", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a character navigating through a maze represented by a 2D grid. The character can start at a specific position denoted by 'S' and can move up, down, left, or right within the maze, but cannot move through walls denot...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert escape_maze(['#####', '#S #', '# #', '# E#', '#####']) == 'Congratulations, you escaped the maze!'\", \"assert escape_maze(['#####', '# S#', '# #', '#E ###', '#####']) == 'Congratulations, you escaped the maze!'\", \"assert escape_maze(['#S######', '# ...
{ "split": "train", "index": 70609, "acecode_id": "oss_10122", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a text classification function. Given a string of text, your function should preprocess the text by tokenizing, converting it to lowercase, removing stopwords, and filtering tokens based on length. After preprocessing, the function should classi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_text('This is a great example of a text classification system.') == 'positive'\", \"assert classify_text('I am sad and disappointed.') == 'negative'\", \"assert classify_text('Just another average day at work.') == 'neutral'\", \"assert classify_tex...
{ "split": "train", "index": 70610, "acecode_id": "oss_17369", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given an integer array 'positions' representing the positions of reads in a circular genome of length 'genome_length', implement a function 'normalize_genome_positions' that normalizes these positions as follows: If a position is greater than half the genome length, it should b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_genome_positions([1, 2, 3], 10) == [1.0, 1.4142135623730951, 1.7320508075688772]\", \"assert normalize_genome_positions([8, 9, 10], 10) == [1.4142135623730951, 1.0, 0.0]\", \"assert normalize_genome_positions([0, 1, 2], 10) == [0.0, 1.0, 1.41421356...
{ "split": "train", "index": 70611, "acecode_id": "bigcode_python_fns_19346", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing return codes from a linting tool. Your task is to implement a function that checks if all the return codes are either 0 (no errors) or 16 (python conventions messages). Return True if all return codes meet this condition, otherwise ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_linting_codes([0, 16, 0]) == True\", \"assert check_linting_codes([16, 16, 16]) == True\", \"assert check_linting_codes([0, 0, 0]) == True\", \"assert check_linting_codes([0]) == True\", \"assert check_linting_codes([16]) == True\", \"assert check_lint...
{ "split": "train", "index": 70612, "acecode_id": "bigcode_python_fns_18334", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 3-dimensional vector represented as a list of three integers, write a function that converts this vector into a unit vector. A unit vector is a vector that has a length of 1 but retains the same direction as the original vector. The input vector will not be the zero vec...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert to_unit_vector([3, 4, 0]) == [0.6, 0.8, 0.0]\", \"assert to_unit_vector([1, 2, 2]) == [0.333333, 0.666667, 0.666667]\", \"assert to_unit_vector([0, 1, 0]) == [0.0, 1.0, 0.0]\", \"assert to_unit_vector([5, 0, 0]) == [1.0, 0.0, 0.0]\", \"assert to_unit_vector(...
{ "split": "train", "index": 70613, "acecode_id": "bigcode_python_fns_5570", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `search_dissertations(dissertations: List[Dict[str, Union[str, List[str]]], keyword: str) -> List[str]` that takes a list of dissertations represented as dictionaries and a keyword string. Each dissertation is a dictionary containing keys: 'title', 'abstrac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_dissertations([{'title': 'Understanding AI', 'abstract': 'This dissertation discusses AI.', 'student': 'Alice', 'supervisor': 'Dr. Smith', 'keywords': ['AI', 'machine learning']}, {'title': 'Quantum Computing Basics', 'abstract': 'A study on quantum m...
{ "split": "train", "index": 70614, "acecode_id": "evol_31472", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the unique elements from the original list, while preserving their original order. Write a function `unique_elements(arr: List[int]) -> List[int]` where `arr` is a list ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 2, 3, 1, 4]) == [1, 2, 3, 4]\", \"assert unique_elements([5, 5, 5, 5]) == [5]\", \"assert unique_elements([]) == []\", \"assert unique_elements([-1, -2, -2, -3, -1, -4]) == [-1, -2, -3, -4]\", \"assert unique_elements([0, 1, 0, 2, 1]) ...
{ "split": "train", "index": 70615, "acecode_id": "bigcode_python_fns_27284", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D array representing a map where each element is a float value. Your task is to create a function that takes this 2D array and a boolean parameter 'update'. If 'update' is True, the function should return a new 2D array of the same size filled with NaN values. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert plot_map([[1.0, 2.0], [3.0, 4.0]], False) == [[1.0, 2.0], [3.0, 4.0]]\", \"assert plot_map([[0.0, 0.0]], False) == [[0.0, 0.0]]\", \"assert plot_map([], True) == []\", \"assert plot_map([], False) == []\", \"assert plot_map([[5.5]], False) == [[5.5]]\", \"as...
{ "split": "train", "index": 70616, "acecode_id": "bigcode_python_fns_19134", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `remove_dead_node(uid: str, universe: dict) -> bool` that simulates the removal of a node from a network. The function will take two parameters: a string `uid` which represents the unique identifier of the node to be removed, and a di...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_dead_node('node1', {'node1': True, 'node2': True}) == True\", \"assert remove_dead_node('node2', {'node1': True, 'node2': True}) == True\", \"assert remove_dead_node('node3', {'node1': True, 'node2': True}) == False\", \"assert remove_dead_node('node1...
{ "split": "train", "index": 70617, "acecode_id": "bigcode_python_fns_25282", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a recursive function `add_subtract(x: int, y: int, operation: str) -> int` that performs either addition or subtraction of two integers `x` and `y` based on the value of the `operation` parameter. The `operation` parameter can be either 'add' or 'subtract'. You are no...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_subtract(5, 3, 'add') == 8\", \"assert add_subtract(10, 7, 'add') == 17\", \"assert add_subtract(0, 0, 'add') == 0\", \"assert add_subtract(-3, -2, 'add') == -5\", \"assert add_subtract(3, 2, 'subtract') == 1\", \"assert add_subtract(5, 5, 'subtract') ==...
{ "split": "train", "index": 70618, "acecode_id": "evol_34847", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `sanitize_input(user_input: str) -> str` that takes a string input from a user and returns a sanitized version of that input to prevent Cross-Site Scripting (XSS) attacks. The sanitization process should remove any HTML tags and escape special characters. Y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sanitize_input('<script>alert(\\\"XSS\\\");</script>') == '&lt;script&gt;alert(&quot;XSS&quot;);&lt;/script&gt;'\", \"assert sanitize_input('Hello World!') == 'Hello World!'\", \"assert sanitize_input('<div>Hello</div>') == '&lt;div&gt;Hello&lt;/div&gt;'\", ...
{ "split": "train", "index": 70619, "acecode_id": "evol_23960", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages product attributes for a given item code. Implement a function `manage_product_attributes(item_code: str) -> List[str]` that simulates the retrieval of optional attributes for the given item code and returns a list of ordered...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_product_attributes('ITEM001') == ['Color: Red', 'Size: M', 'Material: Cotton']\", \"assert manage_product_attributes('ITEM002') == ['Color: Blue', 'Size: L', 'Material: Polyester']\", \"assert manage_product_attributes('ITEM003') == ['Color: Green', '...
{ "split": "train", "index": 70620, "acecode_id": "oss_15736", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `handle_request` that simulates processing a user request in a web application. The function takes two parameters: a `request` string and a `data` dictionary. If the request is 'GET', the function should return the value associated with t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_request('GET', {'message': 'Hello, World!'}) == 'Hello, World!'\", \"assert handle_request('POST', {}) == 'Data added successfully'\", \"assert handle_request('DELETE', {}) == '{\\\"error\\\": \\\"Invalid request.\\\"}'\", \"assert handle_request('PUT...
{ "split": "train", "index": 70621, "acecode_id": "bigcode_python_fns_32150", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that extracts a substring from a given string based on two indices. The function should take a string and two integers representing the starting and ending positions of the substring (inclusive of the start index and exclusive of the end index). Return the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert substring('Hello World', 2, 5) == 'llo'\", \"assert substring('Python Programming', 0, 6) == 'Python'\", \"assert substring('LeetCode', 1, 4) == 'eet'\", \"assert substring('abcdefg', 0, 3) == 'abc'\", \"assert substring('1234567890', 3, 7) == '4567'\", \"as...
{ "split": "train", "index": 70622, "acecode_id": "evol_453", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that splits a given 3D shape (represented as a list of points) into multiple pieces using a set of cutting planes (also represented as lists of points). Your function should take the following parameters: a list of points representing...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_shape([(0, 0, 0), (1, 1, 1)], [[(0, 0, 0), (1, 0, 0)]], [0, 1, 0], True, 0.1) == [[(0, 0, 0)], [(1, 1, 1)]]\", \"assert split_shape([(0, 0, 0), (1, 1, 1), (2, 2, 2)], [[(1, 1, 0), (1, 1, 3)]], [0, 0, 1], False, 0.5) == [[(0, 0, 0), (1, 1, 1)], [(2, 2, ...
{ "split": "train", "index": 70623, "acecode_id": "bigcode_python_fns_35739", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given an array of positive integers `nums`, write a function that returns the maximum possible sum of an ascending subarray in `nums`, along with the start and end indices of that subarray in the original array. A subarray is considered ascending if for all indices `i` where `l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxAscendingSum([10,20,30,5,10,50]) == (65, 3, 5)\", \"assert maxAscendingSum([10,20,30,40,50]) == (150, 0, 4)\", \"assert maxAscendingSum([12,17,15,13,10,11,12]) == (33, 4, 6)\", \"assert maxAscendingSum([100,10,1]) == (100, 0, 0)\", \"assert maxAscendingSu...
{ "split": "train", "index": 70624, "acecode_id": "evol_9039", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function that calculates the total time a machine in a manufacturing plant has been waiting for an operator. You will be given the following inputs: a list of core object IDs, a list of core objects, a list of queues, and the total time the mach...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_waiting_time([1, 2, 3], [], [], 100) == 100\", \"assert calculate_waiting_time([4, 5, 6], [], [], 250) == 250\", \"assert calculate_waiting_time([], [], [], 0) == 0\", \"assert calculate_waiting_time([7], [], [], 150) == 150\", \"assert calculate_w...
{ "split": "train", "index": 70625, "acecode_id": "oss_27532", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of integers and returns a new list that contains only the unique integers from the original list, maintaining the order of their first appearance. Write a function named `get_unique_integers` that takes in a list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_integers([1, 2, 2, 3, 4, 1]) == [1, 2, 3, 4]\", \"assert get_unique_integers([4, 5, 4, 3, 2, 1]) == [4, 5, 3, 2, 1]\", \"assert get_unique_integers([1, 1, 1, 1]) == [1]\", \"assert get_unique_integers([]) == []\", \"assert get_unique_integers([-1,...
{ "split": "train", "index": 70626, "acecode_id": "bigcode_python_fns_13436", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of students in a class. Your task is to write a function that finds the highest score in the list and returns the index of the first occurrence of this highest score. If there are multiple occurrences of the highest score...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_highest_score_index([85, 90, 76, 90, 92, 90]) == 4\", \"assert find_highest_score_index([100, 99, 98, 97, 96]) == 0\", \"assert find_highest_score_index([1, 2, 3, 4, 5]) == 4\", \"assert find_highest_score_index([5, 5, 5, 5, 5]) == 0\", \"assert find_hi...
{ "split": "train", "index": 70627, "acecode_id": "oss_33968", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to restore a candy crush board to a stable state after a player's move. Given a 2D integer array `board` where different positive integers represent different types of candies, and `0` represents empty cells, you need to implement a f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert candyCrush([[1,1,1,1,1],[2,2,2,2,2],[3,3,3,3,3],[4,4,4,4,4],[5,5,5,5,5]]) == ([[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0]], 25)\", \"assert candyCrush([[1,2,3],[4,5,6],[7,8,9]]) == ([[1,2,3],[4,5,6],[7,8,9]], 0)\", \"assert candyCrush([[0,0,...
{ "split": "train", "index": 70628, "acecode_id": "evol_22350", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with configuring Protocol Independent Multicast (PIM) on a network of routers. Each router has a set of links to other routers, and each link can have specific configurations. Given a network topology represented as a dictionary and a set of rules for enabling or...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert enable_disable_pim({'router1': {'links': {'router2': {'pim': 'enable', 'type': 'loopback', 'interface': 'lo1'}, 'router3': {'pim': 'enable', 'type': 'ethernet', 'interface': 'eth0'}}}}, {'router1': {'pim': {'join-prune-interval': 30, 'keep-alive-timer': 60}}...
{ "split": "train", "index": 70629, "acecode_id": "bigcode_python_fns_44402", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that initializes an aggregator with specific attributes and returns a dictionary representation of the aggregator. The function should take the following parameters: `aggregation_scheme` (a string representing the aggregation scheme),...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_aggregator('sum', [('count', 0)], [('count', 1)], 'count') == {'aggregation_scheme': 'sum', 'initialization_updates': [('count', 0)], 'accumulation_updates': [('count', 1)], 'readout_variable': 'count'}\", \"assert create_aggregator('average', [('tota...
{ "split": "train", "index": 70630, "acecode_id": "oss_26404", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of floating-point numbers, implement a function `rescale_to_unit(numbers)` that rescales the numbers to a range between 0 and 1. The rescaling should be done using the formula: new_value = (value - min_value) / (max_value - min_value), where min_value is the minimu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rescale_to_unit([1.0, 2.0, 3.0]) == [0.0, 0.5, 1.0]\", \"assert rescale_to_unit([0.0, 0.0, 0.0]) == [0.0, 0.0, 0.0]\", \"assert rescale_to_unit([-1.0, 0.0, 1.0]) == [0.0, 0.5, 1.0]\", \"assert rescale_to_unit([10.0, 20.0]) == [0.0, 1.0]\", \"assert rescale_t...
{ "split": "train", "index": 70631, "acecode_id": "evol_14653", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a function that takes three phrases as input and returns a dictionary where each key is a character that appears in any of the phrases, and the corresponding value is the total frequency of that character across all three phrases. The function should maintain case-sensiti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_character_freq('abc', 'def', 'ghi') == {'a': 1, 'b': 1, 'c': 1, 'd': 1, 'e': 1, 'f': 1, 'g': 1, 'h': 1, 'i': 1}\", \"assert calculate_character_freq('123', '456', '789') == {'1': 1, '2': 1, '3': 1, '4': 1, '5': 1, '6': 1, '7': 1, '8': 1, '9': 1}\",...
{ "split": "train", "index": 70632, "acecode_id": "evol_34541", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `check_compatibility` that determines the compatibility of a project based on the presence of certain features. The function should take an integer `features` as input, where the integer represents the binary representation of supported f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_compatibility(0b0000) == 0b0000\", \"assert check_compatibility(0b0001) == 0b0001\", \"assert check_compatibility(0b0010) == 0b0000\", \"assert check_compatibility(0b0011) == 0b0001\", \"assert check_compatibility(0b0100) == 0b0000\", \"assert check_co...
{ "split": "train", "index": 70633, "acecode_id": "oss_8323", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that consists of words separated by spaces. Your task is to implement a function that takes this string as input and returns a list of tokens and their corresponding starting indices in the original string. The function should tokenize the input string by...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert tokenize_string('SingleWord') == (['SingleWord'], [0])\", \"assert tokenize_string(' ') == ([], [])\", \"assert tokenize_string('') == ([], [])\", \"assert tokenize_string(' ') == ([], [])\", \"assert tokenize_string('Hello') == (['Hello'], [0])\", \"asse...
{ "split": "train", "index": 70634, "acecode_id": "bigcode_python_fns_18256", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a 2D matrix sorted in decreasing order both row-wise and column-wise, implement a function that counts how many negative numbers are present in the matrix. The matrix is represented as a list of lists, where each sublist represents a row. Write a function `count_negative(...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_negative([[-9, -7, -5], [-8, -6, -4], [2, 7, 11]]) == 6\", \"assert count_negative([[5, 3, 1], [4, 2, 0], [-1, -2, -3]]) == 3\", \"assert count_negative([[0, -1, -2], [1, 0, -1], [2, 1, 0]]) == 3\", \"assert count_negative([[1, 1, 1], [1, 1, 1], [1, 1,...
{ "split": "train", "index": 70635, "acecode_id": "evol_21968", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `generate_password(length: int) -> str` that constructs a cryptographically-secure password of a specified length. The password must include a mix of uppercase letters, lowercase letters, digits, and special characters to ensure high entropy and unguessabil...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_password(8) is not None\", \"assert len(generate_password(8)) == 8\", \"assert len(set(generate_password(10))) > 1\", \"assert len(generate_password(12)) == 12\", \"assert all(c.isupper() for c in generate_password(10)) == False\", \"assert any(c.is...
{ "split": "train", "index": 70636, "acecode_id": "evol_33658", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating a random string of a specified length. The generated string should consist of uppercase letters, lowercase letters, digits, and ASCII punctuation characters. Write a function `generate_random_string(length: int) -> str` that takes an integer `leng...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_random_string(0) == ''\", \"assert len(generate_random_string(1)) == 1\", \"assert len(generate_random_string(5)) == 5\", \"assert len(generate_random_string(10)) == 10\", \"assert len(generate_random_string(15)) == 15\", \"assert len(generate_rando...
{ "split": "train", "index": 70637, "acecode_id": "bigcode_python_fns_15422", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given command line argument is valid for a hypothetical program. The program has specific valid command line arguments: '--help', '--version', and '--verbose'. Your function should take a list of command line arguments an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_arguments_valid(['--help']) == True\", \"assert are_arguments_valid(['--version']) == True\", \"assert are_arguments_valid(['--verbose']) == True\", \"assert are_arguments_valid(['--help', '--version']) == True\", \"assert are_arguments_valid(['--verbose...
{ "split": "train", "index": 70638, "acecode_id": "bigcode_python_fns_33120", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `factorial(n: int) -> int` that calculates the factorial of a non-negative integer n. The factorial of a non-negative integer n is the product of all positive integers less than or equal to n. For example, the factorial of 5 is 5! = 5 * 4 * 3 * 2 * 1 = 120....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(...
{ "split": "train", "index": 70639, "acecode_id": "evol_4031", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with planning a trajectory for a robotic system that moves from a starting configuration to a goal configuration. Given the starting configuration as a list of joint angles `qstart`, the goal configuration `qgoal`, and the maximum number of iterations `max_iters`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert plan_trajectory([0, 0], [1, 1], 2) == 'Plan Successful'\", \"assert plan_trajectory([0, 0], [3, 4], 5) == 'Plan Successful'\", \"assert plan_trajectory([1, 2], [1, 2], 0) == 'Plan Successful'\", \"assert plan_trajectory([1, 1], [4, 5], 2) == 'Plan Failed'\",...
{ "split": "train", "index": 70640, "acecode_id": "bigcode_python_fns_1626", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the unique integers from the input list in the order they first appeared. Implement a function named `unique_integers` that achieves this functionality. The function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 1, 4]) == [1, 2, 3, 4]\", \"assert unique_integers([5, 6, 7, 5, 6, 8]) == [5, 6, 7, 8]\", \"assert unique_integers([]) == []\", \"assert unique_integers([1, 1, 1, 1]) == [1]\", \"assert unique_integers([10, 9, 8, 10, 9]) == [10, ...
{ "split": "train", "index": 70641, "acecode_id": "oss_23540", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a list of integers as input and returns the count of odd numbers in the list. Implement the function to correctly count the odd numbers in the list. The function should have the following signature: `def count_odd_number...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_odd_numbers([]) == 0\", \"assert count_odd_numbers([1, 2, 3, 4, 5]) == 3\", \"assert count_odd_numbers([0, 2, 4, 6]) == 0\", \"assert count_odd_numbers([-1, -2, -3, -4]) == 2\", \"assert count_odd_numbers([-1, 0, 1, 2]) == 2\", \"assert count_odd_numbe...
{ "split": "train", "index": 70642, "acecode_id": "oss_13488", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D matrix representing an image, where each pixel is represented by a list of three integers corresponding to RGB values (0-255). You are also given a binary mask of the same dimensions as the image, where '1' represents the pixels to be colored and '0' represen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert draw_mask([[[0, 0, 0], [255, 255, 255]]], [[1, 1]], [0, 0, 255], 1.0) == [[[0, 0, 255], [0, 0, 255]]]\", \"assert draw_mask([[[255, 255, 255]], [[0, 0, 0]]], [[1], [0]], [255, 255, 0], 0.0) == [[[255, 255, 255]], [[0, 0, 0]]]\", \"assert draw_mask([[[255, 25...
{ "split": "train", "index": 70643, "acecode_id": "bigcode_python_fns_2910", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a Google Analytics payload for a file download event. The function should take the following parameters: `filename` (string), `file_size_downloaded` (int), `file_at_id` (string), `lab_display_title` (string), `file_experime...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_ga_payload('example.txt', 1024, '12345', 'Example Lab', 'experiment_1', 'pdf') == {'v': 1, 'tid': 'default_tracker_id', 't': 'event', 'uip': '0.0.0.0', 'ua': 'Mozilla/5.0', 'dl': 'http://example.com/download', 'dt': 'example.txt', 'cid': '555', 'an'...
{ "split": "train", "index": 70644, "acecode_id": "bigcode_python_fns_34824", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Write a function `remove_punctuation(input_string: str) -> str` that removes all punctuation characters from the input string and returns the modified string without any punctuation. The input string will only contain printable characters. You should define your function to han...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_punctuation('Hello, world!') == 'Hello world'\", \"assert remove_punctuation('Python is fun.') == 'Python is fun'\", \"assert remove_punctuation('No punctuation here') == 'No punctuation here'\", \"assert remove_punctuation('What? How are you!') == 'W...
{ "split": "train", "index": 70645, "acecode_id": "evol_6758", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `get_cnn_parameters` that takes in several parameters to configure a Convolutional Neural Network (CNN). The function should accept the following parameters: \n- `image_size` (int): The size of the input images (default is 84). \n- `bn_ep...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_cnn_parameters() == {'image_size': 84, 'bn_eps': 0.001, 'bn_momentum': 0.95, 'n_classes': 5, 'filter_size': 32, 'levels': None, 'spp': False}\", \"assert get_cnn_parameters(128) == {'image_size': 128, 'bn_eps': 0.001, 'bn_momentum': 0.95, 'n_classes': 5,...
{ "split": "train", "index": 70646, "acecode_id": "bigcode_python_fns_24593", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that checks if a specific rich menu is assigned to a user based on given user data. The function should take a user ID as input and return a status code indicating whether the rich menu is assigned or not. If the user ID matches a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert Check_rich_menu_to_user('user_1') == 200\", \"assert Check_rich_menu_to_user('user_2') == 200\", \"assert Check_rich_menu_to_user('user_3') == 404\", \"assert Check_rich_menu_to_user('user_4') == 404\", \"assert Check_rich_menu_to_user('user_6') == 404\", \"...
{ "split": "train", "index": 70647, "acecode_id": "oss_36166", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the total revenue from selling various types of toys at a toy store. The program should take the quantities of different toys sold as input: puzzles, dolls, bears, minions, and trucks. Each type of toy has a fixed price: puzzles cost $2.6 each, d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_revenue(0, 0, 0, 0, 0) == 0.0\", \"assert calculate_total_revenue(0, 5, 0, 0, 0) == 15.0\", \"assert calculate_total_revenue(0, 0, 0, 4, 0) == 6.0\", \"assert calculate_total_revenue(1, 1, 1, 1, 1) == 16.2\", \"assert calculate_total_revenue(...
{ "split": "train", "index": 70648, "acecode_id": "oss_25370", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a dictionary of user data and returns a modified version of the dictionary. The input dictionary contains various user data, and your function needs to modify the dictionary by setting the \"is_active\" key to False ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_user_data({'username': 'user1', 'is_active': True}) == {'username': 'user1', 'is_active': False, 'created_by': 'Admin'}\", \"assert process_user_data({'username': 'user2', 'email': 'user2@example.com'}) == {'username': 'user2', 'email': 'user2@exampl...
{ "split": "train", "index": 70649, "acecode_id": "oss_16625", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a variable number of arguments that can be integers, lists, or tuples. Your task is to implement a function that flattens these arguments into a single list containing only the integers, ignoring any None values. If an argument is a list or tuple, you should extra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flat_list(1, 2, 3) == [1, 2, 3]\", \"assert flat_list(1) == [1]\", \"assert flat_list([1, 2, 3]) == [1, 2, 3]\", \"assert flat_list([None]) == []\", \"assert flat_list(1, None, 2) == [1, 2]\", \"assert flat_list(1, [None, 2], (3, None)) == [1, 2, 3]\", \"ass...
{ "split": "train", "index": 70650, "acecode_id": "bigcode_python_fns_15511", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `flip_string(s: str) -> str` that takes a string `s` as input and returns the string reversed, excluding any punctuation characters. Punctuation characters are defined as any character not considered a letter or a digit. For example, if the input string is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flip_string('Hello, World!') == 'dlroW olleH'\", \"assert flip_string('Python@2023') == '3202nohtyP'\", \"assert flip_string('1234&5678') == '87654321'\", \"assert flip_string('No punctuation here') == 'ereh noitautcnup oN'\", \"assert flip_string('') == ''\...
{ "split": "train", "index": 70651, "acecode_id": "evol_31887", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing the configuration of a network site. Your task is to implement a function `parse_site_config(config_site: Dict[str, Any]) -> Tuple[List[Dict[str, Any]], List[Dict[str, Any]], List[Dict[str, Any]], List[Dict[str, Any]], List[Dict[str, Any]...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_site_config({'waninterfaces': [{'id': 1}], 'lannetworks': [{'id': 10}], 'elements': [{'id': 100}], 'dhcpservers': [{'id': 200}], 'site_extensions': [{'id': 300}], 'site_security_zones': [{'id': 400}], 'spokeclusters': [{'id': 500}]}) == ([{'id': 1}], [...
{ "split": "train", "index": 70652, "acecode_id": "bigcode_python_fns_48626", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists: `peptides` and `alleles`, where `peptides` contains strings representing peptide sequences and `alleles` contains strings representing MHC alleles. Your task is to implement a function `generate_pairwise_index_data` that generates and returns the follow...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_pairwise_index_data(['A', 'B'], ['HLA-1', 'HLA-2'])[0]) == 2\", \"assert len(generate_pairwise_index_data(['A'], ['HLA-1', 'HLA-2'])[0][0]) == 2\", \"assert len(generate_pairwise_index_data(['A', 'B', 'C'], ['HLA-1'])[0]) == 3\", \"assert len(ge...
{ "split": "train", "index": 70653, "acecode_id": "oss_31589", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of particle positions in a multi-dimensional space, a set of box lengths for each dimension, and a cutoff distance, write a function that determines the number of pairs of particles that are within the cutoff distance of each other. The particle positions are repre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_particle_pairs([(0, 0), (3, 3), (1, 1)], [5, 5], 2) == 1\", \"assert count_particle_pairs([(1, 1), (2, 2), (2.5, 2.5)], [5, 5], 0.5) == 0\", \"assert count_particle_pairs([(0, 0), (1, 1), (1.5, 1)], [2, 2], 1.5) == 3\", \"assert count_particle_pairs([(...
{ "split": "train", "index": 70654, "acecode_id": "bigcode_python_fns_3947", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that validates a set of action parameters based on a given set of constraints. The function should take in a dictionary of action parameters and their corresponding values, returning True if all the parameters satisfy the constrain...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_action_parameters({'param_string': 'test', 'param_integer': 5, 'param_float': 2.5}) == True\", \"assert validate_action_parameters({'param_string': 'hello', 'param_integer': None, 'param_float': 0.0}) == True\", \"assert validate_action_parameters({...
{ "split": "train", "index": 70655, "acecode_id": "oss_35844", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates executing a SQL query on a database and returns the result of the query. The function should take a string `query` and an optional parameter `data`, which can be either None, a list of tuples, or a single tuple. If `data` i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_query('SELECT * FROM table', None) == 'Query executed without parameters'\", \"assert execute_query('SELECT * FROM table', [(1, 'row1'), (2, 'row2')]) == 'Query executed with multiple rows: 2'\", \"assert execute_query('SELECT * FROM users', None) ==...
{ "split": "train", "index": 70656, "acecode_id": "bigcode_python_fns_11758", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a binary tree, write a function to compute the maximum path sum. You need to find the path that provides the maximum sum starting and ending at any point in the tree. The path does not necessarily have to go through the root. A path can be made by visually connecting two ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert Solution().maxPathSum(TreeNode(10)) == 10\", \"assert Solution().maxPathSum(TreeNode(-1, TreeNode(-2), TreeNode(-3))) == -1\", \"assert Solution().maxPathSum(TreeNode(1, TreeNode(2), TreeNode(3))) == 6\", \"assert Solution().maxPathSum(TreeNode(-2, TreeNode(...
{ "split": "train", "index": 70657, "acecode_id": "evol_22525", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function that takes two integers C and D as parameters and returns a list of all prime numbers within the inclusive range [C, D]. Additionally, the function must return a string indicating whether the range contains 'single prime' if there is only one prime number, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_primes_in_range(10, 10) == ([], 'no primes')\", \"assert find_primes_in_range(10, 11) == ([11], 'single prime')\", \"assert find_primes_in_range(10, 20) == ([11, 13, 17, 19], 'multiple primes')\", \"assert find_primes_in_range(1, 5) == ([2, 3, 5], 'mult...
{ "split": "train", "index": 70658, "acecode_id": "evol_14884", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that deletes the first item from a list of integers. The function should take a list of integers as input and remove the first element of the list if it exists. If the list is empty, the function should raise an Exception with the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_first_item([1, 2, 3]) == [2, 3]\", \"assert delete_first_item([5]) == []\", \"assert delete_first_item([10, 20, 30]) == [20, 30]\", \"assert delete_first_item([-1, 0, 1]) == [0, 1]\", \"assert delete_first_item([100, 200, 300, 400]) == [200, 300, 400]...
{ "split": "train", "index": 70659, "acecode_id": "oss_22485", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of events represented as dictionaries, each containing a start time, end time, location, and description, write a function `get_event_without_summary(events: List[Dict[str, Any]]) -> List[Dict[str, Any]]` that returns a list of events missing the 'summary' field. E...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_event_without_summary([{'start': {'dateTime': '2023-10-01T10:00:00'}, 'end': {'dateTime': '2023-10-01T11:00:00'}, 'location': 'Room A', 'description': 'Meeting', 'summary': 'Team Meeting'}, {'start': {'dateTime': '2023-10-01T12:00:00'}, 'end': {'dateTime...
{ "split": "train", "index": 70660, "acecode_id": "bigcode_python_fns_36139", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a binary search algorithm to find the index of a specific element in a sorted array. The binary search algorithm is a divide-and-conquer search algorithm that works by repeatedly dividing in half the portion of the array that could contain the i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_search([1, 2, 3, 4, 5], 3) == 2\", \"assert binary_search([1, 2, 3, 4, 5], 1) == 0\", \"assert binary_search([1, 2, 3, 4, 5], 5) == 4\", \"assert binary_search([1, 2, 3, 4, 5], 6) == -1\", \"assert binary_search([10, 20, 30, 40, 50], 30) == 2\", \"ass...
{ "split": "train", "index": 70661, "acecode_id": "oss_15384", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of feature identifiers (UUIDs) as input and returns a list of unique feature identifiers. The input list may contain duplicates, and your function should remove any duplicates while maintaining the order of the first occ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_feature_ids(['id1', 'id2', 'id1', 'id3']) == ['id1', 'id2', 'id3']\", \"assert unique_feature_ids(['uuid1', 'uuid2', 'uuid2', 'uuid3', 'uuid1']) == ['uuid1', 'uuid2', 'uuid3']\", \"assert unique_feature_ids(['feat1', 'feat1', 'feat1']) == ['feat1']\",...
{ "split": "train", "index": 70662, "acecode_id": "bigcode_python_fns_24383", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of strings representing metadata for software packages. Each string contains information about the package, including its operating system compatibility and programming language. Your goal is to extract and co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_programming_languages([\\\"Operating System :: Windows\\\", \\\"Programming Language :: Ruby\\\", \\\"Programming Language :: Ruby\\\", \\\"Programming Language :: PHP\\\"]) == {'Ruby': 2, 'PHP': 1}\", \"assert count_programming_languages([\\\"Operatin...
{ "split": "train", "index": 70663, "acecode_id": "oss_35525", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes tab-separated values (TSV) data from a string input. The function should take a single string input which represents multiple lines of tab-separated values, where each line corresponds to a record and each value in a li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_tsv('Name\\tAge\\tCity\\\\nAlice\\t30\\tNew York\\\\nBob\\t25\\tLos Angeles') == [{'Name': 'Alice', 'Age': '30', 'City': 'New York'}, {'Name': 'Bob', 'Age': '25', 'City': 'Los Angeles'}]\", \"assert parse_tsv('') == []\", \"assert parse_tsv('Header1\\t...
{ "split": "train", "index": 70664, "acecode_id": "bigcode_python_fns_40042", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two positive integers `n` and `k`, return the `kth` prime factor of `n`. A prime factor of `n` is defined as a prime number `p` where `n % p == 0`. If `n` has less than `k` prime factors, return -1. If a prime number divides `n` multiple times, it should be counted multip...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_kth_prime_factor(7, 1) == 7\", \"assert get_kth_prime_factor(4, 2) == 2\", \"assert get_kth_prime_factor(1, 1) == -1\", \"assert get_kth_prime_factor(30, 3) == 5\", \"assert get_kth_prime_factor(18, 2) == 3\", \"assert get_kth_prime_factor(45, 3) == 5\",...
{ "split": "train", "index": 70665, "acecode_id": "evol_28567", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a list of filters in a specific format. Each filter must be represented as a dictionary containing the following keys: 'id', 'label', 'type', and 'operators'. The function should return a list of filter dictionaries for the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_filters() == [{'id': 'name', 'label': 'Name', 'type': 'string', 'operators': ['equal', 'not_equal', 'begins_with', 'ends_with', 'contains']}, {'id': 'old_name', 'label': 'Old Name', 'type': 'string', 'operators': ['equal', 'not_equal', 'begins_with'...
{ "split": "train", "index": 70666, "acecode_id": "bigcode_python_fns_21573", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with generating two types of noise: Gaussian noise and uniform noise. Implement a function `generate_noise(noise_type: str, param1: float, param2: float, size: int) -> List[float]` where `noise_type` can be either 'gaussian' or 'uniform'. The `param1` and `param2...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_noise('gaussian', 0, 1, 6)) == 6\", \"assert len(generate_noise('uniform', 0, 10, 8)) == 8\", \"assert len(generate_noise('gaussian', 5, 2, 10)) == 10\", \"assert len(generate_noise('uniform', -10, 10, 2)) == 2\", \"assert generate_noise('unifor...
{ "split": "train", "index": 70667, "acecode_id": "oss_35446", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates sending a message to a channel in a chat application. The function should take a string `message` as input and return a string indicating that the message has been sent. The output should be in the format 'Message sent: {me...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_message('Hello, World!') == 'Message sent: Hello, World!'\", \"assert send_message('Test') == 'Message sent: Test'\", \"assert send_message('This is a test message.') == 'Message sent: This is a test message.'\", \"assert send_message('') == 'Message se...
{ "split": "train", "index": 70668, "acecode_id": "bigcode_python_fns_47296", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with generating a unique identifier for documents in a Firestore collection. The identifier must be a random string consisting of 20 characters, which can include both uppercase and lowercase letters as well as digits. Implement a function that generates such an ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_random_id(20)) == 20\", \"assert all(c in string.ascii_letters + string.digits for c in generate_random_id(20))\", \"assert generate_random_id(20) != generate_random_id(20)\", \"assert generate_random_id(20).isalnum() == True\", \"assert all(c.i...
{ "split": "train", "index": 70669, "acecode_id": "evol_12277", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a privilege checking mechanism for a database view. The function will take three parameters: a boolean `has_select_privilege` indicating whether the user has SELECT privilege for the source table, a boolean `has_view_select...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_access(True, True, 0) == 'Access granted to source table.'\", \"assert check_access(True, False, 0) == 'Access granted to source table.'\", \"assert check_access(False, True, 0) == 'Access granted to view.'\", \"assert check_access(True, True, 1) == 'U...
{ "split": "train", "index": 70670, "acecode_id": "bigcode_python_fns_26257", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a Python function called `cyclic_permutation` that takes three integers as input parameters: `x`, `y`, and `z`. The function should perform a cyclical permutation of these variables, such that the value of `x` becomes the value of `y`, the value of `y` becomes the value o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cyclic_permutation(10, 20, 30) == (30, 10, 20)\", \"assert cyclic_permutation(1, 2, 3) == (3, 1, 2)\", \"assert cyclic_permutation(5, 15, 25) == (25, 5, 15)\", \"assert cyclic_permutation(0, 0, 0) == (0, 0, 0)\", \"assert cyclic_permutation(-1, -2, -3) == (-...
{ "split": "train", "index": 70671, "acecode_id": "evol_5167", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a method that takes a list of integers and returns a new list containing only the even integers from the original list, maintaining the order of their appearance. Write a function called `filter_even_numbers` that takes a list of integers as its...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([7, 8, 9, 10, 11]) == [8, 10]\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([1, 3, 5]) ==...
{ "split": "train", "index": 70672, "acecode_id": "evol_29328", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary that represents an encyclopedia, where each key is an entry and its corresponding value is a list of associated articles. Your task is to implement a function that returns a new dictionary containing the count of associated articles for each entry in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_associated_articles({'sandwich':['bread', 'butter', 'cheese'], 'pasta':['macaroni', 'sauce', 'cheese']}) == {'sandwich': 3, 'pasta': 3}\", \"assert count_associated_articles({'apple':[], 'banana':['yellow'], 'grape':['purple', 'sweet']}) == {'apple': 0...
{ "split": "train", "index": 70673, "acecode_id": "evol_7991", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple data catalog in Python. The data catalog should support the storage and retrieval of datasets identified by unique keys. Your task is to implement a function `data_catalog_operations(operations: List[Tuple[str, str, Optional[Any]]]) -> ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert data_catalog_operations([('add', 'dataset2', 'data2'), ('get', 'dataset2', None)]) == ['data2']\", \"assert data_catalog_operations([('add', 'dataset3', 'data3'), ('get', 'dataset4', None)]) == [None]\", \"assert data_catalog_operations([('add', 'dataset5', ...
{ "split": "train", "index": 70674, "acecode_id": "oss_28196", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a secure token for a user based on their credentials. The function should take three parameters: a username (string), a password (string), and a portal URL (string). The function should return a token (string) if the cr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_token('admin', 'secret', 'https://example.com') == 'admin-token'\", \"assert generate_token('admin', 'secret', 'https://another-example.com') == 'admin-token'\", \"assert generate_token('admin', 'secret', 'https://example.com') == 'admin-token'\", \...
{ "split": "train", "index": 70675, "acecode_id": "bigcode_python_fns_34749", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Design a function that takes a string of text and a list of keywords, and returns the frequency of each keyword in the text. The function should ignore case differences and return the results as a list of tuples, each containing a keyword and its frequency, sorted in descending...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert keyword_frequency('Artificial intelligence and machine learning are subfields of AI.', ['artificial', 'intelligence', 'data', 'learning']) == [('artificial', 1), ('intelligence', 1), ('learning', 1)]\", \"assert keyword_frequency('Python is a programming lan...
{ "split": "train", "index": 70676, "acecode_id": "evol_32967", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes an output profile for a video processing application. The function should accept two parameters: `instance` (a dictionary containing video instance data) and `profile` (a dictionary containing profile information). Your...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_video_profile({'families': ['family1', 'family2']}, {'ext': 'mp4', 'families': ['familyA']}) == {'ext': 'mp4', 'families': ['familyA']}\", \"assert process_video_profile({'families': ['family1']}, {'families': ['familyA']}) == {'ext': 'mov', 'familie...
{ "split": "train", "index": 70677, "acecode_id": "oss_36788", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a DNA sequence represented as a string consisting of the characters 'A', 'T', 'C', and 'G'. Your task is to implement a function that counts the number of times the substring 'ATCG' appears in the given DNA sequence. The function should return this count as an int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_atcg_substring('ATCGATCGATCG') == 3\", \"assert count_atcg_substring('GGGATCGGGG') == 1\", \"assert count_atcg_substring('ATCG') == 1\", \"assert count_atcg_substring('ATCGAATCG') == 2\", \"assert count_atcg_substring('ATCGATCGGATCG') == 3\", \"assert ...
{ "split": "train", "index": 70678, "acecode_id": "bigcode_python_fns_21704", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, replace every instance of two consecutive spaces with a single space. Implement a function called replace_dual_spaces that takes a single parameter, text, which is a string. The function should return a new string with all dual spaces replaced by a single space....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_dual_spaces('hello world how are you') == 'hello world how are you'\", \"assert replace_dual_spaces(' leading spaces') == ' leading spaces'\", \"assert replace_dual_spaces('trailing spaces ') == 'trailing spaces '\", \"assert replace_dual_space...
{ "split": "train", "index": 70679, "acecode_id": "evol_25120", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a target object that contains information about a database table. The object has a property 'table' which itself is an object with three attributes: 'project_id', 'dataset_id', and 'table_id'. Write a function `table_str(bq_target)` that takes this target object a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert table_str({'table': {'project_id': 'proj1', 'dataset_id': 'data1', 'table_id': 'table1'}}) == 'proj1.data1.table1'\", \"assert table_str({'table': {'project_id': 'proj2', 'dataset_id': 'data2', 'table_id': 'table2'}}) == 'proj2.data2.table2'\", \"assert tabl...
{ "split": "train", "index": 70680, "acecode_id": "bigcode_python_fns_33431", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes the head of a singly-linked list and reverses the list. After reversing the list, it should insert a new node with a specific value at a given position. If the list is empty, the new node should be added as the head if the position is 0. If the p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_and_insert(ListNode(1), 2, 0).val == 2\", \"assert reverse_and_insert(ListNode(1), 2, 1).val == 1\", \"assert reverse_and_insert(ListNode(1), 2, 2).val == 1\", \"assert reverse_and_insert(ListNode(1, ListNode(2)), 3, 0).val == 3\", \"assert reverse_a...
{ "split": "train", "index": 70681, "acecode_id": "evol_32113", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that constructs a configuration dictionary from a given list of applications and their corresponding versions. The function should take two parameters: a dictionary representing the existing configuration and a list of tuples where each t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_config({'app1': '1.0'}, [('app2', '2.0'), ('app1', '1.1')]) == {'app1': '1.0', 'app2': '2.0'}\", \"assert update_config({}, [('app1', '1.0'), ('app2', '2.0')]) == {'app1': '1.0', 'app2': '2.0'}\", \"assert update_config({'app1': '1.0'}, []) == {'app1'...
{ "split": "train", "index": 70682, "acecode_id": "bigcode_python_fns_41219", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `max_value(a: int, b: int) -> int` that takes two integers as input and returns the maximum of the two integers. The function should use indentation to structure the code properly, adhering to Python's standard indentation rules. Make sure to include the ne...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_value(3, 5) == 5\", \"assert max_value(-1, -5) == -1\", \"assert max_value(0, 0) == 0\", \"assert max_value(100, 50) == 100\", \"assert max_value(-10, -10) == -10\", \"assert max_value(42, 42) == 42\", \"assert max_value(7, 3) == 7\", \"assert max_value(...
{ "split": "train", "index": 70683, "acecode_id": "evol_32482", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the reception of DHCP Offer messages in response to DHCP Discover messages. Given a list of packets represented by their source IP addresses and a valid DHCP server's IP address, your function should return a set of leg...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_legitimate_servers(['192.168.1.1', '192.168.1.2', '192.168.1.3'], '192.168.1.1') == {'192.168.1.1'}\", \"assert filter_legitimate_servers(['192.168.1.2', '192.168.1.3'], '192.168.1.1') == set()\", \"assert filter_legitimate_servers(['10.0.0.1', '10.0....
{ "split": "train", "index": 70684, "acecode_id": "oss_19258", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `search_movies(movies: List[str], query: str) -> List[str]` that takes a list of movie titles and a search query, and returns a list of movie titles that contain the search query (case insensitive). If no movies match the search query, return an empty list....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_movies(['Inception', 'The Dark Knight', 'Interstellar'], 'in') == ['Inception', 'Interstellar']\", \"assert search_movies(['Toy Story', 'Toy Story 2', 'Toy Story 3'], 'Toy') == ['Toy Story', 'Toy Story 2', 'Toy Story 3']\", \"assert search_movies(['Th...
{ "split": "train", "index": 70685, "acecode_id": "evol_3765", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates import statements for a list of module names. Write a function called `generate_import_statements` that takes a list of module names as input and returns a dictionary where the keys are the module names and the values are t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_import_statements(['my_module_example']) == {'my_module_example': 'from .my_module_example import Example'}\", \"assert generate_import_statements(['another_module', 'test_module']) == {'another_module': 'from .another_module import Module', 'test_m...
{ "split": "train", "index": 70686, "acecode_id": "oss_30017", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string or a list of strings, implement a function that flattens the input into a single string. If the input is a string, the function should return the string as is. If the input is a list of strings, the function should join the elements into a single string. You can ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flatten_text('Hello World') == 'Hello World'\", \"assert flatten_text(['Hello', 'World']) == 'Hello World'\", \"assert flatten_text(['Hello', 'World'], ', ') == 'Hello, World'\", \"assert flatten_text(['A', 'B', 'C'], '-') == 'A-B-C'\", \"assert flatten_text...
{ "split": "train", "index": 70687, "acecode_id": "bigcode_python_fns_18626", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `matrix_mult(matrix1, matrix2)` that takes two matrices as input and returns their product. If the matrices have incompatible dimensions for multiplication, raise a ValueError. Ensure to handle any potential exceptions that may arise during the operation, s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert matrix_mult([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\", \"assert matrix_mult([[1]], [[2]]) == [[2]]\", \"assert matrix_mult([[1, 2, 3]], [[4], [5], [6]]) == [[32]]\", \"assert matrix_mult([[1, 2], [3, 4]], [[1, 0], [0, 1]]) == [[1, 2], [3,...
{ "split": "train", "index": 70688, "acecode_id": "evol_18314", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a given time period is valid. The valid time periods are 'daily', 'weekly', and 'monthly'. Your function should take a string input representing the time period and return True if the input is valid, and False otherwise...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_timeperiod('daily') == True\", \"assert is_valid_timeperiod('Daily') == True\", \"assert is_valid_timeperiod('WEEKLY') == True\", \"assert is_valid_timeperiod('weekly') == True\", \"assert is_valid_timeperiod('Monthly') == True\", \"assert is_valid_...
{ "split": "train", "index": 70689, "acecode_id": "oss_186", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple text comparison tool. The function should take two strings, `original_text` and `other_text`, as input and identify the differences between them. For each line in the `original_text`, if the line is not present...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_texts('test\\\\nexample\\\\n', 'example\\\\n') == ['-test']\", \"assert compare_texts('A\\\\nB\\\\nC\\\\nD\\\\n', 'D\\\\nC\\\\nB\\\\nA\\\\n') == []\", \"assert compare_texts('line1\\\\nline2\\\\n', 'line1\\\\nline2\\\\nline3\\\\n') == ['+line3']\", \...
{ "split": "train", "index": 70690, "acecode_id": "oss_14822", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a function `not_infinite(arr)` that takes in a list `arr` of tuples, where each tuple represents an instruction in a custom assembly-like language. Each tuple consists of two elements: a string representing the operation ('acc', 'jmp', or 'nop') and an integer rep...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert not_infinite([('nop', 0), ('acc', 1), ('jmp', 4), ('acc', 3), ('jmp', -3), ('acc', -99), ('acc', 1), ('jmp', -4), ('acc', 6)]) == 5\", \"assert not_infinite([('nop', 0), ('nop', 0), ('acc', 1)]) == 1\", \"assert not_infinite([('nop', 0), ('acc', 5), ('jmp', ...
{ "split": "train", "index": 70691, "acecode_id": "oss_31569", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to process market data based on a provided mapping of market names to their corresponding IDs. The market data is provided as a list of data lines, where each line contains a market name and associated data separated by a delimiter. Y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_market_data({'NYSE': 1, 'NASDAQ': 2}, ['NYSE|AAPL|Apple Inc.', 'NASDAQ|GOOGL|Alphabet Inc.']) == {1: ['NYSE|AAPL|Apple Inc.'], 2: ['NASDAQ|GOOGL|Alphabet Inc.']}\", \"assert process_market_data({'NYSE': 1}, ['NASDAQ|AAPL|Apple Inc.']) == {}\", \"asse...
{ "split": "train", "index": 70692, "acecode_id": "oss_14302", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that generates a file path for a dataset based on a given dataset name and optional keyword arguments. If the 'root_path' keyword argument is not provided, your function should set it to a default value that combines a predefin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_dataset_path('dataset1') == '/default/root/path/dataset1'\", \"assert generate_dataset_path('dataset2') == '/default/root/path/dataset2'\", \"assert generate_dataset_path('dataset3') == '/default/root/path/dataset3'\", \"assert generate_dataset_path...
{ "split": "train", "index": 70693, "acecode_id": "oss_28480", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string as input and returns the string with its characters in reversed order. For example, if the input string is 'hello', the output should be 'olleh'.\nPlease reason step by step, then write a self-contained Python solution. Give your final p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_string('abcde') == 'edcba'\", \"assert reverse_string('hello') == 'olleh'\", \"assert reverse_string('Python') == 'nohtyP'\", \"assert reverse_string('12345') == '54321'\", \"assert reverse_string('!@#$%') == '%$#@!'\", \"assert reverse_string('racec...
{ "split": "train", "index": 70694, "acecode_id": "evol_10573", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of strings and returns a dictionary containing the frequency of each unique word in the list. The function should ignore case sensitivity and consider only alphanumeric characters within the words. Additionall...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert word_frequency_counter(['The', 'quick', 'brown', 'fox', 'jumps', 'over', 'the', 'lazy', 'dog']) == {'quick': 1, 'brown': 1, 'fox': 1, 'jumps': 1, 'over': 1, 'lazy': 1, 'dog': 1}\", \"assert word_frequency_counter(['Hello', 'world', 'hello', 'WORLD']) == {'he...
{ "split": "train", "index": 70695, "acecode_id": "oss_18570", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that generates a formatted summary string based on the details of a content item. The content item can be represented as a dictionary with the following keys: 'id', 'routine', 'is_active', 'content_type', 'format', 'creator', and 'created'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_content_summary({'id': 1, 'routine': 'Weekly', 'is_active': True, 'content_type': 'Blog Post', 'format': 'Markdown', 'creator': {'first_name': 'Alice', 'last_name': 'Smith'}, 'created': '2023-01-01'}) == 'ID: 1, Routine: Weekly, Active: True, Conten...
{ "split": "train", "index": 70696, "acecode_id": "oss_6085", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `raw_ticker` representing a stock ticker symbol and a string `raw_industry` representing the industry of the stock, write a function `make_cse_path(raw_ticker: str, raw_industry: str) -> str` that generates a URL for the Canadian Securities Exchange (CSE) based o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_cse_path('ABC', 'Mining') == 'https://thecse.com/en/listings/mining/abc'\", \"assert make_cse_path('XYZ', 'Technology') == 'https://thecse.com/en/listings/technology/xyz'\", \"assert make_cse_path('123', 'Oil and Gas') == 'https://thecse.com/en/listings...
{ "split": "train", "index": 70697, "acecode_id": "bigcode_python_fns_25861", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function to validate a JSON Web Token (JWT) payload. The function should take in a JWT payload as a dictionary and perform the following tasks: 1. Check if the 'userid' claim in the payload matches a predefined approved user ID. 2. Verify i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_jwt({'userid': 'user123', 'exp': time.time() + 100}) == 'Valid Token'\", \"assert validate_jwt({'userid': 'user123', 'exp': time.time() - 100}) == 'Invalid Token'\", \"assert validate_jwt({'userid': 'user456', 'exp': time.time() + 100}) == 'Invalid ...
{ "split": "train", "index": 70698, "acecode_id": "oss_18258", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function to calculate the sum of the first N natural numbers using recursion. The sum of the first N natural numbers is defined as the sum of all positive integers from 1 to N. Your task is to write a recursive function `sum_Natural` th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_Natural(1) == 1\", \"assert sum_Natural(2) == 3\", \"assert sum_Natural(3) == 6\", \"assert sum_Natural(4) == 10\", \"assert sum_Natural(5) == 15\", \"assert sum_Natural(6) == 21\", \"assert sum_Natural(7) == 28\", \"assert sum_Natural(8) == 36\", \"asse...
{ "split": "train", "index": 70699, "acecode_id": "oss_26867", "num_tests": 16 }