data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that sorts a list of tuples where each tuple represents a genomic interval in the BED format. Each tuple consists of three elements: chromosome (string), start position (integer), and end position (integer). Your function should take ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_bed_intervals([('chr1', 150, 200), ('chr1', 100, 150), ('chr2', 50, 100)]) == [('chr1', 100, 150), ('chr1', 150, 200), ('chr2', 50, 100)]\", \"assert sort_bed_intervals([('chr2', 200, 300), ('chr1', 100, 200), ('chr1', 50, 100)]) == [('chr1', 50, 100), ...
{ "split": "train", "index": 76300, "acecode_id": "bigcode_python_fns_8572", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that creates a custom representation of a tree node in a graphical user interface (GUI) application. Your function should support the following operations: returning a child indicator policy, setting data for specific columns and role...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_tree_node('get_policy') == 'default_policy'\", \"assert manage_tree_node('set_data', 0, 1, 'example') == 'data_set'\", \"assert manage_tree_node('set_data', 1, 2, 123) == 'data_set'\", \"assert manage_tree_node('set_data', 2, 3, True) == 'data_set'\",...
{ "split": "train", "index": 76301, "acecode_id": "oss_4557", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines if a given enrollment mode is valid for a course on the edX platform. The valid modes are 'audit' and 'honor'. Your function should take a string input representing the enrollment mode and return a boolean indicating wheth...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_enrollment_mode('audit') == True\", \"assert is_valid_enrollment_mode('honor') == True\", \"assert is_valid_enrollment_mode('invalid') == False\", \"assert is_valid_enrollment_mode('') == False\", \"assert is_valid_enrollment_mode('AUDIT') == False\...
{ "split": "train", "index": 76302, "acecode_id": "oss_29618", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple regression test storage system in Python. Your task is to create a function `store_test_result(test_name: str, result: bool) -> None` that stores the result of a regression test with the given `test_name`. You also need to implement a f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert store_test_result('test1', True) is None\", \"assert store_test_result('test2', False) is None\", \"assert get_test_result('test2') == False\", \"assert get_test_result('unknown_test') == False\", \"assert store_test_result('test3', True) is None\", \"assert...
{ "split": "train", "index": 76303, "acecode_id": "oss_12363", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the registration and execution of optimization algorithms. The function should take a list of tuples, where each tuple contains the name of the algorithm and a placeholder function (represented as a string) that simulates t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert register_and_execute_algorithms([('neldermead', 'function1'), ('bhhh', 'function2')], ('x**2', 2)) == {'neldermead': 'Nelder-Mead result', 'bhhh': 'BHHH result'}\", \"assert register_and_execute_algorithms([('gradient_descent', 'function3')], ('x**2 + 2*x + ...
{ "split": "train", "index": 76304, "acecode_id": "oss_5712", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a 2D matrix, implement a function `swap_elements(mat)` that swaps the first and last elements of the matrix and then swaps the first and last elements of every row within that matrix. The input matrix will be a list of lists where each inner list represents a row. If the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert swap_elements([[1]]) == [[1]]\", \"assert swap_elements([[]]) == [[]]\", \"assert swap_elements([]) == []\", \"assert swap_elements([[1, 2, 3, 4]]) == [[4, 2, 3, 1]]\", \"assert swap_elements([[1], [2], [3]]) == [[3], [2], [1]]\", \"assert swap_elements([[1]...
{ "split": "train", "index": 76305, "acecode_id": "evol_21613", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a string of words, return the longest word in the string. If there are multiple words with the same maximum length, return the first one encountered. A word is defined as a sequence of characters separated by spaces. You may assume that the input string will not be empty....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert high('making up sentences is very hard') == 'sentences'\", \"assert high('hello world') == 'hello'\", \"assert high('a b c d e f g h') == 'a'\", \"assert high('Python is fun') == 'Python'\", \"assert high('short long longer longest') == 'longest'\", \"assert...
{ "split": "train", "index": 76306, "acecode_id": "bigcode_python_fns_32833", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the delay for reconnection attempts using exponential backoff policy. The function should take the following parameters: initialDelay (float), maxDelay (float), factor (float), and a jitter function (a callable that return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_backoff_policy(1.0, 60.0, 1.5, lambda: 0.0)(0) == 1.0\", \"assert create_backoff_policy(1.0, 60.0, 1.5, lambda: 0.0)(1) == 1.5\", \"assert create_backoff_policy(1.0, 60.0, 1.5, lambda: 0.0)(2) == 2.25\", \"assert create_backoff_policy(1.0, 60.0, 1.5, ...
{ "split": "train", "index": 76307, "acecode_id": "bigcode_python_fns_37239", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that accepts a list of strings, where each string represents a command. Each command can either be a label, denoted by parentheses surrounding a name (e.g., '(label1)'), or a number (e.g., '(102)'). Your function should parse this list an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_commands(['(label1)', '(102)']) == [{'instruction': 'label', 'label': 'label1'}, {'instruction': 'number', 'label': '102'}]\", \"assert parse_commands(['(label2)', '(200)', '(label3)']) == [{'instruction': 'label', 'label': 'label2'}, {'instruction': '...
{ "split": "train", "index": 76308, "acecode_id": "bigcode_python_fns_36926", "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 reverse 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_list([1, 2, 3, 4, 5]) == [5, 4, 3, 2, 1]\", \"assert reverse_list([10, 20, 30]) == [30, 20, 10]\", \"assert reverse_list([-1, -2, -3]) == [-3, -2, -1]\", \"assert reverse_list([0, 1, 2]) == [2, 1, 0]\", \"assert reverse_list([5]) == [5]\", \"assert r...
{ "split": "train", "index": 76309, "acecode_id": "evol_23148", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function `to_text(value: int) -> str` that converts an integer opcode value into its corresponding text representation. The function should handle a predefined set of opcode values, returning a string that describes the opcode. If the opcode is not...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert to_text(0) == 'NOOP'\", \"assert to_text(1) == 'START'\", \"assert to_text(2) == 'STOP'\", \"assert to_text(3) == 'PAUSE'\", \"assert to_text(4) == 'RESUME'\", \"assert to_text(0) == 'NOOP'\", \"assert to_text(1) == 'START'\", \"assert to_text(2) == 'STOP'\"...
{ "split": "train", "index": 76310, "acecode_id": "bigcode_python_fns_30429", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Write a function `traverse_dict(d)` that takes a nested dictionary `d` as input and returns a list of all the unique non-dictionary, non-list values found in the nested structure. The function should handle dictionaries containing other dictionaries and lists. The values can be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert traverse_dict({'key1': {'key2': {'key3': 'value1'}}, 'key4': ['value2', {'key5': 'value3'}], 'key6': 'value4'}) == ['value1', 'value2', 'value3', 'value4']\", \"assert traverse_dict({'a': 1, 'b': {'c': 2, 'd': 3}, 'e': [4, 5, {'f': 6}]}) == [1, 2, 3, 4, 5, 6...
{ "split": "train", "index": 76311, "acecode_id": "evol_5809", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that converts a JBoss command into an HTTP request. The function should take the JBoss command and the HTTP method (e.g., \"POST\") as input and return the corresponding HTTP request. Your goal is to write the function `jboss_command_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert jboss_command_to_http_request('start_service', 'POST') == 'POST request for JBoss command: start_service'\", \"assert jboss_command_to_http_request('stop_service', 'GET') == 'GET request for JBoss command: stop_service'\", \"assert jboss_command_to_http_requ...
{ "split": "train", "index": 76312, "acecode_id": "oss_24664", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that converts a given value into a float. The function should take a single parameter called 'value'. If the value is a boolean, the function should raise a ValueError. If the value is already a float, it should return it as is. If the val...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert float_converter(5) == 5.0\", \"assert float_converter(0) == 0.0\", \"assert float_converter(-10) == -10.0\", \"assert float_converter(3.14) == 3.14\", \"assert float_converter(-2.71) == -2.71\", \"assert float_converter(1000000) == 1000000.0\", \"assert floa...
{ "split": "train", "index": 76313, "acecode_id": "bigcode_python_fns_40790", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `isFull(max_size: int, current_size: int) -> bool` that checks if a stack has reached its maximum capacity. The function takes two arguments: `max_size`, the maximum size of the stack, and `current_size`, the current number of elements in the stack. The fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert isFull(5, 5) == True\", \"assert isFull(5, 4) == False\", \"assert isFull(0, 0) == True\", \"assert isFull(10, 10) == True\", \"assert isFull(10, 0) == False\", \"assert isFull(3, 2) == False\", \"assert isFull(3, 3) == True\", \"assert isFull(100, 0) == Fal...
{ "split": "train", "index": 76314, "acecode_id": "evol_12383", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing unique process IDs for two types of applications: Flight Software (FSW) and Graphical User Interface (GUI). You need to implement a function that assigns a unique process ID to a new client based on the client type and updates the respective client ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert assign_process_id('FSW', b'client3', [b'client1', b'client2'], [101, 102], [b'clientA', b'clientB'], [201, 202]) == [b'client1', b'client2', b'client3_103']\", \"assert assign_process_id('GUI', b'clientC', [b'client1', b'client2'], [101, 102], [b'clientA', b...
{ "split": "train", "index": 76315, "acecode_id": "oss_3236", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given two strings, `workflow_name` and `job_name`, write a function `get_qualified_name(workflow_name: str, job_name: str) -> str` that constructs a qualified name by concatenating `workflow_name`, a predefined delimiter '_', and `job_name`. The delimiter should be considered a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_qualified_name('DataProcessing', 'Extract') == 'DataProcessing_Extract'\", \"assert get_qualified_name('DataProcessing', 'Transform') == 'DataProcessing_Transform'\", \"assert get_qualified_name('DataProcessing', 'Load') == 'DataProcessing_Load'\", \"ass...
{ "split": "train", "index": 76316, "acecode_id": "bigcode_python_fns_6470", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are implementing a function to simulate a service discovery mechanism for a distributed system. Your task is to create a function called `service_discovery_get` that takes the following parameters: \n- `service_discovery_uri`: a string representing the URI of the service di...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert service_discovery_get('http://example.com', 'user', 'pass') == 'Request succeeded'\", \"assert service_discovery_get('http://example.com', 'user', 'pass') == 'Request succeeded'\", \"assert service_discovery_get('http://example.com', 'user', 'pass') == 'Requ...
{ "split": "train", "index": 76317, "acecode_id": "oss_20782", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns a new list containing only the unique elements from the input list, sorted in ascending order. The input list may contain duplicates, and the output should not contain any repeated values. The function should be optimi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_elements([3, 2, 2, 7, 6, 7, 1, 3, 1, 2, 4]) == [1, 2, 3, 4, 6, 7]\", \"assert get_unique_elements([5, 5, 5, 5]) == [5]\", \"assert get_unique_elements([1, 2, 3]) == [1, 2, 3]\", \"assert get_unique_elements([]) == []\", \"assert get_unique_element...
{ "split": "train", "index": 76318, "acecode_id": "evol_21307", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that sanitizes a dictionary of keyword arguments. The function should accept a boolean parameter `keep_name` and a variable number of keyword arguments (`**kwargs`). If the `keep_name` parameter is set to False and the `kwargs` contains a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sanitize_kwargs(False, name='test', age=30) == {'name_or_id': 'test', 'age': 30}\", \"assert sanitize_kwargs(True, name='test', age=30) == {'name': 'test', 'age': 30}\", \"assert sanitize_kwargs(False, age=30) == {'age': 30}\", \"assert sanitize_kwargs(True,...
{ "split": "train", "index": 76319, "acecode_id": "bigcode_python_fns_3688", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of updates for a release schedule. Each update is represented as a tuple containing a field name and a new value. Your function should take an initial release schedule represented as a dictionary and a list of update...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_release_schedule({'date': '2018-01-01', 'release': 'test-release-0.1', 'sla': 'no_issues'}, [('date', '2018-01-02'), ('release', 'test-release-0.2'), ('sla', 'bug_fixes')]) == {'date': '2018-01-02', 'release': 'test-release-0.2', 'sla': 'bug_fixes'}\"...
{ "split": "train", "index": 76320, "acecode_id": "oss_20565", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves all replacement phrases based on a specific object. Each replacement phrase includes the original phrase, the phrase to replace it with, and information about word boundaries. You will receive a list of sensitive phrases an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_replacement_phrases([], []) == []\", \"assert get_replacement_phrases([('sensitive1', 'replace1', True, False)], []) == [{'phrase': 'sensitive1', 'replacement': 'replace1', 'start_boundary': True, 'end_boundary': False}]\", \"assert get_replacement_phras...
{ "split": "train", "index": 76321, "acecode_id": "bigcode_python_fns_30791", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of integers and a target integer, implement a function that checks if the target integer is present in the list. The function should return True if the target is found and False otherwise.\nPlease reason step by step, then write a self-contained Python solution. Gi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_number([1, 2, 3, 4, 5, 6], 3) == True\", \"assert find_number([1, 2, 3, 4, 5, 6], 7) == False\", \"assert find_number([], 1) == False\", \"assert find_number([10, 20, 30, 40], 20) == True\", \"assert find_number([10, 20, 30, 40], 15) == False\", \"asser...
{ "split": "train", "index": 76322, "acecode_id": "evol_1958", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings where each string represents a YouTube URL. Your task is to write a function that filters out invalid YouTube URLs from the list. A valid YouTube URL follows the pattern 'https://www.youtube.com/watch?v=VIDEO_ID' or 'https://youtu.be/VIDEO_ID', w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_valid_youtube_urls(['https://www.youtube.com/watch?v=dQw4w9WgXcQ', 'https://youtu.be/dQw4w9WgXcQ']) == ['https://www.youtube.com/watch?v=dQw4w9WgXcQ', 'https://youtu.be/dQw4w9WgXcQ']\", \"assert filter_valid_youtube_urls(['https://www.youtube.com/watc...
{ "split": "train", "index": 76323, "acecode_id": "bigcode_python_fns_43940", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers and sorts it in ascending order using the cocktail shaker sort algorithm. The function should return the sorted list. For example, given the input [4, 8, 1, 6, 9], the output should be [1, 4, 6, 8, 9].\nPlease reason step by st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cocktail_shaker_sort([4, 8, 1, 6, 9]) == [1, 4, 6, 8, 9]\", \"assert cocktail_shaker_sort([10, 7, 3, 1]) == [1, 3, 7, 10]\", \"assert cocktail_shaker_sort([5, 5, 5, 5]) == [5, 5, 5, 5]\", \"assert cocktail_shaker_sort([9, 0, 2, 3, 5]) == [0, 2, 3, 5, 9]\", \...
{ "split": "train", "index": 76324, "acecode_id": "evol_21336", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that finds the dissimilar elements in the given two tuples, counts the number of occurrences of these dissimilar elements in both tuples, and identifies the tuple from which the dissimilar element originated. The function should return a dictionary where the ke...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_dissimilar_elements((1, 1, 1), (2, 2, 2)) == {1: (3, 'tuple1'), 2: (3, 'tuple2')}\", \"assert find_dissimilar_elements((5, 6, 7), (5, 6, 7)) == {}\", \"assert find_dissimilar_elements((1, (2, (3, 4))), (5, (6, 7))) == {1: (1, 'tuple1'), 2: (1, 'tuple1')...
{ "split": "train", "index": 76325, "acecode_id": "evol_25894", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that calculates the accuracy of a model's predictions. The function takes two parameters: `predicted`, a list of integers representing the model's predicted values, and `target`, a list of integers representing the true target ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_accuracy([1, 2, 3, 4, 5], [1, 2, 3, 4, 5]) == 100.0\", \"assert calculate_accuracy([1, 2, 3, 4, 5], [1, 2, 3, 4, 0]) == 80.0\", \"assert calculate_accuracy([1, 1, 1, 1], [1, 1, 1, 1]) == 100.0\", \"assert calculate_accuracy([10, 20, 30], [10, 20, 3...
{ "split": "train", "index": 76326, "acecode_id": "oss_10397", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `analyze_competitors(data: List[Tuple[str, Tuple[float, float]]]) -> List[str]` that takes a list of competitors with their names and their positions on a competitive quadrant chart (x-axis for reach and y-axis for engagement). The function should return a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_competitors([('Company A', (0.9, 0.8)), ('Company B', (0.4, 0.6)), ('Company C', (0.5, 0.5)), ('Company D', (0.6, 0.9))]) == ['Company A', 'Company D']\", \"assert analyze_competitors([('Competitor 1', (0.3, 0.4)), ('Competitor 2', (0.1, 0.1)), ('Com...
{ "split": "train", "index": 76327, "acecode_id": "evol_19181", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks whether a given environment ID exists in a predefined list of environment IDs. The function should take two parameters: a list of environment IDs and an environment ID to check. It should return True if the environment ID ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_environment_exists(['env1', 'env2', 'env3'], 'env1') == True\", \"assert check_environment_exists(['env1', 'env2', 'env3'], 'env4') == False\", \"assert check_environment_exists([], 'env1') == False\", \"assert check_environment_exists(['my_env', 'test...
{ "split": "train", "index": 76328, "acecode_id": "oss_25948", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that returns the largest prime factor of a given integer 'n'. You can assume that the absolute value of 'n' is greater than 1 and is not prime. Your implementation should only check for odd factors starting from 3 after handling the factor of 2. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert largest_prime_factor(13195) == 29\", \"assert largest_prime_factor(2048) == 2\", \"assert largest_prime_factor(-13195) == 29\", \"assert largest_prime_factor(91) == 13\", \"assert largest_prime_factor(56) == 7\", \"assert largest_prime_factor(77) == 11\", \"...
{ "split": "train", "index": 76329, "acecode_id": "evol_16868", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simplified file management system. Your goal is to create a function `manage_files(operations)` that takes a list of operations to perform on a file system. Each operation is a string that can either be a command to create a file (in the forma...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_files(['create_file:doc.txt', 'create_file:photo.jpg', 'delete_file:doc.txt']) == ['photo.jpg']\", \"assert manage_files(['create_file:file1.txt', 'create_file:file2.txt', 'delete_file:file3.txt']) == ['file1.txt', 'file2.txt']\", \"assert manage_file...
{ "split": "train", "index": 76330, "acecode_id": "oss_27817", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a formatted string representing a simple line plot's data. The function should take two lists as input: `x_data` and `y_data`, which represent the x-coordinates and y-coordinates of the points to be plotted, respectively. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_plot_string([0, 5, 10], [10, 20, 15]) == 'X Ticks: 0, 5, 10, 15, 20, 25, 30; X Label: Time; Y Label: Count; Plot Points: (0, 10), (5, 20), (10, 15)'\", \"assert generate_plot_string([0, 10, 20], [5, 15, 25]) == 'X Ticks: 0, 5, 10, 15, 20, 25, 30; X ...
{ "split": "train", "index": 76331, "acecode_id": "oss_19711", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array of integers `bulbs` representing the order in which bulbs are turned on, and an integer `k` representing the number of empty slots allowed between two lit bulbs. Your task is to write a function `earliest_day(bulbs: List[int], k: int) -> int` that returns...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert earliest_day([1, 3, 2], 1) == 2\", \"assert earliest_day([1, 2, 3], 1) == -1\", \"assert earliest_day([1, 2, 4, 3], 1) == 3\", \"assert earliest_day([1], 0) == -1\", \"assert earliest_day([1, 2, 3, 4, 5], 3) == -1\", \"assert earliest_day([1, 3, 4, 2, 5], 1)...
{ "split": "train", "index": 76332, "acecode_id": "evol_16883", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Write a function `sum_of_sq_root(arr)` that takes a list of integers and returns the sum of the square roots of unique positive prime numbers found in the array, disregarding zero, hexadecimal values, and non-prime numbers. The function should compute the sum in the reverse ord...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_sq_root([-1, 0, 4, 6]) == 0\", \"assert sum_of_sq_root([11, 13, 11, 17]) == (17**0.5 + 13**0.5 + 11**0.5)\", \"assert sum_of_sq_root([4, 6, 8, 10]) == 0\", \"assert sum_of_sq_root([2, 3, 5]) == (5**0.5 + 3**0.5 + 2**0.5)\", \"assert sum_of_sq_root([0,...
{ "split": "train", "index": 76333, "acecode_id": "evol_18703", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that generates a random password consisting of exactly 8 characters. The password should include uppercase letters, lowercase letters, digits, and special characters. The function should not take any input and should return the generated password as a st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_password()) == 8\", \"assert any(c.isupper() for c in generate_password())\", \"assert any(c.islower() for c in generate_password())\", \"assert any(c.isdigit() for c in generate_password())\", \"assert any(c in string.punctuation for c in gener...
{ "split": "train", "index": 76334, "acecode_id": "evol_10747", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `factorial(n)` that calculates the factorial of a given non-negative integer `n` using recursion. The function should raise a `TypeError` if the input is not an integer and a `ValueError` if the input is a negative integer. The function should return the fa...
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": 76335, "acecode_id": "evol_28710", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `generate_pascals_triangle(n: int) -> List[List[int]]` that generates the first `n` rows of Pascal's Triangle. Each row `i` (0-indexed) contains `i + 1` integers. The triangle starts with a single row containing the number 1. You should return a list of lists r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_pascals_triangle(0) == []\", \"assert generate_pascals_triangle(1) == [[1]]\", \"assert generate_pascals_triangle(2) == [[1], [1, 1]]\", \"assert generate_pascals_triangle(3) == [[1], [1, 1], [1, 2, 1]]\", \"assert generate_pascals_triangle(4) == [[...
{ "split": "train", "index": 76336, "acecode_id": "evol_26108", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of buildings in a city skyline. Your task is to implement a function that calculates the total area of the skyline formed by these buildings. The area is computed as the sum of the heights of each building multiplied by ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_skyline_area([2, 1, 5, 6, 2, 3]) == 19\", \"assert calculate_skyline_area([1, 2, 3, 4, 5]) == 15\", \"assert calculate_skyline_area([5, 4, 3, 2, 1]) == 15\", \"assert calculate_skyline_area([0, 0, 0, 0]) == 0\", \"assert calculate_skyline_area([3, ...
{ "split": "train", "index": 76337, "acecode_id": "bigcode_python_fns_45418", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of jobs configured in a service as tuples of (service_name, instance_name), and a list of available jobs as tuples of (service_name, instance_name, job_id), write a function `build_service_job_mapping(configured_jobs: List[Tuple[str, str]], available_jobs: List[Tup...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_service_job_mapping([('service1', 'instance1'), ('service2', 'instance2')], [('service1', 'instance1', 'job1'), ('service1', 'instance1', 'job2'), ('service2', 'instance2', 'job3')]) == {('service1', 'instance1'): 'job2', ('service2', 'instance2'): 'jo...
{ "split": "train", "index": 76338, "acecode_id": "bigcode_python_fns_20803", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `list_files(section_name, files)` that retrieves and displays the titles of all the files in a specified library section represented by a list of strings. The function should take a string `section_name` and a list of strings `files` as i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_files('Movies', ['The Matrix', 'Inception', 'Interstellar']) == ['The Matrix', 'Inception', 'Interstellar']\", \"assert list_files('Movies', []) == []\", \"assert list_files('Movies', ['The Matrix', 'Inception', 'Interstellar', 'Jurassic Park']) == ['Th...
{ "split": "train", "index": 76339, "acecode_id": "oss_23966", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a string representing an operator in the format 'package.operator'. Your task is to implement a function that extracts the module name from this string. The module name is defined as the part of the string before the last dot ('.'). If the input string does not co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_operator_module('com.example.operator') == 'com.example'\", \"assert get_operator_module('org.apache.spark') == 'org.apache'\", \"assert get_operator_module('my.package.module') == 'my.package'\", \"assert get_operator_module('data.processor') == 'data'\...
{ "split": "train", "index": 76340, "acecode_id": "bigcode_python_fns_29049", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function that checks if a user is using an 'opss wallet' based on provided optional arguments. If the 'opss wallet' is indicated but the 'passphrase' is missing, the function should simulate prompting the user for a passphrase and return a defau...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_opss_args({'OPSS_WALLET_SWITCH': True}) == 'default_passphrase'\", \"assert process_opss_args({'OPSS_WALLET_SWITCH': True, 'OPSS_WALLET_PASSPHRASE': 'my_pass'}) == 'my_pass'\", \"assert process_opss_args({'other_key': 'value'}) == 'No action needed'\...
{ "split": "train", "index": 76341, "acecode_id": "bigcode_python_fns_29101", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function `are_anagrams(str1: str, str2: str) -> bool` that takes two strings as input and returns True if the two strings are anagrams of each other, and False otherwise. An anagram is defined as a word or phrase formed by rearranging the letters of a different word or ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_anagrams('listen', 'silent') == True\", \"assert are_anagrams('triangle', 'integral') == True\", \"assert are_anagrams('apple', 'pale') == False\", \"assert are_anagrams('anagram', 'nagaram') == True\", \"assert are_anagrams('rat', 'car') == False\", \"a...
{ "split": "train", "index": 76342, "acecode_id": "evol_34912", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n, write a function `balanced_bracket_sequences(n: int) -> int` that computes the count of distinct balanced bracket sequences of the given length 'n'. A balanced bracket sequence is defined as a sequence where each opening bracket '(' has a corresponding closi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert balanced_bracket_sequences(0) == 1\", \"assert balanced_bracket_sequences(1) == 0\", \"assert balanced_bracket_sequences(2) == 1\", \"assert balanced_bracket_sequences(3) == 0\", \"assert balanced_bracket_sequences(4) == 2\", \"assert balanced_bracket_sequen...
{ "split": "train", "index": 76343, "acecode_id": "evol_18235", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that receives an integer array and returns the result of the following calculation: find the unique positive and negative integers, compute the sum of those unique integers raised to their respective absolute values, and then multiply that sum by the differenc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_sum_mult_powers([]) == None\", \"assert unique_sum_mult_powers([-1, 1]) == 0\", \"assert unique_sum_mult_powers([0]) == 0\", \"assert unique_sum_mult_powers([2, -2, 2]) == 0\", \"assert unique_sum_mult_powers([-4, 4, 4, -4]) == 0\"]}" }
{ "split": "train", "index": 76344, "acecode_id": "evol_1840", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function `fpack_image(filename: str) -> str` that simulates a file packing process for astronomical images. The function takes a single input, `filename`, which is a string representing the name of a file. The file name will have a `.fits` extensio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fpack_image('test.fits') == 'test.fits.fz'\", \"assert fpack_image('test_ldac.fits') == 'test_ldac.fits'\", \"assert fpack_image('test.fits') == 'test.fits.fz'\", \"assert fpack_image('not_fits.txt') == 'not_fits.txt'\", \"assert fpack_image('example_ldac.fi...
{ "split": "train", "index": 76345, "acecode_id": "bigcode_python_fns_25578", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a 2D list of integers representing a matrix, implement a function that returns a list of tuples where each tuple contains the indices (row, column) of each element in the matrix. The indices should be in row-major order. If the matrix is empty, return an empty list. For e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_indices([[1, 2], [3, 4]]) == [(0, 0), (0, 1), (1, 0), (1, 1)]\", \"assert get_indices([[5]]) == [(0, 0)]\", \"assert get_indices([]) == []\", \"assert get_indices([[1, 2, 3], [4, 5, 6]]) == [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2)]\", \"assert get...
{ "split": "train", "index": 76346, "acecode_id": "bigcode_python_fns_28810", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer array, write a function to find the length of the longest consecutive elements sequence. The consecutive elements can be in any order. You need to implement the function `longest_consecutive(nums: List[int]) -> int` which returns the length of the longest conse...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_consecutive([100, 4, 200, 1, 3, 2]) == 4\", \"assert longest_consecutive([0, 0, 1, 1, 2, 2, 3]) == 4\", \"assert longest_consecutive([]) == 0\", \"assert longest_consecutive([1]) == 1\", \"assert longest_consecutive([1, 2, 3, 4, 5]) == 5\", \"assert ...
{ "split": "train", "index": 76347, "acecode_id": "evol_30484", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing file names in a folder. Each file name ends with '.txt'. Your task is to convert these file names into their corresponding HTML file names by replacing the '.txt' extension with '.html'. Write a function that takes a list of file nam...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_html(['example1.txt', 'example2.txt']) == ['example1.html', 'example2.html']\", \"assert convert_to_html(['testfile.txt']) == ['testfile.html']\", \"assert convert_to_html(['document.txt', 'report.txt', 'summary.txt']) == ['document.html', 'report...
{ "split": "train", "index": 76348, "acecode_id": "bigcode_python_fns_28138", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a Python function that takes two lists (list1 and list2) and an additional Boolean variable (rev_order) as input parameters. This function should check if list1 and list2 have equal length. If they do, and rev_order is False, it should combine the elements of list1 and l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert combine_lists(['a', 'b'], [1, 2], False) == {'a': 1, 'b': 2}\", \"assert combine_lists(['a', 'b'], [1, 2], True) == {1: 'a', 2: 'b'}\", \"assert combine_lists(['a', 'a', 'b'], [1, 2, 3], False) == {'a': 2, 'b': 3}\", \"assert combine_lists(['a', 'b', 'c'], [...
{ "split": "train", "index": 76349, "acecode_id": "evol_32903", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple command-line interface (CLI) operation. The function `check(datapath: str, config: str, output: str) -> None` takes three string arguments: `datapath`, `config`, and `output`. The function should print a messag...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check('path/to/data', 'config.yaml', 'output.txt') == None\", \"assert check('/user/files', 'settings.json', 'result.log') == None\", \"assert check('C:/data', 'config.xml', 'final_output.csv') == None\", \"assert check('data/input', 'config.ini', 'output.js...
{ "split": "train", "index": 76350, "acecode_id": "bigcode_python_fns_6188", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes commands for a simple command-line interpreter. The function should take a command string as input, which can either be a block of code or a string. The command will always start with the keyword 'CREATE', followed by an id...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_command('CREATE myCommand AS JSON {\\\"key\\\": \\\"value\\\"}') == (1, {'identifier': 'myCommand', 'input_format': 'JSON', 'content': '{\\\"key\\\": \\\"value\\\"}'})\", \"assert process_command('CREATE anotherCommand AS XML <data></data>') == (1, {...
{ "split": "train", "index": 76351, "acecode_id": "bigcode_python_fns_21816", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing a financial record of a stock for a specific time. The dictionary contains the following keys: 'code' (a string representing the stock's symbol), 'open' (a float representing the opening price), 'high' (a float representing the highest pr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_stock_record({'code': 'AAPL', 'open': 150.0, 'high': 155.0, 'low': 149.0, 'close': 154.0, 'volume': 1000000, 'time_key': '2023-10-01 09:30:00'}) == {'symbol': 'AAPL', 'exchange': '', 'vtSymbol': 'AAPL', 'open': 150.0, 'high': 155.0, 'low': 149.0, 'c...
{ "split": "train", "index": 76352, "acecode_id": "bigcode_python_fns_37070", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that reads a file containing JSON lines. Each line should contain a dictionary with 'input_text' and 'target_text' keys. Your function should parse the lines and return a dictionary with two lists: one for all the 'input_text' values and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_dataset('empty_file.json') == {'input_text': [], 'target_text': []}\", \"assert create_dataset('invalid_json.json') == {'input_text': [], 'target_text': []}\", \"assert create_dataset('nested_json.json') == {'input_text': [], 'target_text': []}\", \"a...
{ "split": "train", "index": 76353, "acecode_id": "evol_12400", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci_series(n: int) -> List[int]` that returns the first n terms of the Fibonacci series. The Fibonacci series is defined as follows: the first term is 0, the second term is 1, and each subsequent term is the sum of the two preceding terms. If n is le...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci_series(0) == []\", \"assert fibonacci_series(1) == [0]\", \"assert fibonacci_series(2) == [0, 1]\", \"assert fibonacci_series(3) == [0, 1, 1]\", \"assert fibonacci_series(4) == [0, 1, 1, 2]\", \"assert fibonacci_series(5) == [0, 1, 1, 2, 3]\", \"as...
{ "split": "train", "index": 76354, "acecode_id": "evol_31376", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that validates a given configuration file for a Grafana client. The configuration file contains various settings, and the function needs to check if certain values have been overridden by command-line arguments. The function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_config_override({'grafana_url': 'http://original.grafana.org:3000'}, ['--grafana-url', 'http://original.grafana.org:3000']) == []\", \"assert validate_config_override({'api_key': 'original_api_key'}, ['--api-key', 'original_api_key']) == []\", \"ass...
{ "split": "train", "index": 76355, "acecode_id": "oss_26433", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with extracting specific values from a JSON-like structure representing a tender object. The paths are given as strings and indicate the location of the desired values within the JSON-like structure. Each path consists of a sequence of keys separated by slashes (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_values({\\\"tender\\\": {\\\"tenderPeriod\\\": {\\\"durationInDays\\\": 30}, \\\"minValue\\\": {\\\"amount\\\": 10000, \\\"currency\\\": \\\"USD\\\"}, \\\"value\\\": {\\\"amount\\\": 50000, \\\"currency\\\": \\\"EUR\\\"}, \\\"items\\\": [{\\\"id\\\":...
{ "split": "train", "index": 76356, "acecode_id": "oss_11690", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of positive integers, implement a function `highest_freq` that identifies the integer that appears with the highest frequency. If there is a tie in frequency, the function should return the integer that appeared first in the list. The function should take a single ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert highest_freq([3, 5, 5, 2, 3, 1, 5, 3, 3, 2, 1, 1, 1, 5]) == 3\", \"assert highest_freq([1, 2, 2, 3, 3, 1]) == 1\", \"assert highest_freq([4, 4, 4, 2, 1, 1, 2, 2]) == 4\", \"assert highest_freq([10, 10, 10, 20, 20, 30]) == 10\", \"assert highest_freq([1, 1, 2...
{ "split": "train", "index": 76357, "acecode_id": "evol_14495", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `print_even_list(lst)` that returns a new list containing only the even numbers from the provided list. The input list may contain both positive and negative integers, as well as zero. Your function should not print anything but in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_even_list([1, 2, 3, 4, 5]) == [2, 4]\", \"assert print_even_list([-1, -2, -3, -4, -5]) == [-2, -4]\", \"assert print_even_list([0, 1, 2, 3, 4]) == [0, 2, 4]\", \"assert print_even_list([2, 4, 6, 8, 10]) == [2, 4, 6, 8, 10]\", \"assert print_even_list([...
{ "split": "train", "index": 76358, "acecode_id": "evol_18794", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages a collection of commands associated with a software extension. The function should take a list of commands and perform the following operations: 1. Add a new command to the list, 2. Remove a command by its name, and 3. Re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_extension_commands([], 'cmd1', 'cmd2') == ['cmd1']\", \"assert manage_extension_commands(['cmd1'], 'cmd2', 'cmd1') == ['cmd2']\", \"assert manage_extension_commands(['cmd1', 'cmd2'], 'cmd3', 'cmd2') == ['cmd1', 'cmd3']\", \"assert manage_extension_com...
{ "split": "train", "index": 76359, "acecode_id": "oss_14711", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings called `program`, where each string represents a tag. Your task is to implement a function `blobs(program: List[str], *tags: str) -> List[str]` that returns a list of all unique tags that are reachable from the given tags. A tag is considered rea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert blobs(['a', 'b', 'c', 'd', 'e'], 'a', 'c') == ['a', 'c']\", \"assert blobs(['x', 'y', 'z', 'x', 'y'], 'x', 'y') == ['x', 'y']\", \"assert blobs(['apple', 'banana', 'cherry', 'date'], 'banana', 'fig') == ['banana']\", \"assert blobs(['one', 'two', 'three', 'f...
{ "split": "train", "index": 76360, "acecode_id": "bigcode_python_fns_23545", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the unique elements from the original list, while maintaining the order of their first appearance. Write a function `unique_elements(arr: List[int]) -> List[int]` th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_elements([5, 5, 5, 5]) == [5]\", \"assert unique_elements([]) == []\", \"assert unique_elements([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_elements([1, 2, 1, 2, 1]) == [...
{ "split": "train", "index": 76361, "acecode_id": "oss_9372", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing a list of tags and their corresponding titles to organize them by labels. Implement a function `process_data(tag_fin, title_fin, trans_dict)` that takes three parameters: \n- `tag_fin` (list): A list of tags. \n- `title_fin` (list): A list of corr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_data([' tag1 ', ' tag2 ', ' tag1 '], [' Title1 ', ' Title2 ', ' Title3 '], {'tag1': 'Label1', 'tag2': 'Label2'}) == {'Label1': ['Title1', 'Title3'], 'Label2': ['Title2']}\", \"assert process_data(['tag1', 'tag1', 'tag2'], ['title1', 'title2', 'title3...
{ "split": "train", "index": 76362, "acecode_id": "oss_35610", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that manages a fruit inventory represented as a dictionary. The dictionary should initially contain the following fruits and their respective quantities: apple = 5, banana = 10, orange = 15. Your function should take a list of operations, where each operati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_fruit_inventory([('add', 'grape', 7)]) == {'apple': 5, 'banana': 10, 'orange': 15, 'grape': 7}\", \"assert manage_fruit_inventory([('delete', 'banana')]) == {'apple': 5, 'orange': 15}\", \"assert manage_fruit_inventory([('update', 'apple', 20)]) == {'...
{ "split": "train", "index": 76363, "acecode_id": "evol_31115", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `historical` and `future`, representing historical and future rainfall data respectively, write a function `calculate_rain_difference(historical: List[int], future: List[int]) -> List[float]` that computes the difference in rainfall between the futu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_rain_difference([10, 20, 30], [15, 25, 35]) == [0.5, 0.25, 0.16666666666666666]\", \"assert calculate_rain_difference([0, 20, 30], [15, 25, 35]) == [0.0, 0.25, 0.16666666666666666]\", \"assert calculate_rain_difference([10, 0, 30], [15, 25, 35]) ==...
{ "split": "train", "index": 76364, "acecode_id": "bigcode_python_fns_25062", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a dataset. Your task is to write a function `num_samples(data: List[int]) -> int` that returns the number of samples in the dataset. The number of samples is defined as the length of the list provided. For example, if the input list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert num_samples([1, 2, 3]) == 3\", \"assert num_samples([]) == 0\", \"assert num_samples([5]) == 1\", \"assert num_samples([10, 20, 30, 40, 50]) == 5\", \"assert num_samples([-1, -2, -3]) == 3\", \"assert num_samples([0, 0, 0, 0]) == 4\", \"assert num_samples([1...
{ "split": "train", "index": 76365, "acecode_id": "oss_10392", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that returns a predefined message template for a contact page. The function should not take any arguments and must return a string that includes the title 'Contact Us' and a placeholder for the user. Specifically, the function should retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert contact_us() == 'Welcome to the Contact Us page, Guest!'\", \"assert contact_us('Alice') == 'Welcome to the Contact Us page, Alice!'\", \"assert contact_us('Bob') == 'Welcome to the Contact Us page, Bob!'\", \"assert contact_us('Charlie') == 'Welcome to the ...
{ "split": "train", "index": 76366, "acecode_id": "bigcode_python_fns_12795", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are developing a simple web application configuration function. Create a function `configure_app(twitter_wall: str, debug_mode: bool) -> None` that takes in two parameters: a string `twitter_wall` representing the configuration for the Twitter wall, and a boolean `debug_mod...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert configure_app('My Twitter Wall', True) is None\", \"assert configure_app('User Feed', False) is None\", \"assert configure_app('News Feed', True) is None\", \"assert configure_app('Updates', False) is None\", \"assert configure_app('Announcements', True) is ...
{ "split": "train", "index": 76367, "acecode_id": "bigcode_python_fns_48312", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the total distance traveled by an unmanned aerial system (UAS) based on a list of GPS positions. The distance should be calculated using the Haversine formula, which takes into account the curvature of the Earth. Implement a function that takes i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(calculate_total_distance([(0, 0), (1, 1)]) - 157.25) < 0.01\", \"assert abs(calculate_total_distance([(0, 0), (0, 0), (0, 0)]) - 0.0) < 0.01\", \"assert abs(calculate_total_distance([(0, 0), (90, 0)]) - 10007.54) < 0.01\", \"assert abs(calculate_total_di...
{ "split": "train", "index": 76368, "acecode_id": "oss_36303", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given an array of integers and an integer k. Write a function to find the k-th highest sum of all possible subarrays of the array. The function should return an error message if k is larger than the total number of subarrays. Handle negative numbers and zeros in the arr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert kth_largest_sum([1, 2, 3], 1) == 6\", \"assert kth_largest_sum([1, 2, 3], 2) == 5\", \"assert kth_largest_sum([-1, -2, -3], 1) == -1\", \"assert kth_largest_sum([0, 0, 0], 2) == 0\", \"assert kth_largest_sum([1, 0, -1, 2], 4) == 1\", \"assert kth_largest_sum...
{ "split": "train", "index": 76369, "acecode_id": "evol_6239", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a string that may contain leading and trailing spaces, implement a function `strip_spaces(s: str) -> str` that removes only the leading and trailing spaces from the string. The function should return the modified string. Note that if the string has only spaces, it should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert strip_spaces(' Hello, World! ') == 'Hello, World!'\", \"assert strip_spaces('NoSpaces') == 'NoSpaces'\", \"assert strip_spaces(' Leading spaces') == 'Leading spaces'\", \"assert strip_spaces('Trailing spaces ') == 'Trailing spaces'\", \"assert strip_...
{ "split": "train", "index": 76370, "acecode_id": "bigcode_python_fns_47269", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of floating-point numbers representing pixel values in an image, where each value is between 0 and 255. Your task is to implement a function that converts these pixel values to their corresponding roughness values based on specific rules. If the input is a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert roughness_convert([255, 255, 255, 255], False) == [127.5, 127.5, 127.5, 127.5]\", \"assert roughness_convert([128, 128, 128, 128], False) == [64.0, 64.0, 64.0, 64.0]\", \"assert roughness_convert([254, 254, 254, 254], True) == [0.0, 0.0, 0.0, 0.0]\", \"asser...
{ "split": "train", "index": 76371, "acecode_id": "bigcode_python_fns_4777", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with updating a software package's bug tracking information based on the input provided. You need to implement a function called `update_bug_tracking(bugs, package)` that takes two parameters: `bugs` and `package`. The `bugs` parameter can either be a string (rep...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_bug_tracking('https://github.com/owner/project/issues', {'bug_tracking_url': '', 'support_contacts': []}) == {'bug_tracking_url': 'https://github.com/owner/project/issues', 'support_contacts': []}\", \"assert update_bug_tracking({'url': 'https://bugtr...
{ "split": "train", "index": 76372, "acecode_id": "bigcode_python_fns_44260", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given two strings `a` and `b`, return the minimum number of times you should repeat string `a` so that string `b` is a substring of it. If it is impossible for `b` to be a substring of `a` after repeating it, return `-1`. You are allowed to replace up to `k` characters in strin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minTimes('abcd', 'cdabcdab', 1) == 3\", \"assert minTimes('a', 'aa', 0) == 2\", \"assert minTimes('a', 'a', 0) == 1\", \"assert minTimes('abc', 'wxyz', 2) == -1\", \"assert minTimes('abc', 'abc', 0) == 1\", \"assert minTimes('xyz', 'xyzzzz', 2) == 2\", \"ass...
{ "split": "train", "index": 76373, "acecode_id": "evol_4750", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a representation of a tree structure where each node contains a name and a list of its children. Write a function `find_elements_with_name(root: Node, name: str, depth: int) -> List[str]` that returns a list of names of all nodes that match the given name within a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_elements_with_name(Node('a', []), 'a', 0) == ['a']\", \"assert find_elements_with_name(Node('a', []), 'b', 0) == []\", \"assert find_elements_with_name(Node('a', [Node('b', [])]), 'b', 1) == ['b']\", \"assert find_elements_with_name(Node('a', [Node('b',...
{ "split": "train", "index": 76374, "acecode_id": "bigcode_python_fns_32217", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes two integers, start_year and end_year, and returns a list of all the leap years between these two years, inclusive. A year is considered a leap year if it is divisible by 4, except for end years which are divisible by 100, unless those end years are ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_leap_years(1900, 2000) == [1904, 1908, 1912, 1916, 1920, 1924, 1928, 1932, 1936, 1940, 1944, 1948, 1952, 1956, 1960, 1964, 1968, 1972, 1976, 1980, 1984, 1988, 1992, 1996, 2000]\", \"assert find_leap_years(2000, 2000) == [2000]\", \"assert find_leap_year...
{ "split": "train", "index": 76375, "acecode_id": "evol_11843", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a password reset feature in a web application. The function should accept a valid email address as input and return a tuple containing the response status code and a message. The function should behave as follows: if the em...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert password_reset('user@example.com') == (200, 'Password reset email has been sent.')\", \"assert password_reset('invalid_email') == (400, 'Invalid email address.')\", \"assert password_reset('') == (400, 'Invalid email address.')\", \"assert password_reset('us...
{ "split": "train", "index": 76376, "acecode_id": "oss_32357", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that computes the n-th element of a modified FibFib number sequence defined as follows: fibfib(0) == a, fibfib(1) == b, fibfib(2) == c, and for n >= 3, fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3). Write a function `fibfib_sequence(n: int, a: int, b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibfib_sequence(0, 5, 10, 15) == 5\", \"assert fibfib_sequence(1, 5, 10, 15) == 10\", \"assert fibfib_sequence(2, 5, 10, 15) == 15\", \"assert fibfib_sequence(3, 5, 10, 15) == 30\", \"assert fibfib_sequence(4, 5, 10, 15) == 55\", \"assert fibfib_sequence(5, ...
{ "split": "train", "index": 76377, "acecode_id": "evol_9478", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function `greet_user(name: str) -> str` that takes a string `name` as input. The function should check if the input is a valid string consisting only of alphabets and spaces. If it is valid, the function should return the string 'Hello ' concatenated with the `name`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert greet_user('Alice') == 'Hello Alice'\", \"assert greet_user('John Doe') == 'Hello John Doe'\", \"assert greet_user('') == 'Hello world!'\", \"assert greet_user('Bob123') == 'Hello world!'\", \"assert greet_user('Charlie!') == 'Hello world!'\", \"assert greet...
{ "split": "train", "index": 76378, "acecode_id": "evol_36003", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `quadratic(x: int) -> int` that calculates the value of the quadratic expression $x^2 + 4x + 5$ for a given integer value of `x`. The function should return the computed value.\nPlease reason step by step, then write a self-contained Python solution. Give y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert quadratic(0) == 5\", \"assert quadratic(1) == 10\", \"assert quadratic(2) == 17\", \"assert quadratic(3) == 26\", \"assert quadratic(4) == 37\", \"assert quadratic(5) == 50\", \"assert quadratic(-1) == 2\", \"assert quadratic(-2) == 1\", \"assert quadratic(-...
{ "split": "train", "index": 76379, "acecode_id": "evol_7670", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the total cost of a shopping cart, taking into account any applicable discounts. The function should take a list of items in the cart and a dictionary of discount codes, and return the total cost after applying the max...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_cost([('item1', 10.0), ('item2', 20.0)], {'DISCOUNT10': 10.0}) == 27.0\", \"assert calculate_total_cost([('itemX', 50.0), ('itemY', 50.0)], {}) == 100.0\", \"assert calculate_total_cost([], {'NODISCOUNT': 15.0}) == 0.0\", \"assert calculate_t...
{ "split": "train", "index": 76380, "acecode_id": "oss_18048", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a string `s`, write a function that determines if the string is a palindrome. A palindrome is a string that reads the same forward and backward, ignoring spaces, punctuation, and capitalization. You need to implement the function `is_palindrome(s: str) -> bool` that retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome('race a car') == False\", \"assert is_palindrome('') == True\", \"assert is_palindrome(' ') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palin...
{ "split": "train", "index": 76381, "acecode_id": "bigcode_python_fns_44581", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are assigned a mission to orchestrate a sequence of interdependent projects within a timeframe of `d` days. The projects are sequential, meaning to initiate the `i-th` project, all preceding projects `j` where `0 <= j < i` must be finalized. A minimum of one project must be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minProjectComplexity([1, 2, 3], 3, [3]) == 3\", \"assert minProjectComplexity([100, 200, 300], 2, [250, 150]) == -1\", \"assert minProjectComplexity([1, 1000, 500, 250], 2, [1000, 500]) == 1000\", \"assert minProjectComplexity([0, 0, 0], 3, [1, 1, 1]) == 0\"...
{ "split": "train", "index": 76382, "acecode_id": "evol_35507", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a list of field names and a list of dictionaries where each dictionary represents an item with certain attributes, write a function that generates a tab-separated string representation of the header and the corresponding values for each item. The function should take a li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_tsv(['Name', 'Age', 'City'], [{'Name': 'Alice', 'Age': 30, 'City': 'New York'}, {'Name': 'Bob', 'City': 'Los Angeles'}, {'Name': 'Charlie', 'Age': 25}]) == 'Name\\\\tAge\\\\tCity\\\\nAlice\\\\t30\\\\tNew York\\\\nBob\\\\t\\\\tLos Angeles\\\\nCharlie...
{ "split": "train", "index": 76383, "acecode_id": "bigcode_python_fns_29990", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `process_text` that takes a string input, removes any extra whitespace (more than one consecutive space), and checks if the processed string is empty or contains only whitespace. The function should return a tuple containing the proce...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_text(' Hello there, how are you? ') == ('Hello there, how are you?', False)\", \"assert process_text(' ') == ('', True)\", \"assert process_text('No extra spaces here') == ('No extra spaces here', False)\", \"assert process_text(' Leadin...
{ "split": "train", "index": 76384, "acecode_id": "oss_28772", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a given input and writes the output to a specified destination. The function should handle two different scenarios based on the input type. You need to implement a function called `process_input` that takes two paramete...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_input('hello', lambda x: x) == 'hello'\", \"assert process_input(123, lambda x: x) == '123'\", \"assert process_input(45.67, lambda x: x) == '45.67'\", \"assert process_input(True, lambda x: x) == 'True'\", \"assert process_input(None, lambda x: x) =...
{ "split": "train", "index": 76385, "acecode_id": "oss_31579", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Write a function `find_palindromes_in_string(input_string: str) -> List[str]` that takes a string as input and returns a list of all unique palindromic words found in the input string. A palindromic word is defined as a word that reads the same forwards and backwards. The compa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_palindromes_in_string('She found herself ensnared by the intricate details prevalent in the aesthetically appealing racecar blueprint.') == ['racecar']\", \"assert find_palindromes_in_string('Hello world') == []\", \"assert find_palindromes_in_string('C...
{ "split": "train", "index": 76386, "acecode_id": "evol_1035", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function that checks if a given list of numbers forms a valid arithmetic progression. An arithmetic progression is defined as a sequence of numbers in which the difference between consecutive terms is constant. The function should return True if the list forms an ar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_arithmetic([1, 2, 3, 4, 5]) == True\", \"assert check_arithmetic([5, 5, 5, 5]) == True\", \"assert check_arithmetic([10, 15, 20, 25]) == True\", \"assert check_arithmetic([1, 3, 5, 7, 9]) == True\", \"assert check_arithmetic([2, 4, 6, 8, 10]) == True\"...
{ "split": "train", "index": 76387, "acecode_id": "evol_5652", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a nested structure represented as a dictionary, where each key can either point to a basic data type (like int, float, or string) or another dictionary, write a function `flatten_dictionary(nested_dict)` that flattens this nested dictionary into a single-level dictionary....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flatten_dictionary({'a': 1, 'b': {'c': 2, 'd': {'e': 3}}}) == {'a': 1, 'b_c': 2, 'b_d_e': 3}\", \"assert flatten_dictionary({'x': 10, 'y': {'z': 20}}) == {'x': 10, 'y_z': 20}\", \"assert flatten_dictionary({'key1': 'value1', 'key2': {'key3': 'value3', 'key4'...
{ "split": "train", "index": 76388, "acecode_id": "bigcode_python_fns_32233", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function `process_dhcp_client` that manages DHCP client information based on the provided parameters. The function accepts the following parameters: \n- `session`: An object representing the session for interacting with DHCP clients. \n- `module`: A dict...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_dhcp_client(session, {'name': 'Client1', 'ip': '192.168.1.10', 'mac': '00:11:22:33:44:55'}, True) == {'changed': True, 'result': 'Client added/updated'}\", \"assert process_dhcp_client(session, {'name': 'Client2', 'ip': '192.168.1.20', 'mac': '00:11:...
{ "split": "train", "index": 76389, "acecode_id": "oss_29855", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given an array of integers and two indices, write a function that swaps the elements at the specified indices in the array. The function should return the modified array after the swap. If the indices are out of bounds, the function should return the original array without any ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert swap_positions([1, 2, 3, 4, 5], 0, 4) == [5, 2, 3, 4, 1]\", \"assert swap_positions([1, 2, 3, 4, 5], 1, 3) == [1, 4, 3, 2, 5]\", \"assert swap_positions([1, 2, 3, 4, 5], 2, 2) == [1, 2, 3, 4, 5]\", \"assert swap_positions([10, 20, 30, 40], 0, 1) == [20, 10, ...
{ "split": "train", "index": 76390, "acecode_id": "evol_35344", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates adding a global parameter to a model. The function `add_global_parameter` should accept a name for the parameter and an optional initial value (defaulting to 1.0). If a parameter with the same name already exists, the funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_global_parameter('param1') == 'Parameter param1 with initial value 1.0 has been added.'\", \"assert add_global_parameter('param1', 2.5) == 'Parameter param1 with initial value 2.5 has been added.'\", \"assert add_global_parameter('param2', 3.0) == 'Param...
{ "split": "train", "index": 76391, "acecode_id": "bigcode_python_fns_4386", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function to manage a list of blog posts. Each blog post has a unique identifier, a title, and content. Your function `post_update` should take a list of current blog posts, a new post's title, a new post's content, and an optional `post_id`. If ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert post_update([], 'First Post', 'This is the content of the first post.') == [{'id': 1, 'title': 'First Post', 'content': 'This is the content of the first post.'}]\", \"assert post_update([{'id': 1, 'title': 'First Post', 'content': 'This is the content of th...
{ "split": "train", "index": 76392, "acecode_id": "oss_37343", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the median and 1-sigma measurement for a parameter called 'ddt' based on different likelihood types. Your function should take a string `likelihood_type` as input and return a tuple `(ddt_median, ddt_sigma)`. The function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_ddt_measurement('DdtGaussian') == (1.5, 0.5)\", \"assert calculate_ddt_measurement('DdtHist') == (2.0, 0.8)\", \"assert calculate_ddt_measurement('DdtGaussKin') == (1.6, 0.4)\", \"assert calculate_ddt_measurement('DdtInvalidType') == (None, None)\"...
{ "split": "train", "index": 76393, "acecode_id": "oss_10739", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates an input string as an IP address. An IP address consists of four decimal numbers separated by periods (e.g., '192.168.1.1'). Your function should take a string input representing an IP address and return a tuple containing ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_ip('192.168.1.1') == (True, 'Valid IP address')\", \"assert validate_ip('256.168.1.1') == (False, 'Invalid IP address: 256 is not a valid number')\", \"assert validate_ip('192.168.1.1.1') == (False, 'Invalid IP address: Too many segments')\", \"asse...
{ "split": "train", "index": 76394, "acecode_id": "oss_22946", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D integer array `image` of size `m x n`, where each element can be either 0 or 1. The task is to compute the average of the elements in the array where the value is 1, but only consider the elements that are surrounded by 1s. If an element is on the border of the array...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_surrounded_ones([[0, 0, 0], [0, 1, 0], [0, 0, 0]]) == 0.0\", \"assert average_surrounded_ones([[1, 1, 1], [1, 1, 1], [1, 1, 1]]) == 1.0\", \"assert average_surrounded_ones([[0, 1, 0], [1, 1, 1], [0, 1, 0]]) == 1.0\", \"assert average_surrounded_ones(...
{ "split": "train", "index": 76395, "acecode_id": "bigcode_python_fns_44466", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Create a function in Python called `delete_element` that removes an element from a specified index in a list. The function should handle the following edge cases: 1. If the index is not within the valid range of the list, return a message indicating the error and leave the list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_element([1, 2, 3, 4, 5], 2) == [1, 2, 4, 5]\", \"assert delete_element([1, 2, 3, 4, 5], 5) == 'Error: Index out of range'\", \"assert delete_element([1, 2, 3, 4, 5], -1) == 'Error: Index out of range'\", \"assert delete_element([], 0) == 'Error: List ...
{ "split": "train", "index": 76396, "acecode_id": "evol_29925", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Construct a function `check_scholar(scholar)` that takes a dictionary representing a scholar's information and returns `True` if the scholar's data is valid, and `False` otherwise. The scholar's dictionary must contain the keys 'id', 'name', and 'grade'. The 'id' must be an int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_scholar({'id': 1, 'name': 'John Doe', 'grade': 85}) == True\", \"assert check_scholar({'id': 2, 'name': 'Alice Smith', 'grade': 95}) == True\", \"assert check_scholar({'id': 3, 'name': '', 'grade': 90}) == False\", \"assert check_scholar({'id': 4, 'nam...
{ "split": "train", "index": 76397, "acecode_id": "evol_14784", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that checks if a given list contains any complex numbers. The function should return True if at least one complex number is found, and False otherwise.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a si...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert contains_complex([1, 2, 3]) == False\", \"assert contains_complex(['a', 'b', 'c']) == False\", \"assert contains_complex([1+0j, 2, 3]) == True\", \"assert contains_complex([3, 4, 5+2j]) == True\", \"assert contains_complex([7, 'Text', 3+2j, 'Hello']) == True...
{ "split": "train", "index": 76398, "acecode_id": "evol_8872", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers and sorts it in ascending order using the insertion sort algorithm. The function should return the sorted list. For example, given the input [4, 6, 3, 5, 1], the output should be [1, 3, 4, 5, 6].\nPlease reason step by step, th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insertion_sort([4, 6, 3, 5, 1]) == [1, 3, 4, 5, 6]\", \"assert insertion_sort([10, 3, 5, 7, 2]) == [2, 3, 5, 7, 10]\", \"assert insertion_sort([1]) == [1]\", \"assert insertion_sort([]) == []\", \"assert insertion_sort([5, 5, 5, 5]) == [5, 5, 5, 5]\", \"asse...
{ "split": "train", "index": 76399, "acecode_id": "evol_34908", "num_tests": 16 }