data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "Given a user ID, a course key, and an optional course masquerade ID, determine if the user is masquerading as a non-audit enrollment in a course. A user is considered to be masquerading as a non-audit enrollment if their masquerade group ID, obtained from a function `_get_masqu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_masquerading_as_non_audit_enrollment('user1', 'course1', 'masquerade1') == True\", \"assert is_masquerading_as_non_audit_enrollment('user2', 'course2', 'masquerade2') == False\", \"assert is_masquerading_as_non_audit_enrollment('user4', 'course4', 'masque...
{ "split": "train", "index": 69100, "acecode_id": "bigcode_python_fns_47194", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that returns the value of a variable `number_1` which should be set to 10. Implement a function called `get_number` that takes no parameters and returns the value of `number_1`.\nPlease reason step by step, then write a self-contained Pyt...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_number() == 10\", \"assert get_number() == 10\", \"assert get_number() == 10\", \"assert get_number() == 10\", \"assert get_number() == 10\", \"assert get_number() == 10\", \"assert get_number() == 10\", \"assert get_number() == 10\", \"assert get_number...
{ "split": "train", "index": 69101, "acecode_id": "oss_31768", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a paragraph, write a function to extract the third word of each sentence. Ensure that you properly handle punctuation marks such as periods, colons, dashes, and semicolons when identifying separate sentences. If a sentence contains fewer than three words, it should not co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_third_word('One. Two.') == []\", \"assert get_third_word('I like to code. Python is my favorite language. It is easy to learn.') == ['to', 'my', 'easy']\", \"assert get_third_word('This is a test. Just a simple test.') == ['a', 'simple']\", \"assert get_...
{ "split": "train", "index": 69102, "acecode_id": "evol_11210", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the percentage of various types of attacks in a dataset. The function should take two parameters: a list of attack types (strings) and a list of corresponding counts (integers) indicating how many times each attack type oc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_attack_percentages(['A', 'B', 'C'], [30, 30, 40]) == {'A': 30.0, 'B': 30.0, 'C': 40.0}\", \"assert calculate_attack_percentages(['X', 'Y'], [10, 0]) == {'X': 100.0, 'Y': 0.0}\", \"assert calculate_attack_percentages(['Fire', 'Ice', 'Lightning'], [0...
{ "split": "train", "index": 69103, "acecode_id": "bigcode_python_fns_47764", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers and returns a new list containing only the even integers from the original list. Ensure that your function handles empty lists correctly and does not modify the original list.\nPlease reason step by step, then write a self-cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even([0, -2, -4, 3]) == [0, -2, -4]\", \"assert filter_even([1, 3, 5]) == []\", \"assert filter_even([]) == []\", \"assert filter_even([2, 4, 6]) ...
{ "split": "train", "index": 69104, "acecode_id": "evol_9743", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries representing employees in a company. Each dictionary contains the keys 'id', 'name', 'department', and 'salary'. Your task is to write a function that takes this list as input and performs the following tasks: 1) Find the total number of emp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert employee_analysis([{'id': 1, 'name': 'Alice', 'department': 'Sales', 'salary': 50000}, {'id': 2, 'name': 'Bob', 'department': 'HR', 'salary': 60000}, {'id': 3, 'name': 'Charlie', 'department': 'Sales', 'salary': 70000}]) == (3, 60000.0, 'Charlie')\", \"asser...
{ "split": "train", "index": 69105, "acecode_id": "oss_31468", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with generating a command line command based on a configuration dictionary, a working directory path, and an output directory path. The configuration dictionary contains various parameters, some of which may be prefixed with 'gear-'. Your goal is to build a comma...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_command({'bids_app_args': 'arg1 arg2', 'num-things': 5}, 'path/to/work', 'path/to/output') == (['BIDS_APP', 'path/to/work', 'path/to/output', 'arg1', 'arg2'], [], [])\", \"assert generate_command({'bids_app_args': '', 'num-things': 42}, 'path/to/wor...
{ "split": "train", "index": 69106, "acecode_id": "bigcode_python_fns_32250", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns a 2D list containing all unique permutations of the input list while maintaining the relative order of duplicate elements. The function should be able to handle duplicate entries and only return unique permutations. Implem...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_permutations([1, 1, 2]) == [[1, 1, 2], [1, 2, 1], [2, 1, 1]]\", \"assert unique_permutations([1, 2, 3]) == [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]\", \"assert unique_permutations([1]) == [[1]]\", \"assert unique_permutations...
{ "split": "train", "index": 69107, "acecode_id": "evol_26160", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with validating a simple message format. Write a function called `validate_message_format` that takes a string `msg` as input. The function should return 'Incorrect format' if the message does not start with 'Msg: ' or if it contains any special characters (anyth...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_message_format('Msg: hello') == 'Valid format'\", \"assert validate_message_format('Msg: hello world') == 'Valid format'\", \"assert validate_message_format('Msg: hello@world') == 'Incorrect format'\", \"assert validate_message_format('hello') == 'I...
{ "split": "train", "index": 69108, "acecode_id": "bigcode_python_fns_11930", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a variable definition in the form of a type and an input value. Your task is to implement a function that checks whether the input value adheres to the specified type. If the input is valid, return the coerced value based on the type; otherwise, raise an error ind...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_and_coerce_variable_value('Int', 10) == 10\", \"assert validate_and_coerce_variable_value('Float', 10.5) == 10.5\", \"assert validate_and_coerce_variable_value('String', 'hello') == 'hello'\", \"assert validate_and_coerce_variable_value('Boolean', T...
{ "split": "train", "index": 69109, "acecode_id": "bigcode_python_fns_8019", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given an integer `n` and an integer `n_bits` representing the bit-width, implement a function that computes the bitwise inverse of `n` while only considering the bits within the specified `n_bits`. The bitwise inverse is defined as flipping each bit of `n` to its opposite (0 be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert inv(5, 3) == 2\", \"assert inv(0, 1) == 1\", \"assert inv(7, 3) == 0\", \"assert inv(10, 4) == 5\", \"assert inv(15, 4) == 0\", \"assert inv(1, 2) == 2\", \"assert inv(3, 2) == 0\", \"assert inv(8, 4) == 7\", \"assert inv(12, 4) == 3\", \"assert inv(2, 3) ==...
{ "split": "train", "index": 69110, "acecode_id": "bigcode_python_fns_21579", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers and a function that transforms an integer into a string representation. Your task is to apply this transformation function to each element in the list and return a new list containing the transformed elements. Write a function named `transform_l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_list_elements([1, 2, 3], lambda x: str(x * 2)) == ['2', '4', '6']\", \"assert transform_list_elements([4, 5, 6], lambda x: f'The number is {x}') == ['The number is 4', 'The number is 5', 'The number is 6']\", \"assert transform_list_elements([0, -1...
{ "split": "train", "index": 69111, "acecode_id": "bigcode_python_fns_30334", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns a new list containing only the elements that are even. The order of the elements in the new list should be the same as in the input list. The input list can contain both positive and negative integers as well as zero. Impl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([-1, -2, -3, -4]) == [-2, -4]\", \"assert filter_even_numbers([0, 1, 2, 3]) == [0, 2]\", \"assert filter_even_numbers...
{ "split": "train", "index": 69112, "acecode_id": "bigcode_python_fns_45734", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two 2D coordinates A and B represented as tuples (x1, y1) and (x2, y2) respectively, and two scaling factors s and t, implement a function `add_coordinates(A: Tuple[float, float], B: Tuple[float, float], s: float = 1.0, t: float = 1.0) -> Tuple[float, float]` that returns...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_coordinates((1, 2), (3, 4), 1.0, 1.0) == (4.0, 6.0)\", \"assert add_coordinates((0, 0), (1, 1), 2.0, 3.0) == (3.0, 3.0)\", \"assert add_coordinates((-1, -1), (2, 3), 0.5, 0.5) == (0.5, 1.0)\", \"assert add_coordinates((2, 3), (4, 5), 0.0, 1.0) == (4.0, 5...
{ "split": "train", "index": 69113, "acecode_id": "bigcode_python_fns_26405", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of non-negative integers representing the heights of buildings, where each integer corresponds to the height of a building at a specific position, write a function `max_area(height)` that returns the maximum amount of rainwater that can be trapped between the bui...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_area([3, 0, 2, 0, 4]) == 7\", \"assert max_area([2, 0, 2]) == 2\", \"assert max_area([3, 0, 0, 2, 0, 4]) == 10\", \"assert max_area([1, 0, 2, 0, 1]) == 2\", \"assert max_area([0, 1, 0, 1, 0]) == 1\", \"assert max_area([0, 0, 0, 0]) == 0\", \"assert max_a...
{ "split": "train", "index": 69114, "acecode_id": "evol_95", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines whether a given string is a palindrome. A palindrome is a word, phrase, number, or other sequences of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization). Your function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('hello') == False\", \"assert is_palindrome('Was it a car or a cat I saw?')...
{ "split": "train", "index": 69115, "acecode_id": "oss_27363", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the conversion of a MongoDB document represented as a dictionary into a simplified data model. Your function should handle the extraction of an '_id' field from the input dictionary and return a new dictionary with the key ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_mongo_document({'_id': 1, 'name': 'Alice', 'age': 25}, True, True) == {'id': 1, 'name': 'Alice', 'age': 25}\", \"assert convert_mongo_document({'_id': 1, 'name': None, 'age': 25}, True, True) == {'id': 1, 'age': 25}\", \"assert convert_mongo_document...
{ "split": "train", "index": 69116, "acecode_id": "oss_34400", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple ATM (Automated Teller Machine) operation for a user. The function should take a list of operations performed by the user and an initial balance as input. The operations can be checking balance (denoted by 'check'),...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert atm_simulator(['check', 'deposit 200', 'withdraw 100', 'exit'], 1000) == 1100\", \"assert atm_simulator(['check', 'withdraw 50', 'deposit 20', 'withdraw 100', 'exit'], 100) == 70\", \"assert atm_simulator(['withdraw 30', 'deposit 50', 'check', 'exit'], 100) ...
{ "split": "train", "index": 69117, "acecode_id": "oss_6190", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers and returns the second highest even number in the list and the mean of all even numbers. The function should handle negative integers and not use any pre-existing functions. If there are fewer than two even numbers in the list,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert second_highest_even_element([1, 2, 4, 3]) == (2, 3.0)\", \"assert second_highest_even_element([1, 3, 5, 7]) == (None, 0.0)\", \"assert second_highest_even_element([-2, -4, -6, -8]) == (-4, -5.0)\", \"assert second_highest_even_element([0, 0, 0, 0]) == (None,...
{ "split": "train", "index": 69118, "acecode_id": "evol_20080", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Design a function that accepts two integers, a and b, and returns their product. The function should handle both positive and negative integers, as well as zero.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```pyt...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert product(3, 4) == 12\", \"assert product(-2, 5) == -10\", \"assert product(0, 10) == 0\", \"assert product(7, -3) == -21\", \"assert product(-8, -1) == 8\", \"assert product(1, 0) == 0\", \"assert product(6, 6) == 36\", \"assert product(0, 0) == 0\", \"assert...
{ "split": "train", "index": 69119, "acecode_id": "evol_13781", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary `coords` that contains polar coordinates for points labeled with letters of the alphabet. Each entry in the dictionary is a key-value pair where the key is a letter (a single character) and the value is a tuple representing the coordinates (x, y) in C...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_distances({'A': (0, 0), 'B': (3, 4)}) == {('A', 'B'): 5.0}\", \"assert calculate_distances({'A': (0, 0), 'B': (0, 1), 'C': (1, 0)}) == {('A', 'B'): 1.0, ('A', 'C'): 1.0, ('B', 'C'): 1.4142135623730951}\", \"assert calculate_distances({'A': (0, 0), ...
{ "split": "train", "index": 69120, "acecode_id": "oss_37292", "num_tests": 9 }
acecode
[ { "role": "user", "content": "In physics, the distance traveled by an object under constant acceleration can be calculated using the formula: distance = initial_speed * duration + 0.5 * acceleration * duration². Write a Python function named `calculate_distance` that takes three parameters: initial_speed (t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_distance(0, 10, 0) == 0.0\", \"assert calculate_distance(100, 1, 0) == 100.0\", \"assert calculate_distance(0, 0, 10) == 0.0\", \"assert calculate_distance(1, 1, 1) == 1.5\", \"assert calculate_distance(10, 10, 10) == 600.0\", \"assert calculate_di...
{ "split": "train", "index": 69121, "acecode_id": "evol_34746", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Write a function `at_least(actual_value: int, expected_value: int) -> bool` that checks if the `actual_value` is at least equal to the `expected_value`. The function should return True if `actual_value` is greater than or equal to `expected_value`, otherwise it should raise an ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert at_least(10, 5) == True\", \"assert at_least(5, 5) == True\", \"assert at_least(0, 0) == True\", \"assert at_least(100, 50) == True\", \"assert at_least(0, -1) == True\", \"assert at_least(7, 7) == True\", \"assert at_least(1000, 999) == True\", \"assert at_...
{ "split": "train", "index": 69122, "acecode_id": "bigcode_python_fns_42583", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `longest(strings: List[str]) -> Optional[str]` that takes a list of strings and returns the longest string in the list. If multiple strings have the same maximum length, return the one that appears first in the list. If the list is empty, return None.\nPlea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest([]) is None\", \"assert longest(['a', 'b', 'c']) == 'a'\", \"assert longest(['aaa', 'bb', 'c']) == 'aaa'\", \"assert longest(['abc', 'defg', 'hi']) == 'defg'\", \"assert longest(['longest', 'short', 'long']) == 'longest'\", \"assert longest(['single'...
{ "split": "train", "index": 69123, "acecode_id": "evol_9751", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that generates a random floating-point number within a specified range. The function should take two parameters, `low` and `high`, which define the inclusive bounds of the range. The function should return a random floating-point number that lies within thi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_random_number(-5, 5) >= -5 and generate_random_number(-5, 5) <= 5\", \"assert generate_random_number(-1, 1) >= -1 and generate_random_number(-1, 1) <= 1\", \"assert generate_random_number(0, 10) >= 0 and generate_random_number(0, 10) <= 10\", \"asse...
{ "split": "train", "index": 69124, "acecode_id": "evol_6504", "num_tests": 16 }
acecode
[ { "role": "user", "content": "In a simplified version of a puzzle game, you have a sequence of moves represented by uppercase letters: 'L' for left, 'R' for right, 'U' for up, and 'D' for down. Each move has a corresponding ASCII value: L=76, R=82, U=85, D=68. Given a string representing a sequence of moves...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_checksum('LULUR') == 19761398\", \"assert calculate_checksum('U') == 85\", \"assert calculate_checksum('D') == 68\", \"assert calculate_checksum('L') == 76\", \"assert calculate_checksum('R') == 82\", \"assert calculate_checksum('') == 0\"]}" }
{ "split": "train", "index": 69125, "acecode_id": "evol_12339", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a 2D array of integers, implement a function `cube_sum(numbers)` that calculates the cube of each element in each nested array and returns their total sum. The function should handle negative integers as well as zero without using any built-in or external library for the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cube_sum([[1, 2], [3, 4]]) == 100\", \"assert cube_sum([[0], [0]]) == 0\", \"assert cube_sum([[2, -2], [-3, 3]]) == 0\", \"assert cube_sum([[1, 1], [1, 1]]) == 4\", \"assert cube_sum([[2], [2], [2]]) == 24\", \"assert cube_sum([[3, 3], [3, 3]]) == 108\", \"a...
{ "split": "train", "index": 69126, "acecode_id": "evol_2422", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with converting a numeric action ID into its corresponding action description. Given a list of action descriptions and an action ID, implement a function `action_id_to_description(action_id: int, actions: List[str]) -> str` that retrieves the action description b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert action_id_to_description(0, ['jump', 'run', 'walk']) == 'jump'\", \"assert action_id_to_description(1, ['jump', 'run', 'walk']) == 'run'\", \"assert action_id_to_description(2, ['jump', 'run', 'walk']) == 'walk'\", \"assert action_id_to_description(3, ['jump...
{ "split": "train", "index": 69127, "acecode_id": "bigcode_python_fns_26467", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `check_parity(n: int) -> str` that takes an integer `n` as input and returns 'Even' if `n` is an even number, and 'Odd' if `n` is an odd number.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ``...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_parity(0) == 'Even'\", \"assert check_parity(1) == 'Odd'\", \"assert check_parity(2) == 'Even'\", \"assert check_parity(3) == 'Odd'\", \"assert check_parity(4) == 'Even'\", \"assert check_parity(-1) == 'Odd'\", \"assert check_parity(-2) == 'Even'\", \"...
{ "split": "train", "index": 69128, "acecode_id": "evol_2460", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array of integers, denoted as `arr`, and another integer, `difference`. Your task is to compute and return the length of the longest subsequence within `arr` that forms an arithmetic progression where the difference between consecutive elements in the subsequen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longestSubsequence([1, 2, 3, 4], 1) == 4\", \"assert longestSubsequence([1, 3, 5, 7], 1) == 1\", \"assert longestSubsequence([1, 5, 7, 8, 5, 3, 4, 2, 1], -2) == 4\", \"assert longestSubsequence([2, 4, 6, 8], 2) == 4\", \"assert longestSubsequence([10, 12, 14...
{ "split": "train", "index": 69129, "acecode_id": "evol_29420", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a string representing a font name in SHX format. Your task is to map it to its corresponding True Type Font (TTF) file name according to a predefined mapping. The mapping is as follows: 'TXT' -> 'txt_____.ttf', 'ARIAL' -> 'arial.ttf', 'VERDANA' -> 'verdana.ttf', '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert resolve_shx_font_name('TXT') == 'txt_____.ttf'\", \"assert resolve_shx_font_name('ARIAL') == 'arial.ttf'\", \"assert resolve_shx_font_name('VERDANA') == 'verdana.ttf'\", \"assert resolve_shx_font_name('COMIC') == 'comic.ttf'\", \"assert resolve_shx_font_name...
{ "split": "train", "index": 69130, "acecode_id": "bigcode_python_fns_40953", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an XOR encrypted message and a list of possible keys, implement a function that decrypts the message using each key and returns the first valid URL found. If no valid URL is found after trying all keys, return 'No valid URL found'. The URL is considered valid if it contai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decrypt_message('jvvr://xcf/1gBc9J-RvhgC', [10, 20, 30, 40, 50]) == 'No valid URL found'\", \"assert decrypt_message('abc://xyz/hello', [1, 2, 3]) == 'No valid URL found'\", \"assert decrypt_message('jvvr://xcy/1gBc9J-RvhgC', [5, 4, 3]) == 'No valid URL foun...
{ "split": "train", "index": 69131, "acecode_id": "evol_27392", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given string is a valid label name according to specific criteria. The label name must be a string with a maximum length of 255 characters and cannot be empty. Write a function named `is_valid_label_name` that takes a sin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_label_name('Label1') == True\", \"assert is_valid_label_name('') == False\", \"assert is_valid_label_name('A label with spaces') == True\", \"assert is_valid_label_name('This label name is exactly 255 characters long and should be valid according to...
{ "split": "train", "index": 69132, "acecode_id": "oss_31073", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `compute_mean_stddev(lst)` that takes a list of numbers as input and returns a tuple containing the mean and standard deviation of the numbers in the list. The standard deviation should be calculated using the sample standard deviation formula.\nPlease reason s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_mean_stddev([1, 2, 3]) == (2.0, 1.0)\", \"assert compute_mean_stddev([5, 5, 5]) == (5.0, 0.0)\", \"assert compute_mean_stddev([10, 20, 30]) == (20.0, 10.0)\", \"assert compute_mean_stddev([1, 2, 3, 4, 5]) == (3.0, 1.5811388300841898)\", \"assert comp...
{ "split": "train", "index": 69133, "acecode_id": "evol_5231", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a string consisting of multiple words, write a function that converts the last two characters of each word into uppercase. Each word is defined as a sequence of characters separated by spaces. Return the modified string with words in their original order. For example, if ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_two_chars_uppercase('code') == 'coDE'\", \"assert convert_two_chars_uppercase('test case') == 'teST caSE'\", \"assert convert_two_chars_uppercase('') == ''\", \"assert convert_two_chars_uppercase('word') == 'woRD'\", \"assert convert_two_chars_upperc...
{ "split": "train", "index": 69134, "acecode_id": "evol_16021", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simplified order book system for a trading platform. The order book consists of bid and ask prices, representing the highest price a buyer is willing to pay and the lowest price a seller is willing to accept, respectively. Your task is to crea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_order_book(100, 105) == 'Updated: Bid is now 100, Ask is now 105'\", \"assert update_order_book(110, 105) == 'Updated: Bid is now 110, Ask is now 105'\", \"assert update_order_book(110, 115) == 'Updated: Bid is now 110, Ask is now 115'\", \"assert upd...
{ "split": "train", "index": 69135, "acecode_id": "oss_18158", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes in a dictionary representing a user's login status and their associated device details. The dictionary will have the following structure: `{ 'success_login': bool, 'device': str, 'username': str, 'password': str, 'ssh_port': in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_interface_details({'success_login': False, 'device': 'Router', 'username': 'admin', 'password': 'pass', 'ssh_port': 22, 'details': 'No details'}) == 'Redirecting to login'\", \"assert get_interface_details({'success_login': True, 'device': 'Router', 'use...
{ "split": "train", "index": 69136, "acecode_id": "bigcode_python_fns_43352", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two points in a 2D space represented by their coordinates (x1, y1) and (x2, y2), write a function `get_step(a: List[float], b: List[float], marks: int) -> Tuple[float, float]` that returns a new point that is `marks` units away from point `a` towards point `b`. If the dis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_step([0, 0], [3, 4], 5) == (3.0, 4.0)\", \"assert get_step([0, 0], [0, 0], 1) == (0.0, 0.0)\", \"assert get_step([1, 2], [4, 6], 10) == (4.0, 6.0)\", \"assert get_step([10, 10], [10, 10], 5) == (10.0, 10.0)\", \"assert get_step([1, 1], [1, 1], 0) == (1.0...
{ "split": "train", "index": 69137, "acecode_id": "bigcode_python_fns_23391", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Define a function `is_anagram(a: str, b: str) -> bool` that checks whether string `a` is an anagram of string `b`. An anagram is a rearrangement of the letters of one word to form another word, ignoring spaces, punctuation, and capitalization. For example, 'Listen' and 'Silent'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_anagram('silent', 'listen') == True\", \"assert is_anagram('triangle', 'integral') == True\", \"assert is_anagram('apple', 'pale') == False\", \"assert is_anagram('A gentleman', 'Elegant man') == True\", \"assert is_anagram('The Morse Code', 'Here come do...
{ "split": "train", "index": 69138, "acecode_id": "evol_13835", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the quantity of different products in a warehouse. Your task is to implement a function that counts how many different products have a quantity greater than zero. Write a function `count_positive_products(quantities: List[int]) -> i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_positive_products([5, 0, 3, 0, 2]) == 3\", \"assert count_positive_products([0, 0, 0, 0]) == 0\", \"assert count_positive_products([10, 20, 30]) == 3\", \"assert count_positive_products([1, 2, 3, 4, 5]) == 5\", \"assert count_positive_products([-1, -2,...
{ "split": "train", "index": 69139, "acecode_id": "bigcode_python_fns_17169", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `filter_by_criteria(arr: List[int]) -> List[int]` that takes an array of integers as input and returns a new array containing only the integers that are divisible by 5. Your implementation should not use any built-in filter functions.\nPlease reason step by...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_by_criteria([1, 2, 5, 10, 15, 20, 25, 30]) == [5, 10, 15, 20, 25, 30]\", \"assert filter_by_criteria([3, 6, 9]) == []\", \"assert filter_by_criteria([5, 10, 15]) == [5, 10, 15]\", \"assert filter_by_criteria([0, 1, 2, 3, 4]) == [0]\", \"assert filter_...
{ "split": "train", "index": 69140, "acecode_id": "evol_17906", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D array of integers, implement a function `layer_sum(array)` that returns a list containing the sums of each individual layer of the array. A layer is defined as a row in the 2D array. The function should return a list where each element corresponds to the sum of numbe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert layer_sum([[1, 2], [3, 4]]) == [3, 7]\", \"assert layer_sum([[5, 6, 7], [8, 9, 10]]) == [18, 27]\", \"assert layer_sum([[1], [2], [3]]) == [1, 2, 3]\", \"assert layer_sum([[10, 20], [30, 40], [50, 60]]) == [30, 70, 110]\", \"assert layer_sum([[0, 0], [0, 0]]...
{ "split": "train", "index": 69141, "acecode_id": "evol_6290", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of coordinates in the form of tuples (x, y) and two lists representing offsets for each coordinate: one for the x-direction and one for the y-direction. Your task is to implement a function that takes these three lists and returns a new list of coordinates,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert apply_offsets([(1, 2)], [0.5], [1.0]) == [(1.5, 3.0)]\", \"assert apply_offsets([(0, 0), (1, 1)], [1, -1], [1, 1]) == [(1, 1), (0, 2)]\", \"assert apply_offsets([(5, 5)], [2.5], [-2.5]) == [(7.5, 2.5)]\", \"assert apply_offsets([(10, 20)], [-10], [10]) == [(...
{ "split": "train", "index": 69142, "acecode_id": "bigcode_python_fns_24579", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with finding a valid configuration file path based on a starting directory and a given filename. Implement a function `find_valid_path(start_path: str, filename: str, default: Optional[str] = None) -> Optional[str]` that takes in the following parameters: \n\n- `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_valid_path('/foo/bar/boo', 'config.ini', '/default/config.ini') == '/foo/bar/boo/config.ini'\", \"assert find_valid_path('/foo/bar', 'config.ini', '/default/config.ini') == '/foo/bar/config.ini'\", \"assert find_valid_path('/foo', 'config.ini', '/defaul...
{ "split": "train", "index": 69143, "acecode_id": "bigcode_python_fns_802", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of transactions where each transaction is represented as a dictionary with keys 'day' and 'value'. The 'day' key contains a string representing the date of the transaction, and the 'value' key contains an integer representing the amount of money spent on th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_daily_spending([{'day': '2022-01-01', 'value': 100}]) == {'2022-01-01': 100}\", \"assert calculate_daily_spending([{'day': '2022-01-01', 'value': 50}, {'day': '2022-01-01', 'value': 50}]) == {'2022-01-01': 100}\", \"assert calculate_daily_spending(...
{ "split": "train", "index": 69144, "acecode_id": "oss_34320", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a directed graph represented as an adjacency list where each key is a node and its value is a list of nodes it points to, write a function `is_immediate_sister(graph: Dict[int, List[int]], node1: int, node2: int) -> bool` that determines if `node2` is an immediate sister ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_immediate_sister({1: [2, 3], 2: [4], 3: [5]}, 1, 2) == False\", \"assert is_immediate_sister({1: [], 2: [3]}, 2, 3) == False\", \"assert is_immediate_sister({1: [2, 3], 3: [4]}, 1, 4) == False\", \"assert is_immediate_sister({1: [2], 3: [2]}, 1, 3) == Fal...
{ "split": "train", "index": 69145, "acecode_id": "bigcode_python_fns_18723", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a numeric array, implement a function that calculates the running mean (temporally variant mean value) of the array. The running mean at each position is defined as the average of all elements from the start of the array up to that position. Write a function `compute_runn...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_running_mean([10, 20, 30]) == [10.0, 15.0, 20.0]\", \"assert compute_running_mean([-1, -2, -3, -4]) == [-1.0, -1.5, -2.0, -2.5]\", \"assert compute_running_mean([0]) == [0.0]\", \"assert compute_running_mean([5, 15]) == [5.0, 10.0]\", \"assert comput...
{ "split": "train", "index": 69146, "acecode_id": "evol_25416", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of orders, where each order is represented as a dictionary containing the following keys: 'orderNumber', 'orderDate', 'orderTotalAmount', 'clientNumber', and 'quoteNumber'. Your function should return a CSV formatted str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert export_data_to_csv([]) == 'Num\\u00e9ro de commande,Date,Montant total,Num\\u00e9ro client,R\\u00e9f\\u00e9rence devis\\\\n'\", \"assert export_data_to_csv([{'orderNumber': 1, 'orderDate': '2023-01-01', 'orderTotalAmount': 100.0, 'clientNumber': 10, 'quoteNu...
{ "split": "train", "index": 69147, "acecode_id": "bigcode_python_fns_10448", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `dataset_config()` that returns a dictionary containing two key-value pairs: 'factory' and 'flag'. The 'factory' key should be assigned the string 'Dataset' and the 'flag' key should be assigned the boolean value True. Implement the funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dataset_config() == {'factory': 'Dataset', 'flag': True}\", \"assert dataset_config()['factory'] == 'Dataset'\", \"assert dataset_config()['flag'] is True\", \"assert type(dataset_config()) == dict\", \"assert len(dataset_config()) == 2\", \"assert 'factory'...
{ "split": "train", "index": 69148, "acecode_id": "bigcode_python_fns_7397", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that fills in a dictionary with specific parameters based on the provided type and default value. The function should take in a dictionary `pb`, a string `name`, a type `ptype`, and an optional default value. The `pb` dictionary should be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fill_runtime_parameter({}, 'param1', int, 10) == {'name': 'param1', 'type': 'int', 'default_value': 10}\", \"assert fill_runtime_parameter({}, 'param2', float, 3.14) == {'name': 'param2', 'type': 'float', 'default_value': 3.14}\", \"assert fill_runtime_param...
{ "split": "train", "index": 69149, "acecode_id": "bigcode_python_fns_7446", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function that checks if a given Python code snippet is syntactically correct. The function should return True if the code is valid and False if it contains any syntax errors.\nPlease reason step by step, then write a self-contained Python solution. Give your final p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_syntax_correct('def test():\\\\n x = 5\\\\n y = 3') == True\", \"assert is_syntax_correct('def test():\\\\n x = 5\\\\n y =') == False\", \"assert is_syntax_correct('x = 5\\\\nprint(x)') == True\", \"assert is_syntax_correct('def test():\\\\n ...
{ "split": "train", "index": 69150, "acecode_id": "evol_8842", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the daily temperature readings of a week. Your task is to implement a function `daily_temperature_difference(temperatures: List[int]) -> List[int]` that computes the difference between the highest and lowest temperature readings for...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert daily_temperature_difference([25, 25, 25, 25, 25, 25, 25]) == [0, 0, 0, 0, 0, 0, 0]\", \"assert daily_temperature_difference([10, 20, 30, 40, 50, 60, 70]) == [60, 50, 40, 30, 20, 10, 0]\", \"assert daily_temperature_difference([5, 5, 5]) == []\", \"assert da...
{ "split": "train", "index": 69151, "acecode_id": "oss_5493", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `compress_and_encode_constants` that takes a dictionary where keys are strings representing constant names and values are lists of integers representing constant values. The function should return a new dictionary where each list of in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compress_and_encode_constants({'weights': [1, 2, 2, 3, 255, 256], 'bias': [0, 0, 1]}) == {'weights': [1, 2, 3, 255], 'bias': [0, 1]}\", \"assert compress_and_encode_constants({'weights': [], 'bias': []}) == {'weights': [], 'bias': []}\", \"assert compress_an...
{ "split": "train", "index": 69152, "acecode_id": "bigcode_python_fns_43528", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a CPU model number and two integers representing the core count and clock speed in megahertz. Write a function that takes these inputs and returns a dictionary containing the CPU model, its product ID (an integer), the manufacturer (always 'i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_cpu_model('i7-9700K', 1, 8, 3500) == {'model': 'i7-9700K', 'product_id': 1, 'manufacturer': 'intel', 'core_count': 8, 'clock_speed_hz': 3500000000}\", \"assert parse_cpu_model('i5-9600K', 2, 6, 4000) == {'model': 'i5-9600K', 'product_id': 2, 'manufactu...
{ "split": "train", "index": 69153, "acecode_id": "bigcode_python_fns_37543", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a reminder system for a messaging application. Your function should check for pending messages and send reminders if there are any. You are provided with a function `report_action_card(message)` for sending reminders. Your task is to implement the `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_messages(['Reminder 1', 'Reminder 2', 'Reminder 3']) == 3\", \"assert check_messages([]) == 0\", \"assert check_messages(['Single Reminder']) == 1\", \"assert check_messages(['Message A', 'Message B']) == 2\", \"assert check_messages(['Test Message 1',...
{ "split": "train", "index": 69154, "acecode_id": "oss_28786", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a git remote URL, implement a function that retrieves the repository owner (user or organization) from the URL. The URL can be in either HTTPS format (e.g., 'https://github.com/owner/repo.git') or SSH format (e.g., 'git@github.com:owner/repo.git'). T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_repo_owner_from_url('https://github.com/shalb/cluster.dev.git') == 'shalb'\", \"assert get_repo_owner_from_url('git@github.com:shalb/cluster.dev.git') == 'shalb'\", \"assert get_repo_owner_from_url('https://github.com/user/repo.git') == 'user'\", \"asser...
{ "split": "train", "index": 69155, "acecode_id": "bigcode_python_fns_31267", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with finding all possible medians from a list of integers without sorting the list. The function should return a list of unique median values. If the list has an even number of elements, the two middle values are both considered medians. If there are multiple ins...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_medians([3, 1, 2, 4, 5]) == [3]\", \"assert unique_medians([5, 2, 2, 5]) == [2, 5]\", \"assert unique_medians([1, 1, 1, 1]) == [1]\", \"assert unique_medians([4, 2, 8]) == [4]\", \"assert unique_medians([9, 7, 5, 3, 11]) == [7]\", \"assert unique_medi...
{ "split": "train", "index": 69156, "acecode_id": "evol_32421", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `dummy_request` that simulates returning a dummy request object. The function does not take any parameters and returns a dictionary representing a dummy request with the following keys: 'method', 'url', and 'headers'. The values of these keys should be 'GET...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dummy_request() == {'method': 'GET', 'url': 'http://example.com', 'headers': {}}\", \"assert dummy_request()['method'] == 'GET'\", \"assert dummy_request()['url'] == 'http://example.com'\", \"assert dummy_request()['headers'] == {}\", \"assert type(dummy_req...
{ "split": "train", "index": 69157, "acecode_id": "bigcode_python_fns_48268", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with controlling a robot's movement based on input speeds from two entry boxes. Write a function `handle_movement(left_speed: int, right_speed: int) -> List[str]` that takes two integers representing the speed of the left and right motors of the robot. The functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_movement(5, 3) == ['5', '-3']\", \"assert handle_movement(-2, 4) == ['-2', '-4']\", \"assert handle_movement(0, 0) == ['0', '0']\", \"assert handle_movement(10, -10) == ['10', '10']\", \"assert handle_movement(7, 8) == ['7', '-8']\", \"assert handle_m...
{ "split": "train", "index": 69158, "acecode_id": "bigcode_python_fns_17441", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a stock trading algorithm. Write a function `stock_trading_decision(input1, input2, input3, input4, input5)` that takes five parameters representing trading conditions. The parameters are: '신고저구분' (High-Low Division), '고저종구분' (High-Low-Close Div...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert stock_trading_decision('high', 'low', 'bad', 'low', 'bad') == 'buy'\", \"assert stock_trading_decision('low', 'low', 'good', 'high', 'bad') == 'sell'\", \"assert stock_trading_decision('high', 'high', 'bad', 'low', 'bad') == 'no decision'\", \"assert stock_t...
{ "split": "train", "index": 69159, "acecode_id": "oss_22151", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a logging system that allows you to set a minimum log level. Create a function `init_logging(log_level: str) -> str` that takes a string `log_level` as input, which represents the minimum log level to log messages. The function should return a s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert init_logging('DEBUG') == 'Logging initialized at DEBUG level.'\", \"assert init_logging('INFO') == 'Logging initialized at INFO level.'\", \"assert init_logging('WARNING') == 'Logging initialized at WARNING level.'\", \"assert init_logging('ERROR') == 'Loggi...
{ "split": "train", "index": 69160, "acecode_id": "bigcode_python_fns_14314", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of bigram words, your task is to transform this list into a unique list of unigram words. Each bigram is formed by combining two adjacent words in the list, and the unique unigrams are the distinct words that appear in these bigrams. Implement the function `unique_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_unigrams(['hello world', 'world is', 'is great']) == ['hello', 'world', 'is', 'great']\", \"assert unique_unigrams(['a b', 'b c', 'a d']) == ['a', 'b', 'c', 'd']\", \"assert unique_unigrams(['test one', 'one two', 'two three', 'three']) == ['test', 'o...
{ "split": "train", "index": 69161, "acecode_id": "bigcode_python_fns_28838", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing file paths. Your task is to implement a function `findLatestFile(files: List[str]) -> str` that returns the latest file path based on alphabetical order. If the list is empty, return an empty string. The function should only consider...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert findLatestFile(['path/to/file1.bin', 'path/to/file2.bin', 'path/to/file3.txt']) == 'path/to/file2.bin'\", \"assert findLatestFile(['path/to/a.bin', 'path/to/b.bin', 'path/to/c.bin']) == 'path/to/c.bin'\", \"assert findLatestFile(['path/to/file1.txt', 'path/t...
{ "split": "train", "index": 69162, "acecode_id": "bigcode_python_fns_5140", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `create_dataframe` that represents a DataFrame by storing its name. The function should take a single argument, a string `name`, and return a string representation of the DataFrame in the format: `DataFrame(name='name')`. The `name` shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_dataframe('example_df') == \\\"DataFrame(name='example_df')\\\"\", \"assert create_dataframe('test_data') == \\\"DataFrame(name='test_data')\\\"\", \"assert create_dataframe('my_dataframe') == \\\"DataFrame(name='my_dataframe')\\\"\", \"assert create_...
{ "split": "train", "index": 69163, "acecode_id": "oss_4437", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function that takes an integer n as input and returns the nth Fibonacci number. The Fibonacci sequence is defined as follows: the first two Fibonacci numbers are 0 and 1, and every subsequent number is the sum of the two preceding ones. Implement the function that calc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci_series(0) == 0\", \"assert fibonacci_series(1) == 1\", \"assert fibonacci_series(2) == 1\", \"assert fibonacci_series(3) == 2\", \"assert fibonacci_series(4) == 3\", \"assert fibonacci_series(5) == 5\", \"assert fibonacci_series(6) == 8\", \"assert...
{ "split": "train", "index": 69164, "acecode_id": "evol_23088", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of import IDs representing different registered imports. Write a function that takes this list as input and returns a list of strings where each string is the representation of the import details corresponding to each import ID in the input list. If an impo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_import_details([1]) == ['Import 1 Details']\", \"assert get_import_details([2]) == ['Import 2 Details']\", \"assert get_import_details([3]) == ['Import 3 Details']\", \"assert get_import_details([4]) == ['Import 4 Details']\", \"assert get_import_details...
{ "split": "train", "index": 69165, "acecode_id": "bigcode_python_fns_9496", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary that represents an item identifier (`item_pid`). The dictionary contains a key 'type' which can have various string values. Your task is to implement a function `validate_item_pid(item_pid)` that checks the 'type' of the item identifier and returns an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_item_pid({'type': 'ITEM'}).is_item == True\", \"assert validate_item_pid({'type': 'ITEM'}).is_brw_req == False\", \"assert validate_item_pid({'type': 'BORROWING_REQUEST'}).is_item == False\", \"assert validate_item_pid({'type': 'BORROWING_REQUEST'})...
{ "split": "train", "index": 69166, "acecode_id": "bigcode_python_fns_32592", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks whether a provided URL is safe based on a list of allowed hosts. The function should take a URL string and a list of allowed hosts as input. It should also determine if the request requires HTTPS based on a boolean value. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_safe_url('https://example.com', ['example.com', 'test.com'], True) == True\", \"assert is_safe_url('http://example.com', ['example.com', 'test.com'], True) == False\", \"assert is_safe_url('https://example.com', ['example.com', 'test.com'], False) == True...
{ "split": "train", "index": 69167, "acecode_id": "bigcode_python_fns_9338", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing weekly death counts from a specific cause over a period of weeks. Your task is to implement a function that calculates the total number of deaths over the entire period. The function should take a list of integers as input, where ea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_deaths([10, 20, 30, 40]) == 100\", \"assert total_deaths([0, 0, 0, 0]) == 0\", \"assert total_deaths([5]) == 5\", \"assert total_deaths([1, 2, 3, 4, 5]) == 15\", \"assert total_deaths([]) == 0\", \"assert total_deaths([100, 200, 300]) == 600\", \"asser...
{ "split": "train", "index": 69168, "acecode_id": "bigcode_python_fns_9889", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves a specific post from a list of posts based on a given post ID. Write a function `get_post_by_id` that takes an integer `post_id` as an argument and returns the post with that ID from a predefined list of posts. Each post is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_post_by_id(1) == {'id': 1, 'title': 'First Post', 'content': 'This is the content of the first post.'}\", \"assert get_post_by_id(2) == {'id': 2, 'title': 'Second Post', 'content': 'This is the content of the second post.'}\", \"assert get_post_by_id(4) ...
{ "split": "train", "index": 69169, "acecode_id": "oss_7486", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function that accepts an integer value and performs the following operations: 1. Increase a stored correct value by 5. 2. Store an additional erroneous value by doubling the input value and then subtracting 3. 3. Switch between the correct and erroneous stored value...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert function(0, 'increase') == 5\", \"assert function(0, 'update') == -3\", \"assert function(10, 'update') == 17\", \"assert function(-5, 'update') == -13\", \"assert function(-5, 'switch') == 0\", \"assert function(1, 'increase') == 5\", \"assert function(1, '...
{ "split": "train", "index": 69170, "acecode_id": "evol_18243", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given an integer array 'arr', write a function 'max_subarray_sum' that returns the maximum sum of a contiguous subarray. The function should also return the starting and ending indices of this subarray. You must solve this problem in linear time, O(n). The function should handl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_subarray_sum([-2, -3, -1, -5]) == (-1, (2, 2))\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) == (23, (0, 4))\", \"assert max_subarray_sum([-1, -2, -3, -4]) == (-1, (0, 0))\", \"assert max_subarray_sum([-2, 1, -3, 4, -1, 2, 1, -5, 4]) == (6, (3, 6))\", \...
{ "split": "train", "index": 69171, "acecode_id": "evol_5961", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `draw_cards(deck: List[str], cards_to_draw: int, ignore_empty_deck: bool) -> List[str]`. This function simulates drawing cards from a deck represented as a list of strings, where each string represents a card. The function takes the f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert draw_cards(['A', 'B', 'C', 'D'], 2, False) == ['A', 'B']\", \"assert draw_cards(['A', 'B', 'C', 'D'], 5, True) == ['A', 'B', 'C', 'D']\", \"assert draw_cards(['A', 'B'], 3, True) == ['A', 'B']\", \"assert draw_cards([], 1, True) == []\", \"assert draw_cards(...
{ "split": "train", "index": 69172, "acecode_id": "bigcode_python_fns_38002", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a YouTube video view counter. The function should take two parameters: the number of visits (an integer) and the video URL (a string). The function should return a string that indicates how many times the video has been vie...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert view_counter(1, 'https://www.youtube.com/watch?v=dQw4w9WgXcQ') == 'Video https://www.youtube.com/watch?v=dQw4w9WgXcQ has been viewed 1 times.'\", \"assert view_counter(5, 'https://www.youtube.com/watch?v=abcdef') == 'Video https://www.youtube.com/watch?v=abc...
{ "split": "train", "index": 69173, "acecode_id": "bigcode_python_fns_40733", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a custom exception class for a Python application that manages smart home devices. Your goal is to create a custom exception class called `DisabledError` that will be raised when a smart home device's API is disabled. When this exception is raised, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert (check_device_api('Thermostat', True) == 'The API for Thermostat is ready to use.')\", \"assert (check_device_api('Security Camera', True) == 'The API for Security Camera is ready to use.')\", \"assert (check_device_api('Smart Speaker', True) == 'The API for...
{ "split": "train", "index": 69174, "acecode_id": "oss_25310", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function called `cocktail_sort` that takes a list of integers and sorts it in ascending order using the Cocktail Sort algorithm. The function should optimize the sorting process by tracking the last swapped index for both the left and right sides of the list, skippi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cocktail_sort([3, 1, 5, 8, 2, 6, 9, 4, 7]) == [1, 2, 3, 4, 5, 6, 7, 8, 9]\", \"assert cocktail_sort([10, 9, 8, 7, 6, 5]) == [5, 6, 7, 8, 9, 10]\", \"assert cocktail_sort([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert cocktail_sort([5, 4, 3, 2, 1]) == [1, 2,...
{ "split": "train", "index": 69175, "acecode_id": "evol_31253", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the values of a sparse tensor, return a list of strings where each integer is converted to its string representation. The input will be a list of integers, and the output should be a list of their corresponding string values. The input list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sparse_tensor_to_string_values([]) == []\", \"assert sparse_tensor_to_string_values([1, 2, 3]) == ['1', '2', '3']\", \"assert sparse_tensor_to_string_values([-1, -2, -3]) == ['-1', '-2', '-3']\", \"assert sparse_tensor_to_string_values([0]) == ['0']\", \"ass...
{ "split": "train", "index": 69176, "acecode_id": "bigcode_python_fns_24491", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of bounding boxes represented by their center coordinates (y_center, x_center) and their height and width (h, w), write a function that converts these boxes into their corner coordinates. The output should be in the format (y_min, x_min, y_max, x_max), where: \n- ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_boxes([(1, 2, 4, 6)]) == [( -1.0, -1.0, 3.0, 5.0)]\", \"assert convert_boxes([(0, 0, 2, 2)]) == [(-1.0, -1.0, 1.0, 1.0)]\", \"assert convert_boxes([(5, 5, 10, 10)]) == [(0.0, 0.0, 10.0, 10.0)]\", \"assert convert_boxes([(3, 3, 6, 4)]) == [(0.0, 1.0...
{ "split": "train", "index": 69177, "acecode_id": "bigcode_python_fns_21212", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that removes any string entries from an array that contain a specified substring. The function should take an array of strings and a substring as input and return a new array with the strings that do not contain the substring. For example, if the input arra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert purge_strings(['remove this', 'keep this', 'also remove'], 'remove') == ['keep this']\", \"assert purge_strings(['hello world', 'goodbye world'], 'remove') == ['hello world', 'goodbye world']\", \"assert purge_strings(['not only python', 'python', 'not only ...
{ "split": "train", "index": 69178, "acecode_id": "evol_35505", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that takes a list of variable names (as strings) and a dictionary containing variable names as keys and their corresponding values. The function should return a new list containing the names of all non-module global variables d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_non_module_globals(['x', 'y', '__private', 'z'], {'x': 10, 'y': 'hello', '__private': 42}) == ['x', 'y']\", \"assert filter_non_module_globals(['a', '__hidden', 'b'], {'a': 1, 'b': 2}) == ['a', 'b']\", \"assert filter_non_module_globals(['__secret', '...
{ "split": "train", "index": 69179, "acecode_id": "oss_37714", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list representing a leaderboard of players' scores. Your task is to implement a function that removes a specified number of lowest scores from the beginning of the leaderboard. Implement a function `remove_lowest_scores` that takes two parameters: 1. `leaderboar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_lowest_scores([100, 90, 80, 70, 60, 50], 2) == [80, 70, 60, 50]\", \"assert remove_lowest_scores([10, 20, 30, 40, 50], 1) == [20, 30, 40, 50]\", \"assert remove_lowest_scores([5, 3, 8, 1, 6], 3) == [1, 6]\", \"assert remove_lowest_scores([10, 10, 10, ...
{ "split": "train", "index": 69180, "acecode_id": "oss_36173", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of ICD codes and the version of the ICD. Your task is to categorize each ICD code based on predefined ranges for each category according to the specified ICD version. Implement a function `categorize_icd_codes(codes: List[str], icd_version: int) -> List[str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_icd_codes(['001', '100', '200', '300', '400', '500'], 6) == ['Category A', 'Category B', 'Category C', 'Category D', 'Category E', 'Other']\", \"assert categorize_icd_codes(['001', '002', '003'], 5) == ['Other', 'Other', 'Other']\", \"assert categ...
{ "split": "train", "index": 69181, "acecode_id": "bigcode_python_fns_6452", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simplified version of the Fredkin Game of Life rule. The function takes two parameters: `cell`, which is an integer that can be either 1 (alive) or 0 (dead), and `live_count`, which is an integer representing the coun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fredkin(1, 3) == 0\", \"assert fredkin(0, 0) == 0\", \"assert fredkin(0, 1) == 1\", \"assert fredkin(0, 2) == 0\", \"assert fredkin(1, 0) == 1\", \"assert fredkin(0, 3) == 1\", \"assert fredkin(0, 5) == 1\", \"assert fredkin(0, 4) == 0\", \"assert fredkin(0,...
{ "split": "train", "index": 69182, "acecode_id": "bigcode_python_fns_44135", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a dictionary containing two URLs: an 'ImageUrl' and an 'S3Url'. Your task is to write a Python function called `modify_urls` that takes this dictionary as input and returns a new dictionary with modified URLs. For the 'ImageUrl', replace the substring 'http' with ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modify_urls({'ImageUrl': 'http://example.com/image.jpg', 'S3Url': 'example.com/images_rl_file.jpg'}) == {'ImageUrl': 'https://example.com/image.jpg', 'S3Url': 'example.com/images_thumb_file.jpg'}\", \"assert modify_urls({'ImageUrl': 'http://test.com/photo.pn...
{ "split": "train", "index": 69183, "acecode_id": "oss_26458", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the selection of files in a file browsing application. Write a function `simulateFileSelection` that takes a list of file names as input and returns a single string containing all file paths separated by newline characters....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulateFileSelection(['file1.txt', 'file2.txt', 'file3.txt']) == 'file1.txt\\\\nfile2.txt\\\\nfile3.txt'\", \"assert simulateFileSelection(['document.pdf', 'image.png']) == 'document.pdf\\\\nimage.png'\", \"assert simulateFileSelection(['a.txt']) == 'a.txt'...
{ "split": "train", "index": 69184, "acecode_id": "oss_37685", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `merge_sort(arr)` that takes a list of integers containing both duplicates and unique elements, as well as negative and positive numbers, and sorts the list in non-decreasing order. The function should use a sorting algorithm with a time complexity better t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_sort([8, -4, 3, 5, -9, 8, 10]) == [-9, -4, 3, 5, 8, 8, 10]\", \"assert merge_sort([1, 2, 3]) == [1, 2, 3]\", \"assert merge_sort([3, 2, 1]) == [1, 2, 3]\", \"assert merge_sort([5, 5, 5]) == [5, 5, 5]\", \"assert merge_sort([]) == []\", \"assert merge_s...
{ "split": "train", "index": 69185, "acecode_id": "evol_17099", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a target operating system name and a target ID, and returns a list of files needed for an infotainment server setup based on the provided operating system. If the operating system is 'debian', the function should return a l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_infotainment_files('debian', 1) == ['infotainment_server', 'infotainment-server.service']\", \"assert get_infotainment_files('FreeBSD', 2) == ['infotainment_server', 'infotainment-server.sh']\", \"assert get_infotainment_files('ubuntu', 3) == []\", \"ass...
{ "split": "train", "index": 69186, "acecode_id": "bigcode_python_fns_6565", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `classify(text: str) -> str` that classifies a given text into one of the following categories: 'maritime', 'quantum computing', 'holistic health', 'performance art', or 'classical music'. The classification should be based on the presence of specific keywords ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify('CMA CGM recently launched their new fleet of cargo ships.') == 'maritime'\", \"assert classify('The research in quantum computing is advancing rapidly.') == 'quantum computing'\", \"assert classify('Practicing mindfulness is an essential part of ho...
{ "split": "train", "index": 69187, "acecode_id": "evol_14866", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a language code as input and returns the corresponding codepage as a hexadecimal string. The mapping between language codes and their respective codepages is provided in a dictionary. The function should return the codepage in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_codepage('en') == '0030'\", \"assert get_codepage('fr') == '0031'\", \"assert get_codepage('no') == '0000'\", \"assert get_codepage('xx') == '0000'\", \"assert get_codepage('') == '0000'\", \"assert get_codepage('language_not_in_map') == '0000'\"]}" }
{ "split": "train", "index": 69188, "acecode_id": "bigcode_python_fns_35682", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simplified rule-based text categorization system that predicts the category of a given text based on the presence of certain words and word pairs. You need to define a function `predict_category(text: str, positive_words: List[str], negative_w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict_category('I love programming', ['love'], ['hate'], [], []) == 'positive'\", \"assert predict_category('I hate bugs', [], ['hate'], [], []) == 'negative'\", \"assert predict_category('This is a test', [], [], [], []) == 'neutral'\", \"assert predict_c...
{ "split": "train", "index": 69189, "acecode_id": "oss_6623", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, A and B, each containing n elements. Your task is to write a function `calculate_sum_of_products(A, B)` that computes the sum of the products of corresponding elements in the two lists. If the lists are of different lengths, the function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_sum_of_products([1, 2, 3], [4, 5, 6]) == 32\", \"assert calculate_sum_of_products([0, 0, 0], [1, 2, 3]) == 0\", \"assert calculate_sum_of_products([1, 1, 1], [1, 1, 1]) == 3\", \"assert calculate_sum_of_products([-1, -2, -3], [4, 5, 6]) == -32\", \...
{ "split": "train", "index": 69190, "acecode_id": "oss_31928", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `print_test_results` that simulates the reporting of test results for a simple testing framework. The function takes in a test suite represented as a list of dictionaries, where each dictionary contains a 'name' (string) and a 'result...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_test_results([]) == 'No tests run.'\", \"assert print_test_results([{'name': 'test1', 'result': True}]) == 'Test test1: Passed'\", \"assert print_test_results([{'name': 'test1', 'result': False}]) == 'Test test1: Failed'\", \"assert print_test_results(...
{ "split": "train", "index": 69191, "acecode_id": "oss_17829", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Construct a function that derives a list, without repetitions, consisting of every individual word present within the provided text string that possesses a length exceeding n characters. Characters are not case-sensitive. In addition, words in the sentence are composed only of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longer_words('To be, or not to be: that is the question.', 5) == ['question']\", \"assert longer_words('Caps and lowercase.', 3) == ['Caps', 'lowercase']\", \"assert longer_words('123 test! test123', 3) == ['test']\", \"assert longer_words('', 0) == []\", \"...
{ "split": "train", "index": 69192, "acecode_id": "evol_7620", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given two floating-point numbers x0 and x1, and a parameter p (0 <= p <= 1), implement a function that linearly interpolates between x0 and x1. When p = 0, the function should return x0, and when p = 1, it should return x1. For values of p between 0 and 1, the function should r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert linear_interpolate(0.0, 10.0, 0.0) == 0.0\", \"assert linear_interpolate(0.0, 10.0, 1.0) == 10.0\", \"assert linear_interpolate(0.0, 10.0, 0.5) == 5.0\", \"assert linear_interpolate(-10.0, 10.0, 0.0) == -10.0\", \"assert linear_interpolate(-10.0, 10.0, 1.0) ...
{ "split": "train", "index": 69193, "acecode_id": "bigcode_python_fns_41560", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `decode_string(s)` that takes a string `s` as input and decodes it using a predefined mapping called `decoding_cipher`, which maps 'x' to 'a', 'y' to 'b', and 'z' to 'c'. If the input is not a string, the function should return None. For characters not in the m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decode_string('xyz') == 'abc'\", \"assert decode_string('x') == 'a'\", \"assert decode_string('y') == 'b'\", \"assert decode_string('z') == 'c'\", \"assert decode_string('') == ''\", \"assert decode_string('hello') == 'hello'\", \"assert decode_string('xyzxy...
{ "split": "train", "index": 69194, "acecode_id": "evol_12157", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function that receives an array of positive integers and sorts them in ascending order based on the length of their binary representations. If two integers have the same binary length, they should be sorted by their decimal values. Implement the function as follows:\n\...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_by_binary_len([1, 31, 15, 2, 7]) == [1, 2, 7, 15, 31]\", \"assert sort_by_binary_len([14, 58, 39, 41, 61]) == [14, 39, 41, 58, 61]\", \"assert sort_by_binary_len([1, 0, 2, 3, 4]) == [0, 1, 2, 3, 4]\", \"assert sort_by_binary_len([8, 4, 2, 1]) == [1, 2, ...
{ "split": "train", "index": 69195, "acecode_id": "evol_34177", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing tokens. Each token is a non-empty string consisting of alphanumeric characters and underscores. Your task is to implement a function that filters out any tokens that exceed a maximum length of 5 characters. The function should return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_tokens(['a', 'bb', 'ccc', 'dddd', 'eeeee'], 5) == ['a', 'bb', 'ccc', 'dddd', 'eeeee']\", \"assert filter_tokens([], 5) == []\", \"assert filter_tokens(['abc', 'def', 'ghijkl'], 3) == ['abc', 'def']\", \"assert filter_tokens(['token1', 'token2', 'token...
{ "split": "train", "index": 69196, "acecode_id": "bigcode_python_fns_1007", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of a set of buildings. Your task is to implement a function that calculates the average height of the buildings in the list. If the list is empty, return 0.0. The function should have the following signature: `def averag...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_building_height([3, 9, 7, 5]) == 6.0\", \"assert average_building_height([10, 20, 30]) == 20.0\", \"assert average_building_height([-1, -2, -3]) == -2.0\", \"assert average_building_height([0, 0, 0]) == 0.0\", \"assert average_building_height([100]) ...
{ "split": "train", "index": 69197, "acecode_id": "bigcode_python_fns_6852", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings and a target string. Write a function that identifies all the substrings within the target string that are not fully marked by any annotations, given a set of rules. An annotation is represented by a string that marks the beginning and end of a s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_unmarked_substrings(['abc', 'def'], 'abcdefg') == ['g']\", \"assert find_unmarked_substrings(['foo', 'bar'], 'foobar') == []\", \"assert find_unmarked_substrings(['test'], 'testing123') == ['ing123']\", \"assert find_unmarked_substrings(['apple'], 'appl...
{ "split": "train", "index": 69198, "acecode_id": "bigcode_python_fns_10117", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates stopping a job in a workflow system. The function should take two parameters: a job name (a string) and an execution ID (a string). Your job is to return a message indicating whether the job has been successfully stoppe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert stop_job('job1', 'exec123') == 'Job job1 with execution ID exec123 has been stopped.'\", \"assert stop_job('job2', 'exec456') == 'Job job2 with execution ID exec456 has been stopped.'\", \"assert stop_job('job3', 'exec789') == 'Job not found.'\", \"assert st...
{ "split": "train", "index": 69199, "acecode_id": "bigcode_python_fns_40374", "num_tests": 16 }