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": "Create a function `set_ball_properties(color: str, radius: float) -> dict` that takes a color and a radius as input parameters and returns a dictionary representing a ball with the given properties. The dictionary should contain two keys: 'color' and 'radius', with their corres...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_ball_properties('Blue', 5.0) == {'color': 'Blue', 'radius': 5.0}\", \"assert set_ball_properties('Red', 10.0) == {'color': 'Red', 'radius': 10.0}\", \"assert set_ball_properties('Green', 3.5) == {'color': 'Green', 'radius': 3.5}\", \"assert set_ball_prop...
{ "split": "train", "index": 84800, "acecode_id": "evol_29392", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the sizes of files in bytes. Your task is to implement a function that calculates the total size of files that can be downloaded, given a maximum download limit in bytes. If the total size exceeds the limit, return the maximum size ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_download_size([100, 200, 300], 600) == 600\", \"assert calculate_download_size([100, 200, 300], 100) == 100\", \"assert calculate_download_size([100, 200, 300], 0) == 0\", \"assert calculate_download_size([], 1000) == 0\", \"assert calculate_downlo...
{ "split": "train", "index": 84801, "acecode_id": "bigcode_python_fns_19785", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that determines if a list of integers can 'fly' based on two conditions: the list must be a palindrome and the sum of the list's elements must be less than or equal to a given maximum weight. The function should also ensure that all elements in the list are...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert will_it_fly([1, 2], 5) == False\", \"assert will_it_fly([3, 2, 3], 1) == False\", \"assert will_it_fly([3, 2, 3], 9) == True\", \"assert will_it_fly([3], 5) == True\", \"assert will_it_fly([], 0) == True\", \"assert will_it_fly([1, 2, 1], 4) == True\", \"ass...
{ "split": "train", "index": 84802, "acecode_id": "evol_10097", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a user logout process. The function should reset two global variables, `bandwidth_object` and `qos_object`, to empty dictionaries. Additionally, it should return a string 'Logout successful' to indicate that the logout proc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert user_logout() == 'Logout successful'\", \"assert isinstance(bandwidth_object, dict)\", \"assert isinstance(qos_object, dict)\"]}" }
{ "split": "train", "index": 84803, "acecode_id": "bigcode_python_fns_35077", "num_tests": 3 }
acecode
[ { "role": "user", "content": "You are given a dictionary where each key is a string and each value is a numerical value. Your task is to implement a function that removes the last item from the dictionary and returns a tuple containing the key and value of the removed item. If the dictionary is empty, retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_last_item({'a': 1.0, 'b': 2.0, 'c': 3.0}) == ('c', 3.0)\", \"assert remove_last_item({'x': 10.5}) == ('x', 10.5)\", \"assert remove_last_item({'first': 5.0, 'second': 10.0, 'third': 15.0}) == ('third', 15.0)\", \"assert remove_last_item({'key1': 100, ...
{ "split": "train", "index": 84804, "acecode_id": "bigcode_python_fns_35477", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two nested dictionaries, where each dictionary has the same keys and the values are also dictionaries. Your task is to merge these two dictionaries into a single dictionary. The merging process should create a new dictionary that combines the values from the two d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_nested_dicts({'a': {'x': 1}}, {'a': {'y': 2}}) == {'a': {'x': 1, 'y': 2}}\", \"assert merge_nested_dicts({'a': {'x': 1}, 'b': {'y': 2}}, {'a': {'y': 3}, 'b': {'z': 4}}) == {'a': {'x': 1, 'y': 3}, 'b': {'y': 2, 'z': 4}}\", \"assert merge_nested_dicts({'...
{ "split": "train", "index": 84805, "acecode_id": "bigcode_python_fns_11256", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `generate_indivisible_numbers(n: int) -> List[int]` that constructs an array containing all the odd numbers starting from the integer 0 up to and including the integer n. The function should return the array of these odd integers in the order they are found.\nP...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_indivisible_numbers(0) == []\", \"assert generate_indivisible_numbers(1) == [1]\", \"assert generate_indivisible_numbers(2) == [1]\", \"assert generate_indivisible_numbers(3) == [1, 3]\", \"assert generate_indivisible_numbers(4) == [1, 3]\", \"asser...
{ "split": "train", "index": 84806, "acecode_id": "evol_35288", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a list of strings and a user-defined character. The function should identify all strings in the list that start with the specified character, sort those strings in decreased lexicographic order, join them together with a pipe (|), and return the modi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_and_join_strings(['Apple', 'Banana', 'Boat'], 'C') == ['Apple', 'Banana', 'Boat']\", \"assert sort_and_join_strings(['Zebra', 'Apple', 'Ace'], 'A') == ['Apple|Ace', 'Zebra']\", \"assert sort_and_join_strings([], 'A') == []\", \"assert sort_and_join_stri...
{ "split": "train", "index": 84807, "acecode_id": "evol_31428", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_person()` that returns a dictionary containing the default details of a person. The dictionary should have the following key-value pairs: 'name' with the value 'John Doe', 'age' with the value 34, and 'gender' with the value 'Male'.\nPlease reason s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_person() == {'name': 'John Doe', 'age': 34, 'gender': 'Male'}\", \"assert create_person()['name'] == 'John Doe'\", \"assert create_person()['age'] == 34\", \"assert create_person()['gender'] == 'Male'\", \"assert 'name' in create_person()\", \"assert ...
{ "split": "train", "index": 84808, "acecode_id": "evol_30946", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `subtract_two_numbers` that takes two parameters, `num1` and `num2`. The function should return the difference between `num1` and `num2` if both inputs are either integers or floats. If either of the inputs is not a number, the function should raise ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert subtract_two_numbers(10, 5) == 5\", \"assert subtract_two_numbers(5.5, 2.2) == 3.3\", \"assert subtract_two_numbers(-3, -7) == 4\", \"assert subtract_two_numbers(0, 0) == 0\", \"assert subtract_two_numbers(100, 50) == 50\", \"assert subtract_two_numbers(3.5,...
{ "split": "train", "index": 84809, "acecode_id": "evol_35356", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `length_of_first_dimension(data: List[int]) -> int` that calculates the length of the list. The function should return the number of elements in the input list. If the list is empty, the function should return 0. \n\n### Example\nI...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert length_of_first_dimension([1, 2, 3, 4]) == 4\", \"assert length_of_first_dimension([]) == 0\", \"assert length_of_first_dimension([5, 10, 15]) == 3\", \"assert length_of_first_dimension([-1, -2, -3, -4, -5]) == 5\", \"assert length_of_first_dimension([100]) ...
{ "split": "train", "index": 84810, "acecode_id": "bigcode_python_fns_27004", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function to swap the characters at even and odd index positions of a given string. For example, if the input string is 'abcdef', the output should be 'badcfe'. The function should handle strings of any length, including empty strings.\nPlease reason step by step,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert swap_characters('abcdef') == 'badcfe'\", \"assert swap_characters('abcdefg') == 'badcfeg'\", \"assert swap_characters('') == ''\", \"assert swap_characters('a') == 'a'\", \"assert swap_characters('ab') == 'ba'\", \"assert swap_characters('abc') == 'bac'\", \...
{ "split": "train", "index": 84811, "acecode_id": "evol_21142", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a list of integers and returns the sum of all even numbers in that list. If there are no even numbers, the function should return 0. Implement a function named `sum_of_evens(numbers: List[int]) -> int` that performs this task. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 21, 32, 43]) == 42\", \"assert sum_of_evens([0, 1, 2, 3, 4]) == 6\", \"assert sum_of_evens([-2, -1, 0, 1, 2]) == 0\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([1, 3, 5]) == 0\", ...
{ "split": "train", "index": 84812, "acecode_id": "oss_14202", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers called `permutation` and a string called `digit`, implement a function that returns a set of integers corresponding to the characters in the `digit` string based on their positions in the `permutation` list. Each character in `digit` is assumed to be a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_set_from_word([6, 5, 4, 3, 2, 1, 0], 'abcd') == {6, 5, 4, 3}\", \"assert get_set_from_word([10, 20, 30, 40, 50, 60, 70, 80, 90, 100], 'abc') == {10, 20, 30}\", \"assert get_set_from_word([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 'xyz') == set()\", \"assert get_set...
{ "split": "train", "index": 84813, "acecode_id": "bigcode_python_fns_5248", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that contains tokens in the format `{argument}`. Your task is to replace each token with its corresponding argument, effectively removing the token formatting. Write a function `strip_tokens(tokenized: str) -> str` that takes this string as input and retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert strip_tokens('Hello {world}, welcome to {Python}!') == 'Hello world, welcome to Python!'\", \"assert strip_tokens('{greeting}, {name}!') == 'greeting, name!'\", \"assert strip_tokens('No tokens here.') == 'No tokens here.'\", \"assert strip_tokens('Multiple ...
{ "split": "train", "index": 84814, "acecode_id": "bigcode_python_fns_32344", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of periods where each period is represented as a tuple (start, end), write a function that returns a list of periods that end before or at a given end time. The input will be a list of periods and a specific end time. The function should include the periods that en...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_periods_up_to([(1, 3), (2, 5), (4, 6)], 5) == [(1, 3), (2, 5)]\", \"assert get_periods_up_to([(1, 3), (2, 5), (4, 6)], 3) == [(1, 3)]\", \"assert get_periods_up_to([(1, 3), (2, 5), (4, 6)], 2) == []\", \"assert get_periods_up_to([(1, 3), (4, 5)], 5) == [...
{ "split": "train", "index": 84815, "acecode_id": "bigcode_python_fns_4851", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `extract_exemptions` that takes a list of strings as input and returns a list of exemptions. An exemption is defined as the string immediately following the string 'X' in the input list. If 'X' appears multiple times in the input list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_exemptions(['A', 'X', 'exemption1', 'B', 'X', 'exemption2', 'C']) == ['exemption1', 'exemption2']\", \"assert extract_exemptions(['X', 'exemption3', 'X', 'exemption4']) == ['exemption3', 'exemption4']\", \"assert extract_exemptions(['A', 'B', 'C']) =...
{ "split": "train", "index": 84816, "acecode_id": "oss_18404", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Design a Python function that identifies the first non-repeating character within a provided string, returning its index position, ASCII value, and the character encoded in base64 format. If the input string consists solely of repeating characters, the function should return 'N...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_char_info('example') == {'Index': 1, 'ASCII': 120, 'Base64': 'eA==' }\", \"assert unique_char_info('aaaaaaa') == 'No unique character found.'\", \"assert unique_char_info('aA') == {'Index': 0, 'ASCII': 97, 'Base64': 'YQ==' }\", \"assert unique_char_in...
{ "split": "train", "index": 84817, "acecode_id": "evol_15228", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of import aliases represented by a class `ImportAlias` that has two attributes: `evaluated_name` (a string representing the name of the import) and `comma` (a boolean indicating whether there is a trailing comma). Your task is to implement a function `clean...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_new_import_aliases([ImportAlias('a', False), ImportAlias('b', True)]) == [ImportAlias('a', False), ImportAlias('b', False)]\", \"assert clean_new_import_aliases([ImportAlias('c', True), ImportAlias('a', False)]) == [ImportAlias('a', False), ImportAlias...
{ "split": "train", "index": 84818, "acecode_id": "bigcode_python_fns_45493", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a secure aggregator for processing sensitive data. The aggregator is designed to handle both weighted and unweighted data. Your task is to create a function that takes in the data and specifies whether it is weighted or unweighted, as well as wh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert secure_aggregator([1.0, 2.0, 3.0], False, True, False) == 0.0\", \"assert secure_aggregator([1.0, 2.0, 3.0], True, True, False) == 0.0\", \"assert secure_aggregator([], False, False, False) == 0.0\", \"assert secure_aggregator([], True, False, False) == 0.0\...
{ "split": "train", "index": 84819, "acecode_id": "oss_28989", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates a given payload dictionary for a web service. The function should check if the 'filters' key in the payload is present and, if so, whether it is parsed as a dictionary. If the 'filters' key is not present in the payload...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_payload({'filters': {'type': 'date', 'value': '2022-01-01'}}) == True\", \"assert validate_payload({'filters': 'abc'}) == False\", \"assert validate_payload({'filters': 123}) == False\", \"assert validate_payload({'filters': None}) == False\", \"ass...
{ "split": "train", "index": 84820, "acecode_id": "oss_30963", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a text processing function that takes a string as input and returns a modified version of the string based on a set of rules. Your function should be named `process_text` and should take two parameters: a string `input_text` and a dictionary `co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_text(' Hello ', {'declared': ['Hello']}) == 'Hello'\", \"assert process_text(' Test ', {'declared': ['Hello', 'test']}) == 'Test'\", \"assert process_text('This is a test.', {'declared': ['Hello', 'test']}) == 'This is a test.'\", \"assert pr...
{ "split": "train", "index": 84821, "acecode_id": "oss_25986", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple calculator that supports basic arithmetic operations. Specifically, you need to implement a function `add(a: int, b: int) -> int` that takes two integers as input and returns their sum. Your function should handle both positive and nega...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add(3, 5) == 8\", \"assert add(-2, 4) == 2\", \"assert add(-3, -7) == -10\", \"assert add(0, 0) == 0\", \"assert add(10, 5) == 15\", \"assert add(-1, 1) == 0\", \"assert add(7, -3) == 4\", \"assert add(100, 200) == 300\", \"assert add(-50, -50) == -100\", \"...
{ "split": "train", "index": 84822, "acecode_id": "oss_13380", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `analyze_string` that takes a string as input and returns a dictionary containing the frequency of each unique alphabet character (case sensitive) and the frequency of each unique combination of two adjacent alphabet characters (digraphs) in the string. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_string('') == {'characters': {}, 'digraphs': {}}\", \"assert analyze_string('!!!') == {'characters': {}, 'digraphs': {}}\", \"assert analyze_string('zyxwvutsrqponmlkjihgfedcba') == {'characters': {'z': 1, 'y': 1, 'x': 1, 'w': 1, 'v': 1, 'u': 1, 't': ...
{ "split": "train", "index": 84823, "acecode_id": "evol_10639", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function that generates a securely randomized alphanumeric passcode of a given length. The passcode should consist of uppercase letters, lowercase letters, and digits. You need to ensure that the generated passcode is random and secure. The function should take an i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_passcode(8) != generate_passcode(8)\", \"assert len(generate_passcode(12)) == 12\", \"assert all(c in string.ascii_letters + string.digits for c in generate_passcode(10))\", \"assert generate_passcode(16).isalnum()\", \"assert generate_passcode(1) i...
{ "split": "train", "index": 84824, "acecode_id": "evol_2702", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates input and processes it. The function should take a single input string and check if it is a valid integer. If the input is a valid integer, apply the function `dec()` to it and return the result. If the input is not a v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_input('42') == 84\", \"assert process_input('0') == 0\", \"assert process_input('-5') == -10\", \"assert process_input('abc') == 'BAD INPUT'\", \"assert process_input('3.14') == 'BAD INPUT'\", \"assert process_input('') == 'BAD INPUT'\", \"assert pro...
{ "split": "train", "index": 84825, "acecode_id": "oss_21927", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples, where each tuple represents a record containing an item count and an error code. Your task is to implement a function `validate_data` that checks if the records follow specific validation rules: 1) The item count must be a non-negative integer. 2...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_data([(0, None), (10, None)]) == True\", \"assert validate_data([(0, None), (25, None), (50, 404)]) == True\", \"assert validate_data([(0, 404)]) == False\", \"assert validate_data([(5, None), (10, 500)]) == True\", \"assert validate_data([(0, 500)]...
{ "split": "train", "index": 84826, "acecode_id": "oss_25394", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages configuration settings for a meet-up application. The function should allow for the configuration of the application's name. Implement a function named `manage_meetup_name` that takes two parameters: `current_name` (a string ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_meetup_name('meetup', 'networking') == 'networking'\", \"assert manage_meetup_name('meetup', '') == 'meetup'\", \"assert manage_meetup_name('', 'event') == 'event'\", \"assert manage_meetup_name('', '') == 'meetup'\", \"assert manage_meetup_name('conf...
{ "split": "train", "index": 84827, "acecode_id": "oss_26678", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the ages of a group of people. Your task is to implement a function that returns the average age of the group. If the list is empty, the function should return 0.0. The average age should be calculated as a float with two decimal pl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_age([20, 30, 40]) == 30.0\", \"assert average_age([18, 22, 29, 35, 40]) == 28.8\", \"assert average_age([100, 200, 300]) == 200.0\", \"assert average_age([1, 2, 3, 4, 5]) == 3.0\", \"assert average_age([0, 0, 0]) == 0.0\", \"assert average_age([15, 1...
{ "split": "train", "index": 84828, "acecode_id": "bigcode_python_fns_25549", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes three real numbers as input and returns their multiplication product. The function signature should be: def multiply_three_numbers(a: float, b: float, c: float) -> float.\nPlease reason step by step, then write a self-contained Python solution. G...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply_three_numbers(1.0, 2.0, 3.0) == 6.0\", \"assert multiply_three_numbers(-1.0, 2.0, 3.0) == -6.0\", \"assert multiply_three_numbers(0.0, 2.0, 3.0) == 0.0\", \"assert multiply_three_numbers(1.5, 2.0, 3.0) == 9.0\", \"assert multiply_three_numbers(-1.5,...
{ "split": "train", "index": 84829, "acecode_id": "evol_7654", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing data from a sensor system that collects numerical readings over time. Your goal is to implement a Python function that calculates the total error of these sensor readings based on a given sample value. The total error is defined as: \\( \\text{Tota...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_error([1.0, 2.0, 3.0], 2.0) == 0.6666666666666666\", \"assert calculate_total_error([1.5, 1.5, 1.5], 1.5) == 0.0\", \"assert calculate_total_error([1.0, 1.0, 1.0, 1.0], 1.0) == 0.0\", \"assert calculate_total_error([0.0, 0.0, 0.0], 0.0) == 0....
{ "split": "train", "index": 84830, "acecode_id": "oss_36233", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with counting the occurrences of a specific target object in a given list of object class IDs. The function should take in a list of integers representing the detected object class IDs and a string representing the target object name. The target object names corr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_target_objects([0, 1, 2, 3, 0, 1, 4], 'person') == 2\", \"assert count_target_objects([1, 2, 2, 3, 4, 5], 'bicycle') == 1\", \"assert count_target_objects([0, 1, 0, 0, 2, 2], 'car') == 2\", \"assert count_target_objects([5, 5, 5, 5], 'bus') == 4\", \"a...
{ "split": "train", "index": 84831, "acecode_id": "oss_36163", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two distinct strings, determine if one string can be rearranged to form an anagram of the other. Implement a function `are_anagrams(string1: str, string2: str) -> bool` that returns True if the two strings are anagrams of each other, and False otherwise.\nPlease reason st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_anagrams('abcde', 'edcba') == True\", \"assert are_anagrams('listen', 'silent') == True\", \"assert are_anagrams('triangle', 'integral') == True\", \"assert are_anagrams('apple', 'pale') == False\", \"assert are_anagrams('rat', 'car') == False\", \"asser...
{ "split": "train", "index": 84832, "acecode_id": "evol_227", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function in Python that categorizes elements of a 2D array into prime numbers, non-prime numbers, and composite numbers with more than two distinct prime factors. The function should return a dictionary with three keys: 'Prime', 'Non_prime', and 'Composite'. The values ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_2D([[2, 3], [4, 5]]) == {'Prime': [2, 3, 5], 'Non_prime': {'Even': [4], 'Odd': []}, 'Composite': []}\", \"assert categorize_2D([[7, 11], [13, 17]]) == {'Prime': [7, 11, 13, 17], 'Non_prime': {'Even': [], 'Odd': []}, 'Composite': []}\", \"assert ca...
{ "split": "train", "index": 84833, "acecode_id": "evol_26051", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of integers where each integer can either be 1 or 3. You need to count the number of arrangements where every sequence of consecutive 1's is followed by a 3. The count of arrangements is determined by the number of ways to arrange the sequences of 1's based...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert arrangements([1, 3]) == 1\", \"assert arrangements([1, 1, 3]) == 2\", \"assert arrangements([1, 1, 1, 3]) == 4\", \"assert arrangements([1, 3, 1]) == 1\", \"assert arrangements([1, 1, 1, 1, 3]) == 7\", \"assert arrangements([1, 3, 3]) == 1\", \"assert arrang...
{ "split": "train", "index": 84834, "acecode_id": "bigcode_python_fns_18344", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `menu_with_categories()` that returns a list of categories available for users to select. The function should return a list containing at least three categories: 'anime', 'nature', and 'food'. Additionally, implement a function `handle_ca...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert menu_with_categories() == ['anime', 'nature', 'food']\", \"assert handle_category_selection('anime') == 'You selected anime! Enjoy your anime pictures!'\", \"assert handle_category_selection('nature') == 'You selected nature! Enjoy nature pictures!'\", \"ass...
{ "split": "train", "index": 84835, "acecode_id": "oss_5249", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of devices represented as dictionaries, where each dictionary contains information about a device's attributes such as 'sdk', 'name', and 'status'. Write a function `count_devices_with_sdk(devices: List[Dict[str, Any]], sdk_value: str) -> int` that takes in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_devices_with_sdk([{'sdk': '19', 'name': 'DeviceA', 'status': 'active'}, {'sdk': '20', 'name': 'DeviceB', 'status': 'inactive'}, {'sdk': '19', 'name': 'DeviceC', 'status': 'active'}], '19') == 2\", \"assert count_devices_with_sdk([{'sdk': '21', 'name': ...
{ "split": "train", "index": 84836, "acecode_id": "bigcode_python_fns_2735", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `update_metadata(bucket_names: List[str], metadata: Dict[str, str]) -> None` that takes a list of S3 bucket names and a dictionary of metadata key-value pairs. The function should simulate updating the metadata of all objects in the specified S3 buckets con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_metadata(['bucket1', 'bucket2'], {'key1': 'value1'}) is None\", \"assert update_metadata(['bucket3'], {'key2': 'value2', 'key3': 'value3'}) is None\", \"assert update_metadata([], {'key4': 'value4'}) is None\", \"assert update_metadata(['bucket4'], {}...
{ "split": "train", "index": 84837, "acecode_id": "evol_15569", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple task coordinator that manages a queue of tasks. Implement a function `create_coordinator()` that initializes a coordinator object. The coordinator should maintain two queues: a workflow queue for incoming tasks and a complete queue for fini...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_coordinator() is not None\", \"assert isinstance(create_coordinator(), WorkflowThread)\", \"assert isinstance(create_coordinator().workflow_queue, Queue)\", \"assert isinstance(create_coordinator().complete_queue, Queue)\", \"assert create_coordinator...
{ "split": "train", "index": 84838, "acecode_id": "bigcode_python_fns_46259", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function called `transform_elements` that takes a list of strings as input and returns a new list where each string is transformed to uppercase. The function should maintain the order of the input list. Please implement this function.\nPlease reason step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_elements(['hello', 'world']) == ['HELLO', 'WORLD']\", \"assert transform_elements(['python', 'is', 'great']) == ['PYTHON', 'IS', 'GREAT']\", \"assert transform_elements(['LeetCode', 'is', 'fun']) == ['LEETCODE', 'IS', 'FUN']\", \"assert transform_e...
{ "split": "train", "index": 84839, "acecode_id": "evol_7514", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that compares two integers and returns a boolean value indicating whether the first integer is greater than the second integer without using any built-in comparison operators. The function signature is as follows: `def is_great...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_greater(30, 20) == True\", \"assert is_greater(15, 15) == False\", \"assert is_greater(0, -1) == True\", \"assert is_greater(-10, -5) == False\", \"assert is_greater(100, 99) == True\", \"assert is_greater(50, 70) == False\", \"assert is_greater(25, 25) =...
{ "split": "train", "index": 84840, "acecode_id": "oss_15239", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with determining the minimum number of semesters required to complete all courses given the number of courses, their relations indicating prerequisites, and a maximum number of courses that can be taken in a semester. You need to implement a function that takes t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minNumberOfSemesters(3, [(1, 2), (2, 3)], 1) == 3\", \"assert minNumberOfSemesters(4, [(1, 2), (1, 3), (2, 4)], 2) == 3\", \"assert minNumberOfSemesters(5, [(1, 2), (1, 3), (2, 4), (4, 5)], 1) == 5\", \"assert minNumberOfSemesters(3, [], 1) == 3\", \"assert ...
{ "split": "train", "index": 84841, "acecode_id": "evol_16297", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing a set of chemical reactions. Each key in the dictionary is a unique reaction identifier, and the corresponding value is a tuple containing the direction of the reaction ('forward' or 'reverse' or an empty string) and the reaction rate as ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_overall_rate({'REAC1': ('forward', 1/10), 'REAC2': ('', 10), 'REAC3': ('reverse', 1/5)}, {'REAC1', 'REAC2'}) == 1.0\", \"assert calculate_overall_rate({'REAC1': ('reverse', 1/2)}, {'REAC1'}) == 2.0\", \"assert calculate_overall_rate({'REAC1': ('for...
{ "split": "train", "index": 84842, "acecode_id": "oss_10587", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given an integer array `nums`. The unique elements of an array are those elements that appear exactly once in the array. Write a function `unique_product(nums)` that returns the product of all the unique elements of `nums`. If there are no unique elements, return 1. If ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_product([1, 2, 3, 2]) == 3\", \"assert unique_product([1, 1, 1, 1, 1]) == 1\", \"assert unique_product([1, 2, 3, 4, 5]) == 120\", \"assert unique_product([5, 5, 6, 7, 8]) == 336\", \"assert unique_product([1, 1, 2, 2, 3]) == 3\", \"assert unique_produ...
{ "split": "train", "index": 84843, "acecode_id": "evol_26904", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of file names as strings and a file extension as a string. Your task is to filter the list and return a new list that contains only the file names that end with the specified extension. The comparison should be case insensitive. Implement a function `filter...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_files_by_extension(['test.py', 'example.txt', 'script.PY', 'data.csv'], 'py') == ['test.py', 'script.PY']\", \"assert filter_files_by_extension(['image.JPG', 'photo.jpeg', 'icon.PNG', 'thumbnail.gif'], 'jpg') == ['image.JPG']\", \"assert filter_files_...
{ "split": "train", "index": 84844, "acecode_id": "bigcode_python_fns_21065", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a class that manages a list of accepted values for a specific field. This class should have a property called `values`, which represents a set of accepted values, and a property called `name` that can be set to any string. Your implementation sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert FieldManager('example', ['value1', 'value2']).get_values() == ['value1', 'value2']\", \"assert FieldManager('test', ['apple', 'banana']).get_values() == ['apple', 'banana']\", \"assert FieldManager('empty', []).get_values() == []\", \"assert FieldManager('no...
{ "split": "train", "index": 84845, "acecode_id": "oss_7250", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of `n` points on a two-dimensional plane, where each point is represented as [xi, yi]. Your task is to determine the maximum width of the vertical area between two points, ensuring that no other points fall within this area. A vertical area is defined as a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxWidthOfVerticalArea([[8,7],[9,9],[7,4],[9,7]]) == 1\", \"assert maxWidthOfVerticalArea([[3,1],[9,0],[1,0],[1,4],[5,3],[8,8]]) == 3\", \"assert maxWidthOfVerticalArea([[1,2],[3,4],[5,6],[7,8]]) == 2\", \"assert maxWidthOfVerticalArea([[1,1],[2,2],[3,3],[4,...
{ "split": "train", "index": 84846, "acecode_id": "evol_21350", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a grayscale image represented as a 2D list of integers, where each integer is a pixel value ranging from 0 to 255, implement a function `canny_transform(image: List[List[int]], low_threshold: int = 50, high_threshold: int = 150) -> List[List[int]]` that applies a Canny ed...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert canny_transform([[40]], 50, 150) == [[0]]\", \"assert canny_transform([[200]], 50, 150) == [[255]]\", \"assert canny_transform([[255, 255, 255], [0, 0, 0]], 100, 200) == [[255, 255, 255], [0, 0, 0]]\", \"assert canny_transform([[0, 0, 0], [0, 0, 0]], 50, 150...
{ "split": "train", "index": 84847, "acecode_id": "bigcode_python_fns_46475", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Write a function that takes in a string and a character and returns the index of the first occurrence of the character in the string, ignoring case. If the character does not exist in the string, return -1.\nPlease reason step by step, then write a self-contained Python solutio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_index('Hello World', 'o') == 4\", \"assert find_index('Hello World', 'H') == 0\", \"assert find_index('Hello World', 'w') == 6\", \"assert find_index('Case Insensitive', 'C') == 0\", \"assert find_index('Case Insensitive', 'c') == 0\", \"assert find_ind...
{ "split": "train", "index": 84848, "acecode_id": "evol_8742", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a float parameter 'coupling', implement a function 'coupler' that computes two values based on the provided coupling. The first value is the square root of the coupling, and the second value is the square root of the difference between 1 and the coupling. The function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert coupler(coupling=0.0) == {'kappa': 0.0, 'tau': 1.0}\", \"assert coupler(coupling=0.5) == {'kappa': 0.7071067811865476, 'tau': 0.7071067811865476}\", \"assert coupler(coupling=1.0) == {'kappa': 1.0, 'tau': 0.0}\", \"assert coupler(coupling=0.1) == {'kappa': 0...
{ "split": "train", "index": 84849, "acecode_id": "bigcode_python_fns_31882", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Create a function `convert_text_to_html(text: str, language: str = None) -> str` that converts a given text into HTML5 format with custom data attributes. The function should wrap each word in a `span` element with the class `word`, while punctuation marks and whitespace should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_text_to_html('Hello, world!', 'English') == '<span class=\\\"verse\\\">Hello, world!</span>'\", \"assert convert_text_to_html('Hello, world!', 'Greek') == '<span class=\\\"verse\\\"><span class=\\\"word\\\">Hello</span>, <span class=\\\"word\\\">worl...
{ "split": "train", "index": 84850, "acecode_id": "bigcode_python_fns_21026", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of dictionaries, where each dictionary represents an entity with various attributes. Your function should perform the following tasks:\n\n1. Each dictionary contains at least two fields: 'name' (a string) and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_adult_names([{'name': 'Alice', 'age': 30}, {'name': 'Bob', 'age': 17}, {'name': 'Charlie', 'age': 22}]) == ['Alice', 'Charlie']\", \"assert filter_adult_names([{'name': 'David', 'age': 18}, {'name': 'Eve', 'age': 19}]) == ['Eve']\", \"assert filter_ad...
{ "split": "train", "index": 84851, "acecode_id": "oss_34613", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple data structure that represents a user profile. The user profile should contain the following fields: a string for 'bio' with a maximum length of 200 characters, a date for 'date_of_birth', and a string for 'avatar' representing the URL of t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_profile('This is a sample bio.', '1990-05-15', 'http://example.com/avatar.jpg') == {'bio': 'This is a sample bio.', 'date_of_birth': '1990-05-15', 'avatar': 'http://example.com/avatar.jpg'}\", \"assert create_profile('This bio is way too long' + 'a' *...
{ "split": "train", "index": 84852, "acecode_id": "oss_28741", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with solving a puzzle based on a list of integers. Your function should take in a list of integers and return two values: the sum of the integers and the product of the integers. Implement the function `calculate_sum_and_product(numbers: List[int]) -> Tuple[int, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_sum_and_product([]) == (0, 1)\", \"assert calculate_sum_and_product([1, 2, 3]) == (6, 6)\", \"assert calculate_sum_and_product([-1, -2, -3]) == (-6, -6)\", \"assert calculate_sum_and_product([0]) == (0, 0)\", \"assert calculate_sum_and_product([5, ...
{ "split": "train", "index": 84853, "acecode_id": "oss_10255", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers and a condition function, implement a function that finds the minimum value in the array that satisfies the condition, its index, and the total sum of all values in the array that satisfy the condition. If no values satisfy the condition, return an em...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_min_and_sum([4, 2, 3], lambda x: x % 2 == 0) == [2, 1, 6]\", \"assert find_min_and_sum([4, 2, 3], lambda x: x % 3 == 0) == [3, 2, 3]\", \"assert find_min_and_sum([1, 3, 5], lambda x: x % 2 == 0) == []\", \"assert find_min_and_sum([2, 4, 6], lambda x: x ...
{ "split": "train", "index": 84854, "acecode_id": "evol_12848", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of sentences and their corresponding start and end times, and generates a list of translated sentences in multiple target languages. The function should be able to return the translated sentences as a list of dictionarie...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert translate_sentences('en', ['fr', 'de'], [{'text': 'Hello', 'start_time': 0.0, 'end_time': 1.0}]) == [{'text': 'Hello', 'translated': 'Hello (translated)', 'start_time': 0.0, 'end_time': 1.0}, {'text': 'Hello', 'translated': 'Hello (translated)', 'start_time'...
{ "split": "train", "index": 84855, "acecode_id": "bigcode_python_fns_8445", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a string of text and wraps it into multiple lines based on a specified maximum line width. Each line should not exceed the maximum width when rendered. If a word is too long to fit on a line by itself, it should be split in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert wrap_text('The quick brown fox jumps over the lazy dog', 10) == ['The quick', 'brown fox', 'jumps over', 'the lazy', 'dog']\", \"assert wrap_text('Short', 10) == ['Short']\", \"assert wrap_text('Hello World', 5) == ['Hello', 'World']\", \"assert wrap_text('T...
{ "split": "train", "index": 84856, "acecode_id": "bigcode_python_fns_40429", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function `generate_random_vectors(num_vectors: int, n: int) -> List[List[float]]` that generates an array of `num_vectors` vectors, each with `n` dimensions, filled with random floating-point numbers between 0 and 1. The output should be a list of lists, where each ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_random_vectors(5, 3)) == 5\", \"assert all(len(vector) == 3 for vector in generate_random_vectors(5, 3))\", \"assert len(generate_random_vectors(10, 1)) == 10\", \"assert all(0 <= num <= 1 for vector in generate_random_vectors(3, 2) for num in v...
{ "split": "train", "index": 84857, "acecode_id": "evol_34469", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function that checks whether two strings share the same sequence of words, taking word multiplicity, case sensitivity, punctuation and word order into account. Implement the function `compare_word_sequence(phrase1: str, phrase2: str) -> bool` that returns True if both...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_word_sequence(\\\"Apple, Banana: Orange!\\\", \\\"orange apple Banana\\\") == False\", \"assert compare_word_sequence(\\\"apple!\\\", \\\"AppLE, Apple\\\") == False\", \"assert compare_word_sequence(\\\"Hello, World!\\\", \\\"Hello World\\\") == Fals...
{ "split": "train", "index": 84858, "acecode_id": "evol_16992", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to manage video capture devices. Your function should support the ability to add and remove video capture devices dynamically, and also provide a method to simulate capturing frames from all connected devices. You need to implement the fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_video_devices([('add', 0), ('add', 1), ('remove', 0)]) == ['Device 0 added.', 'Device 1 added.', 'Device 0 removed.']\", \"assert manage_video_devices([('add', 2), ('remove', 2)]) == ['Device 2 added.', 'Device 2 removed.']\", \"assert manage_video_de...
{ "split": "train", "index": 84859, "acecode_id": "oss_18049", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program to calculate speeding fines based on a driver's velocity. The program should take the input of the driver's velocity in kilometers per hour (Km/h). If the velocity exceeds the speed limit of 80 Km/h, the program should calculate the fine a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_speeding_fine(90) == 'Voc\\u00ea nao viu o radar de 80Km/h? Acabou de ser Multado em R$70 Reais. Tem o prazo de 15 dias para recorrer.'\", \"assert calculate_speeding_fine(100) == 'Voc\\u00ea nao viu o radar de 80Km/h? Acabou de ser Multado em R$14...
{ "split": "train", "index": 84860, "acecode_id": "oss_36055", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a positive integer n (1 <= n < 1,000,000) and generates the Collatz sequence starting from n up to 1. The function should return a tuple containing the number of steps taken to reach 1 and a boolean indicating whether the sequence includes at lea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_collatz_sequence(6) == (8, True)\", \"assert generate_collatz_sequence(1) == (0, False)\", \"assert generate_collatz_sequence(10) == (6, True)\", \"assert generate_collatz_sequence(2) == (1, True)\", \"assert generate_collatz_sequence(8) == (3, True...
{ "split": "train", "index": 84861, "acecode_id": "evol_17270", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers and returns the total sum of the integers in the list. The function should handle an empty list and return 0 in that case.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_elements([]) == 0\", \"assert sum_of_elements([1]) == 1\", \"assert sum_of_elements([1, 2]) == 3\", \"assert sum_of_elements([-1, 1]) == 0\", \"assert sum_of_elements([0, 0, 0]) == 0\", \"assert sum_of_elements([2, 3, 4, 5]) == 14\", \"assert sum_of_e...
{ "split": "train", "index": 84862, "acecode_id": "evol_28425", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a nested dictionary, write a function `depth(d)` that returns the maximum depth of the dictionary. The depth of the dictionary is defined as the number of levels of nested dictionaries it contains. For example, a dictionary with no nested dictionaries has a depth of 1, wh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert depth({'a': 1, 'b': {'c': 2}}) == 2\", \"assert depth({'a': {'b': {'c': {'d': 3}}}}) == 4\", \"assert depth({'x': 1, 'y': 2, 'z': 3}) == 1\", \"assert depth({'key': {'nested_key': {'deep_key': 42}}}) == 3\", \"assert depth({'a': 'string', 'b': 123, 'c': [1, ...
{ "split": "train", "index": 84863, "acecode_id": "bigcode_python_fns_46413", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple function that simulates the behavior of an OK and Cancel button click in a GUI application. The function takes a string input that can either be 'OK' or 'Cancel'. If the input is 'OK', the function should return the message 'Action conf...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert button_action('OK') == 'Action confirmed'\", \"assert button_action('Cancel') == 'Action canceled'\", \"assert button_action('OK') == 'Action confirmed'\", \"assert button_action('Cancel') == 'Action canceled'\", \"assert button_action('OK') == 'Action confi...
{ "split": "train", "index": 84864, "acecode_id": "oss_17774", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a command-line argument parser. The function `parse_arguments` should take a list of strings representing command-line arguments and return a dictionary where each key is the argument name (without the leading '-' or '--') ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_arguments([]) == {}\", \"assert parse_arguments(['-i', 'input.txt']) == {'i': 'input.txt'}\", \"assert parse_arguments(['--input', 'input.txt']) == {'input': 'input.txt'}\", \"assert parse_arguments(['-i', 'input.txt', '--output', 'output.txt']) == {'i...
{ "split": "train", "index": 84865, "acecode_id": "bigcode_python_fns_5490", "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 dictionary containing the frequency of each integer in the list. The function should be named `count_frequency` and should take a single parameter `nums`, which is a list of integer...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_frequency([1, 2, 2, 3, 3, 3]) == {1: 1, 2: 2, 3: 3}\", \"assert count_frequency([]) == {}\", \"assert count_frequency([5, 5, 5, 5]) == {5: 4}\", \"assert count_frequency([10, 20, 10, 30, 20, 10]) == {10: 3, 20: 2, 30: 1}\", \"assert count_frequency([-1...
{ "split": "train", "index": 84866, "acecode_id": "oss_32706", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the button selection actions for a tester in a testing application. The function should take a string input representing the button selected by the tester and return the corresponding action as a string. The actions are...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert tester_action('Aggregate') == 'Redirecting to aggregate test results'\", \"assert tester_action('Daily') == 'Redirecting to daily test results'\", \"assert tester_action('Change Sites') == 'Redirecting to change site'\", \"assert tester_action('View Appointm...
{ "split": "train", "index": 84867, "acecode_id": "bigcode_python_fns_15271", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a list of mobile apps for a user. Implement a function `manage_apps(operations)` that takes a list of operations and returns the final state of the app list. The operations can be one of the following: 'add <app_name>' to add an app to the list (if ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_apps(['add app1', 'add app2', 'display']) == ['app1', 'app2']\", \"assert manage_apps(['add app1', 'add app1', 'display']) == ['app1']\", \"assert manage_apps(['remove app1', 'display']) == []\", \"assert manage_apps(['add app1', 'remove app1', 'displ...
{ "split": "train", "index": 84868, "acecode_id": "oss_9230", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the factorial of a non-negative integer n. The factorial of n, denoted as n!, is the product of all positive integers less than or equal to n. The function should return 1 if n is 0, as 0! is defined to be 1. Your function should handle inpu...
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": 84869, "acecode_id": "evol_1936", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that calculates the absolute replaced width of an element based on the provided input values. The absolute replaced width is a concept in web development that represents the intrinsic width of an element, such as an image or a repl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_absolute_replaced_width(250, 0.25, 1000) == 1000.0\", \"assert calculate_absolute_replaced_width(50, 0, 500) == 500.0\", \"assert calculate_absolute_replaced_width(100, 1, 500) == -1\", \"assert calculate_absolute_replaced_width(150, 0.2, 300) == 3...
{ "split": "train", "index": 84870, "acecode_id": "oss_556", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given file name is valid. A valid file name must not be empty and cannot begin with a hyphen ('-'). Write a function called `is_valid_file_name(file_name: str) -> bool` that takes a single argument, `file_name`, and retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_file_name('file.txt') == True\", \"assert is_valid_file_name('') == False\", \"assert is_valid_file_name('-file.txt') == False\", \"assert is_valid_file_name('valid_file_123') == True\", \"assert is_valid_file_name('-valid_file') == False\", \"asser...
{ "split": "train", "index": 84871, "acecode_id": "bigcode_python_fns_42220", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing variable names in a programming language. Your task is to write a function that takes this list as input and returns a new list containing the same variable names, but with the following modifications: - Convert all variable names to...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modify_variable_names(['TreeValue', ' Diff ', 'DELTA', ' Variable Name ']) == ['treevalue', 'diff', 'delta', 'variable name']\", \"assert modify_variable_names(['DELTA', ' delta ', 'Alpha', 'Beta']) == ['delta', 'delta', 'alpha', 'beta']\", \"assert modif...
{ "split": "train", "index": 84872, "acecode_id": "oss_28414", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `fetch_data(service: str, path: str, params: Optional[dict] = None) -> Optional[dict]` that simulates sending a request to a hypothetical API endpoint. The function will take three parameters: a string `service`, a string `path`, and an o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fetch_data('user', 'profile', {'id': 1}) == {'data': \\\"{'id': 1}\\\"}\", \"assert fetch_data('order', 'details', {'order_id': 100}) == {'data': \\\"{'order_id': 100}\\\"}\", \"assert fetch_data('product', 'info', {'product_id': 200, 'category': 'electronic...
{ "split": "train", "index": 84873, "acecode_id": "bigcode_python_fns_5263", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates adding a new field to a data model represented as a dictionary in Python. The model is called `ProjectObjective`, and you need to add a field called `position` to this model. The `position` field should have a default value...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_position_field({'name': 'Objective 1'}) == {'name': 'Objective 1', 'position': 1}\", \"assert add_position_field({'name': 'Objective 2', 'position': 2}) == {'name': 'Objective 2', 'position': 2}\", \"assert add_position_field({'name': 'Objective 3'}) == ...
{ "split": "train", "index": 84874, "acecode_id": "oss_22322", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two binary search trees, implement a function that determines the minimum number of swaps required to make the two trees identical. You can assume that both trees contain distinct integer values. The function should accept the root nodes of both trees and return the numbe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert countSwaps(r1, r2) == 3\", \"assert countSwaps(Node(1), Node(1)) == 0\", \"assert countSwaps(Node(3), Node(3)) == 0\", \"assert countSwaps(Node(5), Node(5)) == 0\", \"assert countSwaps(Node(4), Node(4)) == 0\"]}" }
{ "split": "train", "index": 84875, "acecode_id": "evol_27549", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple command-line interface (CLI) compile command. This command should accept no arguments and should always return a message indicating that the compilation was successful. The function must return the string 'Scri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compile_command() == 'Script syntax passed!'\", \"assert compile_command() == 'Script syntax passed!'\", \"assert compile_command() == 'Script syntax passed!'\", \"assert compile_command() == 'Script syntax passed!'\", \"assert compile_command() == 'Script s...
{ "split": "train", "index": 84876, "acecode_id": "bigcode_python_fns_7666", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple authentication system. You need to write a function `authenticate(username: str, password: str, expected_username: str, expected_password: str) -> bool` that verifies if the provided `username` and `password` match the expected values. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert authenticate('user1', 'pass123', 'user1', 'pass123') == True\", \"assert authenticate('user1', 'wrongpass', 'user1', 'pass123') == False\", \"assert authenticate('wronguser', 'pass123', 'user1', 'pass123') == False\", \"assert authenticate('', '', 'user1', '...
{ "split": "train", "index": 84877, "acecode_id": "oss_18125", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `compute_mean` that takes a list of numbers as input and returns the mean (average) of those numbers. The mean is calculated as the sum of the numbers divided by the count of the numbers in the list. If the input list is empty, the function should return 0....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_mean([1, 2, 3, 4, 5]) == 3.0\", \"assert compute_mean([-1, 0, 1]) == 0.0\", \"assert compute_mean([10, 20, 30]) == 20.0\", \"assert compute_mean([5]) == 5.0\", \"assert compute_mean([]) == 0\", \"assert compute_mean([1, 2, 3]) == 2.0\", \"assert comp...
{ "split": "train", "index": 84878, "acecode_id": "evol_7651", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a tuple of integers representing musical pitch classes. Each pitch class is an integer in the range of 0 to 11, where 10 is represented by 't', 11 is represented by 'e', and all other integers are represented by their string equivalent. Write a function called `tu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert tuple_to_string((11, 10, 5, 9, 3)) == 'et593'\", \"assert tuple_to_string((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)) == '0123456789te'\", \"assert tuple_to_string((10, 10, 10)) == 'ttt'\", \"assert tuple_to_string((11, 11, 11)) == 'eee'\", \"assert tuple_to_str...
{ "split": "train", "index": 84879, "acecode_id": "bigcode_python_fns_11828", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to mark a given workflow as deleted. A workflow is represented by a dictionary containing at least two fields: 'id' (an integer representing the unique identifier of the workflow) and 'status' (a string representing the current status...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert mark_workflow_as_deleted({'id': 1, 'status': 'active'}) == {'id': 1, 'status': 'deleted'}\", \"assert mark_workflow_as_deleted({'id': 2, 'status': 'inactive'}) == {'id': 2, 'status': 'deleted'}\", \"assert mark_workflow_as_deleted({'id': 3, 'status': 'pendin...
{ "split": "train", "index": 84880, "acecode_id": "bigcode_python_fns_4891", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a string as input and returns the string with all its vowels removed. A vowel is defined as any of the following characters: 'a', 'e', 'i', 'o', 'u' (in both uppercase and lowercase). Implement the function `remove_vowels(s: st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_vowels('Hello World') == 'Hll Wrld'\", \"assert remove_vowels('Python Programming') == 'Pythn Prgrmmng'\", \"assert remove_vowels('LeetCode') == 'LtCd'\", \"assert remove_vowels('A quick brown fox jumps over the lazy dog') == ' qck brwn fx jmps vr th ...
{ "split": "train", "index": 84881, "acecode_id": "bigcode_python_fns_37866", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating a 'keep score' based on a set of counts. You will receive three dictionaries as input: `source_counts`, `prediction_counts`, and `target_counts`. Each dictionary contains keys that represent items and their corresponding integer values, which den...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_keep_score({}, {'a': 1}, {}) == 0.0\", \"assert get_keep_score({'a': 1}, {}, {'a': 1}) == 0.0\", \"assert get_keep_score({'a': 1, 'b': 1}, {'a': 1, 'b': 1}, {'a': 1, 'b': 1}) == 1.0\", \"assert get_keep_score({'a': 5}, {'a': 5}, {'a': 5}) == 1.0\", \"ass...
{ "split": "train", "index": 84882, "acecode_id": "bigcode_python_fns_1604", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a square adjacency matrix representing an undirected graph, implement a function that transforms this matrix into an adjacency list representation. The function should take a matrix as input and return a dictionary where each key is a node, and its value is a list of node...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert adjacency_matrix_to_list([[0, 1, 0], [1, 0, 1], [0, 1, 0]]) == {0: [1], 1: [0, 2], 2: [1]}\", \"assert adjacency_matrix_to_list([[0, 0], [0, 0]]) == {0: [], 1: []}\", \"assert adjacency_matrix_to_list([[0, 1, 1], [1, 0, 0], [1, 0, 0]]) == {0: [1, 2], 1: [0],...
{ "split": "train", "index": 84883, "acecode_id": "evol_9198", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of strings representing actions and returns a new function that, when called, executes those actions in the order they were provided. Each action is a string that represents a simple print statement. The new function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_multiaction('test_action', ['action1', 'action2', 'action3'])() == ['action1', 'action2', 'action3']\", \"assert create_multiaction('single_action', ['only_one'])() == ['only_one']\", \"assert create_multiaction('empty_action', [])() == []\", \"assert...
{ "split": "train", "index": 84884, "acecode_id": "bigcode_python_fns_1670", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an image represented as a string (e.g., 'image_data') that needs to be processed to compute its embeddings. Implement a function `compute_embeddings(image: str) -> int` that takes an image string as input and returns a fixed integer value of 42, simulating the out...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_embeddings('image_data') == 42\", \"assert compute_embeddings('test_image_1') == 42\", \"assert compute_embeddings('test_image_2') == 42\", \"assert compute_embeddings('sample_image') == 42\", \"assert compute_embeddings('data') == 42\", \"assert com...
{ "split": "train", "index": 84885, "acecode_id": "bigcode_python_fns_33929", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a Python function that retrieves the 3 lowest even numbers from the list. If the list does not contain at least three even numbers, return a message indicating that. You should only implement one function that takes a single parameter, the list o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lowest_even_numbers([12, 7, 18, 2, 10, 15, 20, 4, 13, 9]) == [2, 4, 10]\", \"assert lowest_even_numbers([1, 3, 5, 7]) == 'The list does not contain up to three even numbers.'\", \"assert lowest_even_numbers([8, 6, 4, 2]) == [2, 4, 6]\", \"assert lowest_even_...
{ "split": "train", "index": 84886, "acecode_id": "evol_4814", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that receives a stock model name and a time identifier as input. Your function should return a dictionary containing hyperparameters for that stock model. The hyperparameters are defined as follows: if the input stock model name is 'Black...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_metadata('BlackScholes', 1) == {'volatility': 0.2, 'risk_free_rate': 0.05, 'time_to_maturity': 1.0}\", \"assert load_metadata('GARCH', 2) == {'alpha': 0.1, 'beta': 0.85, 'gamma': 0.04}\", \"assert load_metadata('UnknownModel', 3) == {}\", \"assert load_...
{ "split": "train", "index": 84887, "acecode_id": "bigcode_python_fns_37090", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating an alarm system. The alarm has three states: 'disarmed', 'armed_home', and 'armed_away'. Implement a function called `arm_home` that takes the current state of the alarm as a string. If the current state is 'disarmed', the function should change t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert arm_home('disarmed') == 'armed_home'\", \"assert arm_home('armed_home') == 'armed_home'\", \"assert arm_home('armed_away') == 'armed_away'\", \"assert arm_home('disarmed') == 'armed_home'\", \"assert arm_home('armed_home') == 'armed_home'\", \"assert arm_hom...
{ "split": "train", "index": 84888, "acecode_id": "bigcode_python_fns_43660", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `amalgamate_nested_dict` that takes a nested dictionary as an input and returns a flat dictionary. The keys in the returned dictionary should be formed by concatenating the keys from the original nested dictionaries, separated by underscores. For example, for t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert amalgamate_nested_dict({\\\"x\\\": {\\\"y\\\": 4, \\\"z\\\": 5}, \\\"a\\\": {\\\"b\\\": {\\\"c\\\": 1}, \\\"d\\\": 6}}) == {\\\"x_y\\\": 4, \\\"x_z\\\": 5, \\\"a_d\\\": 6, \\\"a_b_c\\\": 1}\", \"assert amalgamate_nested_dict({\\\"a\\\": 1, \\\"b\\\": {\\\"c\...
{ "split": "train", "index": 84889, "acecode_id": "evol_12345", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings, write a function `find_string_with_prefix(strings: List[str], prefix: str) -> Optional[str]` that returns the first string in the list that starts with the given prefix. If no such string exists, return None. The input list may contain empty strings and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_string_with_prefix(['apple', 'banana', 'cherry', 'date'], 'ba') == 'banana'\", \"assert find_string_with_prefix(['apple', 'banana', 'cherry', 'date'], 'ap') == 'apple'\", \"assert find_string_with_prefix(['apple', 'banana', 'cherry', 'date'], 'ch') == '...
{ "split": "train", "index": 84890, "acecode_id": "bigcode_python_fns_7317", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the years when certain songs were released. Your task is to implement a function that takes in this list of years and returns a dictionary that counts the number of songs released in each year. The function should be named `count_so...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_songs_by_year([1990, 1990, 1991, 1992]) == {1990: 2, 1991: 1, 1992: 1}\", \"assert count_songs_by_year([2000, 2001, 2000, 2000, 2001]) == {2000: 3, 2001: 2}\", \"assert count_songs_by_year([1985, 1990, 1990, 1985, 1985, 1995]) == {1985: 3, 1990: 2, 199...
{ "split": "train", "index": 84891, "acecode_id": "bigcode_python_fns_43181", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a directed graph represented as an adjacency list, write a function `shortest_path(graph, start, end)` that returns the length of the shortest path from the `start` node to the `end` node. If there is no path, return `None`. The graph is represented as a dictionary where ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shortest_path({'A': {'B': 1, 'C': 4}, 'B': {'C': 2, 'D': 5}, 'C': {'D': 1}, 'D': {}}, 'A', 'D') == 4\", \"assert shortest_path({'A': {'B': 2}, 'B': {'C': 3}, 'C': {'D': 1}, 'D': {}}, 'A', 'C') == 5\", \"assert shortest_path({'A': {'B': 1}, 'B': {'A': 1}}, 'A...
{ "split": "train", "index": 84892, "acecode_id": "evol_10920", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `construct_url` that takes the following parameters: a string `protocol`, a string `subdomain`, a string `domain`, a string `path`, a dictionary `query_params`, and a string `fragment`. The function should construct a comprehensive URL based on these compon...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_url('http', 'www', 'example.com', '/path/to/resource', {'key': 'value'}, '') == ('http://www.example.com/path/to/resource?key=value', 'http://www.example.com/path/to/resource?key=value')\", \"assert construct_url('https', 'blog', 'mywebsite.org', '...
{ "split": "train", "index": 84893, "acecode_id": "evol_20457", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given an m x n integer matrix, where each row is sorted in ascending order from left to right and each column is sorted in ascending order from top to bottom, implement a function that searches for a specific target value. The function should return true if the target is found ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert searchMatrix([[1,4,7,11,15],[2,5,8,12,19],[3,6,9,16,22],[10,13,14,17,24],[18,21,23,26,30]], 5) == True\", \"assert searchMatrix([[1,4,7,11,15],[2,5,8,12,19],[3,6,9,16,22],[10,13,14,17,24],[18,21,23,26,30]], 20) == False\", \"assert searchMatrix([[1]], 1) == ...
{ "split": "train", "index": 84894, "acecode_id": "evol_1786", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a configuration dictionary and a prefix string, return a list of tuples containing keys and values from the dictionary that match the prefix. For each matching key, remove the prefix and convert the remaining part of the key to uppercase. The function should be defined as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_config_keys({'app_name': 'my_app', 'app_version': '1.0', 'db_host': 'localhost'}, 'app_') == [('NAME', 'my_app'), ('VERSION', '1.0')]\", \"assert get_config_keys({'server_port': 8080, 'server_timeout': 30, 'server_ssl': True}, 'server_') == [('PORT', 808...
{ "split": "train", "index": 84895, "acecode_id": "bigcode_python_fns_17168", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dataset represented as a list of integers. Your task is to split this dataset into three parts: a training set, a validation set, and a test set. The training set should contain 70% of the data, the validation set should contain 15%, and the test set should cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_dataset([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == ([1, 2, 3, 4, 5, 6, 7], [8], [9, 10])\", \"assert split_dataset([10, 20, 30, 40, 50, 60, 70, 80, 90, 100]) == ([10, 20, 30, 40, 50, 60, 70], [80], [90, 100])\", \"assert split_dataset([1, 2, 3, 4, 5]) == ([1,...
{ "split": "train", "index": 84896, "acecode_id": "oss_11577", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats a name and age into a specific string representation. The function `format_person_info` should take two parameters: `name`, a string representing the name of the person, and `age`, an integer representing the age of the perso...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_person_info('Alice', 25) == 'Name: Alice, Age: 25'\", \"assert format_person_info('Bob', 30) == 'Name: Bob, Age: 30'\", \"assert format_person_info('Charlie', 22) == 'Name: Charlie, Age: 22'\", \"assert format_person_info('Diana', 40) == 'Name: Diana,...
{ "split": "train", "index": 84897, "acecode_id": "oss_23862", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that compares two version control systems based on a specific feature. The function should take in a string representing the feature to compare: 'branching_merging', 'security', or 'large_scale_projects'. Depending on the feature, the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_vcs('branching_merging') == 'Git: Flexible but complex, Mercurial: Robust but less flexible'\", \"assert compare_vcs('security') == 'Git: Top level, Mercurial: Top level'\", \"assert compare_vcs('performance') == 'Feature not recognized'\", \"assert ...
{ "split": "train", "index": 84898, "acecode_id": "evol_14202", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Develop a function that takes a two-dimensional list of mixed data types (numbers and strings) and processes it to fill any missing values (represented as None). For each column, if the column contains strings, fill missing values with the most frequently occurring string (mode...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_data([[1, 2], [None, None], [3, 4]]) == [[1, 2], [2.0, 3.0], [3, 4]]\", \"assert process_data([[None, None, 1], [None, 'apple', None], ['banana', None, None]]) == [['banana', 'apple', 1], ['banana', 'apple', 1], ['banana', 'apple', 1]]\", \"assert pr...
{ "split": "train", "index": 84899, "acecode_id": "evol_36240", "num_tests": 10 }