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 string of symbols, write a function `shortest_subsequence(input_string)` that identifies and returns the shortest possible subsequence that covers all distinct alphabetic characters within the input string. If there is no such subsequence, return an empty string. The in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shortest_subsequence('aabbcc') == 'abc'\", \"assert shortest_subsequence('xyzxyz') == 'xyz'\", \"assert shortest_subsequence('aaa') == 'a'\", \"assert shortest_subsequence('abcabc') == 'abc'\", \"assert shortest_subsequence('aabbccddeeff') == 'abcdef'\", \"a... | {
"split": "train",
"index": 84900,
"acecode_id": "evol_25243",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of boolean values representing the states of several knobs (True for 'on' and False for 'off'). Your task is to implement a function `toggle_knobs(knobs: List[bool]) -> List[bool]` that inverts the states of these knobs based on the majority value. If the m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert toggle_knobs([True, True, False]) == [False, False, False]\", \"assert toggle_knobs([True, True, True]) == [False, False, False]\", \"assert toggle_knobs([True, False, True]) == [False, False, False]\", \"assert toggle_knobs([True, True, False, False]) == [F... | {
"split": "train",
"index": 84901,
"acecode_id": "bigcode_python_fns_10115",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `calculate_tracer_effects(tracer_mass_fraction: List[float], plugin_var: List[float]) -> List[float]` that takes two lists of floating-point numbers as input. The first list, `tracer_mass_fraction`, represents the mass fraction of a trace... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_tracer_effects([1.0, 2.0], [3.0, 4.0]) == [3.0, 8.0]\", \"assert calculate_tracer_effects([0.0, 0.5], [10.0, 20.0]) == [0.0, 10.0]\", \"assert calculate_tracer_effects([], [1.0, 2.0]) == []\", \"assert calculate_tracer_effects([0.1, 0.2, 0.3], []) ... | {
"split": "train",
"index": 84902,
"acecode_id": "bigcode_python_fns_16487",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a particle's position 'z' and the boundaries of a simulation supercell defined by 'z_min' and 'z_max'. Write a function `recast_to_supercell(z, z_min, z_max)` that computes the position of the particle at 'z' within the supercell. If the particle is outside the su... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert recast_to_supercell(5, 0, 10) == 5\", \"assert recast_to_supercell(-3, 0, 10) == 7\", \"assert recast_to_supercell(12, 0, 10) == 2\", \"assert recast_to_supercell(0, 0, 10) == 0\", \"assert recast_to_supercell(10, 0, 10) == 0\", \"assert recast_to_supercell(... | {
"split": "train",
"index": 84903,
"acecode_id": "bigcode_python_fns_3910",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a program that simulates a gardening system. The gardening system consists of a variety of plants, each with its own specific water requirements. Your task is to create a function that takes in a dictionary representing the gardening system and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_water_required({\\\"rose\\\": {\\\"water_requirement\\\": 30, \\\"growth_rate\\\": 0.4}, \\\"oak\\\": {\\\"water_requirement\\\": 60, \\\"growth_rate\\\": 0.2}}) == 90\", \"assert calculate_total_water_required({\\\"lily\\\": {\\\"water_requi... | {
"split": "train",
"index": 84904,
"acecode_id": "oss_36809",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `newton_cube_root` that utilizes Newton's method to calculate the cube root of a given positive numerical value. The function should take a single parameter, `number`, which is a positive float or integer, and return the cube root of that number. You may as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert newton_cube_root(64) == 4.0\", \"assert newton_cube_root(125) == 5.0\", \"assert newton_cube_root(216) == 6.0\", \"assert newton_cube_root(512) == 8.0\", \"assert newton_cube_root(729) == 9.0\", \"assert newton_cube_root(1728) == 12.0\", \"assert newton_cube... | {
"split": "train",
"index": 84905,
"acecode_id": "evol_7575",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the installation of a software pre-commit hook. The function should take a string as input, representing the name of the hook to be installed. If the name of the hook is 'pre-commit', the function should return 'Hook instal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert install_hook('pre-commit') == 'Hook installed successfully'\", \"assert install_hook('pre-push') == 'Hook installation failed'\", \"assert install_hook('pre-merge') == 'Hook installation failed'\", \"assert install_hook('pre-commit') == 'Hook installed succe... | {
"split": "train",
"index": 84906,
"acecode_id": "bigcode_python_fns_31613",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates checking the existence of files on a disk. The function should take a list of file names and return a list of boolean values indicating whether each file exists on the disk. For simplicity, let's assume that the file na... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_files_existence(['file1.txt', 'file2.txt', 'file3.txt']) == [True, True, True]\", \"assert check_files_existence(['file4.txt', 'file5.txt']) == [False, False]\", \"assert check_files_existence(['file1.txt', 'file4.txt']) == [True, False]\", \"assert ch... | {
"split": "train",
"index": 84907,
"acecode_id": "oss_18161",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a commit message to extract a specific pattern and perform a validation check. The function should take a commit message as input and return a boolean value based on whether the commit message contains a specific pat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_commit_message('Implemented new feature\\\\n--story=1234\\\\n# This is a comment') == True\", \"assert validate_commit_message('Fixed a bug\\\\n# This is a comment') == False\", \"assert validate_commit_message('--story=5678\\\\nAnother line\\\\n# C... | {
"split": "train",
"index": 84908,
"acecode_id": "oss_2430",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a K-means clustering algorithm for a given dataset. Your function should take a 2D list of data points and an integer k, representing the number of clusters, as input. The function should perform K-means clustering and return a list of cluster a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert k_means_clustering([[1, 2], [1, 4], [1, 0], [10, 2], [10, 4], [10, 0]], 2) in [[0, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 0]]\", \"assert k_means_clustering([[1, 1], [2, 2], [3, 3], [10, 10]], 2) in [[0, 0, 0, 1], [1, 1, 1, 0]]\", \"assert k_means_clustering([[1, 2... | {
"split": "train",
"index": 84909,
"acecode_id": "oss_6867",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to move a character on a grid-based map. The function should take two parameters: a direction in which the character should move and the current position of the character on the grid. Implement a function `move_character(direction, cu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert move_character('up', (2, 3)) == (2, 2)\", \"assert move_character('down', (2, 3)) == (2, 4)\", \"assert move_character('left', (2, 3)) == (1, 3)\", \"assert move_character('right', (2, 3)) == (3, 3)\", \"assert move_character('up', (0, 0)) == (0, -1)\", \"as... | {
"split": "train",
"index": 84910,
"acecode_id": "oss_33480",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `manage_tasks` that takes in a list of tasks, a list of engineers, and an action string. The function should return a dictionary mapping each task to its assigned engineer and its status based on the action provided ('delegate', 'update', or 'status'). If t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_tasks(['task1', 'task2'], ['engineer1', 'engineer2'], 'delegate') == {'task1': {'engineer': 'engineer1', 'status': 'not-started'}, 'task2': {'engineer': 'engineer2', 'status': 'not-started'}}\", \"assert manage_tasks(['task1', 'task2'], ['engineer1', ... | {
"split": "train",
"index": 84911,
"acecode_id": "evol_21361",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary `config` that contains key-value pairs representing configuration settings. Write a function `get_config_value(config: Dict[str, Any], option: str) -> str` that returns a message indicating the value of the given `option` in the `config`. If the `opti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_config_value({'option1': 10, 'option2': 20}, 'option1') == \\\"The value of 'option1' is set to '10'.\\\"\", \"assert get_config_value({'option1': 10, 'option2': 20}, 'option2') == \\\"The value of 'option2' is set to '20'.\\\"\", \"assert get_config_val... | {
"split": "train",
"index": 84912,
"acecode_id": "bigcode_python_fns_23106",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "A numerical value is designated as eleven-free if its decimal representation does not encompass any substring that signifies a power of 11, with the sole exception being 1. Your task is to implement a function that determines the value of E(n), which is the n-th positive intege... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert E(1) == 1\", \"assert E(2) == 2\", \"assert E(3) == 3\", \"assert E(4) == 4\", \"assert E(5) == 5\", \"assert E(6) == 6\", \"assert E(7) == 7\", \"assert E(8) == 8\", \"assert E(9) == 9\", \"assert E(10) == 10\", \"assert E(11) == 12\", \"assert E(12) == 13\... | {
"split": "train",
"index": 84913,
"acecode_id": "evol_22161",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list that consists of the squares of the original integers, but only includes the squares of the even integers. If there are no even integers in the input list, return an empty list. Wri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_and_square_evens([1, 2, 3, 4]) == [4, 16]\", \"assert filter_and_square_evens([0, 1, 2, 3]) == [0, 4]\", \"assert filter_and_square_evens([1, 3, 5]) == []\", \"assert filter_and_square_evens([]) == []\", \"assert filter_and_square_evens([-2, -1, 0, 1,... | {
"split": "train",
"index": 84914,
"acecode_id": "bigcode_python_fns_4416",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `update_departure_board(stop_area_id: int) -> str` that simulates updating a departure board for a train station identified by the given `stop_area_id`. The function should return a string message indicating whether the update was success... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_departure_board(1) == 'Departure board updated successfully.'\", \"assert update_departure_board(100) == 'Departure board updated successfully.'\", \"assert update_departure_board(42) == 'Departure board updated successfully.'\", \"assert update_depar... | {
"split": "train",
"index": 84915,
"acecode_id": "bigcode_python_fns_35446",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `define_app_flags(scenario_num: str) -> dict` that simulates the definition of application-wide flags for a hypothetical application. The function should take a single parameter, `scenario_num`, which is a string representing the scenario... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert define_app_flags('1') == {'save_model': False, 'summaries_dir': './logs', 'ckpt_dir': './saved_models/', 'scenario_num': '1', 'errors_dir': './errors/'}\", \"assert define_app_flags('2') == {'save_model': False, 'summaries_dir': './logs', 'ckpt_dir': './save... | {
"split": "train",
"index": 84916,
"acecode_id": "bigcode_python_fns_15780",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that initializes a 3D camera with given parameters and returns a representation of the camera's configuration. The function should accept a variable number of positional arguments representing camera settings (like resolution, field o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_camera(1280, 720, color='black', model='D3500') == {'resolution': (1280, 720), 'color': 'black', 'model': 'D3500'}\", \"assert initialize_camera(640, 480) == {'resolution': (640, 480)}\", \"assert initialize_camera() == {}\", \"assert initialize_c... | {
"split": "train",
"index": 84917,
"acecode_id": "oss_23381",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that categorizes materials based on a given category slug. Implement the function `retrieve_materials_by_category(category_slug: str) -> List[str]` where `category_slug` can take the following values: \n\n- If the category slug is 'scie... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_materials_by_category('science') == ['MaterialA', 'MaterialB', 'MaterialC']\", \"assert retrieve_materials_by_category('technology') == ['TechMaterial']\", \"assert retrieve_materials_by_category('space') == ['SpaceMaterial']\", \"assert retrieve_ma... | {
"split": "train",
"index": 84918,
"acecode_id": "oss_24803",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a class that represents a reinforcement learning environment with a list of actors. Each actor can have a reward value, which may be None if the reward is not available. Your task is to implement a function that calculates the total reward obtained by all the acto... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_reward(ReinforcementEnvironment([10, None, 5]), 1) == 16\", \"assert calculate_total_reward(ReinforcementEnvironment([None, None, None]), 2) == 6\", \"assert calculate_total_reward(ReinforcementEnvironment([None]), 7) == 7\", \"assert calcula... | {
"split": "train",
"index": 84919,
"acecode_id": "oss_28226",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function in Python that calculates the GCD (Greatest Common Divisor) of two positive integers. The function should return an error message if either of the inputs is not a positive integer. If the inputs are valid, return the GCD of the two numbers.\nPlease reason s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gcd(48, 18) == 6\", \"assert gcd(54, 24) == 6\", \"assert gcd(101, 10) == 1\", \"assert gcd(7, 1) == 1\", \"assert gcd(13, 39) == 13\", \"assert gcd(100, 25) == 25\", \"assert gcd(1, 1) == 1\", \"assert gcd(1024, 2048) == 1024\", \"assert gcd(17, 19) == 1\",... | {
"split": "train",
"index": 84920,
"acecode_id": "evol_4889",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of student group names and a maximum group size as input, and returns a dictionary where the keys are the student group names and the values are lists of student IDs. Each group should contain a maximum number of stu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert assign_students_to_groups(['Group A', 'Group B'], 3) == {'Group A': [0, 1, 2], 'Group B': [3, 4, 5]}\", \"assert assign_students_to_groups(['Group A'], 2) == {'Group A': [0, 1]}\", \"assert assign_students_to_groups(['Group A', 'Group B', 'Group C'], 1) == {... | {
"split": "train",
"index": 84921,
"acecode_id": "bigcode_python_fns_15978",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list (matrix) of shape m x n where m represents the number of rows and n represents the number of columns, write a function `adjust_matrix(matrix)` that performs the following operations: 1) Normalize each column of the matrix by dividing each element by the first el... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert adjust_matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == 2\", \"assert adjust_matrix([[1, 1, 1], [1, 1, 1], [1, 1, 1]]) == 1\", \"assert adjust_matrix([[2, 4, 6], [1, 3, 5], [3, 2, 1]]) == 2\", \"assert adjust_matrix([[5, 10, 15], [10, 20, 30], [15, 25, 35]]) == ... | {
"split": "train",
"index": 84922,
"acecode_id": "bigcode_python_fns_4102",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative index `rowIndex`, write a function `getPascalRow(rowIndex)` that returns the `rowIndex`-th row of Pascal's triangle as a list. Pascal's triangle is constructed such that the `n`-th row contains the binomial coefficients of the expansion of `(a + b)^n`. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert getPascalRow(0) == [1]\", \"assert getPascalRow(1) == [1, 1]\", \"assert getPascalRow(2) == [1, 2, 1]\", \"assert getPascalRow(3) == [1, 3, 3, 1]\", \"assert getPascalRow(4) == [1, 4, 6, 4, 1]\", \"assert getPascalRow(5) == [1, 5, 10, 10, 5, 1]\", \"assert g... | {
"split": "train",
"index": 84923,
"acecode_id": "oss_11336",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of records, where each record is represented as a dictionary containing various attributes. Your goal is to create a function that returns a summary of the records based on a specified attribute. The summary should include the total number ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_summary([], 'department') == {'total_records': 0, 'unique_values_count': 0, 'value_frequency': {}}\", \"assert generate_summary([{'name': 'Alice', 'department': 'HR'}], 'department') == {'total_records': 1, 'unique_values_count': 1, 'value_frequency... | {
"split": "train",
"index": 84924,
"acecode_id": "oss_9630",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that applies a provided function to each item in a list of integers and returns a new list containing the results. Your function should take two parameters: a function 'func' that takes an integer and returns an integer, and a list of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_function(lambda x: x * 2, [1, 2, 3]) == [2, 4, 6]\", \"assert apply_function(lambda x: x + 1, [0, -1, -2]) == [1, 0, -1]\", \"assert apply_function(lambda x: x ** 2, [1, 2, 3, 4]) == [1, 4, 9, 16]\", \"assert apply_function(lambda x: x % 2, [1, 2, 3, 4... | {
"split": "train",
"index": 84925,
"acecode_id": "bigcode_python_fns_46357",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `find_mode(num_list)` that returns a sorted list of the modes (the numbers that appear most frequently) in the list. If there are no modes (i.e., all numbers appear only once), return the string 'No mode found'. The output should b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_mode([1, 2, 2, 3, 4, 4, 5, 5]) == [2, 4, 5]\", \"assert find_mode([1, 1, 2, 3, 3, 4, 5]) == [1, 3]\", \"assert find_mode([1, 2, 3]) == 'No mode found'\", \"assert find_mode([1, 1, 1, 2, 2, 3, 3]) == [1]\", \"assert find_mode([5, 5, 6, 6, 7, 7]) == [5, 6... | {
"split": "train",
"index": 84926,
"acecode_id": "evol_14953",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integers a and b, write a function that returns the sum of all integers between a and b (inclusive). If a is greater than b, return 0. You can assume that both a and b are within the range of 0 to 10000. The function signature should be: def sum_between(a: int, b: int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_between(1, 5) == 15\", \"assert sum_between(0, 0) == 0\", \"assert sum_between(5, 1) == 0\", \"assert sum_between(10, 10) == 10\", \"assert sum_between(1, 10) == 55\", \"assert sum_between(200, 100) == 0\", \"assert sum_between(15, 15) == 15\", \"assert ... | {
"split": "train",
"index": 84927,
"acecode_id": "bigcode_python_fns_18448",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function to compute the nth number in the Fibonacci sequence using an optimized recursive approach with memoization. The function should handle edge cases by returning a specific error message if the input is not a positive integer. Your function should be named `fi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci_with_memoization(1) == 0\", \"assert fibonacci_with_memoization(2) == 1\", \"assert fibonacci_with_memoization(3) == 1\", \"assert fibonacci_with_memoization(4) == 2\", \"assert fibonacci_with_memoization(5) == 3\", \"assert fibonacci_with_memoizat... | {
"split": "train",
"index": 84928,
"acecode_id": "evol_18657",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers representing memory allocations in a custom programming language and identifies the integers that are no longer being referenced (i.e., those that do not appear in a list of active references). Your funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_unreferenced_allocations([1, 2, 3, 4, 5], [2, 3]) == [1, 4, 5]\", \"assert find_unreferenced_allocations([10, 20, 30, 40], [10, 20]) == [30, 40]\", \"assert find_unreferenced_allocations([1, 2, 3], [1, 2, 3]) == []\", \"assert find_unreferenced_allocati... | {
"split": "train",
"index": 84929,
"acecode_id": "oss_33597",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that converts a character representing a NumPy data type into its corresponding field details, such as the field name and data type. The function `details_from_numpy_dtype(dtype_char: str) -> dict` takes a single character as input (repre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert details_from_numpy_dtype('i') == {'name': 'integer_field', 'data_type': 'int'}\", \"assert details_from_numpy_dtype('f') == {'name': 'float_field', 'data_type': 'float'}\", \"assert details_from_numpy_dtype('b') == {'name': 'boolean_field', 'data_type': 'boo... | {
"split": "train",
"index": 84930,
"acecode_id": "oss_24922",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that takes this list and returns a list of tuples, where each tuple contains consecutive elements from the input list. For example, if the input list is [1, 2, 3], the output should be [(1, 2), (2, 3)]. If the input list has less t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pairwise([1, 2, 3]) == [(1, 2), (2, 3)]\", \"assert pairwise([5, 10, 15, 20]) == [(5, 10), (10, 15), (15, 20)]\", \"assert pairwise([0]) == []\", \"assert pairwise([]) == []\", \"assert pairwise([1]) == []\", \"assert pairwise([1, 2]) == [(1, 2)]\", \"assert... | {
"split": "train",
"index": 84931,
"acecode_id": "bigcode_python_fns_46523",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the termination of a bot identified by its unique ID. The function will take in a bot ID and a boolean flag indicating whether to wait for the bot to finish its current task before termination. If the bot ID is valid (non-e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert terminate_bot('bot123', True) == 'Terminating bot with ID bot123'\", \"assert terminate_bot('bot456', False) == 'Bot bot456 terminated'\", \"assert terminate_bot('', True) == 'Invalid bot ID'\", \"assert terminate_bot('', False) == 'Invalid bot ID'\", \"asse... | {
"split": "train",
"index": 84932,
"acecode_id": "bigcode_python_fns_49988",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `product_of_primes_in_range(start: int, end: int) -> int` that calculates the product of all prime numbers within a given inclusive range from `start` to `end`. The function should return 1 if there are no prime numbers in the range. The input values `start` an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_of_primes_in_range(1, 10) == 210\", \"assert product_of_primes_in_range(1, 1) == 1\", \"assert product_of_primes_in_range(2, 2) == 2\", \"assert product_of_primes_in_range(3, 3) == 3\", \"assert product_of_primes_in_range(4, 4) == 1\", \"assert produ... | {
"split": "train",
"index": 84933,
"acecode_id": "evol_10731",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples, where each tuple represents properties of an atom in the format (atomic_number, charge, max_valence). Write a function `get_atoms()` that takes no parameters and returns a list of tuples representing the properties of atoms. The function should r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_atoms() == [(1, 0, 1), (6, 4, 4), (8, -2, 2)]\", \"assert len(get_atoms()) == 3\", \"assert get_atoms()[0] == (1, 0, 1)\", \"assert get_atoms()[1] == (6, 4, 4)\", \"assert get_atoms()[2] == (8, -2, 2)\", \"assert all(isinstance(atom, tuple) for atom in g... | {
"split": "train",
"index": 84934,
"acecode_id": "bigcode_python_fns_28441",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `use_board(name: str) -> str` that simulates the usage of a board with a given name. The function should initialize the board and return a string indicating that the board is in use. The function should return the string in the format: 'B... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert use_board('Arduino') == 'Board Arduino is now in use.'\", \"assert use_board('RaspberryPi') == 'Board RaspberryPi is now in use.'\", \"assert use_board('ESP32') == 'Board ESP32 is now in use.'\", \"assert use_board('BeagleBone') == 'Board BeagleBone is now i... | {
"split": "train",
"index": 84935,
"acecode_id": "bigcode_python_fns_4385",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function called `validate_and_convert` that takes a single parameter `a`. This parameter can be an integer or a string. If `a` is an integer, the function should return it as is. If `a` is a string that starts with '123<warning descr=\"null\">', the func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_and_convert(123) == 123\", \"assert validate_and_convert('123<warning descr=\\\"null\\\">') == 123\", \"assert validate_and_convert('456') == 456\", \"assert validate_and_convert('abc') == 'xyz'\", \"assert validate_and_convert('789') == 789\", \"as... | {
"split": "train",
"index": 84936,
"acecode_id": "oss_23781",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing items. Each item may be a valid entry or a comment. A comment is indicated by a string that starts with the '#' character. Your task is to implement a function `filter_comments(items: List[str]) -> List[str]` that takes a list of str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_comments(['apple', '# This is a comment', 'banana', 'orange', '# Another comment', 'grape']) == ['apple', 'banana', 'orange', 'grape']\", \"assert filter_comments(['# comment 1', '# comment 2', '# comment 3']) == []\", \"assert filter_comments(['item1... | {
"split": "train",
"index": 84937,
"acecode_id": "oss_6580",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of IP addresses and generates a string containing each IP address formatted as an XML `<item>` element. The input is a list of IP addresses that can include both IPv4 and IPv6 addresses. Your function should return a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_xml_from_ips(['192.168.1.1', '192.168.1.1', '10.0.0.1']) == '<item>192.168.1.1</item>\\\\n<item>10.0.0.1</item>'\", \"assert generate_xml_from_ips(['::1', '::1', '2001:db8::1']) == '<item>::1</item>\\\\n<item>2001:db8::1</item>'\", \"assert generate... | {
"split": "train",
"index": 84938,
"acecode_id": "oss_23403",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing an additive hash function that computes a hash value for a given string key. The hash function should iterate through each character in the string, converting it to its ASCII value, and summing these values to produce a single integer hash. Impl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert additive_hash('abc') == 294\", \"assert additive_hash('') == 0\", \"assert additive_hash('a') == 97\", \"assert additive_hash('z') == 122\", \"assert additive_hash('hello') == 532\", \"assert additive_hash('world') == 552\", \"assert additive_hash('123') == ... | {
"split": "train",
"index": 84939,
"acecode_id": "bigcode_python_fns_22876",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `recreate_database` that simulates the process of resetting a database. The function should take no parameters and return a string that indicates the status of the operation. The string should be 'Database cleaned and set up' if the o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert recreate_database() == 'Database cleaned and set up'\", \"assert recreate_database() == 'Database cleaned and set up'\", \"assert recreate_database() == 'Database cleaned and set up'\", \"assert recreate_database() == 'Database cleaned and set up'\", \"asser... | {
"split": "train",
"index": 84940,
"acecode_id": "bigcode_python_fns_44619",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a method that retrieves a value from a dictionary based on a list of attribute objects. Each attribute object has a method `get_string_form()` which returns its string representation. Your task is to implement the `get_value` method that concate... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert AttributeCache({'foo': 1, 'bar': 2}).get_value([MockAttribute('bar')]) == 2\", \"assert AttributeCache({'foo': 1, 'bar': 2}).get_value([MockAttribute('baz')]) == None\", \"assert AttributeCache({'abc': 3, 'def': 4}).get_value([MockAttribute('abc')]) == 3\", ... | {
"split": "train",
"index": 84941,
"acecode_id": "oss_2888",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of characters representing a mathematical expression that contains nested brackets, specifically square brackets '[' and ']'. Your task is to implement a function `find_outermost_sub_expression(expression: List[str]) -> List[str]` that finds and returns the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_outermost_sub_expression(['[', 'a', '+', '[', 'b', ']', ']']) == ['[', 'a', '+', '[', 'b', ']', ']']\", \"assert find_outermost_sub_expression(['[', '[', 'x', ']', '[', 'y', ']']) == ['[', '[', 'x', ']', '[', 'y', ']']\", \"assert find_outermost_sub_exp... | {
"split": "train",
"index": 84942,
"acecode_id": "bigcode_python_fns_7370",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating a specific sum based on a given input value `ei`. The calculation involves three derived values: `suu1`, which is the integer value of `ei`, `suu2`, which is the integer value of `ei` squared, and `suu3`, which is the integer value of `ei` cubed.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_sum(0) == 0\", \"assert calculate_sum(1) == 3\", \"assert calculate_sum(2) == 14\", \"assert calculate_sum(3) == 39\", \"assert calculate_sum(4) == 84\", \"assert calculate_sum(5) == 155\", \"assert calculate_sum(7) == 399\"]}"
} | {
"split": "train",
"index": 84943,
"acecode_id": "oss_12037",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a string representing an ISO 8601 formatted datetime, write a function that converts it into a more human-readable format 'YYYY.MM.DD HH:MM:SS'. If the input string is None, return 'an unknown time'. The function should handle valid ISO datetime strings correctly, includi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_iso_datetime('2023-10-05T14:48:00Z') == '2023.10.05 14:48:00'\", \"assert format_iso_datetime('2021-01-01T00:00:00+00:00') == '2021.01.01 00:00:00'\", \"assert format_iso_datetime('2022-12-25T18:30:00-05:00') == '2022.12.25 18:30:00'\", \"assert forma... | {
"split": "train",
"index": 84944,
"acecode_id": "bigcode_python_fns_48788",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a number `maximum`. Write a function `is_less_than(maximum: Union[int, float, Decimal]) -> Callable[[Union[int, float, Decimal]], bool]` that returns a predicate function. This predicate function takes a single number `i` as input and returns `True` if `i` is less... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_less_than(10)(5) == True\", \"assert is_less_than(10)(10) == False\", \"assert is_less_than(10)(15) == False\", \"assert is_less_than(0)(-1) == True\", \"assert is_less_than(0)(0) == False\", \"assert is_less_than(0)(1) == False\", \"assert is_less_than(5... | {
"split": "train",
"index": 84945,
"acecode_id": "bigcode_python_fns_36724",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that processes a list of products and their details. Implement the function `calculate_total_cost(products: List[Tuple[str, int, float]]) -> List[Tuple[str, int, float, float]]` that takes a list of tuples as input. Each tuple contains the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_cost([('Apple', 5, 2.5), ('Banana', 7, 1.8), ('Orange', 10, 3.2)]) == [('Apple', 5, 2.5, 12.5), ('Banana', 7, 1.8, 12.6), ('Orange', 10, 3.2, 32.0)]\", \"assert calculate_total_cost([('Grapes', 3, 4.0), ('Peach', 2, 3.5)]) == [('Grapes', 3, 4... | {
"split": "train",
"index": 84946,
"acecode_id": "oss_13005",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, implement a function `compute_pi(n)` that uses a probabilistic algorithm to estimate the value of π (pi) using random sampling within a unit square. The function should return the estimated value of π after generating n random points. The estimated π is calc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_pi(10) >= 2.0 and compute_pi(10) <= 4.0\", \"assert compute_pi(100) >= 2.0 and compute_pi(100) <= 4.0\", \"assert compute_pi(1000) >= 2.0 and compute_pi(1000) <= 4.0\", \"assert compute_pi(10000) >= 3.0 and compute_pi(10000) <= 4.0\", \"assert comput... | {
"split": "train",
"index": 84947,
"acecode_id": "evol_32916",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `countdown_with_factorials(n: int) -> List[str]` that takes an integer `n` (1 <= n <= 10) and returns a list of strings representing a countdown from `n` to 1. For each number in the countdown, it should also include the factorial of that number. The output... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert countdown_with_factorials(10) == ['The factorial of 10 is 3628800', 'The factorial of 9 is 362880', 'The factorial of 8 is 40320', 'The factorial of 7 is 5040', 'The factorial of 6 is 720', 'The factorial of 5 is 120', 'The factorial of 4 is 24', 'The factor... | {
"split": "train",
"index": 84948,
"acecode_id": "evol_11728",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `search_and_modify_list(list_items: List[str], item_to_search: str, item_to_add: str, item_to_remove: str) -> Tuple[str, List[str]]` that searches for a given item in a list and determines its positions within the list. If the item does not exist, return a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_and_modify_list(['apple', 'banana'], 'grape', 'kiwi', 'banana') == ('Item \\\"grape\\\" not found in the list.', ['apple', 'kiwi'])\", \"assert search_and_modify_list(['apple'], 'apple', 'banana', 'apple') == ('Item \\\"apple\\\" found at positions [0... | {
"split": "train",
"index": 84949,
"acecode_id": "evol_35714",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of node IDs represented as integers. Your task is to implement a function `check_nodes(node_id_list)` that takes in this list and returns a list of boolean values indicating whether each node ID is valid (an even integer). A node ID is considered valid if i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_nodes([1, 2, 3, 4, 5]) == [False, True, False, True, False]\", \"assert check_nodes([0, 2, 4, 6]) == [True, True, True, True]\", \"assert check_nodes([-2, -4, 6, 8]) == [False, False, True, True]\", \"assert check_nodes([]) == []\", \"assert check_node... | {
"split": "train",
"index": 84950,
"acecode_id": "bigcode_python_fns_44660",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a value `v` and a default value `default`, return the default value if `v` is None; otherwise, return `v`. Implement a function `default_if_none(v: Optional[Any], default: Any) -> Any` that takes in two parameters: `v`, which can be of any type (including None), and `defa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert default_if_none(None, 5) == 5\", \"assert default_if_none(0, 10) == 0\", \"assert default_if_none('test', 'default') == 'test'\", \"assert default_if_none('', 'default') == ''\", \"assert default_if_none(3.14, 1.59) == 3.14\", \"assert default_if_none(None, ... | {
"split": "train",
"index": 84951,
"acecode_id": "bigcode_python_fns_2266",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to retrieve playlists based on certain criteria from a list of playlists. You are given a function `show_playlists(playlists, user, owner_only=False)` that takes three parameters: \n- `playlists`: a list of dictionaries, where each di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert show_playlists([{'name': 'Chill Vibes', 'owner': 'Alice'}, {'name': 'Workout Mix', 'owner': 'Bob'}, {'name': 'Morning Beats', 'owner': 'Alice'}], 'Alice', owner_only=True) == [{'name': 'Chill Vibes', 'owner': 'Alice'}, {'name': 'Morning Beats', 'owner': 'Ali... | {
"split": "train",
"index": 84952,
"acecode_id": "oss_3802",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given two integers, value_max and value, write a function that ensures the value does not exceed the bounds set by value_max. Specifically, if the value is greater than value_max, return value_max; if the value is less than -value_max, return -value_max; otherwise, return the v... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert limit_to_value_max(10, 15) == 10\", \"assert limit_to_value_max(10, -5) == -5\", \"assert limit_to_value_max(10, 10) == 10\", \"assert limit_to_value_max(10, 0) == 0\", \"assert limit_to_value_max(10, -10) == -10\", \"assert limit_to_value_max(10, 11) == 10\... | {
"split": "train",
"index": 84953,
"acecode_id": "bigcode_python_fns_48591",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages a simple contact book. The function should allow users to perform the following operations: add a contact by name, remove a contact by name, search for a contact by name, and return the total number of contacts. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contact_book([('add', 'Alice'), ('add', 'Bob'), ('search', 'Alice')]) == [True]\", \"assert contact_book([('add', 'Alice'), ('remove', 'Alice'), ('search', 'Alice')]) == [False]\", \"assert contact_book([('add', 'Alice'), ('add', 'Bob'), ('total', None)]) ==... | {
"split": "train",
"index": 84954,
"acecode_id": "oss_9096",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates storing user credentials in a cookie jar. The function should take two parameters: a username (string) and a password (string). The function will store these credentials in a dictionary with the keys 'username' and 'passwor... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert store_credentials('user1', 'pass1') == {'username': 'user1', 'password': 'pass1'}\", \"assert store_credentials('admin', 'admin123') == {'username': 'admin', 'password': 'admin123'}\", \"assert store_credentials('test_user', 'securepass') == {'username': 'te... | {
"split": "train",
"index": 84955,
"acecode_id": "oss_13173",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a system represented by a dictionary with the following keys: 'system_id' (integer), 'system_name' (string), 'dnsname' (string or None), 'domain' (string or None), and 'system_install_time' (datetime object or None). Your task is to implement a function that gener... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_system_report({'system_id': 1, 'system_name': 'test_system', 'dnsname': None, 'domain': None, 'system_install_time': None}) == ('1', 'test_system', 'systems/test_system.md')\", \"assert generate_system_report({'system_id': 2, 'system_name': 'test_sy... | {
"split": "train",
"index": 84956,
"acecode_id": "bigcode_python_fns_44542",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a Docker build command string based on provided parameters. The function should take three parameters: `dockerfile` (a string representing the path to the Dockerfile), `project_name` (a string representing the name of the p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_release('Dockerfile', 'my_project', 'latest') == 'docker build -f Dockerfile -t twined/my_project_latest .'\", \"assert build_release('Dockerfile.dev', 'my_app', 'dev') == 'docker build -f Dockerfile.dev -t twined/my_app_dev .'\", \"assert build_releas... | {
"split": "train",
"index": 84957,
"acecode_id": "bigcode_python_fns_43085",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of 2D points, `impoints_known` and `impoints_reprojected`, both represented as lists of tuples where each tuple contains two integers (x, y), compute the root mean square (RMS) error of the points reprojection. The RMS error is calculated as the square root of t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reprojection_rms([(0, 0), (1, 1)], [(0, 0), (1, 1)]) == 0.0\", \"assert reprojection_rms([(1, 2), (3, 4)], [(1, 2), (3, 4)]) == 0.0\", \"assert reprojection_rms([(1, 2), (3, 4)], [(1, 3), (3, 5)]) == 1.0\", \"assert reprojection_rms([(1, 1)], [(1, 2)]) == 1.... | {
"split": "train",
"index": 84958,
"acecode_id": "bigcode_python_fns_47702",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of service instances, each represented as a tuple containing a service name, an IP address, and a port number, and a list of last records represented as a list of tuples where each tuple contains a result ('SUCCESS' or 'FAIL') and a corresponding service name, IP, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert highest_priority_service([('service1', '192.168.0.1', 8080), ('service2', '192.168.0.2', 8080)], [('SUCCESS', 'service1', '192.168.0.1', 8080), ('FAIL', 'service1', '192.168.0.1', 8080), ('SUCCESS', 'service2', '192.168.0.2', 8080)]) in [('192.168.0.1', 8080... | {
"split": "train",
"index": 84959,
"acecode_id": "bigcode_python_fns_31059",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_primes_up_to(n: int) -> List[int]` that returns a list of all prime numbers that are less than or equal to the given integer n. The function should handle cases where n is not a positive integer or exceeds 10000 by returning an empty list. Optimize you... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_primes_up_to(10) == [2, 3, 5, 7]\", \"assert get_primes_up_to(1) == []\", \"assert get_primes_up_to(0) == []\", \"assert get_primes_up_to(-5) == []\", \"assert get_primes_up_to(10001) == []\", \"assert get_primes_up_to(20) == [2, 3, 5, 7, 11, 13, 17, 19]... | {
"split": "train",
"index": 84960,
"acecode_id": "evol_5433",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the installation of software tools on a Mac operating system. The function should take a single parameter, `software_name`, which is a string representing the name of the software to be installed. If the software name is 'c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert install_software('command line tools') == 'Installation of command line tools completed.'\", \"assert install_software('xcode') == 'Software xcode is not recognized for installation.'\", \"assert install_software('homebrew') == 'Software homebrew is not reco... | {
"split": "train",
"index": 84961,
"acecode_id": "bigcode_python_fns_34008",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and a non-negative integer representing the number of right rotations to perform on the list, implement a function `rotate_list(input_list: List[int], rotations: int) -> List[int]` that returns the list after performing the specified number of rotations... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rotate_list([1, 2, 3, 4, 5], 1) == [5, 1, 2, 3, 4]\", \"assert rotate_list([1, 2, 3, 4, 5], 2) == [4, 5, 1, 2, 3]\", \"assert rotate_list([1, 2, 3, 4, 5], 3) == [3, 4, 5, 1, 2]\", \"assert rotate_list([1, 2, 3, 4, 5], 4) == [2, 3, 4, 5, 1]\", \"assert rotate... | {
"split": "train",
"index": 84962,
"acecode_id": "evol_122",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, write a function `jaccard_similarity(x: List[int], y: List[int]) -> float` that calculates the Jaccard Similarity Coefficient (Jaccard Index) between these two lists. The Jaccard coefficient measures the similarity between two sets and is defined as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert jaccard_similarity([1, 2, 3], [2, 3, 4]) == 0.5\", \"assert jaccard_similarity([1, 1, 2, 2], [1, 2]) == 1.0\", \"assert jaccard_similarity([1, 2, 3], [4, 5, 6]) == 0.0\", \"assert jaccard_similarity([1, 2, 3], [1, 2, 3]) == 1.0\", \"assert jaccard_similarity... | {
"split": "train",
"index": 84963,
"acecode_id": "bigcode_python_fns_43265",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that calculates the trimmed average price of a list of prices. The function should take a list of prices as input and return the average price after removing the highest and lowest prices from the list. If there are fewer than ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert trimmed_average(['1,000\\u5186', '2,000\\u5186', '3,000\\u5186']) == 2000.0\", \"assert trimmed_average(['500\\u5186', '1,500\\u5186', '2,500\\u5186', '3,500\\u5186']) == 2000.0\", \"assert trimmed_average(['1,000', '2,000', '3,000', '4,000', '5,000']) == 30... | {
"split": "train",
"index": 84964,
"acecode_id": "oss_12117",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of peaks, where each peak is represented as a list of values. Each peak contains the following information: an ID (integer), three weights (floats), a specification type (string), volume (float), volume error (float), intermolecular interaction (string), a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_peaks([[1, 1.0, 2.0, 3.0, 'A', 10.0, 0.5, 'int1', 0, 1, 2, 3]]) == [{'id': 1, 'w1': 1.0, 'w2': 2.0, 'w3': 3.0, 'spec_type': 'A', 'vol': 10.0, 'vol_err': 0.5, 'intm': 'int1', 'unused': 0, 'ass1': 1, 'ass2': 2, 'ass3': 3}]\", \"assert parse_peaks([[1, 1.... | {
"split": "train",
"index": 84965,
"acecode_id": "bigcode_python_fns_21891",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with building a function that simulates the construction of a bidirectional recurrent neural network (RNN) model for speech recognition. The function should take three parameters: `input_dim` (an integer representing the length of the input sequence), `units` (an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bidirectional_rnn_model(10, 32) == {'input_shape': (None, 10), 'units': 32, 'output_dim': 29}\", \"assert bidirectional_rnn_model(20, 64) == {'input_shape': (None, 20), 'units': 64, 'output_dim': 29}\", \"assert bidirectional_rnn_model(15, 128) == {'input_sh... | {
"split": "train",
"index": 84966,
"acecode_id": "bigcode_python_fns_21607",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to simulate a simple token-based authentication system. Your function should take in a request object and an expected token string. The request object has two attributes: 'path', a string representing the requested path, and 'token', a st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert authenticate_request(create_request('/secure-data', 'API_TOKEN'), 'API_TOKEN') == True\", \"assert authenticate_request(create_request('/public-data', 'PUBLIC_TOKEN'), 'PUBLIC_TOKEN') == True\", \"assert authenticate_request(create_request('/admin', 'ADMIN_T... | {
"split": "train",
"index": 84967,
"acecode_id": "oss_14624",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function in Python that takes a list of integers and returns a new list containing the elements of the input list in the reversed order.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block."
... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_array([1, 2, 3, 4, 5]) == [5, 4, 3, 2, 1]\", \"assert reverse_array([10, 20, 30]) == [30, 20, 10]\", \"assert reverse_array([-1, -2, -3]) == [-3, -2, -1]\", \"assert reverse_array([0]) == [0]\", \"assert reverse_array([]) == []\", \"assert reverse_ar... | {
"split": "train",
"index": 84968,
"acecode_id": "evol_4629",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function that transforms a provided string into uppercase. The function should reverse the string, eliminate any numerical digits it contains, and manage any special characters or punctuation marks. Additionally, it should proficiently handle unicode characters... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_string('12345') == ''\", \"assert process_string('') == ''\", \"assert process_string('A B C D E F G H I J K L M N O P Q R S T U V W X Y Z') == 'Z Y X W V U T S R Q P O N M L K J I H G F E D C B A'\", \"assert process_string('A1B2C3') == 'CBA'\", \"a... | {
"split": "train",
"index": 84969,
"acecode_id": "evol_19189",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a function `count_unicode_whitespace(input_text: str) -> int` that takes a string as input and returns the count of Unicode whitespace characters within the string. Unicode whitespace characters include spaces, tabs, and other special whitespace characters defined in Unic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unicode_whitespace('NoWhitespaceHere') == 0\", \"assert count_unicode_whitespace('Line1\\\\nLine2') == 1\", \"assert count_unicode_whitespace('Space\\\\u00A0after') == 1\", \"assert count_unicode_whitespace('Tab\\\\tand\\\\tspace') == 2\", \"assert cou... | {
"split": "train",
"index": 84970,
"acecode_id": "evol_15675",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to write a function that generates a dictionary where the keys are the unique integers from the list, and the values are the counts of how many times each integer appears in the list. Implement a function named `count_occurrences(a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_occurrences([1, 2, 2, 3, 4, 4, 4]) == {1: 1, 2: 2, 3: 1, 4: 3}\", \"assert count_occurrences([]) == {}\", \"assert count_occurrences([5]) == {5: 1}\", \"assert count_occurrences([1, 1, 1, 1]) == {1: 4}\", \"assert count_occurrences([10, 20, 20, 10, 30]... | {
"split": "train",
"index": 84971,
"acecode_id": "bigcode_python_fns_26332",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom function called `copy_field` that takes a 2D list (a game board) as input and returns a deep copy of that 2D list. The deep copy should ensure that modifications to the copied list do not affect the original list. Write the function `co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert copy_field([[1, 2], [3, 4]]) == [[1, 2], [3, 4]]\", \"assert copy_field([[0]]) == [[0]]\", \"assert copy_field([[1]]) == [[1]]\", \"assert copy_field([[1, 2], [3, 4], [5, 6]]) == [[1, 2], [3, 4], [5, 6]]\", \"assert copy_field([[1, 2], [3, 4]]) is not copy_f... | {
"split": "train",
"index": 84972,
"acecode_id": "oss_17045",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a quantum circuit represented as a string and a list of parameters. Your task is to calculate the derivative of the circuit with respect to its parameters. Implement the function `calculateCircuitDerivative(circuit: str, params: List[float]) -> List[float]` that t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculateCircuitDerivative('circuit1', [1.0, 2.0, 3.0]) == [0, 2, 4]\", \"assert calculateCircuitDerivative('circuit2', [0.5, 1.5, 2.5, 3.5]) == [0, 2, 4, 6]\", \"assert calculateCircuitDerivative('circuit3', [10, 20]) == [0, 2]\", \"assert calculateCircuitD... | {
"split": "train",
"index": 84973,
"acecode_id": "oss_26769",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that simulates the conversion of HTML content to PDF format. Write a function `convert_html_to_pdf` that takes a string representing HTML content and returns a string indicating the success of the conversion. The function should check if t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_html_to_pdf('<html><body>Hello, World!</body></html>') == 'Conversion successful'\", \"assert convert_html_to_pdf('<h1>Title</h1><p>This is a paragraph.</p>') == 'Conversion successful'\", \"assert convert_html_to_pdf('<div></div>') == 'Conversion su... | {
"split": "train",
"index": 84974,
"acecode_id": "oss_24397",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and returns a dictionary containing the count of each distinct vowel (both lowercase and uppercase) present in the string. The vowels to consider are 'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'. In the returned dictionary, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_vowels('Hello World!') == {'a': 0, 'e': 1, 'i': 0, 'o': 2, 'u': 0, 'A': 0, 'E': 0, 'I': 0, 'O': 0, 'U': 0}\", \"assert find_vowels('AEIOUaeiou') == {'a': 1, 'e': 1, 'i': 1, 'o': 1, 'u': 1, 'A': 1, 'E': 1, 'I': 1, 'O': 1, 'U': 1}\", \"assert find_vowels(... | {
"split": "train",
"index": 84975,
"acecode_id": "evol_32582",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_max` that returns the maximum integer in the list. If the list is empty, the function should return None. The function should handle both positive and negative integers. Please implement the function with the following signature:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max([1, 2, 3, 4, 5]) == 5\", \"assert find_max([-1, -2, -3, -4, -5]) == -1\", \"assert find_max([5, 3, 9, 1, 7]) == 9\", \"assert find_max([-5, -3, -9, -1, -7]) == -1\", \"assert find_max([]) == None\", \"assert find_max([0]) == 0\", \"assert find_max([... | {
"split": "train",
"index": 84976,
"acecode_id": "bigcode_python_fns_26679",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom wrapper for a binary tree node. The custom node should have the following features: 1. It should store a value. 2. It should have a counter to track the number of times it is accessed or modified. 3. It should have a method `increment_c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_node_operations(10, 3) == 0\", \"assert custom_node_operations(5, 1) == 0\", \"assert custom_node_operations(8, 0) == 0\", \"assert custom_node_operations(1, 5) == 0\", \"assert custom_node_operations(15, 2) == 0\", \"assert custom_node_operations(20,... | {
"split": "train",
"index": 84977,
"acecode_id": "oss_6571",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a plugin registration system for a cloud management tool. The tool allows users to register plugins based on the type of cloud cluster they are using. Your task is to implement a function `register_plugin` that takes three parameters: 1. `cluste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_plugin('kubernetes', 'kubectl-exec-to-instance', lambda: None) is None\", \"assert register_plugin('aws', 'aws-plugin', lambda: None) == 'Plugin registration is not supported for this cluster type'\", \"assert register_plugin('gcp', 'gcp-plugin', la... | {
"split": "train",
"index": 84978,
"acecode_id": "oss_33963",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing the content of a SQL file that may contain a Jinja configuration with an alias, implement a function `find_alias(content: str) -> str` that returns the alias if it exists. If there is no alias defined, return the filename (without the extension) as t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_alias(\\\"{{\\\\n config(alias='my_alias')\\\\n}}\\\") == 'my_alias'\", \"assert find_alias(\\\"{{\\\\n config()\\\\n}}\\\") == 'default_filename'\", \"assert find_alias(\\\"{{\\\\n config(alias='another_alias')\\\\n}}\\\") == 'another_alias'\"... | {
"split": "train",
"index": 84979,
"acecode_id": "evol_22363",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two arrays of the same shape representing scores and counts. Your task is to compute a weighted average of scores based on the counts for a specific range of indices. Specifically, you will merge the output scores and their corresponding counts into a combined out... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_parallel_rank_vote([[0.0]], [[0]], [[10.0]], [[5]], 0) == None\", \"assert merge_parallel_rank_vote([[10.0, 20.0]], [[1, 1]], [[30.0, 40.0]], [[2, 2]], 0) == None\", \"assert merge_parallel_rank_vote([[1.0, 1.0]], [[1, 1]], [[2.0, 2.0]], [[1, 1]], 0) =... | {
"split": "train",
"index": 84980,
"acecode_id": "bigcode_python_fns_41012",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a string as input and returns a new string where all uppercase letters are converted to lowercase. The input string will contain only alphabetic characters (both uppercase and lowercase).\nPlease reason step by step, then write a self-contained Pytho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_lowercase('HELLO') == 'hello'\", \"assert convert_to_lowercase('WORLD') == 'world'\", \"assert convert_to_lowercase('Python') == 'python'\", \"assert convert_to_lowercase('TESTING') == 'testing'\", \"assert convert_to_lowercase('LeEtCoDe') == 'lee... | {
"split": "train",
"index": 84981,
"acecode_id": "evol_32886",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a collection of decals in a 3D environment. Each decal has specific properties: a material name, a sort key, an attenuation angle, and an opacity value. Write a function `configure_decals` that takes two lists of decals' properties and returns a lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_decals([{'name': 'decal_1', 'material': 'airship_symbol_decal.material', 'sort_key': 10, 'attenuation_angle': 0.75, 'opacity': 0.03}]) == ['Decal decal_1: Material=airship_symbol_decal.material, Sort Key=10, Attenuation Angle=0.75, Opacity=0.03']\"... | {
"split": "train",
"index": 84982,
"acecode_id": "bigcode_python_fns_23730",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the installation of a Java JDK based on given parameters. The function should take in the following inputs: a platform (string), an architecture (string), and an optional java_version (string, default value '8'). The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert install('windows', 'x64', '8') == 'Installed Java 8 on windows with architecture x64'\", \"assert install('linux', 'arm', '8') == 'Installed Java 8 on linux with architecture arm'\", \"assert install('windows', 'x64', '11') == 'Installed Java 11 on windows w... | {
"split": "train",
"index": 84983,
"acecode_id": "bigcode_python_fns_471",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that checks if a given log message contains a specific warning about a safety interlock. The function should take a list of log messages (strings) as input and return a boolean value: True if any log message contains the phrase 'safety int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_safety_interlock(['Initialization successful', 'All systems operational']) == False\", \"assert check_safety_interlock(['Warning: safety interlock engaged']) == True\", \"assert check_safety_interlock(['Critical error occurred', 'safety interlock issue... | {
"split": "train",
"index": 84984,
"acecode_id": "bigcode_python_fns_20814",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes an unordered collection of numerical values as an argument and returns a list of unique even integers present in the collection. The even integers should be reported in the order of their first appearance. Ensure that the function can handle repe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_even_numbers([1, 2, 3, 4, 5, 6, 7, 8, 9, -2, 2, 2.0, '2']) == [2, 4, 6, 8, -2]\", \"assert unique_even_numbers([10, 12, 10, 14, 15, 15.0, 16, 'abc', -14, 14.0]) == [10, 12, 14, 16, -14]\", \"assert unique_even_numbers([]) == []\", \"assert unique_even... | {
"split": "train",
"index": 84985,
"acecode_id": "evol_21687",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes log messages stored in a dictionary based on their log level. Your function should take a dictionary containing log messages categorized by their log levels (e.g., 'debug', 'info', 'warning', 'error', 'critical') and a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_log_messages({'debug': ['Debug message 1', 'Debug message 2'], 'info': ['Info message 1']}, 'debug') == 2\", \"assert count_log_messages({'debug': [], 'info': ['Info message 1']}, 'debug') == 0\", \"assert count_log_messages({'warning': ['Warning messa... | {
"split": "train",
"index": 84986,
"acecode_id": "oss_35483",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the process of creating a software bundle from a given set of source files. The function should take a dictionary `source_files` as input, where the keys represent the paths of the source files, and the values represent... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_bundle({'src/rocky/index.js': 'console.log(\\\"Hello, Rocky!\\\");'}) == {'bundle/src/rocky/index.js': 'console.log(\\\"Hello, Rocky!\\\");'}\", \"assert build_bundle({'src/common/lib.js': 'function add(a, b) { return a + b; }'}) == {'bundle/src/common... | {
"split": "train",
"index": 84987,
"acecode_id": "oss_28413",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string that may contain repeating characters, implement a function to generate all possible unique permutations of the string. The function should return a list of these permutations, ensuring there are no duplicates in the result. The order of the permutations in the o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert permute('a') == ['a']\", \"assert sorted(permute('ab')) == sorted(['ab', 'ba'])\", \"assert sorted(permute('abc')) == sorted(['abc', 'acb', 'bac', 'bca', 'cab', 'cba'])\", \"assert sorted(permute('aab')) == sorted(['aab', 'aba', 'baa'])\", \"assert sorted(pe... | {
"split": "train",
"index": 84988,
"acecode_id": "evol_6004",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given two strings representing DNA sequences: a long sequence and a short sequence. Your task is to implement a function `find_best_dna_match(short_sequence: str, long_sequence: str) -> int` that returns the starting index of the first occurrence of the short sequence i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_best_dna_match('TAC', 'ACGTACGT') == 3\", \"assert find_best_dna_match('AAA', 'ACGTACGT') == -1\", \"assert find_best_dna_match('ACG', 'ACGTACGT') == 0\", \"assert find_best_dna_match('GT', 'ACGTACGT') == 2\", \"assert find_best_dna_match('C', 'ACGTACGT... | {
"split": "train",
"index": 84989,
"acecode_id": "bigcode_python_fns_1722",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings `Writelines`, where each string represents a method name used in an APK. Additionally, you are provided with a dictionary `ThirdClassDict` that maps method names to their corresponding lists of third-party method names. Your task is to create a f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert map_methods(['methodD', 'methodE'], {'methodA': ['thirdParty1']}) == ['methodD', 'methodE']\", \"assert map_methods(['methodF'], {'methodF': ['thirdParty4', 'thirdParty5']}) == ['thirdParty4', 'thirdParty5']\", \"assert map_methods(['methodG', 'methodH', 'me... | {
"split": "train",
"index": 84990,
"acecode_id": "bigcode_python_fns_29320",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of detections and a list of trackers, each represented as lists of attributes. Your task is to implement a function that determines which detections are matched to which trackers based on a score derived from their IoU (Intersection over Union) and category... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert associate_detections_and_trackers([[0, 0, 1, 1, 0.3]], [[0, 0, 1, 1, 0.1]], [1], 0.5) == ([], [0], [0])\", \"assert associate_detections_and_trackers([[0, 0, 1, 1, 0.4]], [[1, 1, 2, 2, 0.4]], [1], 0.3) == ([], [0], [0])\", \"assert associate_detections_and_t... | {
"split": "train",
"index": 84991,
"acecode_id": "bigcode_python_fns_16696",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a credential based on three input parameters: a hierarchical node name, a credential hash, and a participant DID. The function should return a dictionary representing the credential with the following structure: { 'node_nam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_credential('metrovacesa.deconfianza.pubcred', 'Hola que tal', 'did:elsi:VATES-B60645900') == {'node_name': 'metrovacesa.deconfianza.pubcred', 'credential_hash': 'Hola que tal', 'participantDID': 'did:elsi:VATES-B60645900'}\", \"assert create_credentia... | {
"split": "train",
"index": 84992,
"acecode_id": "bigcode_python_fns_48790",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given the total area (in square meters) covered by a row of houses and the total length (in meters) of that row. The houses are arranged in such a way that they form a rectangle when combined. Your task is to implement the function `find_width(total_area: int, total_len... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_width(240, 60) == 4.0\", \"assert find_width(0, 10) == 0.0\", \"assert find_width(1000, 200) == 5.0\", \"assert find_width(500, 0) == 0.0\", \"assert find_width(300, 75) == 4.0\", \"assert find_width(600, 150) == 4.0\", \"assert find_width(1200, 300) ==... | {
"split": "train",
"index": 84993,
"acecode_id": "evol_35149",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries where each dictionary represents a person with keys 'name', 'age', and 'city'. Your task is to implement a function that takes this list as input and returns a new list of dictionaries, where each dictionary contains only the 'name' and 'age... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_people([{'name': 'Alice', 'age': 30, 'city': 'New York'}, {'name': 'Bob', 'age': 25, 'city': 'Los Angeles'}]) == [{'name': 'Alice', 'age': 30}, {'name': 'Bob', 'age': 25}]\", \"assert filter_people([{'name': 'Charlie', 'age': 35, 'city': 'Chicago'}]) ... | {
"split": "train",
"index": 84994,
"acecode_id": "bigcode_python_fns_2743",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that converts a list of characters into a dictionary that maps each character to a unique index. The function should take the list of characters as input and return a dictionary where each character is the key and its corresponding index ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert map_characters_to_indices(['a', 'b', 'c']) == {'a': 0, 'b': 1, 'c': 2}\", \"assert map_characters_to_indices(['x', 'y', 'z']) == {'x': 0, 'y': 1, 'z': 2}\", \"assert map_characters_to_indices(['1', '2', '3']) == {'1': 0, '2': 1, '3': 2}\", \"assert map_chara... | {
"split": "train",
"index": 84995,
"acecode_id": "bigcode_python_fns_43572",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer n, implement a function `recursive_sum(n)` that returns the sum of all integers from 1 to n using recursion and memoization to optimize performance. The function should avoid redundant calculations by storing previously computed results. Your implem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert recursive_sum(0) == 0\", \"assert recursive_sum(1) == 1\", \"assert recursive_sum(2) == 3\", \"assert recursive_sum(3) == 6\", \"assert recursive_sum(4) == 10\", \"assert recursive_sum(5) == 15\", \"assert recursive_sum(6) == 21\", \"assert recursive_sum(7) ... | {
"split": "train",
"index": 84996,
"acecode_id": "evol_24289",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of JSON strings, where each string represents a valid JSON object. Write a function that converts this list of JSON strings into a list of corresponding Python dictionaries. If the input list is empty or contains None, the function should return an empty li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_json_strings_to_dicts([\\\"{\\\\\\\"key1\\\\\\\": 1, \\\\\\\"key2\\\\\\\": 2}\\\", \\\"{\\\\\\\"key3\\\\\\\": 3}\\\"]) == [{\\\"key1\\\": 1, \\\"key2\\\": 2}, {\\\"key3\\\": 3}]\", \"assert convert_json_strings_to_dicts([\\\"{\\\\\\\"name\\\\\\\": \\... | {
"split": "train",
"index": 84997,
"acecode_id": "bigcode_python_fns_20387",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a Python script based on a predefined template. The script should read a list of items and create a to-do list for each item where each item is accompanied by a specific action that needs to be performed. Implement a function called `generate_todo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_todo_list(['task1', 'task2'], ['action1', 'action2']) == {'task1': 'action1', 'task2': 'action2'}\", \"assert generate_todo_list(['task1'], ['action1']) == {'task1': 'action1'}\", \"assert generate_todo_list(['task1', 'task2'], ['action1']) == {}\",... | {
"split": "train",
"index": 84998,
"acecode_id": "bigcode_python_fns_28292",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that returns the first n Fibonacci numbers in a list. The function should include error checking to ensure that the input n is a positive integer. If n is less than or equal to 1, return an empty list. Your implementation should efficiently generate Fibonac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == []\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(7) == [0, 1,... | {
"split": "train",
"index": 84999,
"acecode_id": "evol_23075",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.