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": "Write a Python function that computes the mean of the three largest integers and the mean of the three smallest integers from a given list of integers. The function should return these two mean values as a tuple. The input list will not be empty and will contain at least three ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mean_of_trio([1, 2, 3, 4, 5]) == (2.0, 4.0)\", \"assert mean_of_trio([10, 20, 30, 40, 50]) == (20.0, 40.0)\", \"assert mean_of_trio([7, 8, 9, 10, 11]) == (8.0, 10.0)\", \"assert mean_of_trio([-1, -2, -3, -4, -5]) == (-4.0, -2.0)\", \"assert mean_of_trio([100... | {
"split": "train",
"index": 73200,
"acecode_id": "evol_10086",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of solutions, where each solution is represented as a dictionary containing the keys 'owner', 'resemblance_int', 'solution_size', and 'problem_id'. Your task is to implement a function `get_best_solutions(solutions: List[Dict[str, Union[str, int]]]) -> List... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_best_solutions([{'owner': 'user1', 'resemblance_int': 80, 'solution_size': 150, 'problem_id': 'prob1', '_id': 'sol1'}, {'owner': 'user2', 'resemblance_int': 90, 'solution_size': 200, 'problem_id': 'prob1', '_id': 'sol2'}, {'owner': 'user3', 'resemblance_... | {
"split": "train",
"index": 73201,
"acecode_id": "bigcode_python_fns_1404",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `y_true` and `y_pred`, representing the true labels and predicted labels of a classification problem, respectively. Your task is to implement a function that calculates the confusion matrix for these labels. The confusion matrix is a 2D arra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_confusion_matrix([0, 0, 1, 1], [0, 1, 0, 1]) == [[1, 1], [1, 1]]\", \"assert calculate_confusion_matrix([1, 1, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0]) == [[3, 0], [1, 2]]\", \"assert calculate_confusion_matrix([0, 1, 0, 1, 2], [0, 0, 1, 1, 2]) == [[1, 1, ... | {
"split": "train",
"index": 73202,
"acecode_id": "bigcode_python_fns_44758",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of dictionaries containing configuration information for webcams. Each dictionary represents a webcam and contains two key-value pairs: 'URL' (the URL of the webcam) and 'directory' (the directory where the we... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_webcams([{'URL': 'http://webcam1.com', 'directory': '/data/webcam1'}]) == ['http://webcam1.com /data/webcam1']\", \"assert process_webcams([{'URL': 'http://webcam1.com', 'directory': '/data/webcam1'}, {'URL': 'http://webcam2.com', 'directory': '/data... | {
"split": "train",
"index": 73203,
"acecode_id": "oss_2028",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the counts of different functional groups in a molecule, write a function `count_functional_groups` that takes this list as input and returns a dictionary where the keys are the names of the functional groups prefixed with 'group_' followed... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_functional_groups([0, 0, 0]) == {'group_0': 0, 'group_1': 0, 'group_2': 0}\", \"assert count_functional_groups([1]) == {'group_0': 1}\", \"assert count_functional_groups([5, 10]) == {'group_0': 5, 'group_1': 10}\", \"assert count_functional_groups([2, ... | {
"split": "train",
"index": 73204,
"acecode_id": "bigcode_python_fns_4700",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a multi-line text, implement a function `get_velocity_range(text: str) -> Tuple[float, float]` that extracts the starting and ending velocities from the text. The text will contain lines that include the phrases 'starting velocity:' and 'ending veloc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_velocity_range('starting velocity: 10.5\\\\nending velocity: 20.3\\\\n') == (10.5, 20.3)\", \"assert get_velocity_range('starting velocity: -5.0\\\\nending velocity: 15.0\\\\n') == (-5.0, 15.0)\", \"assert get_velocity_range('no velocity information here... | {
"split": "train",
"index": 73205,
"acecode_id": "bigcode_python_fns_32966",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string called `desg` that represents a body designation. Your task is to write a function `desg_to_prefix(desg: str) -> str` that converts this body designation into a file prefix. The conversion rules are as follows: 1) Remove all '/' characters from the string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert desg_to_prefix('design/ (file) name') == 'design_file_name'\", \"assert desg_to_prefix('test (1) / example') == 'test_1_example'\", \"assert desg_to_prefix(' spaced string ') == 'spacedstring'\", \"assert desg_to_prefix('singleword') == 'singleword'\",... | {
"split": "train",
"index": 73206,
"acecode_id": "bigcode_python_fns_40371",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the weights of different packages. You need to implement a function that determines the maximum weight that can be carried by a truck given a weight limit. The truck can carry a maximum of 'limit' weight at a time, and you want to m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_weight([10, 20, 30], 50) == 50\", \"assert max_weight([50, 50, 50], 100) == 100\", \"assert max_weight([1, 1, 1, 1], 2) == 2\", \"assert max_weight([], 100) == 0\", \"assert max_weight([1, 2, 3], 3) == 3\", \"assert max_weight([4, 4, 4, 4], 8) == 8\", \"... | {
"split": "train",
"index": 73207,
"acecode_id": "bigcode_python_fns_6928",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `sort_and_count_swaps` that takes a list of integers as input and returns a tuple containing two elements: the sorted list and the total number of swaps made during the sorting process. Use an optimized version of the Bubble Sort algorithm to achieve... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_and_count_swaps([1, 2, 3, 4, 5]) == ([1, 2, 3, 4, 5], 0)\", \"assert sort_and_count_swaps([2, 1]) == ([1, 2], 1)\", \"assert sort_and_count_swaps([10, 9, 8, 7, 6]) == ([6, 7, 8, 9, 10], 10)\", \"assert sort_and_count_swaps([0]) == ([0], 0)\", \"assert s... | {
"split": "train",
"index": 73208,
"acecode_id": "evol_8010",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Write a function `check_voting_eligibility(age: int) -> str` that determines the voting eligibility based on the provided age. The function should return a message indicating whether the person is eligible to vote or the number of years remaining until they can vote. If the age... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_voting_eligibility(18) == 'You are eligible to vote and can mark a ballot.'\", \"assert check_voting_eligibility(24) == 'You are eligible to vote and can mark a ballot.'\", \"assert check_voting_eligibility(17) == 'You will be eligible to vote in 1 yea... | {
"split": "train",
"index": 73209,
"acecode_id": "oss_8034",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that extracts a subquery from a given SQL string based on its alias. The function should take two parameters: the SQL string and the alias of the subquery to be obtained. The SQL string may contain multiple subqueries, each wit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_subquery(\\\"SELECT * FROM (SELECT column1, column2 FROM table1) AS a\\\", \\\"a\\\") == \\\"SELECT column1, column2 FROM table1\\\"\", \"assert extract_subquery(\\\"SELECT * FROM (SELECT id FROM users) AS user_query\\\", \\\"user_query\\\") == \\\"S... | {
"split": "train",
"index": 73210,
"acecode_id": "oss_9888",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that removes all even numbers from the list and returns the remaining list containing only odd numbers. If the resulting list is empty, return an empty list. Write a function `remove_even_numbers(arr: List[i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_even_numbers([1, 2, 3, 4, 5]) == [1, 3, 5]\", \"assert remove_even_numbers([2, 4, 6, 8]) == []\", \"assert remove_even_numbers([0, 1, 2, 3, 4, 5]) == [1, 3, 5]\", \"assert remove_even_numbers([-1, -2, -3, -4]) == [-1, -3]\", \"assert remove_even_numbe... | {
"split": "train",
"index": 73211,
"acecode_id": "bigcode_python_fns_43422",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the total active power consumption given a list of active power readings. Each reading is represented as a float value in the list. Your function should return the sum of all active power readings. If the list is empty... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_active_power([100.0, 150.5, 200.0]) == 450.5\", \"assert total_active_power([0.0, 0.0, 0.0]) == 0.0\", \"assert total_active_power([-50.0, 50.0]) == 0.0\", \"assert total_active_power([250.0]) == 250.0\", \"assert total_active_power([]) == 0.0\", \"ass... | {
"split": "train",
"index": 73212,
"acecode_id": "bigcode_python_fns_42313",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a recursive function that returns the letters of the alphabet in reverse order as a string. The function should not use any built-in functions or libraries. The function should take no parameters.\nPlease reason step by step, then write a self-contained Python solutio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_alphabet() == 'zyxwvutsrqponmlkjihgfedcba'\", \"assert reverse_alphabet() == 'zyxwvutsrqponmlkjihgfedcba'\", \"assert reverse_alphabet() == 'zyxwvutsrqponmlkjihgfedcba'\", \"assert reverse_alphabet() == 'zyxwvutsrqponmlkjihgfedcba'\", \"assert revers... | {
"split": "train",
"index": 73213,
"acecode_id": "evol_18445",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two numbers, `multiplicand` and `multiplier`, implement a function that returns the product of these two numbers. The function should only accept integers or floats as inputs. If either input is not a number (int/float), the function should raise a TypeError. If either in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply(6, 3) == 18\", \"assert multiply(0, 5) == 0\", \"assert multiply(5, 0) == 0\", \"assert multiply(-2, 3) == -6\", \"assert multiply(2.5, 4) == 10.0\", \"assert multiply(3, -3) == -9\", \"assert multiply(1.5, 2) == 3.0\", \"assert multiply(0, 0) == 0\... | {
"split": "train",
"index": 73214,
"acecode_id": "bigcode_python_fns_38934",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of domain names as strings. Your task is to implement a function that counts how many unique top-level domains (TLDs) are present in the list. A TLD is defined as the last segment of a domain name, which comes after the last dot (.). For example, in 'exampl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_tlds(['example.com', 'test.org', 'example.com', 'sample.net', 'test.org']) == 3\", \"assert count_unique_tlds(['a.com', 'b.com', 'c.com', 'd.com']) == 1\", \"assert count_unique_tlds(['one.two.org', 'three.four.org', 'five.six.net']) == 2\", \"a... | {
"split": "train",
"index": 73215,
"acecode_id": "bigcode_python_fns_24919",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a nested list of integers where the depth of the lists is unknown, implement a recursive function to find the largest integer in the entire structure. You must not use built-in sorting or max functions. The input will be a list that can contain integers or other nested li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_largest([10, [100, [200]], [500, 400, [800, [1000, [2000]]]]]) == 2000\", \"assert find_largest([1, [2, [3]], [4], 5]) == 5\", \"assert find_largest([[-1, -2], [-3, -4]]) == -1\", \"assert find_largest([[[[5]]], [[4]], [3, 2, 1]]) == 5\", \"assert find_... | {
"split": "train",
"index": 73216,
"acecode_id": "evol_18474",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves the name of a chemical element based on its atomic number. Given an integer atomic number, return the name of the element. If the atomic number does not correspond to any known element, return 'Element not found'. Additiona... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_element_name(1) == 'Hydrogen'\", \"assert get_element_name(2) == 'Helium'\", \"assert get_element_name(3) == 'Lithium'\", \"assert get_element_name(4) == 'Beryllium'\", \"assert get_element_name(5) == 'Boron'\", \"assert get_element_name(6) == 'Carbon'\"... | {
"split": "train",
"index": 73217,
"acecode_id": "bigcode_python_fns_11963",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that selects a random archived video ID from a given list of videos associated with a specific YouTube channel. Each video is represented as a dictionary containing its details, including whether it is archived or not. If there are no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_random_archived_video([{'id': 'v1', 'archived': True}, {'id': 'v2', 'archived': False}, {'id': 'v3', 'archived': True}]) in ['v1', 'v3']\", \"assert select_random_archived_video([{'id': 'v1', 'archived': False}, {'id': 'v2', 'archived': False}]) is No... | {
"split": "train",
"index": 73218,
"acecode_id": "bigcode_python_fns_4159",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple game where a player navigates through a grid-based world represented as a 2D list. In this world, the player can collect stars and avoid obstacles. The grid is defined by its height and width and contains character... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert navigate_game([['.', '*'], ['.', 'X']], [0, 0]) == 1\", \"assert navigate_game([['P', '.', '.', 'X'], ['*', '.', '.', '.']], [0, 0]) == 1\", \"assert navigate_game([['.', 'X', 'X'], ['P', '*', '.']], [1, 0]) == 1\", \"assert navigate_game([['P', '.', '.'], [... | {
"split": "train",
"index": 73219,
"acecode_id": "oss_2809",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function `add_entities(array_data: List[str]) -> List[str]` that takes an array of named entities as input and returns the array with duplicate entities removed, preserving the original order. Each entity is a string. For example, if the input is [... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_entities(['Alice', 'Bob', 'Alice', 'Charlie']) == ['Alice', 'Bob', 'Charlie']\", \"assert add_entities(['Alice', 'Alice', 'Alice']) == ['Alice']\", \"assert add_entities([]) == []\", \"assert add_entities(['Alice']) == ['Alice']\", \"assert add_entities(... | {
"split": "train",
"index": 73220,
"acecode_id": "oss_7894",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Construct a function that can take any date string in various formats (for example '5th January 2021', 'January 5 2021', '01/05/2021', '2021-01-05', etc.) as input. It should convert and return the date string according to ISO 8601 standard 'YYYY-MM-DD' regardless of the input ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_date('5th January 2021') == '2021-01-05'\", \"assert convert_date('January 5 2021') == '2021-01-05'\", \"assert convert_date('2021-01-05') == '2021-01-05'\", \"assert convert_date('15th August 2020') == '2020-08-15'\", \"assert convert_date('2022-03-... | {
"split": "train",
"index": 73221,
"acecode_id": "evol_21695",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a progress bar representation of a task's completion. The progress bar should display the progress as a series of '>' characters, along with the percentage completion. The function should take an integer input represent... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_progress_bar(0) == '[ ]0.00%'\", \"assert generate_progress_bar(100) == '[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>]100.00%'\", \"assert generate_progress_bar(-1) == 'Error: Progress must be ... | {
"split": "train",
"index": 73222,
"acecode_id": "oss_19271",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function `longest_subsequence(strings: List[str]) -> Optional[str]` that returns the longest common subsequence present in all the strings. If there is no common subsequence or if the list is empty, the function should return None. The subse... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_subsequence([]) is None\", \"assert longest_subsequence(['a', 'b', 'c']) is None\", \"assert longest_subsequence(['xyz', 'xy', 'x']) == 'x'\", \"assert longest_subsequence(['aaa', 'aaa', 'aaa']) == 'aaa'\", \"assert longest_subsequence(['abcde', 'bcd... | {
"split": "train",
"index": 73223,
"acecode_id": "evol_17120",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the brain activity data over time, along with a threshold value. Write a function `analyze_brain_activity(data: List[int], threshold: int) -> dict` that analyzes this brain activity data and returns a dictionary containing two key p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_brain_activity([5, 4, 3, 2, 1], 4) == {'mean_value': 3.0, 'first_exceed_index': 0}\", \"assert analyze_brain_activity([1, 1, 1, 1, 1], 2) == {'mean_value': 1.0, 'first_exceed_index': -1}\", \"assert analyze_brain_activity([-1, -2, -3, -4, -5], 0) == ... | {
"split": "train",
"index": 73224,
"acecode_id": "oss_21408",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with tracking the entry of vehicles into a specific section of a parking lot. Implement a function `track_vehicle_entry(idveh: int, idsection: int) -> int` that simulates the entry of a vehicle into the parking section. The function should take two parameters: `i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert track_vehicle_entry(1, 101) == 0\", \"assert track_vehicle_entry(2, 102) == 0\", \"assert track_vehicle_entry(1, 101) == 0\", \"assert track_vehicle_entry(3, 103) == 0\", \"assert track_vehicle_entry(2, 102) == 0\", \"assert track_vehicle_entry(4, 104) == 0\... | {
"split": "train",
"index": 73225,
"acecode_id": "bigcode_python_fns_49086",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a date in the format 'YYYY-MM-DD', implement a function that transforms and standardizes the date to the format 'dd/mm/yyyy'. If the input date is not in the correct format, the function should return 'Incorrect date format. Please provide date in 'YYYY-MM-DD' format.'\nP... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_date('2021-02-14', '%d/%m/%Y') == '14/02/2021'\", \"assert transform_date('2020-01-01', '%d/%m/%Y') == '01/01/2020'\", \"assert transform_date('2019-12-31', '%d/%m/%Y') == '31/12/2019'\", \"assert transform_date('2022-03-15', '%d/%m/%Y') == '15/03/... | {
"split": "train",
"index": 73226,
"acecode_id": "evol_32064",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing sentences. Your task is to implement a function that processes this list by selecting only the unique strings that contain fewer than 6 words. The function should return a list of these unique strings. The output list should maintain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_sentences(['One', 'Two', 'Three', 'Four', 'Five', 'One', 'Two', 'Three'] ) == ['One', 'Two', 'Three', 'Four', 'Five']\", \"assert filter_sentences(['Just a test.', 'Unique test cases.', 'Short', 'Too many words in this one'] ) == ['Just a test.', 'Uni... | {
"split": "train",
"index": 73227,
"acecode_id": "bigcode_python_fns_45531",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a string of alphabetical symbols (the cluster) and a list of words (the lexicon), implement a function that finds the longest word from the lexicon that can be formed using the characters from the cluster. Each character in the cluster can be used as many times as it appe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_longest_word('abc', ['a', 'b', 'abc', 'c']) == 'abc'\", \"assert find_longest_word('xyz', ['a', 'b', 'c']) == ''\", \"assert find_longest_word('hello', ['he', 'hell', 'hello', 'o']) == 'hello'\", \"assert find_longest_word('aabbcc', ['abc', 'aabbcc', 'a... | {
"split": "train",
"index": 73228,
"acecode_id": "evol_9913",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that returns the sum of all even numbers in the list. If there are no even numbers, the function should return 0. Implement the function `sum_of_evens(numbers: List[int]) -> int` where `numbers` is the input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 15, 20, 25]) == 30\", \"assert sum_of_evens([-2, -4, 1, 3]) == -6\", \"assert sum_of_evens([1, 3, 5]) == 0\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([0, 1, 2]) == 2\", \"assert... | {
"split": "train",
"index": 73229,
"acecode_id": "oss_9608",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, each representing a package type. Write a function that returns the first package type that is found in a predefined list of installed plugins. Each plugin is represented by a dictionary containing a 'name' and a list of 'package_formats'. If no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_first_matching_package(['type5', 'type2', 'type3']) == 'type2'\", \"assert get_first_matching_package(['type1', 'type6']) == 'type1'\", \"assert get_first_matching_package(['type1', 'type2']) == 'type1'\", \"assert get_first_matching_package(['type2', 't... | {
"split": "train",
"index": 73230,
"acecode_id": "bigcode_python_fns_12497",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a mathematical expression containing only non-negative integers, the operators '+', '-', '*', and '/'. Your task is to evaluate the expression and return the result as an integer. The expression is guaranteed to be valid and will not contain ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_expression('3+2*2') == 7\", \"assert evaluate_expression(' 3/2 ') == 1\", \"assert evaluate_expression(' 3+5 / 2 ') == 5\", \"assert evaluate_expression(' 14-3/2 ') == 13\", \"assert evaluate_expression(' 2*3+4 ') == 10\", \"assert evaluate_expressi... | {
"split": "train",
"index": 73231,
"acecode_id": "bigcode_python_fns_43868",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string 'name' representing an email alias and a string 'target' representing the email address, implement a function that returns a dictionary with the keys 'comment', 'changes', 'name', and 'result'. The 'comment' should indicate that the alias is being set to the targ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_email_alias('saltdude', 'dude@saltstack.com') == {'comment': 'Set email alias saltdude -> dude@saltstack.com', 'changes': {'alias': 'saltdude'}, 'name': 'saltdude', 'result': True}\", \"assert set_email_alias('john_doe', 'john@example.com') == {'comment'... | {
"split": "train",
"index": 73232,
"acecode_id": "bigcode_python_fns_5590",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that accepts a hexadecimal string and a binary string as input parameters. The function should convert the hexadecimal string to binary and the binary string to hexadecimal. It should then perform an XOR operation on the resulting binary numbers and return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hex_bin_xor('0', '0') == {'binary': '0', 'hex': '0'}\", \"assert hex_bin_xor('xyz', '1101') == 'Invalid hexadecimal string'\", \"assert hex_bin_xor('1a', 'xyz') == 'Invalid binary string'\", \"assert hex_bin_xor('g1', '1010') == 'Invalid hexadecimal string'\... | {
"split": "train",
"index": 73233,
"acecode_id": "evol_36061",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Create a Python function that finds the immediate preceding and following unique values of a given target in a sorted list. If duplicates exist, they should be ignored, and the function should return the next unique number. The function should take a sorted list of integers and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_values([1, 3, 3, 4, 6, 6, 6, 7, 8], 6) == (4, 7)\", \"assert find_values([1, 1, 2, 2, 3, 3, 4], 2) == (1, 3)\", \"assert find_values([1, 2, 3, 4, 5], 3) == (2, 4)\", \"assert find_values([1, 1, 1, 1], 1) == (None, None)\", \"assert find_values([1, 2, 2,... | {
"split": "train",
"index": 73234,
"acecode_id": "evol_26865",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_valid_ipv6_address(addr: str) -> bool` that takes a string `addr` as input and returns `True` if the input string is a valid IPv6 address according to the standard format, and `False` otherwise. An IPv6 address is considered valid if it consists of eigh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_ipv6_address('2001:0db8:85a3:0000:0000:8a2e:0370:7334') == True\", \"assert is_valid_ipv6_address('2001:db8:85a3:0:0:8a2e:370:7334') == True\", \"assert is_valid_ipv6_address('2001:0db8:0000:0042:0000:8a2e:0370:7334') == True\", \"assert is_valid_ip... | {
"split": "train",
"index": 73235,
"acecode_id": "evol_22086",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a balanced binary tree with nodes holding any integer (positive or negative), implement a function to find its diameter - the length of the longest path between any two nodes. The diameter of a tree is the number of nodes on the longest path between any two leaves. A leaf... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert BinaryTree(1).get_diameter() == 1\", \"assert BinaryTree(1).get_diameter() == 1\", \"assert BinaryTree(1).get_diameter() == 1\", \"assert BinaryTree(1).get_diameter() == 1\", \"assert BinaryTree(1).get_diameter() == 1\", \"assert BinaryTree(1).get_diameter()... | {
"split": "train",
"index": 73236,
"acecode_id": "evol_5949",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and a number, implement a function that inserts the number into the list at a specified index, shifting the current elements to the right. The function should return the new list after the insertion. The function signature is as follows: `def insert_at_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert_at_index([3, 4, 5, 6, 7], 2, 2.5) == [3, 4, 2.5, 5, 6, 7]\", \"assert insert_at_index([], 0, 1) == [1]\", \"assert insert_at_index([1, 2, 3], 0, 0) == [0, 1, 2, 3]\", \"assert insert_at_index([1, 2, 3], 3, 4) == [1, 2, 3, 4]\", \"assert insert_at_inde... | {
"split": "train",
"index": 73237,
"acecode_id": "bigcode_python_fns_26352",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that counts the occurrences of specific subsequences within a given sequence of characters, taking into account the case sensitivity of the characters. The function should return a dictionary where the keys are the subsequences and the values are their resp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_subsequences('Please find the number of occurrences of STRING string String', ['string', 'String', 'STRING']) == {'string': 1, 'String': 1, 'STRING': 1}\", \"assert count_subsequences('Test TEST test', ['test', 'TEST', 'TeSt']) == {'test': 1, 'TEST': 1... | {
"split": "train",
"index": 73238,
"acecode_id": "evol_20056",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines whether a button should be enabled or disabled based on the state of a feature checkbox group. The function `features_change` takes two parameters: `old`, which represents the current state of the checkbox group (a lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert features_change([], []) == False\", \"assert features_change([], ['feature1']) == True\", \"assert features_change(['feature1'], ['feature1']) == True\", \"assert features_change(['feature1'], []) == False\", \"assert features_change(['feature1', 'feature2']... | {
"split": "train",
"index": 73239,
"acecode_id": "bigcode_python_fns_26754",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that simulates a simple logging system for an application. The function should receive a list of log messages and return a formatted string representing the logs. Each log message should be prefixed with a timestamp indicating when the log was c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_logs([('Error occurred', '2023-10-01 10:00:00'), ('User logged in', '2023-10-01 10:05:00')]) == '2023-10-01 10:00:00 Error occurred\\\\n2023-10-01 10:05:00 User logged in\\\\n'\", \"assert format_logs([('System rebooted', '2023-10-02 12:00:00')]) == '... | {
"split": "train",
"index": 73240,
"acecode_id": "bigcode_python_fns_39766",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a numerical input, write a Python function called `format_numbers` that formats the number in four different ways. The function should return a dictionary containing the following keys and their corresponding formatted values: \n\n1. \"scientific\": the number in scientif... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_numbers(0) == {'scientific': '0.00e+00', 'percentage': '0.0%', 'general': '0', 'original': '0'}\", \"assert format_numbers(1) == {'scientific': '1.00e+00', 'percentage': '100.0%', 'general': '1', 'original': '1'}\", \"assert format_numbers(3.14159) ==... | {
"split": "train",
"index": 73241,
"acecode_id": "oss_5329",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function that rounds a given floating-point number to the nearest hundredth. The function should take a single parameter, a float, and return a float rounded to two decimal places.\nPlease reason step by step, then write a self-contained Python solution. Give your f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert round_to_hundredth(768.3195) == 768.32\", \"assert round_to_hundredth(1.235) == 1.24\", \"assert round_to_hundredth(1.236) == 1.24\", \"assert round_to_hundredth(5.554) == 5.55\", \"assert round_to_hundredth(0.004) == 0.0\", \"assert round_to_hundredth(0.005... | {
"split": "train",
"index": 73242,
"acecode_id": "evol_11408",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given string and performs a specific operation based on the content of the string. The function should take a string as input and return a modified version of the string according to the following rules: If the inp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_string('This repository has <gh_stars>') == 'This repository has 250'\", \"assert process_string('There are no stars mentioned here.') == 'There are no stars mentioned here.'\", \"assert process_string('<gh_stars> is a placeholder.') == '250 is a pla... | {
"split": "train",
"index": 73243,
"acecode_id": "oss_23068",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `transform_string(s: str) -> str` that takes a string `s` as input and returns a new string where all unique uppercase letters in `s` are converted to lowercase. The function should only consider uppercase letters that appear in the string. If there are no uppe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_string('Hello Universe') == 'hello universe'\", \"assert transform_string('Python Programming') == 'python programming'\", \"assert transform_string('HELLO WORLD') == 'hello world'\", \"assert transform_string('no uppercase here') == 'no uppercase ... | {
"split": "train",
"index": 73244,
"acecode_id": "evol_2435",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that simulates a network call which might fail. Your task is to implement a function that retries this network call a specified number of times in case of failure, with an increasing delay between each attempt. The function should accept the following p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retry_network_call(1, 1, 2) == 'Success'\", \"assert retry_network_call(2, 1, 2) == 'Success'\", \"assert retry_network_call(10, 1, 1) == 'Success'\", \"assert retry_network_call(4, 1, 1) == 'Success'\", \"assert retry_network_call(2, 2, 2) == 'Success'\"]}"... | {
"split": "train",
"index": 73245,
"acecode_id": "bigcode_python_fns_29737",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a function `lcm_multiple` that takes an arbitrary number of integers as input and returns their least common multiple (LCM). The function should return None if fewer than two integers are provided. The input integers can be negative, and the output should be a positive in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lcm_multiple(4, 6) == 12\", \"assert lcm_multiple(3, 5, 7) == 105\", \"assert lcm_multiple(1, 2, 3, 4) == 12\", \"assert lcm_multiple(12, 15) == 60\", \"assert lcm_multiple(-4, -6) == 12\", \"assert lcm_multiple(0, 5) == 0\", \"assert lcm_multiple(7, 0) == 0... | {
"split": "train",
"index": 73246,
"acecode_id": "evol_29114",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a dropout layer in a neural network. The dropout layer randomly sets a fraction of input units to 0 based on a specified dropout rate, which is a decimal value between 0 and 1. Your task is to implement a function that takes a list of input values... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_dropout([1.0, 2.0, 3.0], 0.0) == [1.0, 2.0, 3.0]\", \"assert apply_dropout([1.0, 2.0, 3.0], 1.0) == [0, 0, 0]\", \"assert apply_dropout([1.0, 2.0, 3.0, 4.0, 5.0], 0.2) == [1.0, 2.0, 3.0, 4.0, 0]\", \"assert apply_dropout([10.0, 20.0, 30.0, 40.0], 0.5) ... | {
"split": "train",
"index": 73247,
"acecode_id": "oss_7142",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a connection string for a database based on provided host and port parameters. The function should accept two string inputs, 'host' and 'port', and return a formatted connection string in the following format: 'http://<host... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_connection_string('localhost', '8529') == 'http://localhost:8529'\", \"assert generate_connection_string('127.0.0.1', '8080') == 'http://127.0.0.1:8080'\", \"assert generate_connection_string('my.database.com', '5432') == 'http://my.database.com:543... | {
"split": "train",
"index": 73248,
"acecode_id": "bigcode_python_fns_17218",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers as input and returns a new list containing only the unique integers from the input list, maintaining their original order. The input list may contain duplicates, and the output list should not contain any... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_unique_numbers([1, 2, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert filter_unique_numbers([5, 5, 5]) == [5]\", \"assert filter_unique_numbers([]) == []\", \"assert filter_unique_numbers([1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert filter_unique_numbers([1, 1, 2,... | {
"split": "train",
"index": 73249,
"acecode_id": "bigcode_python_fns_41749",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that sorts a string containing several words alphabetically, ignoring the case. If there are multiple similar words, the function must keep the original order of occurrence (stable sorting). Additionally, the function should validate if the input string contain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_words('apple banana cherry') == 'apple banana cherry'\", \"assert sort_words('Banana apple Cherry') == 'apple Banana Cherry'\", \"assert sort_words('apple apple banana') == 'apple apple banana'\", \"assert sort_words('kiwi orange banana') == 'banana kiw... | {
"split": "train",
"index": 73250,
"acecode_id": "evol_31675",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a class name and a dictionary of valid class names. Your task is to implement a function that checks if the given class name is valid or not. If the class name is not recognized, return a message indicating that it is 'not a recognized class'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_class('BaseClass', {'BaseClass': True, 'DerivedClass': False}) == 'recognized base class'\", \"assert validate_class('DerivedClass', {'BaseClass': True, 'DerivedClass': False}) == 'incorrect use of class attribute'\", \"assert validate_class('Unknow... | {
"split": "train",
"index": 73251,
"acecode_id": "bigcode_python_fns_6488",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `geocode(level: Optional[str], names: Union[List[str], str], countries: Optional[List[Union[str, Geocoder]]], states: Optional[List[Union[str, Geocoder]]], counties: Optional[List[Union[str, Geocoder]]], scope: Optional[Union[str, Geocoder]]) ->... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert geocode('city', 'New York') is not None\", \"assert isinstance(geocode('state', ['California', 'Texas']), NamesGeocoder)\", \"assert geocode('country', ['Canada'], ['Canada']) is not None\", \"assert geocode('county', 'Los Angeles', ['USA'], ['California'], ... | {
"split": "train",
"index": 73252,
"acecode_id": "bigcode_python_fns_3693",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of paths and a list of class names as input. The function should append the paths to the Python `sys.path`, and should dynamically import the specified classes, making them available for use in the current namespace. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert import_classes(['/invalid/path'], ['sample_step.SampleStep']) == []\", \"assert import_classes(['/path/to/common/scenario'], ['sample_step.NonExistentClass']) == []\", \"assert import_classes([], ['sample_step.SampleStep']) == []\", \"assert import_classes([... | {
"split": "train",
"index": 73253,
"acecode_id": "oss_33699",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and a threshold number, implement a function `filter_values(my_list, num)` that returns a new list containing only the values from the input list that are less than or equal to the given number. The function should also handle cases where non-numeric in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_values([2, 4, 'a', 6, 7], 5) == [2, 4]\", \"assert filter_values([1, 2, 3, 4, 5], 5) == [1, 2, 3, 4, 5]\", \"assert filter_values([10, 20, 30, 'x', 5], 15) == [10, 5]\", \"assert filter_values(['b', 'c', 3, 2, 1], 2) == [2, 1]\", \"assert filter_value... | {
"split": "train",
"index": 73254,
"acecode_id": "evol_3092",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents either a single integer or a range in the notation '<start>:<step>:<stop>'. Your task is to implement a function that parses this string and returns either the integer or a list of integers generated by the range. If the input represents a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_integer_or_range('5') == 5\", \"assert parse_integer_or_range('1:2:5') == [1, 3, 5]\", \"assert parse_integer_or_range('3:1:10') == [3, 4, 5, 6, 7, 8, 9, 10]\", \"assert parse_integer_or_range('0:3:9') == [0, 3, 6, 9]\", \"assert parse_integer_or_range... | {
"split": "train",
"index": 73255,
"acecode_id": "bigcode_python_fns_3517",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Design a function in Python that takes a list of integers and a single integer as parameters and returns a new list where each element from the original list is raised to the power of the given integer. The original list should remain unchanged. For example, the function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_elements_power([1, 2, 3], 2) == [1, 4, 9]\", \"assert multiply_elements_power([0, 1, 2], 3) == [0, 1, 8]\", \"assert multiply_elements_power([-1, -2, -3], 2) == [1, 4, 9]\", \"assert multiply_elements_power([4, 5], 0) == [1, 1]\", \"assert multiply_... | {
"split": "train",
"index": 73256,
"acecode_id": "evol_16547",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, your task is to implement the function `max_subarray_sum` that returns the maximum sum of a contiguous subarray within the input list. A contiguous subarray is defined as a subarray that consists of elements that are adjacent in the input list. For exa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([1, -2, 3, 4, -1, 2, 1, -5, 4]) == 9\", \"assert max_subarray_sum([-2, -3, -1, -5]) == -1\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([1, 2, 3, 4, 5])... | {
"split": "train",
"index": 73257,
"acecode_id": "oss_22220",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of entities and their corresponding colors. Your task is to write a function `visualize_entities` that takes two parameters: a list of entities and a list of colors. The function should return a list of strings where each string indicates the visualization ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert visualize_entities(['Circle', 'Square', 'Triangle'], ['Red', 'Green', 'Blue']) == ['Entity Circle is visualized with color Red', 'Entity Square is visualized with color Green', 'Entity Triangle is visualized with color Blue']\", \"assert visualize_entities([... | {
"split": "train",
"index": 73258,
"acecode_id": "oss_37003",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to create a function that takes a string representing the type of a model and returns a descriptive string about that model. The function should accept the following model types: 'alexnet', 'vgg16', 'resnet50', or 'mobilenet'. If the input string does not match any of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_model('alexnet') == 'AlexNet model created'\", \"assert create_model('vgg16') == 'VGG16 model created'\", \"assert create_model('resnet50') == 'ResNet50 model created'\", \"assert create_model('mobilenet') == 'MobileNet model created'\", \"assert crea... | {
"split": "train",
"index": 73259,
"acecode_id": "bigcode_python_fns_27189",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of lists, where each inner list contains numerical values, implement a function `scale_data(data: List[List[float]]) -> List[List[float]]` that scales each inner list's values to a range of 0 to 1. The scaling should be done using min-max normalization, where each ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert scale_data([[1, 2, 3], [4, 5, 6]]) == [[0.0, 0.5, 1.0], [0.0, 0.5, 1.0]]\", \"assert scale_data([[1, 1, 1], [1, 1, 1]]) == [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]\", \"assert scale_data([[5, 5, 5], [5, 5, 5]]) == [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]\", \"assert sca... | {
"split": "train",
"index": 73260,
"acecode_id": "bigcode_python_fns_23210",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with parsing a list of strings representing paragraphs and grouping them into blocks based on certain parsing rules. Each paragraph can be followed by one or more empty lines or other paragraphs. Your function should return a list of blocks where each block is a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_paragraphs(['Paragraph one.', '', '', 'Paragraph two.']) == ['Paragraph one.', 'Paragraph two.']\", \"assert parse_paragraphs(['', '']) == []\", \"assert parse_paragraphs(['Single paragraph']) == ['Single paragraph']\", \"assert parse_paragraphs(['Firs... | {
"split": "train",
"index": 73261,
"acecode_id": "bigcode_python_fns_6681",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of encoded repository IDs and a dictionary representing the dependencies of various repositories. Each key in the dictionary is a repository ID, and its value is a list of tuples where each tuple contains details about a dependent repository, including whet... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_prior_installation_ids(None, ['4', '5'], {'repo3': [('tool3', 'repoC', 'owner3', 'rev3', False)], 'repo4': [('tool4', 'repoD', 'owner4', 'rev4', True)], 'description': [], 'root_key': []}) == []\", \"assert get_prior_installation_ids(None, ['6'], {'repo5... | {
"split": "train",
"index": 73262,
"acecode_id": "bigcode_python_fns_5235",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing an algorithm to detect drowsiness in a person's eyes using the Eye Aspect Ratio (EAR) technique. The EAR is a measure used in facial recognition to determine the openness of an eye. You are given two constants: `EAR_thresh`, which is the thresho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_drowsiness([0.2, 0.18, 0.17, 0.16, 0.19, 0.18, 0.2]) == True\", \"assert detect_drowsiness([0.2, 0.2, 0.2]) == False\", \"assert detect_drowsiness([0.1, 0.1, 0.1, 0.1]) == True\", \"assert detect_drowsiness([0.3, 0.4, 0.5]) == False\", \"assert detect... | {
"split": "train",
"index": 73263,
"acecode_id": "oss_20110",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of ISO 8601 formatted date strings, write a function that classifies these dates into sequentially ordered seven-day time periods. Additionally, identify any date strings that do not conform to the ISO 8601 standard and list them separately. The function should r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_and_validate_dates(['2020-02-29', '2020-03-01', '2020-03-02']) == ([[ '2020-02-29', '2020-03-01', '2020-03-02']], [])\", \"assert classify_and_validate_dates(['2021-02-28', '2021-03-01', '2021-03-02']) == ([[ '2021-02-28', '2021-03-01', '2021-03-02'... | {
"split": "train",
"index": 73264,
"acecode_id": "evol_19709",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes in a 2D list of integers representing a grayscale image of size 28x28 pixels and returns a normalized 2D list where each pixel value is scaled to the range [0, 1]. The normalization is performed by dividing each pixel value by 255.0. The input im... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_image([[0, 0, 0], [255, 255, 255]]) == [[0.0, 0.0, 0.0], [1.0, 1.0, 1.0]]\", \"assert normalize_image([[128, 128, 128], [64, 64, 64]]) == [[0.5019607843137255, 0.5019607843137255, 0.5019607843137255], [0.25098039215686274, 0.25098039215686274, 0.25... | {
"split": "train",
"index": 73265,
"acecode_id": "evol_26695",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates a configuration data string and its associated file format. Write a function `validate_and_warn` that takes two parameters: \n- `cfg_str` (string): A string containing the configuration data. \n- `file_format` (strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_and_warn('key: value', '.json') == None\", \"assert validate_and_warn('key: value', '.yaml') == None\", \"assert validate_and_warn('key: value', '.yml') == None\", \"assert validate_and_warn('key: value', '.py') == None\", \"assert validate_and_warn... | {
"split": "train",
"index": 73266,
"acecode_id": "oss_19878",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a string `s` and a substring `sub`, implement a function `count_subsequences(s: str, sub: str) -> int` that counts the number of non-overlapping subsequences of `sub` in `s`. You must use dynamic programming to solve this problem.\nPlease reason step by step, then write a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_subsequences('aaa', 'aa') == 3\", \"assert count_subsequences('abcdef', 'ace') == 1\", \"assert count_subsequences('xyz', 'xyz') == 1\", \"assert count_subsequences('abcd', 'd') == 1\", \"assert count_subsequences('abc', 'abc') == 1\", \"assert count_s... | {
"split": "train",
"index": 73267,
"acecode_id": "evol_31168",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given an array `arr` composed of integers that may or may not be distinct. Your task is to determine the minimum number of contiguous subarrays that can be created such that if each subarray is sorted independently and then concatenated back together, the resulting arra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minSubarrays([1, 2, 3, 4, 5, 6, 7, 8]) == 1\", \"assert minSubarrays([1]) == 1\", \"assert minSubarrays([1, 3, 2]) == 2\", \"assert minSubarrays([4, 3, 2, 1]) == 4\", \"assert minSubarrays([10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == 10\", \"assert minSubarrays([1, 3... | {
"split": "train",
"index": 73268,
"acecode_id": "evol_8305",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that calculates the factorial of a non-negative integer. The function should raise a ValueError if the input is a negative integer or if the input is not an integer. Define the function as follows: def factorial_calculator(n): where n is the input in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial_calculator(0) == 1\", \"assert factorial_calculator(1) == 1\", \"assert factorial_calculator(2) == 2\", \"assert factorial_calculator(3) == 6\", \"assert factorial_calculator(4) == 24\", \"assert factorial_calculator(5) == 120\", \"assert factorial... | {
"split": "train",
"index": 73269,
"acecode_id": "evol_28303",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings representing different types of keys, write a function `get_private_key_class(key_type: str) -> str` that returns the corresponding private key class name for each key type. The mapping of key types to class names is as follows: 'rsa' -> 'RSAPrivateKey',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_private_key_class('rsa') == 'RSAPrivateKey'\", \"assert get_private_key_class('dsa') == 'DSAPrivateKey'\", \"assert get_private_key_class('ecdsa') == 'ECDSAPrivateKey'\", \"assert get_private_key_class('ed25519') == 'Ed25519PrivateKey'\", \"assert get_pr... | {
"split": "train",
"index": 73270,
"acecode_id": "bigcode_python_fns_19914",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates user login to a generic online account system. The function `login_account` should take two parameters: `username` (a string) and `password` (a string). The function will return a string indicating whether the login was suc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert login_account('user123', 'pass123') == 'Login successful'\", \"assert login_account('user123', 'wrongpass') == 'Login failed'\", \"assert login_account('wronguser', 'pass123') == 'Login failed'\", \"assert login_account('wronguser', 'wrongpass') == 'Login fa... | {
"split": "train",
"index": 73271,
"acecode_id": "bigcode_python_fns_6362",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the weights of items. Your task is to implement the function `max_weight_capacity(weights)` that returns the maximum weight capacity that can be achieved by selecting items from the list, such that no two selected items can be adjac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_weight_capacity([1, 2, 3, 1]) == 4\", \"assert max_weight_capacity([2, 7, 9, 3, 1]) == 12\", \"assert max_weight_capacity([2, 1, 1, 2]) == 4\", \"assert max_weight_capacity([5, 5, 10, 100, 10, 5]) == 110\", \"assert max_weight_capacity([]) == 0\", \"asse... | {
"split": "train",
"index": 73272,
"acecode_id": "oss_13263",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, you need to organize them into a grid format with a specified number of columns. The grid should be filled row-wise. If the total number of integers is not divisible by the number of columns, the last row of the grid can have fewer elements. Implement ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert organize_array_by_rows([1, 2, 3, 4, 5], 2) == [[1, 2], [3, 4], [5]]\", \"assert organize_array_by_rows([1, 2, 3, 4, 5, 6], 3) == [[1, 2, 3], [4, 5, 6]]\", \"assert organize_array_by_rows([], 3) == []\", \"assert organize_array_by_rows([1], 1) == [[1]]\", \"a... | {
"split": "train",
"index": 73273,
"acecode_id": "bigcode_python_fns_45172",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns the largest sum of non-adjacent elements in the list. This means that you cannot pick both numbers if they are next to each other. The function should take a list of integers as input and return an integer representing the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_non_adjacent_sum([2, 4, 6, 2, 5]) == 13\", \"assert max_non_adjacent_sum([1, 2, 3, 4, 5]) == 9\", \"assert max_non_adjacent_sum([5, 1, 1, 5]) == 10\", \"assert max_non_adjacent_sum([]) == 0\", \"assert max_non_adjacent_sum([1, 2]) == 2\", \"assert max_no... | {
"split": "train",
"index": 73274,
"acecode_id": "bigcode_python_fns_47382",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list of integers representing a matrix, write a function `normalize_matrix(matrix: List[List[int]]) -> List[List[float]]` that normalizes the values in the matrix to be between 0 and 1. The normalization should be done using the formula: normalized_value = (value - m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_matrix([[1, 2], [3, 4]]) == [[0.0, 0.3333333333333333], [0.6666666666666666, 1.0]]\", \"assert normalize_matrix([[5, 5], [5, 5]]) == [[0.0, 0.0], [0.0, 0.0]]\", \"assert normalize_matrix([[0]]) == [[0.0]]\", \"assert normalize_matrix([[1], [2]]) ==... | {
"split": "train",
"index": 73275,
"acecode_id": "bigcode_python_fns_28188",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string consisting of the characters 'I', 'X', 'Y', and 'Z', and an optional list of qubit labels, return a list of tuples where each tuple represents a Pauli term. Each Pauli term is represented by a character from the input string and a corresponding qubit label. The q... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert str_to_pauli_term('II', None) == [('I', 1), ('I', 0)]\", \"assert str_to_pauli_term('Z', None) == [('Z', 0)]\", \"assert str_to_pauli_term('X', [0]) == [('X', 0)]\", \"assert str_to_pauli_term('Y', [1]) == [('Y', 1)]\", \"assert str_to_pauli_term('ZZ', None)... | {
"split": "train",
"index": 73276,
"acecode_id": "bigcode_python_fns_30851",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function that returns a new list containing each string in the original list sorted in alphabetical order. The function should maintain the original order of the strings. For example, if the input is ['banana', 'apple', 'cherry'], the output... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_strings(['banana', 'apple', 'cherry']) == ['apple', 'banana', 'cherry']\", \"assert sort_strings(['orange', 'banana', 'apple']) == ['apple', 'banana', 'orange']\", \"assert sort_strings(['zebra', 'lion', 'tiger']) == ['lion', 'tiger', 'zebra']\", \"asse... | {
"split": "train",
"index": 73277,
"acecode_id": "evol_35158",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a description of affected entities based on provided security details. The function should accept two parameters: a set of affected entity names and a set of related hostnames, along with an optional limit that specifies th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_affected_entities_description({'entity1', 'entity2', 'entity3'}, {'host1', 'host2'}, 5) == 'Affected entities: entity1, entity2, entity3\\\\nAffected hostnames: host1, host2\\\\n'\", \"assert create_affected_entities_description({'entity1', 'entity2',... | {
"split": "train",
"index": 73278,
"acecode_id": "bigcode_python_fns_33113",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a string as input and removes all vowels (both uppercase and lowercase), digits, punctuation, and any repetitive consonants, leaving only distinct consonants in the output. The output should retain the order of the first occurrence of each consonant.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_elements_and_repeats('Python3.9 is awesome!') == 'Pythnswm'\", \"assert remove_elements_and_repeats('1234567890') == ''\", \"assert remove_elements_and_repeats('!!@#$%^&*()') == ''\", \"assert remove_elements_and_repeats('aaeeiioouu') == ''\", \"asser... | {
"split": "train",
"index": 73279,
"acecode_id": "evol_11712",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sort_array(arr: List[int]) -> Tuple[List[int], List[int]]` that takes a list of integers and returns a tuple containing two lists: the first list should be the input list sorted in ascending order, and the second list should be the input list sorted in des... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_array([2, 1, 5, 3, 7, 8, 6, 4, 7, 1]) == ([1, 1, 2, 3, 4, 5, 6, 7, 7, 8], [8, 7, 7, 6, 5, 4, 3, 2, 1, 1])\", \"assert sort_array([]) == ([], [])\", \"assert sort_array([5]) == ([5], [5])\", \"assert sort_array([3, 3, 3]) == ([3, 3, 3], [3, 3, 3])\", \"a... | {
"split": "train",
"index": 73280,
"acecode_id": "evol_4272",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_primes(starting_number)` that generates a list of the first 20 prime numbers starting from the given `starting_number`. If `starting_number` is less than 2, the function should start checking from 2. The function should return a list of 20 prime n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_primes(10) == [11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89]\", \"assert generate_primes(1) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71]\", \"assert generate_primes(20) == [23, 29,... | {
"split": "train",
"index": 73281,
"acecode_id": "evol_20448",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of elements that may contain integers, strings, and other data types, implement a function `remove_duplicates` that returns a new list containing only the unique elements from the input list, while preserving the original order of their first occurrence. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert remove_duplicates(['apple', 'banana', 'apple', 'orange']) == ['apple', 'banana', 'orange']\", \"assert remove_duplicates([1, 1, 1, 1]) == [1]\", \"assert remove_duplicates(['x', 'y', 'x', 'z', 'y... | {
"split": "train",
"index": 73282,
"acecode_id": "oss_31721",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that modifies a list of resources by removing specified attributes. Each resource is represented as a dictionary with various attributes. Write a function called `process_resources` that takes two parameters: 1. `resources` (list o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_resources([{'id': 1, 'name': 'Resource 1', 'type': 'A', 'status': 'active'}], ['status']) == [{'id': 1, 'name': 'Resource 1', 'type': 'A'}]\", \"assert process_resources([{'id': 2, 'name': 'Resource 2', 'type': 'B', 'status': 'inactive'}], ['type', '... | {
"split": "train",
"index": 73283,
"acecode_id": "oss_8478",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `xs` and `ys`, representing the x-coordinates and y-coordinates of points respectively. Define a function `plot_single_points(xs, ys)` that returns a list of tuples, where each tuple contains the coordinates of a point (x, y). If `xs` is Non... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert plot_single_points([1, 2, 3], [4, 5, 6]) == [(1, 4), (2, 5), (3, 6)]\", \"assert plot_single_points([], [1, 2, 3]) == []\", \"assert plot_single_points(None, [1, 2, 3]) == [(0, 1), (1, 2), (2, 3)]\", \"assert plot_single_points([1, 2], [3]) == []\", \"assert... | {
"split": "train",
"index": 73284,
"acecode_id": "bigcode_python_fns_44626",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a camera system that tracks the state of various cameras in a streaming environment. Each camera can either be in the 'STREAMING' state or 'OFF' state. Your task is to implement a function that attempts to turn off a camera based on its identifier. If the camera i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert turn_off_camera({'camera1': 'STREAMING', 'camera2': 'OFF'}, 'camera1') == 'OFF'\", \"assert turn_off_camera({'camera1': 'STREAMING', 'camera2': 'OFF'}, 'camera2') == 'OFF'\", \"assert turn_off_camera({'camera1': 'STREAMING', 'camera2': 'OFF'}, 'camera3') == ... | {
"split": "train",
"index": 73285,
"acecode_id": "bigcode_python_fns_37568",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats a status message for a file upload progress display. The function should take three parameters: a string `filename` representing the name of the file being uploaded, an integer `current` representing the number of bytes uploa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_status('file.txt', 0, 100) == 'file.txt 0% (0 B of 100 B)'\", \"assert format_status('file.txt', 100, 100) == 'file.txt 100% (100 B of 100 B)'\", \"assert format_status('file.txt', 0, 0) == 'file.txt 0% (0 B of 0 B)'\", \"assert format_status('script.... | {
"split": "train",
"index": 73286,
"acecode_id": "bigcode_python_fns_32800",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of 3D positions represented by a list of tuples, where each tuple contains three floating-point values (x, y, z), write a function `create_mesh` that generates a representation of a mesh where each position corresponds to three vertices at the same coordinates. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_mesh([(1.0, 2.0, 3.0)]) == {'vertices': [(1.0, 2.0, 3.0), (1.0, 2.0, 3.0), (1.0, 2.0, 3.0)], 'polygons': [[0, 1, 2]]}\", \"assert create_mesh([(0.0, 0.0, 0.0), (1.0, 1.0, 1.0)]) == {'vertices': [(0.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0), (1.0,... | {
"split": "train",
"index": 73287,
"acecode_id": "bigcode_python_fns_2134",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing the configuration of an Elasticsearch domain. The configuration contains a key 'DomainConfig' which in turn contains a key 'AccessPolicies' that is also a dictionary. Your task is to implement a function that extracts the 'AccessPolicies'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_access_policies({'DomainConfig': {'AccessPolicies': {'Options': ['policy1', 'policy2']}}}) == '{\\\"Options\\\": [\\\"policy1\\\", \\\"policy2\\\"]}'\", \"assert extract_access_policies({'DomainConfig': {'AccessPolicies': {'Options': []}}}) == '{\\\"... | {
"split": "train",
"index": 73288,
"acecode_id": "bigcode_python_fns_38846",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a module name and an optional origin string as inputs. The function should return a dictionary representing a blank module with the provided name and origin. The dictionary should contain two keys: 'name' for the module name, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_blank_module('module1') == {'name': 'module1', 'origin': None}\", \"assert create_blank_module('module2', 'local') == {'name': 'module2', 'origin': 'local'}\", \"assert create_blank_module('module3', 'remote') == {'name': 'module3', 'origin': 'remote'... | {
"split": "train",
"index": 73289,
"acecode_id": "bigcode_python_fns_30336",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integers n and r, return the number of ways to arrange r elements from a set of size n in a given order. If r is not provided, assume it to be equal to n. The function should raise a TypeError if either n or r are not integers, and it should raise a ValueError if r is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert permutations(5) == 120\", \"assert permutations(5, 3) == 60\", \"assert permutations(4) == 24\", \"assert permutations(4, 2) == 12\", \"assert permutations(6, 2) == 30\", \"assert permutations(0) == 1\", \"assert permutations(1) == 1\", \"assert permutations... | {
"split": "train",
"index": 73290,
"acecode_id": "bigcode_python_fns_15078",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary `workspace` which contains a key 'active_workspace' that maps to a string representing the path of a user's active workspace. Implement a function `show_user_workspace(workspace: dict) -> str` that returns a string in the format 'current workspace: <p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert show_user_workspace({'active_workspace': '/home/user/project'}) == 'current workspace: /home/user/project'\", \"assert show_user_workspace({'active_workspace': '/usr/local/bin'}) == 'current workspace: /usr/local/bin'\", \"assert show_user_workspace({'other_... | {
"split": "train",
"index": 73291,
"acecode_id": "bigcode_python_fns_3561",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts a list of integers in ascending order using the Bubble Sort algorithm. Your solution should be in-place, meaning you cannot use extra space for a new array. The function should take a list of integers as input and modify the list directly to refl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubbleSort([5, 1, 4, 2, 8]) == [1, 2, 4, 5, 8]\", \"assert bubbleSort([3, 0, 2, 5, -1, 4, 1]) == [-1, 0, 1, 2, 3, 4, 5]\", \"assert bubbleSort([1]) == [1]\", \"assert bubbleSort([]) == []\", \"assert bubbleSort([2, 1]) == [1, 2]\", \"assert bubbleSort([10, 9... | {
"split": "train",
"index": 73292,
"acecode_id": "evol_10090",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that echoes a given message back to the user. The function should take a single argument, `message`, which is a string. The function should return the same string passed as the input. Your function should handle empty strings as well. Ple... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert echo_message('Hello, World!') == 'Hello, World!'\", \"assert echo_message('') == ''\", \"assert echo_message('Python is great!') == 'Python is great!'\", \"assert echo_message('LeetCode challenge') == 'LeetCode challenge'\", \"assert echo_message('Echo this ... | {
"split": "train",
"index": 73293,
"acecode_id": "bigcode_python_fns_39449",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that counts the frequency of lowercase consonants located at odd-indexed positions within a given string. A consonant is defined as any lowercase letter that is not a vowel (i.e., 'a', 'e', 'i', 'o', 'u'). The function should be able to handle a variety of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_lower('ABCDEF') == 0\", \"assert count_lower('zxyA') == 1\", \"assert count_lower('!@#$$%^&*()') == 0\", \"assert count_lower('aAbBcCdDeEfFgGhH') == 0\", \"assert count_lower('AEIOU') == 0\", \"assert count_lower('abcdefg') == 3\", \"assert count_lower... | {
"split": "train",
"index": 73294,
"acecode_id": "evol_21106",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of activity periods for a user profile and returns the total duration of all activity periods in hours. Each activity period is represented as a dictionary with the following keys: 'id', 'start_time', and 'end_time'. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_activity_duration([{'id': 1, 'start_time': '2023-10-01 09:00:00', 'end_time': '2023-10-01 10:00:00'}, {'id': 2, 'start_time': '2023-10-01 10:30:00', 'end_time': '2023-10-01 11:30:00'}]) == 2.0\", \"assert total_activity_duration([{'id': 1, 'start_time'... | {
"split": "train",
"index": 73295,
"acecode_id": "oss_7888",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a command to list all IP host groups for a firewall. The function takes two parameters, an integer 'offset' and an integer 'limit', which represent pagination in the list of host groups. The function should return a dic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ip_host_group_list_command(0, 10) == {'outputs_prefix': 'SophosFirewall.IPHostGroup', 'outputs': [{'Name': 'ip_hosts'}, {'Name': 'web_hosts'}]}\", \"assert ip_host_group_list_command(0, 5) == {'outputs_prefix': 'SophosFirewall.IPHostGroup', 'outputs': [{'Nam... | {
"split": "train",
"index": 73296,
"acecode_id": "bigcode_python_fns_4989",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a regular expression pattern, implement a function that checks if two input strings match the defined pattern. The function should return one of the following strings: 'Both strings are compatible with the regular expression.', 'Only the first string is compatible with th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert assess_compatibility(r'^[a-z]+$', 'abc', 'def') == 'Both strings are compatible with the regular expression.'\", \"assert assess_compatibility(r'^[a-z]+$', 'abc', 'abc123') == 'Only the first string is compatible with the regular expression.'\", \"assert ass... | {
"split": "train",
"index": 73297,
"acecode_id": "evol_3508",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of image file paths as strings. Your task is to implement a function `process_images(image_name: List[str]) -> List[str]` that takes this list as input and returns a new list containing the processed image file paths. The specific operations to be performed... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_images(['input_file.png', 'image_file.png', 'other_file.png']) == ['output_file.png', 'picture_file.png', 'other_file.png']\", \"assert process_images(['input_image.png', 'test_image.png', 'sample_input.png']) == ['output_picture.png', 'test_picture.... | {
"split": "train",
"index": 73298,
"acecode_id": "oss_35023",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement the function `smithWaterman(seqA: str, seqB: str, matScore: dict, gapOpen: int, gapExtend: int) -> Tuple[str, str, int]` that calculates the optimal local alignment between two sequences `seqA` and `seqB` using the Smith-Waterman algorithm. The function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert smithWaterman('AAA', 'AAAA', {'A': {'A': 2}}, 2, 1) == ('AAA', 'AAA', 6)\", \"assert smithWaterman('ABC', 'XYZ', {'A': {'X': -1, 'Y': -1, 'Z': -1}, 'B': {'X': -1, 'Y': -1, 'Z': -1}, 'C': {'X': -1, 'Y': -1, 'Z': -1}}, 2, 1) == ('', '', 0)\", \"assert smithWat... | {
"split": "train",
"index": 73299,
"acecode_id": "oss_10337",
"num_tests": 9
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.