data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "Write a function `extract_domain(url: str) -> str` that takes a URL as a string and returns the domain name of the website. The domain name is defined as the part of the URL that comes after 'https://' or 'http://' and before the next '/' or the end of the string. If the URL do...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_domain('https://www.samplewebsite.org/') == 'www.samplewebsite.org'\", \"assert extract_domain('http://example.com/path/to/resource') == 'example.com'\", \"assert extract_domain('https://subdomain.example.org') == 'subdomain.example.org'\", \"assert ...
{ "split": "train", "index": 62600, "acecode_id": "evol_32387", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function that returns a new array where each element at index 'i' is the product of all the numbers in the input array except the number at index 'i'. You must not use division in your solution. The input array will contain at least two i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert problem_sol([1, 2, 3, 4]) == [24, 12, 8, 6]\", \"assert problem_sol([2, 3, 4]) == [12, 8, 6]\", \"assert problem_sol([1, 1, 1, 1]) == [1, 1, 1, 1]\", \"assert problem_sol([5, 10, 15]) == [150, 75, 50]\", \"assert problem_sol([-1, -2, -3, -4]) == [-24, -12, -...
{ "split": "train", "index": 62601, "acecode_id": "evol_3494", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a Python function that recursively converts an input decimal integer into its corresponding binary representation as a string. The function should not have any side effects such as printing to the console. Implement the function named `decimal_to_binary`. If the input n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decimal_to_binary(0) == '0'\", \"assert decimal_to_binary(1) == '1'\", \"assert decimal_to_binary(2) == '10'\", \"assert decimal_to_binary(3) == '11'\", \"assert decimal_to_binary(4) == '100'\", \"assert decimal_to_binary(5) == '101'\", \"assert decimal_to_b...
{ "split": "train", "index": 62602, "acecode_id": "evol_16530", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function `create_json(class_name, attributes)` that takes a class name as a string and a dictionary mapping attribute names to attribute values. The function should generate a valid JSON object in string format with the class name as the main key and the attribut...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_json('Student', {'roll_no': 345}) == '{\\\"Student\\\": {\\\"roll_no\\\": 345}}'\", \"assert create_json('Course', {'course_name': 'Mathematics'}) == '{\\\"Course\\\": {\\\"course_name\\\": \\\"Mathematics\\\"}}'\", \"assert create_json('Teacher', {'n...
{ "split": "train", "index": 62603, "acecode_id": "evol_1580", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a given dictionary and returns a list containing the keys and values of the dictionary in a specific format. Write a function called `process_dictionary` that takes a dictionary `input_dict` as its parameter and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_dictionary({'sector': 'Finance', 'variable': 'Revenue'}) == ['Sector: Finance', 'Variable: Revenue']\", \"assert process_dictionary({'sector': 'Health', 'variable': 'Cost'}) == ['Sector: Health', 'Variable: Cost']\", \"assert process_dictionary({'sec...
{ "split": "train", "index": 62604, "acecode_id": "oss_3584", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function in Python that checks whether a given number is even or odd. You should not use the modulo operator (%), the division operator (/), or the built-in Python function `isinstance()`. Your function should handle both integer and floating point numbers. For floa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert checkEvenOrOdd(2) == 'Even'\", \"assert checkEvenOrOdd(3) == 'Odd'\", \"assert checkEvenOrOdd(-4) == 'Even'\", \"assert checkEvenOrOdd(-5) == 'Odd'\", \"assert checkEvenOrOdd(0) == 'Even'\", \"assert checkEvenOrOdd(2.0) == 'Even'\", \"assert checkEvenOrOdd(3...
{ "split": "train", "index": 62605, "acecode_id": "evol_31819", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two integers, a list of fruit items in the format 'X apples', and a list of non-fruit items in the format 'Y pencils', along with a multiplier. The function should return two dictionaries: one for fruits and another for non-fruit items, containin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert advanced_fruit_distribution(1, 10, ['3 apples', '2 oranges'], ['5 pencils'], 50) == ({'apples': 1.5, 'oranges': 1.0}, {'pencils': 5})\", \"assert advanced_fruit_distribution(2, 15, ['4 bananas'], ['3 markers', '2 erasers'], 20) == ({'bananas': 4}, {'markers'...
{ "split": "train", "index": 62606, "acecode_id": "evol_32367", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a string containing words, spaces, and punctuation marks (specifically commas and periods), implement a function that removes any extra spaces between words and ensures that punctuation marks are surrounded by a single space. The output should maintain a uniform gap among...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_superfluous_spaces(' The quick, brown fox jumps over . the lazy dog ') == 'The quick , brown fox jumps over . the lazy dog'\", \"assert remove_superfluous_spaces(' Python is great! ') == 'Python is great!'\", \"assert remove...
{ "split": "train", "index": 62607, "acecode_id": "evol_28900", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `multiply(lst)` that computes the product of all odd numbers located at even indices in a given list of integers `lst`. The list will not be empty. The function should return the product of these odd numbers. If there are no odd numbers at even indices, the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply([2, 4, 6, 8]) == 1\", \"assert multiply([3, 1, 4, 5, 2, 7]) == 3\", \"assert multiply([1]) == 1\", \"assert multiply([2, 1]) == 1\", \"assert multiply([3, 0]) == 3\", \"assert multiply([1, 2, 3, 4, 5]) == 15\", \"assert multiply([10, 20, 30, 40]) ==...
{ "split": "train", "index": 62608, "acecode_id": "evol_21570", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a 2D list of float values representing acoustic backscatter data from an echogram. Your task is to implement a function that calculates and returns the average backscatter value across the entire echogram. The average backscatter value is defined as the sum of all...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_backscatter([[1.0, 2.0], [3.0, 4.0]]) == 2.5\", \"assert average_backscatter([[0.0, 0.0], [0.0, 0.0]]) == 0.0\", \"assert average_backscatter([[10.0]]) == 10.0\", \"assert average_backscatter([[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]) == 1.0\", \"assert ave...
{ "split": "train", "index": 62609, "acecode_id": "oss_31286", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a given response and returns a modified version of it. The response is a string containing a series of words separated by spaces. Your task is to reverse the order of the words in the response while preserving the order...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverseResponse('hello world example') == 'example world hello'\", \"assert reverseResponse(' leading spaces') == 'spaces leading'\", \"assert reverseResponse('trailing spaces ') == 'spaces trailing'\", \"assert reverseResponse(' multiple spaces here...
{ "split": "train", "index": 62610, "acecode_id": "oss_33015", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of pairs of integers, where each pair consists of a key and a value. Your task is to combine the values of pairs that have the same key by summing them up. Implement a function `sum_pairs(pairs: List[Tuple[int, int]]) -> Dict[int, int]` that takes a list of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_pairs([(1, 2), (2, 3), (1, 5)]) == {1: 7, 2: 3}\", \"assert sum_pairs([(1, 1), (1, 1), (2, 2), (2, 3)]) == {1: 2, 2: 5}\", \"assert sum_pairs([]) == {}\", \"assert sum_pairs([(3, 4), (3, 4), (3, 4)]) == {3: 12}\", \"assert sum_pairs([(10, 1), (10, 2), (2...
{ "split": "train", "index": 62611, "acecode_id": "bigcode_python_fns_44565", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a basic HTTP GET request. Your function should take a URL as input and return a tuple containing the content of the response and the corresponding status code. For simplicity, you can assume that the function will only ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert http_get('http://example.com') == ('Example Domain', 200)\", \"assert http_get('http://notfound.com') == ('Not Found', 404)\", \"assert http_get('http://servererror.com') == ('Internal Server Error', 500)\", \"assert http_get('http://gatewaytimeout.com') == ...
{ "split": "train", "index": 62612, "acecode_id": "bigcode_python_fns_33379", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of feed IDs and returns a list of feed URLs for those IDs. The function should simulate fetching URLs from a predefined dictionary where keys are feed IDs and values are feed URLs. The function should be named `get_feed_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_feed_urls([1, 2, 3]) == ['http://example.com/feed1', 'http://example.com/feed2', 'http://example.com/feed3']\", \"assert get_feed_urls([4, 5]) == []\", \"assert get_feed_urls([1, 6]) == ['http://example.com/feed1']\", \"assert get_feed_urls([]) == []\", ...
{ "split": "train", "index": 62613, "acecode_id": "oss_24126", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `nonagonal(n, dictate)` that computes values related to a nonagonal sequence. The function should take an integer `n` and a string `dictate`. The `dictate` can be one of three options: 'sequence', 'sum', or 'product'. If `dictate` is 'sequence', the functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert nonagonal(5, 'product') == 0\", \"assert nonagonal(0, 'sequence') == [0]\", \"assert nonagonal(0, 'sum') == 0\", \"assert nonagonal(10, 'product') == 0\", \"assert nonagonal(15, 'product') == 0\", \"assert nonagonal(500, 'product') == 0\", \"assert nonagonal...
{ "split": "train", "index": 62614, "acecode_id": "evol_4124", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given two strings `r` and `s`, return `true` if they become identical after being processed with special characters. The character `'*'` represents a duplicate character operation, `'/‘` represents a delete character operation, and `'%'` represents a conversion to its ASCII num...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert identical_strings('a/c', 'b') == False\", \"assert identical_strings('abc*de', 'abccde') == True\", \"assert identical_strings('abc/', 'ab') == True\", \"assert identical_strings('/*/b', 'b') == True\", \"assert identical_strings('z', 'z/') == False\", \"ass...
{ "split": "train", "index": 62615, "acecode_id": "evol_27441", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a binary sequence `data`, write a function that computes the least number of exchanges necessary to consolidate all binary `1`s present in the sequence at any location within the sequence. An exchange is defined as moving a `1` from one position to another. The function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minExchange([1,0,1,0,1]) == 1\", \"assert minExchange([0,0,0,1,0]) == 0\", \"assert minExchange([1,0,1,0,1,0,0,1,1,0,1]) == 3\", \"assert minExchange([1,0,1,0,1,0,1,1,1,0,1,0,0,1,1,1,0,0,1,1,1,0,1,0,1,1,0,0,0,1,1,1,1,0,0,1]) == 8\", \"assert minExchange([0,0...
{ "split": "train", "index": 62616, "acecode_id": "evol_11147", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a dictionary of names with their respective frequencies and returns the name with the minimum frequency. If there are multiple names with the same minimum frequency, return the name that comes first alphabetically. For example, given the input {'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_frequency_name({'Jon': 3, 'Arya': 1, 'Tyrion': 1, 'Cersei': 1}) == 'Arya'\", \"assert min_frequency_name({'Alice': 2, 'Bob': 2, 'Charlie': 1}) == 'Charlie'\", \"assert min_frequency_name({'Zoe': 1, 'Liam': 1, 'Noah': 2}) == 'Liam'\", \"assert min_frequen...
{ "split": "train", "index": 62617, "acecode_id": "evol_34834", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `softmax` that takes a list of numerical scores and returns a list of probabilities after applying the softmax function. The function should handle numerical stability by subtracting the maximum score from each score before applying the exponential function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert softmax([0.0, 0.0, 0.0]) == [0.3333333333333333, 0.3333333333333333, 0.3333333333333333]\", \"assert softmax([10.0, 10.0, 10.0]) == [0.3333333333333333, 0.3333333333333333, 0.3333333333333333]\", \"assert softmax([1.0, 1000.0, 1.0]) == [0.0, 1.0, 0.0]\", \"a...
{ "split": "train", "index": 62618, "acecode_id": "evol_2301", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a string `title` that represents the title of a media item (like a song or a video). Your task is to determine if the title is a valid URL or a search term. A valid URL should match a specific regex pattern (for simplicity, assume a basic pattern for this problem)...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_media_title('https://www.example.com') == 'Valid URL'\", \"assert validate_media_title('http://example.com/video') == 'Valid URL'\", \"assert validate_media_title('My Favorite Song') == 'Search Term'\", \"assert validate_media_title('A Great Video')...
{ "split": "train", "index": 62619, "acecode_id": "bigcode_python_fns_37358", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given string is a valid 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 should...
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('Was it a car or a cat I saw?') == True\", \"assert is_palindrome('Hello, W...
{ "split": "train", "index": 62620, "acecode_id": "bigcode_python_fns_26972", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates stopping a specified process by its name from a list of running processes. The function should take a list of process names and a target process name to stop. If the target process name is found in the list, the functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert stop_process(['ser2sock', 'python', 'bash'], 'ser2sock') == 'Process ser2sock stopped.'\", \"assert stop_process(['node', 'docker', 'nginx'], 'ser2sock') == 'Process ser2sock not found.'\", \"assert stop_process(['ser2sock', 'ser2sock', 'python'], 'ser2sock'...
{ "split": "train", "index": 62621, "acecode_id": "bigcode_python_fns_39067", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a duration in seconds, implement a function `getCountdown(seconds: int) -> Tuple[int, int, int, int]` that converts this duration into a human-readable format representing days, hours, minutes, and seconds. The function should return a tuple containing the number of days,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert getCountdown(0) == (0, 0, 0, 0)\", \"assert getCountdown(1) == (0, 0, 0, 1)\", \"assert getCountdown(59) == (0, 0, 0, 59)\", \"assert getCountdown(60) == (0, 0, 1, 0)\", \"assert getCountdown(3600) == (0, 1, 0, 0)\", \"assert getCountdown(86400) == (1, 0, 0,...
{ "split": "train", "index": 62622, "acecode_id": "bigcode_python_fns_30466", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the prices of items in a store. Write a function `get_max_profit(prices: List[int]) -> int` that calculates the maximum profit you can achieve by buying and selling one item. You can only complete one transaction, meaning you must b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_max_profit([7, 1, 5, 3, 6, 4]) == 5\", \"assert get_max_profit([7, 6, 4, 3, 1]) == 0\", \"assert get_max_profit([1, 2]) == 1\", \"assert get_max_profit([2, 1]) == 0\", \"assert get_max_profit([3, 2, 6, 5, 0, 3]) == 4\", \"assert get_max_profit([]) == 0\"...
{ "split": "train", "index": 62623, "acecode_id": "bigcode_python_fns_11876", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D list of integers representing a matrix. Write a function `matrix_properties(matrix: List[List[int]]) -> Tuple[Tuple[int, int], int]` that returns a tuple containing two elements: the first element is a tuple with the number of rows and the number of columns i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert matrix_properties([[1, 2], [3, 4]]) == ((2, 2), 2)\", \"assert matrix_properties([[1], [2], [3]]) == ((3, 1), 2)\", \"assert matrix_properties([[1, 2, 3]]) == ((1, 3), 2)\", \"assert matrix_properties([[1, 2], [3, 4], [5, 6]]) == ((3, 2), 2)\", \"assert matr...
{ "split": "train", "index": 62624, "acecode_id": "oss_10752", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that logs filesystem events. Given a tuple `event_id_status_message`, which contains three elements: an integer `event_id`, a string `status`, and a string `message`, your function should return a tuple containing the `event_id` and the `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_event((1, 'success', 'File created')) == (1, 'success')\", \"assert log_event((2, 'error', 'File not found')) == (2, 'error')\", \"assert log_event((3, 'warning', 'Disk space low')) == (3, 'warning')\", \"assert log_event((4, 'info', 'File copied success...
{ "split": "train", "index": 62625, "acecode_id": "bigcode_python_fns_32651", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a binary search algorithm in Python that supports searching for an integer in a dynamic array. The dynamic array should be able to handle duplicates effectively. When searching for an integer, the function should return the count of that integer in the array. If the i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_count([1, 2, 3, 2, 1], 2) == 2\", \"assert search_count([4, 5, 6, 4, 5, 4], 4) == 3\", \"assert search_count([1, 1, 1, 1, 1], 1) == 5\", \"assert search_count([], 3) == 0\", \"assert search_count([7, 8, 9, 10, 7], 10) == 1\", \"assert search_count([1,...
{ "split": "train", "index": 62626, "acecode_id": "evol_1831", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function that takes a list of food items and returns a list of unique food items that have been added to the user's daily intake. The input will be a list of strings where each string represents a food item. Your function should filter out dupli...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_food_items(['apple', 'banana', 'apple', 'orange']) == ['apple', 'banana', 'orange']\", \"assert get_unique_food_items(['egg', 'egg', 'egg']) == ['egg']\", \"assert get_unique_food_items([]) == []\", \"assert get_unique_food_items(['carrot', 'beet'...
{ "split": "train", "index": 62627, "acecode_id": "bigcode_python_fns_36008", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a quaternion represented as a list of four elements [x, y, z, w], write a function `yaw_from_quaternion(quat: List[float]) -> float` that calculates the yaw (rotation around the Z-axis) in radians. The quaternion is defined as follows: q = [x, y, z, w]. The yaw can be cal...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(yaw_from_quaternion([0, 0, 0, 1]) - 0) < 1e-6\", \"assert abs(yaw_from_quaternion([0, 1, 0, 0]) - 3.141593) < 1e-6\", \"assert abs(yaw_from_quaternion([1, 0, 0, 0]) - 0) < 1e-6\", \"assert abs(yaw_from_quaternion([0.7071068, 0, 0, 0.7071068]) - 0) < 1e-6...
{ "split": "train", "index": 62628, "acecode_id": "bigcode_python_fns_42012", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages a list of persons represented as a list of dictionaries. Each dictionary contains the details of a person, including their 'name' and 'age'. Your function should perform the following operations based on the given command: 'l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_persons([], 'list') == []\", \"assert manage_persons([], 'create', {'name': 'Alice', 'age': 30}) == [{'name': 'Alice', 'age': 30}]\", \"assert manage_persons([{'name': 'Alice', 'age': 30}, {'name': 'Bob', 'age': 25}], 'sort') == [{'name': 'Bob', 'age'...
{ "split": "train", "index": 62629, "acecode_id": "oss_22257", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a log line represented as a string and an expected exact match string. Your task is to implement a function that checks if the expected string appears as an exact match in the log line. An exact match means that the expected string should not be part of another wo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_exact_match('66118.999958 - INFO - [MainThread] - ly_test_tools.o3de.asset_processor - foo', 'foo') == 'foo'\", \"assert check_exact_match('9189.9998188 - INFO - [MainThread] - example.tests.test_system_example - Log Monitoring test 1', 'Log Monitoring...
{ "split": "train", "index": 62630, "acecode_id": "bigcode_python_fns_34431", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of elements, write a function `same_datatypes(lst)` that checks if all elements in the list are of the same data type. If the elements are complex types such as lists or dictionaries, the function should also ensure that their structures are consistent. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert same_datatypes([1, 2, 3]) == True\", \"assert same_datatypes([1.0, 2.5, 3.1]) == True\", \"assert same_datatypes(['a', 'b', 'c']) == True\", \"assert same_datatypes([[1, 2], [3, 4]]) == True\", \"assert same_datatypes([[1, 2], [3, '4']]) == False\", \"assert...
{ "split": "train", "index": 62631, "acecode_id": "bigcode_python_fns_18240", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `validate_bet(player_bet: str, valid_exit_commands: List[str]) -> bool` that checks if a player's bet is valid. The function should return `False` if the player wants to exit the game (if `player_bet` matches any command in `valid_exit_co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_bet('exit', ['exit', 'quit', 'leave']) == False\", \"assert validate_bet('quit', ['exit', 'quit', 'leave']) == False\", \"assert validate_bet('leave', ['exit', 'quit', 'leave']) == False\", \"assert validate_bet('100', ['exit', 'quit', 'leave']) == ...
{ "split": "train", "index": 62632, "acecode_id": "oss_36717", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a user is authorized to perform a specified operation (either 'read' or 'write') on a repository within an organization. The function should take the organization name, repository name, user name, and operation as input...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_authorization('organization1', 'repository1', 'user1', 'read') == True\", \"assert check_authorization('organization1', 'repository1', 'user2', 'read') == True\", \"assert check_authorization('organization1', 'repository1', 'user1', 'write') == True\",...
{ "split": "train", "index": 62633, "acecode_id": "oss_27133", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two 3D positions, `pos_In` and `pos_As`, represented as tuples of three floats each, implement a function `compare_orbitals(pos_In: Tuple[float, float, float], pos_As: Tuple[float, float, float]) -> bool` that compares the symmetry of the orbitals generated from these pos...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_orbitals((1.0, 1.0, 1.0), (1.25, 1.25, 1.25)) == False\", \"assert compare_orbitals((0.5, 0.5, 0.5), (0.75, 0.75, 0.75)) == False\", \"assert compare_orbitals((1, 0, 0), (0, 1, 0)) == False\", \"assert compare_orbitals((0.25, 0.25, 0.25), (0.5, 0.5, ...
{ "split": "train", "index": 62634, "acecode_id": "bigcode_python_fns_35503", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a Python function `convert_text_code(text_or_code: str) -> str` that takes a string `text_or_code` as input and performs a conversion between text and code. The function should operate as follows: If the input is a valid text (consisting only of alphabetic characters)...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_text_code('Hello') != 'Invalid input'\", \"assert convert_text_code('1234') == 'Invalid input'\", \"assert convert_text_code('') == 'Invalid input'\", \"assert convert_text_code('HelloWorld') != 'Invalid input'\", \"assert convert_text_code('!@#') ==...
{ "split": "train", "index": 62635, "acecode_id": "oss_636", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function `validate_ean13(ean: str) -> bool` that takes a 13-digit EAN (European Article Number) as a string and returns True if the EAN is valid according to the checksum algorithm, and False otherwise. The checksum is calculated by summing the digits in odd positio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_ean13('9780201310054') == True\", \"assert validate_ean13('1234567890123') == False\", \"assert validate_ean13('9780201310053') == False\", \"assert validate_ean13('9780201310052') == False\", \"assert validate_ean13('9780201310051') == False\", \"a...
{ "split": "train", "index": 62636, "acecode_id": "evol_9186", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function `square(num)` that takes a single argument `num` and returns the square of `num`. If `num` is of an unexpected type (such as a string or None), the function should raise a `ValueError` with the message 'Invalid input type'.\nPlease reason step by step, then...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert square(4) == 16\", \"assert square(0) == 0\", \"assert square(-3) == 9\", \"assert square(2.5) == 6.25\", \"assert square(1) == 1\", \"assert square(-1) == 1\", \"assert square(100) == 10000\", \"assert square(-100) == 10000\", \"assert square(10**6) == 1000...
{ "split": "train", "index": 62637, "acecode_id": "evol_24646", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function `least_frequent_word(text: str) -> str` that takes a string `text` as input and returns the least frequently occurring word in the text. The function should ignore stop words, one-letter words, and non-English words. If there are multiple least frequently occur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert least_frequent_word('The cat sat on the mat') == 'cat'\", \"assert least_frequent_word('Hello world world hello') == 'hello'\", \"assert least_frequent_word('Python is great and python is also fun') == 'great'\", \"assert least_frequent_word('The sun shines ...
{ "split": "train", "index": 62638, "acecode_id": "evol_28547", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a packet matching algorithm for a network communication system. The system receives packets and attempts to match them with known link configurations. Your task is to implement a function that checks if a received packet matches any known link c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_packet_matched([{'dest_panid': 1, 'source': {'get_long_address': lambda: 'abc'}, 'destination': {'get_long_address': lambda: 'def'}}], {'dest_panid': 1, 'fcf_srcaddrmode': 3, 'src_addr': 'abc', 'dest_addr': 'def'}) == True\", \"assert is_packet_matched([{...
{ "split": "train", "index": 62639, "acecode_id": "oss_6884", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given an M-by-N matrix of integers, implement a function that returns a new matrix where each element is replaced by the number of non-NaN values in its corresponding row and column combined. If a cell contains NaN, it should not be counted in the respective row and column tota...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_non_nan([[None, None, None], [None, None, None]]) == [[0, 0, 0], [0, 0, 0]]\", \"assert count_non_nan([[None]]) == [[0]]\", \"assert count_non_nan([[5, None, None], [None, 10, None], [None, None, None]]) == [[1, 0, 0], [0, 1, 0], [0, 0, 0]]\", \"assert...
{ "split": "train", "index": 62640, "acecode_id": "bigcode_python_fns_47998", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that restores a configuration file to its original state based on its path. The function should take a single argument, `config_file`, which is an object with a property `path`. If the path of the `config_file` is equal to a predefined con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reset_config_file(MockConfigFile('path/to/config')) == 'Configuration file has been restored to its original state.'\", \"assert reset_config_file(MockConfigFile('STB_INTERNAL_CONFIG_FILE')) == \\\"You're using the internal configuration file, can't reset.\\...
{ "split": "train", "index": 62641, "acecode_id": "bigcode_python_fns_43541", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function that segregates prime numbers, composite numbers, and perfect numbers from a given list of integers. The function should return a tuple containing three lists: the first list of prime numbers, the second list of composite numbers, and the third list of perfect...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert segregate_num([0, -1, -2, -3, -4]) == ([], [], [])\", \"assert segregate_num([15, 21, 35, 49]) == ([], [15, 21, 35, 49], [])\", \"assert segregate_num([37, 41, 43, 44]) == ([37, 41, 43], [44], [])\", \"assert segregate_num([22, 24, 25, 27]) == ([], [22, 24, ...
{ "split": "train", "index": 62642, "acecode_id": "evol_12232", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `get_primes_up_to(n: int) -> List[int]` that takes an integer n as input and returns a list of all prime numbers up to n in ascending order. The function should first validate that n is an integer and lies within the range of 2 to 1,000,000. If the input do...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_primes_up_to(10) == [2, 3, 5, 7]\", \"assert get_primes_up_to(20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert get_primes_up_to(2) == [2]\", \"assert get_primes_up_to(3) == [2, 3]\", \"assert get_primes_up_to(100) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 3...
{ "split": "train", "index": 62643, "acecode_id": "evol_10536", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of binary keys represented as byte strings. Your task is to implement a function `find_max_path_value(keys)` that takes a list of binary keys and returns the maximum integer path value obtained by converting each binary key to an integer using the conversio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_path_value([b'\\\\x00', b'\\\\x01', b'\\\\x10']) == 16\", \"assert find_max_path_value([b'\\\\x00', b'\\\\x02', b'\\\\x05']) == 5\", \"assert find_max_path_value([b'\\\\x1A', b'\\\\x0F', b'\\\\x03']) == 26\", \"assert find_max_path_value([b'\\\\x80'...
{ "split": "train", "index": 62644, "acecode_id": "oss_27534", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples representing Kohn-Sham orbitals, where each tuple contains three integers: (kpoint, spin, band). Your task is to process these orbitals and return a list of modified tuples where for each input tuple, you need to increment each element of the tupl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert increment_orbitals([(1, 0, 2), (0, 1, 3)]) == [(2, 1, 3), (1, 2, 4)]\", \"assert increment_orbitals([(0, 0, 0)]) == [(1, 1, 1)]\", \"assert increment_orbitals([(2, 2, 2)]) == [(3, 3, 3)]\", \"assert increment_orbitals([(3, 1, 4), (2, 0, 1)]) == [(4, 2, 5), (...
{ "split": "train", "index": 62645, "acecode_id": "bigcode_python_fns_36717", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer 'limit', write a function `even_fibonacci_sum(limit)` that calculates the sum of all even Fibonacci numbers less than or equal to 'limit'. The Fibonacci sequence starts with 0 and 1, and each subsequent number is the sum of the two preceding ones. Your ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert even_fibonacci_sum(0) == 0\", \"assert even_fibonacci_sum(1) == 0\", \"assert even_fibonacci_sum(2) == 2\", \"assert even_fibonacci_sum(3) == 2\", \"assert even_fibonacci_sum(4) == 2\", \"assert even_fibonacci_sum(5) == 2\", \"assert even_fibonacci_sum(6) ==...
{ "split": "train", "index": 62646, "acecode_id": "oss_23235", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that finds the maximum numerical value in a given array. The array can contain mixed data types, including integers, floats, and strings. The function should return the maximum numerical value found in the array. If the array contains only strings or no num...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_value([1, 2, '10', -3, 'abc', 15]) == 15\", \"assert max_value(['hello', 'world', 'python']) == 'No numerical values found.'\", \"assert max_value([3.5, 2.1, 'abc', 5.0]) == 5.0\", \"assert max_value([None, 'text', 12, '7']) == 12\", \"assert max_value([...
{ "split": "train", "index": 62647, "acecode_id": "evol_36113", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python script that imports specific functions from a module within a package and all functions from another module within the same package. Given a package structure with a directory named `project` that contains three files: `__init__.py`, `map.p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert import_functions() == 'from project.map import get_map\\\\nfrom project.util import *'\", \"assert import_functions() == 'from project.map import get_map\\\\nfrom project.util import *'\", \"assert import_functions() == 'from project.map import get_map\\\\nf...
{ "split": "train", "index": 62648, "acecode_id": "oss_5459", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a job execution function that takes a list of jobs and their corresponding durations as input and returns a list of dictionaries containing the job names and their respective completion times. The input is a list of tuples, where each tuple cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert job_execution([('Task1', 1)]) == [{'Job': 'Task1', 'CompletionTime': 1}]\", \"assert job_execution([]) == []\", \"assert job_execution([('Job3', 15)]) == [{'Job': 'Job3', 'CompletionTime': 15}]\", \"assert job_execution([('Job1', 3)]) == [{'Job': 'Job1', 'Co...
{ "split": "train", "index": 62649, "acecode_id": "oss_19640", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the minimum values of different segments in a sequence. Your task is to write a function to merge these segments and return a new list of non-overlapping segments. Each segment is defined by its minimum value, and if two segments ov...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_segments([1, 3, 5, 7, 9]) == [1, 3, 5, 7, 9]\", \"assert merge_segments([5, 1, 3, 7, 2]) == [1, 3, 5, 7]\", \"assert merge_segments([10, 20, 15, 25]) == [10, 15, 20, 25]\", \"assert merge_segments([5, 10, 5, 15, 10]) == [5, 10, 15]\", \"assert merge_se...
{ "split": "train", "index": 62650, "acecode_id": "oss_30621", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a 2D list of integers where each sublist represents a sequence of integer codes, implement a function that converts each sequence into a readable string. Each integer in the sequence corresponds to a character in the ASCII table, where 0-127 represent standard ASCII chara...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dense_to_text([[72, 101, 108, 108, 111], [87, 111, 114, 108, 100]]) == (['Hello', 'World'], [['Hello', [72, 101, 108, 108, 111]], ['World', [87, 111, 114, 108, 100]]])\", \"assert dense_to_text([[65, 66, 67]]) == (['ABC'], [['ABC', [65, 66, 67]]])\", \"asser...
{ "split": "train", "index": 62651, "acecode_id": "bigcode_python_fns_9593", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given two strings, str1 and str2, write a function that finds the longest common substring between them. A substring is defined as a contiguous sequence of characters within a string. Your function should return the longest common substring. If there are multiple longest common...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_common_substring('abc', 'abc') == 'abc'\", \"assert longest_common_substring('abcdef', 'zabcf') == 'abc'\", \"assert longest_common_substring('xyz', 'abc') == ''\", \"assert longest_common_substring('', 'abc') == ''\", \"assert longest_common_substri...
{ "split": "train", "index": 62652, "acecode_id": "evol_790", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of account balances represented as dictionaries, where each dictionary contains two keys: 'currency' (a string representing the type of coin) and 'balance' (a float representing the amount of that coin). Write a function `get_coin_total(accounts: List[Dict[...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_coin_total([{'currency': 'BTC', 'balance': 1.5}, {'currency': 'ETH', 'balance': 3.0}], 'BTC') == 1.5\", \"assert get_coin_total([{'currency': 'BTC', 'balance': 1.5}, {'currency': 'ETH', 'balance': 3.0}], 'ETH') == 3.0\", \"assert get_coin_total([{'curren...
{ "split": "train", "index": 62653, "acecode_id": "bigcode_python_fns_35245", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with identifying files that meet specific criteria in a given list of file names. Write a function `find_valid_files(file_list: List[str]) -> List[str]` that takes a list of file names as input and returns a list of valid files. A file is considered valid if it h...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_valid_files(['test', 'test.asc', 'test.txt']) == ['test', 'test.asc']\", \"assert find_valid_files(['sample', 'sample.txt', 'sample.asc']) == ['sample', 'sample.asc']\", \"assert find_valid_files(['data', 'data.asc', 'data1', 'data2.asc']) == ['data', '...
{ "split": "train", "index": 62654, "acecode_id": "bigcode_python_fns_1920", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with processing friend requests in a social media platform. You need to implement a function `process_friend_request(request: dict) -> Optional[dict]` that takes a dictionary representing a friend request, processes it, and returns the same dictionary if the requ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_friend_request({'user_id': '123', 'action': 'accept'}) == {'user_id': '123', 'action': 'accept'}\", \"assert process_friend_request({'user_id': '456', 'action': 'decline'}) == {'user_id': '456', 'action': 'decline'}\", \"assert process_friend_request...
{ "split": "train", "index": 62655, "acecode_id": "oss_24660", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `navigate_boat` that takes three parameters: `speed` (a positive float representing the speed of the boat in km/h), `direction` (a string that can be 'north', 'south', 'east', or 'west'), and `distance` (a positive float representing the distance to ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert navigate_boat(10.0, 'north', 5.0) == [0.0, 50.0]\", \"assert navigate_boat(10.0, 'south', 5.0) == [0.0, -50.0]\", \"assert navigate_boat(10.0, 'east', 5.0) == [50.0, 0.0]\", \"assert navigate_boat(10.0, 'west', 5.0) == [-50.0, 0.0]\", \"assert navigate_boat(...
{ "split": "train", "index": 62656, "acecode_id": "evol_31460", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of acronyms and an optional list of tags, implement a function that filters the acronyms based on the provided tags. If the tags list is empty, return all acronyms. The function should return the filtered list of acronyms. Each acronym is a string consisting of upp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_acronyms(['NASA', 'FBI', 'CIA'], []) == ['NASA', 'FBI', 'CIA']\", \"assert filter_acronyms(['NASA', 'FBI', 'CIA'], ['N']) == ['NASA']\", \"assert filter_acronyms(['NASA', 'FBI', 'CIA'], ['F']) == ['FBI']\", \"assert filter_acronyms(['NASA', 'FBI', 'CI...
{ "split": "train", "index": 62657, "acecode_id": "bigcode_python_fns_32068", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a data structure representing a tree where each node has a type and may have child nodes. Each node can be accessed through a series of field paths, which can be either integers (for child nodes) or strings (for field names). You need to implement a function that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert field_path_get_type({'type': 'root', 'fields': {'field1': {'type': 'bool'}}}, ['fields', 'field1']) == 'bool'\", \"assert field_path_get_type({'type': 'root', 'fields': {'field1': {'type': 'bool'}, 'field2': {'type': 'float'}}}, ['fields', 'field2']) == 'flo...
{ "split": "train", "index": 62658, "acecode_id": "bigcode_python_fns_18691", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Create a function called 'createMatrix' that generates a square matrix of dimension nxn with sequential elements proceeding in a row-major sequence commencing from 1 to n squared. The function should validate the input to ensure it is an integer and falls within the range of 1 ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert createMatrix(1) == [[1]]\", \"assert createMatrix(2) == [[1, 2], [3, 4]]\", \"assert createMatrix(3) == [[1, 2, 3], [4, 5, 6], [7, 8, 9]]\", \"assert createMatrix(4) == [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]]\", \"assert createMatrix(...
{ "split": "train", "index": 62659, "acecode_id": "evol_392", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a user authentication system for a web application. Your goal is to create a function that simulates the logout process by clearing the user's session and returning a string that indicates the user has been logged out. Write a Python function `l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert logout_user() == 'User logged out'\", \"assert logout_user() == 'User logged out'\", \"assert logout_user() == 'User logged out'\", \"assert logout_user() == 'User logged out'\", \"assert logout_user() == 'User logged out'\", \"assert logout_user() == 'User ...
{ "split": "train", "index": 62660, "acecode_id": "oss_23165", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_class(name: str, attributes: dict) -> type` that takes a class name as a string and a dictionary of attributes. The function should return a new class with the specified name and attributes. The attributes dictionary will have string keys representi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_class('Person', {'name': 'Alice', 'age': 30})().name == 'Alice'\", \"assert create_class('Car', {'model': 'Tesla', 'year': 2020})().model == 'Tesla'\", \"assert create_class('Animal', {'species': 'Dog', 'color': 'Brown'})().species == 'Dog'\", \"asser...
{ "split": "train", "index": 62661, "acecode_id": "evol_31911", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a dictionary representing configuration for axis formatters for a graph. The function should validate the input dictionary and return a list of supported formatter names based on the provided configuration. The input dictionary...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_supported_formatters({'x': {'major': {'name': 'FormatStrFormatter'}}}) == [('x', 'major', 'FormatStrFormatter')]\", \"assert get_supported_formatters({'y': {'minor': {'name': 'PercentFormatter'}}}) == [('y', 'minor', 'PercentFormatter')]\", \"assert get_...
{ "split": "train", "index": 62662, "acecode_id": "bigcode_python_fns_39761", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of strings, write a function that returns the count of occurrences of a specified substring within those strings. The function should take two parameters: a list of strings 'data' and a string 'substring'. The function should return an integer representing the tota...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_substring(['hello', 'world', 'hello'], 'hello') == 2\", \"assert count_substring(['apple', 'apricot', 'banana'], 'ap') == 2\", \"assert count_substring(['test', 'testing', 'tester'], 'test') == 3\", \"assert count_substring(['abc', 'def', 'ghi'], 'xyz'...
{ "split": "train", "index": 62663, "acecode_id": "bigcode_python_fns_45545", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `gcd(a: int, b: int) -> int` that takes two integers as input and returns the greatest common divisor (GCD) of those integers. The GCD is the largest positive integer that divides both numbers without leaving a remainder.\nPlease reason step by step, then w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert gcd(48, 18) == 6\", \"assert gcd(56, 98) == 14\", \"assert gcd(101, 10) == 1\", \"assert gcd(0, 5) == 5\", \"assert gcd(5, 0) == 5\", \"assert gcd(0, 0) == 0\", \"assert gcd(17, 17) == 17\", \"assert gcd(12, 15) == 3\", \"assert gcd(100, 25) == 25\", \"asser...
{ "split": "train", "index": 62664, "acecode_id": "evol_3250", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of definitions that specify conditions under which certain variables should be assigned a value. Each definition consists of a 'name' and a list of 'matching' conditions. Your task is to implement a function `get_matching_values(match_definitions: List[Dict...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_matching_values([{'name': 'C', 'matching': [2]}], 3) == [None, None, 'C']\", \"assert get_matching_values([{'name': 'J', 'matching': [0]}], 1) == ['J']\", \"assert get_matching_values([{'name': 'K', 'matching': ['x <= 5', 'x == 4']}], 3) == ['K', 'K', 'K...
{ "split": "train", "index": 62665, "acecode_id": "bigcode_python_fns_20923", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `fetch_lol_players(region: str, pseudonym: str) -> List[str]` that retrieves a list of League of Legends players based on the specified region and player pseudonym. The function should take two input parameters: `region`, a string represe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fetch_lol_players('NA1', 'NonExistentPlayer') == []\", \"assert fetch_lol_players('EUW1', 'PlayerThree') == []\", \"assert fetch_lol_players('NA1', 'PlayerWithSpecialChars!') == []\", \"assert fetch_lol_players('NA2', 'PlayerOne') == []\", \"assert fetch_lol...
{ "split": "train", "index": 62666, "acecode_id": "oss_23139", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple environment using a state-based approach. The environment will be represented by a state variable of a generic type. Your task is to implement a function `simulate_environment(initial_state: Any, updates: List[Any]...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_environment(0, [1, 2, 3]) == 3\", \"assert simulate_environment('initial', ['update1', 'update2']) == 'update2'\", \"assert simulate_environment([], [1, 2, 3]) == 3\", \"assert simulate_environment('start', []) == 'start'\", \"assert simulate_enviro...
{ "split": "train", "index": 62667, "acecode_id": "oss_33780", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes in three parameters: `context`, `name`, and `action_term`. The `context` parameter is a string representing the context of the event, the `name` parameter is a string representing the name of the event, and the `action_term` pa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_event('Finance', 'Loan Approval', 'Approve') == {'context': 'Finance', 'name': 'Loan Approval', 'action_term': 'Approve'}\", \"assert create_event('Healthcare', 'Patient Registration', 'Register') == {'context': 'Healthcare', 'name': 'Patient Registra...
{ "split": "train", "index": 62668, "acecode_id": "oss_12229", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `generate_maze(width: int, height: int) -> List[List[str]]` that generates a random maze represented as a 2D list, where walls are represented by '#' and paths are represented by ' '. The maze should have a border of walls and include at least one path from...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_maze(3, 3)[2] == ['#', ' ', '#']\", \"assert all(len(row) == 10 for row in generate_maze(10, 10))\", \"assert generate_maze(5, 5)[1][1] == ' '\", \"assert generate_maze(5, 5)[3][3] == ' '\", \"assert generate_maze(9, 5)[-1][-1] == '#'\", \"assert ge...
{ "split": "train", "index": 62669, "acecode_id": "evol_8907", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function that returns the least common multiple of three positive integers x, y, and z. If any of the inputs are not positive integers, return the string 'Input should be positive integers.'\nPlease reason step by step, then write a self-contained Python solution. G...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert least_common_multiple(3, 5, 2) == 30\", \"assert least_common_multiple(4, 6, 8) == 24\", \"assert least_common_multiple(1, 1, 1) == 1\", \"assert least_common_multiple(12, 15, 20) == 60\", \"assert least_common_multiple(7, 5, 3) == 105\", \"assert least_comm...
{ "split": "train", "index": 62670, "acecode_id": "evol_14210", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of game names and attempts to add them to a game collection. If a game name already exists in the collection, it should not be added, and the function should return a message indicating the error. Implement the function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_games(['Game A', 'Game B', 'Game A']) == ['Game successfully added', 'Game successfully added', 'Error: game name already exists']\", \"assert add_games(['Game C', 'Game D', 'Game C', 'Game E']) == ['Game successfully added', 'Game successfully added', '...
{ "split": "train", "index": 62671, "acecode_id": "bigcode_python_fns_44218", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that retrieves the five most recent live-stream video titles from a list of live streams. Each live stream is represented as a dictionary containing 'title' and 'started_at' as keys. The function should take a list of these dictionaries and return a list of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_recent_stream_titles([{'title': 'Stream A', 'started_at': '2023-10-01T12:00:00Z'}, {'title': 'Stream B', 'started_at': '2023-10-03T12:00:00Z'}, {'title': 'Stream C', 'started_at': '2023-10-02T12:00:00Z'}, {'title': 'Stream D', 'started_at': '2023-10-04T1...
{ "split": "train", "index": 62672, "acecode_id": "evol_16258", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of sensor names and their corresponding ids represented as a list of tuples `sensors`, where each tuple contains an integer `id` and a string `name`. You need to update the ids of the sensors by subtracting a given integer `offset` from each sensor's id. Re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_sensor_ids([(1, 'SensorA'), (2, 'SensorB')], 1) == [(0, 'SensorA'), (1, 'SensorB')]\", \"assert update_sensor_ids([(10, 'SensorC'), (20, 'SensorD')], 5) == [(5, 'SensorC'), (15, 'SensorD')]\", \"assert update_sensor_ids([(100, 'SensorE')], 100) == [(0...
{ "split": "train", "index": 62673, "acecode_id": "bigcode_python_fns_21815", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of movie ratings represented as floating-point numbers. Your task is to create a function that takes this list as input and returns the average rating of the movies. If the list is empty, return 0.0. Implement the function `calculate_average_rating(ratings:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_rating([5.0, 4.5, 3.8, 4.0, 4.9]) == 4.44\", \"assert calculate_average_rating([2.5, 3.0, 3.5]) == 3.0\", \"assert calculate_average_rating([4.8, 4.9, 5.0, 4.7, 4.6]) == 4.8\", \"assert calculate_average_rating([1.0]) == 1.0\", \"assert cal...
{ "split": "train", "index": 62674, "acecode_id": "oss_14587", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of audio file durations represented in seconds. Your task is to implement a function that sorts these durations in ascending order. The function should take a list of integers as input, where each integer represents the duration of an audio file in seconds,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_audio_durations([3, 1, 4, 1, 5]) == [1, 1, 3, 4, 5]\", \"assert sort_audio_durations([10, 2, 8, 6, 4]) == [2, 4, 6, 8, 10]\", \"assert sort_audio_durations([1]) == [1]\", \"assert sort_audio_durations([]) == []\", \"assert sort_audio_durations([5, 5, 5]...
{ "split": "train", "index": 62675, "acecode_id": "bigcode_python_fns_29117", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries where each dictionary represents a peak with the following keys: 'SpectrumFile', 'SequenceModi', 'Charge', 'PrecursorArea', and 'IonScore'. Your task is to remove redundant peaks by keeping only the peak with the highest 'IonScore' for each ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_redundant_peaks([{'SpectrumFile': 'file1', 'SequenceModi': 'mod1', 'Charge': 2, 'PrecursorArea': 100, 'IonScore': 50}, {'SpectrumFile': 'file1', 'SequenceModi': 'mod1', 'Charge': 2, 'PrecursorArea': 100, 'IonScore': 60}]) == [{'SpectrumFile': 'file1',...
{ "split": "train", "index": 62676, "acecode_id": "bigcode_python_fns_48713", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `product_of_complex_numbers(arr)` that calculates and returns the product of an array of complex numbers. The function should raise a `ValueError` if the input is not a non-empty list of complex numbers. Ensure that the function handles precision errors app...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert product_of_complex_numbers([1+2j, 3+4j]) == (-5+10j)\", \"assert product_of_complex_numbers([0+0j]) == 0j\", \"assert product_of_complex_numbers([1+2j, 0+0j, 2+2j]) == 0j\", \"assert product_of_complex_numbers([2+3j, 4+5j]) == (-7+22j)\", \"assert product_of...
{ "split": "train", "index": 62677, "acecode_id": "evol_31412", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a string representing data in YAML format. Implement a function that converts this YAML string into a Python dictionary. The function should handle cases where the input string is empty or not valid YAML, and return an empty dictionary in such cases. Your function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert yaml_to_dict('') == {}\", \"assert yaml_to_dict('key: value') == {'key': 'value'}\", \"assert yaml_to_dict('key1: value1\\\\nkey2: value2') == {'key1': 'value1', 'key2': 'value2'}\", \"assert yaml_to_dict('') == {}\", \"assert yaml_to_dict('invalid: yaml: st...
{ "split": "train", "index": 62678, "acecode_id": "bigcode_python_fns_17972", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `get_employee_department(employee_id: int, employees: List[Dict[str, Union[int, str]]]) -> Optional[str]` that retrieves the department name for a given employee ID from a list of employee records. Each employee record is represented as a dictionary with ke...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_employee_department(1, [{'id': 1, 'name': 'Alice', 'department_name': 'Engineering'}, {'id': 2, 'name': 'Bob', 'department_name': 'HR'}]) == 'Engineering'\", \"assert get_employee_department(2, [{'id': 1, 'name': 'Alice', 'department_name': 'Engineering'...
{ "split": "train", "index": 62679, "acecode_id": "evol_9663", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `lucas_sequence_reverse(n: int) -> List[int]` that returns the first `n` terms of the Lucas number sequence in reverse order. The Lucas sequence is defined as follows: L(0) = 2, L(1) = 1, and L(n) = L(n-1) + L(n-2) for n >= 2. The function should return the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lucas_sequence_reverse(1) == [2]\", \"assert lucas_sequence_reverse(2) == [1, 2]\", \"assert lucas_sequence_reverse(3) == [3, 1, 2]\", \"assert lucas_sequence_reverse(4) == [4, 3, 1, 2]\", \"assert lucas_sequence_reverse(5) == [7, 4, 3, 1, 2]\", \"assert luc...
{ "split": "train", "index": 62680, "acecode_id": "evol_12677", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves the name of a messaging application based on the input name provided. The function should take a single string parameter `name` and return it as the output. If the input is an empty string, the function should return 'Unnam...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_messaging_name('WhatsApp') == 'WhatsApp'\", \"assert get_messaging_name('Telegram') == 'Telegram'\", \"assert get_messaging_name('Signal') == 'Signal'\", \"assert get_messaging_name('Facebook Messenger') == 'Facebook Messenger'\", \"assert get_messaging_...
{ "split": "train", "index": 62681, "acecode_id": "oss_9642", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes two integers, low and high, and returns a list of all Fibonacci numbers that lie between low and high, inclusive. The Fibonacci sequence starts with 0 and 1, and each subsequent number is the sum of the two preceding ones. The function should handle ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci_between(1, 100) == [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]\", \"assert fibonacci_between(0, 10) == [0, 1, 1, 2, 3, 5, 8]\", \"assert fibonacci_between(10, 50) == [13, 21, 34]\", \"assert fibonacci_between(-10, 10) == [0, 1, 1, 2, 3, 5, 8]\", \"asser...
{ "split": "train", "index": 62682, "acecode_id": "evol_1250", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Create a function that takes in a list of dictionaries and a list of keys. The function should return a tuple of all the values associated with the keys in each dictionary. If a key is missing in a dictionary, add a value of 'N/A' for it. The function should be defined as follo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert values_with_keys([{'Country': 'USA', 'Capital': 'Washington D.C.', 'Currency': 'USD'}, {'Country': 'Canada', 'Capital': 'Ottawa'}], ['Country', 'Capital', 'Currency']) == (('USA', 'Washington D.C.', 'USD'), ('Canada', 'Ottawa', 'N/A'))\", \"assert values_wit...
{ "split": "train", "index": 62683, "acecode_id": "evol_18784", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing file names. Each file name consists of a base name and a file extension. Your task is to write a function that counts the number of files for each unique base name (ignoring the file extensions) and returns a dictionary where the key...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_file_bases(['file1.txt', 'file2.txt', 'file1.pdf', 'file3.txt', 'file2.pdf']) == {'file1': 2, 'file2': 2, 'file3': 1}\", \"assert count_file_bases(['doc1.docx', 'doc2.docx', 'doc1.doc', 'doc2.doc', 'doc3.txt']) == {'doc1': 2, 'doc2': 2, 'doc3': 1}\", \...
{ "split": "train", "index": 62684, "acecode_id": "bigcode_python_fns_9061", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `sqrtrange_python(n: int) -> List[int]` that generates a list of equally spaced integers from 0 to `n`, including the integer `n`. The spacing between the integers should be determined by the rounded value of the square root of `n + 2`. Your implementation ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sqrtrange_python(0) == [0]\", \"assert sqrtrange_python(2) == [0, 2]\", \"assert sqrtrange_python(4) == [0, 2, 4]\", \"assert sqrtrange_python(20) == [0, 5, 10, 15, 20]\", \"assert sqrtrange_python(25) == [0, 5, 10, 15, 20, 25]\", \"assert sqrtrange_python(1...
{ "split": "train", "index": 62685, "acecode_id": "oss_12959", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes another function as an argument and returns a new function. This new function, when called, should print the arguments it received and then return the result of the original function. The function signature should be: `def debu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert debug(lambda x: x)(5) == 5\", \"assert debug(lambda x, y: x + y)(3, 4) == 7\", \"assert debug(lambda a, b=1: a + b)(2) == 3\", \"assert debug(lambda *args: sum(args))(1, 2, 3, 4) == 10\", \"assert debug(lambda **kwargs: kwargs.get('key', 'default'))(key='val...
{ "split": "train", "index": 62686, "acecode_id": "bigcode_python_fns_268", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns a list of the sums of all adjacent pairs of integers in the list. However, if both integers in a pair are prime, that pair should not be included in the output list. Write a function named `pair_sum` that takes a list ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pair_sum([2, 3, 5, 7]) == []\", \"assert pair_sum([10, 12, 14, 16]) == [22, 26, 30]\", \"assert pair_sum([2, 4, 6, 8]) == [6, 10, 14]\", \"assert pair_sum([5, 7, 11, 13]) == []\", \"assert pair_sum([8, 10, 12, 14]) == [18, 22, 26]\", \"assert pair_sum([1, 1,...
{ "split": "train", "index": 62687, "acecode_id": "evol_12074", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a matrix of integers represented as a string, implement a function that identifies all the perfect squares in the matrix and returns their coordinates as a list of tuples (row, column). The input string is formatted with rows separated by semicolons and columns separated ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert perfect_square_coordinates('1, 2, 3; 4, 5, 6; 7, 8, 9') == [(0, 0), (1, 0), (2, 2)]\", \"assert perfect_square_coordinates('16, 25, 36; 49, 64, 81') == [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2)]\", \"assert perfect_square_coordinates('2, 3, 5; 7, 8, 10...
{ "split": "train", "index": 62688, "acecode_id": "evol_13080", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes the details of a product as input and returns a dictionary containing all the attributes of the product. The product details include the title, instructions, HTML-formatted instructions, short description, detailed description,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_product('Product 1', 'Use as directed.', '<p>Use as directed.</p>', 'Short desc 1', 'Detailed description 1.', 'https://example.com/image1.jpg', 'tag1', 50) == {'title': 'Product 1', 'instruction': 'Use as directed.', 'instruction_html': '<p>Use as di...
{ "split": "train", "index": 62689, "acecode_id": "oss_6600", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of migration operations, where each operation is represented by a dictionary containing 'model_name' and 'name' of the field being removed. Your task is to create a function `extract_removed_fields(operations)` that takes the list of migration operations as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_removed_fields([{'model_name': 'product', 'name': 'chooseColor'}, {'model_name': 'product', 'name': 'chooseSize'}, {'model_name': 'order', 'name': 'shippingAddress'}]) == {'product': ['chooseColor', 'chooseSize'], 'order': ['shippingAddress']}\", \"a...
{ "split": "train", "index": 62690, "acecode_id": "oss_26477", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing memory storage allocations. Your task is to implement a function that releases all memory allocations by returning the total amount of memory that was released. The function should accept a single parameter, a list of integers, and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert release_memory([]) == 0\", \"assert release_memory([10]) == 10\", \"assert release_memory([1, 2, 3]) == 6\", \"assert release_memory([5, 5, 5, 5]) == 20\", \"assert release_memory([0]) == 0\", \"assert release_memory([10, 20, 30]) == 60\", \"assert release_m...
{ "split": "train", "index": 62691, "acecode_id": "bigcode_python_fns_20790", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `bubble_sort` that takes a list of numeric values, which may include integers, floats, and complex numbers. The function should sort the list in ascending order using the Bubble Sort algorithm. For complex numbers, sort based on their absolute values...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bubble_sort([10, 5, 20, 3, 7, 6, 1, 15]) == [1, 3, 5, 6, 7, 10, 15, 20]\", \"assert bubble_sort([2+3j, 1+1j, 3+3j, 2+2j]) == [1+1j, 2+2j, 2+3j, 3+3j]\", \"assert bubble_sort([3.5, 2.1, 4.2, 1.0]) == [1.0, 2.1, 3.5, 4.2]\", \"assert bubble_sort([5, 3.5, 5.1, ...
{ "split": "train", "index": 62692, "acecode_id": "evol_17693", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of Python objects. Write a function `check_different_types` that takes this list as input and returns a boolean value indicating whether all the elements in the list are of different types. The function should take a single parameter: `input_list` (1 <= len...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_different_types([1, 'text', 3.14, {'key': 'value'}, [1, 2, 3]]) == True\", \"assert check_different_types([None, 5, 3.14, 'hello', True]) == True\", \"assert check_different_types([1, 1, 1]) == False\", \"assert check_different_types(['apple', 'banana'...
{ "split": "train", "index": 62693, "acecode_id": "oss_162", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simplified version of a resource management system in Python. The system should support adding resources and retrieving the available resources. Implement a function `manage_resources` that takes a list of operations and returns the current li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_resources([('add', 'products'), ('get', 'orders'), ('add', 'users'), ('get', 'users')]) == ['products', 'users']\", \"assert manage_resources([('get', 'non_existing')]) == []\", \"assert manage_resources([('add', 'articles'), ('add', 'articles'), ('ge...
{ "split": "train", "index": 62694, "acecode_id": "oss_20636", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple class that represents a file object with specific attributes. Implement a function `load_file_object(name: str, hash: str, date: str) -> dict` that simulates loading a file object and returns its attributes in a dictionary format. The funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_file_object('a', '123abc', '2023-10-01') == {'name': 'a', 'hash': '123abc', 'date': '2023-10-01'}\", \"assert load_file_object('b', '456def', '2023-10-02') == {'name': 'b', 'hash': '456def', 'date': '2023-10-02'}\", \"assert load_file_object('c', '789gh...
{ "split": "train", "index": 62695, "acecode_id": "bigcode_python_fns_48274", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that removes all duplicate elements from a list of complex data structures (like dictionaries or other lists) while maintaining the original order of the remaining elements. Elements that are not exactly the same but considered equal (e.g., dictionaries with di...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates([2, 'a', {'x': 1, 'y': 2}, 4, [5, 6], 2, 8, {'y': 2, 'x': 1}, 4, [5, 6], 8, 2]) == [2, 'a', {'x': 1, 'y': 2}, 4, [5, 6], 8]\", \"assert remove_duplicates([1, 2, 1, 2, 3]) == [1, 2, 3]\", \"assert remove_duplicates(['apple', 'banana', 'apple...
{ "split": "train", "index": 62696, "acecode_id": "evol_1828", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program that extracts the domain name from a given URL. The domain name is the sequence of characters between the first double forward slash ('//') and the next single forward slash ('/') or the end of the URL. Write a function `extract_domain(url...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_domain('http://www.example.com/index.html') == 'www.example.com'\", \"assert extract_domain('https://subdomain.example.org/path/to/resource') == 'subdomain.example.org'\", \"assert extract_domain('http://example.net') == 'example.net'\", \"assert ext...
{ "split": "train", "index": 62697, "acecode_id": "oss_28399", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that converts a given integer between 1 and 3999 into its corresponding Roman numeral representation. The function should handle standard integers as well as special cases where subtraction principles are applied, such as 4 and 9. Your function should take ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert int_to_roman(1) == 'I'\", \"assert int_to_roman(4) == 'IV'\", \"assert int_to_roman(9) == 'IX'\", \"assert int_to_roman(10) == 'X'\", \"assert int_to_roman(40) == 'XL'\", \"assert int_to_roman(50) == 'L'\", \"assert int_to_roman(90) == 'XC'\", \"assert int_t...
{ "split": "train", "index": 62698, "acecode_id": "evol_21243", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves the application ID from a given environment dictionary. The function should first check for the key 'APPLICATION_ID' in the provided dictionary. If it does not exist, it should look for the key 'GAE_APPLICATION'. If neither...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_application_id({'APPLICATION_ID': '12345'}) == '12345'\", \"assert get_application_id({'GAE_APPLICATION': '67890'}) == '67890'\", \"assert get_application_id({'APPLICATION_ID': '12345', 'GAE_APPLICATION': '67890'}) == '12345'\", \"assert get_application_...
{ "split": "train", "index": 62699, "acecode_id": "bigcode_python_fns_8990", "num_tests": 16 }