data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are given a list of file paths represented as strings. Each file path can contain multiple directories followed by the actual file name. Your task is to transform the list of file paths into a list of tuples, where each tuple contains the file name and a modified file path.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_file_paths(['dir1/dir2/file.txt', 'dir3/file2.txt']) == [('file.txt', 'dir1-dir2-file.txt'), ('file2.txt', 'dir3-file2.txt')]\", \"assert transform_file_paths(['folder1/notes.txt', 'folder2/folder3/report.pdf']) == [('notes.txt', 'folder1-notes.txt... | {
"split": "train",
"index": 64700,
"acecode_id": "bigcode_python_fns_8369",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with extracting sentences from a structured text representation. Given a list of strings, where each string represents a sentence, your goal is to return the list of sentences that contain the word 'Python'. Implement a function called `extract_python_sentences(s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_python_sentences(['I love programming in Python.', 'Java is also popular.', 'Python is versatile.']) == ['I love programming in Python.', 'Python is versatile.']\", \"assert extract_python_sentences(['This sentence does not mention it.', 'Another one... | {
"split": "train",
"index": 64701,
"acecode_id": "bigcode_python_fns_19604",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a queue with the ability to efficiently retrieve the maximum element in the current queue. Implement the function `max_queue_operations(operations: List[Tuple[str, int]]) -> List[Optional[int]]` where `operations` is a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_queue_operations([('enqueue', 5), ('enqueue', 3), ('enqueue', 8), ('get_max', 0)]) == [8]\", \"assert max_queue_operations([('enqueue', 10), ('enqueue', 10), ('get_max', 0), ('dequeue', 0), ('get_max', 0)]) == [10, 10]\", \"assert max_queue_operations([(... | {
"split": "train",
"index": 64702,
"acecode_id": "oss_27421",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of user data in JSON format, where each user is represented as a dictionary containing a unique 'user_id' and other user details. Write a function `load_users_from_list(users: List[Dict[str, Any]]) -> Dict[str, Dict[str, Any]]` that takes a list of user dic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_users_from_list([{'user_id': '1', 'name': 'Alice'}, {'user_id': '2', 'name': 'Bob'}, {'name': 'Charlie'}]) == {'1': {'user_id': '1', 'name': 'Alice'}, '2': {'user_id': '2', 'name': 'Bob'}}\", \"assert load_users_from_list([{'user_id': '3'}, {'user_id': ... | {
"split": "train",
"index": 64703,
"acecode_id": "bigcode_python_fns_32323",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples, where each tuple contains four elements: a key (string), a URL (string), a line (string), and the line number (integer). Your task is to create a function `canonical_url_cleaner(matches)` that returns a list of tuples with the same structure, but... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert canonical_url_cleaner([('key1', 'http://example.com', 'some line', 1)]) == [('key1', 'https://example.com', 'some line', 1)]\", \"assert canonical_url_cleaner([('key1', 'https://example.com', 'some line', 1)]) == [('key1', 'https://example.com', 'some line',... | {
"split": "train",
"index": 64704,
"acecode_id": "bigcode_python_fns_49127",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string `s` consisting of lowercase letters, write a function `longestPalindromeSubseq(s)` that returns the length of the longest palindromic subsequence in the given string. A palindromic subsequence is a sequence that reads the same forwards and backwards, but not nece... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longestPalindromeSubseq('bbbab') == 4\", \"assert longestPalindromeSubseq('cbbd') == 2\", \"assert longestPalindromeSubseq('a') == 1\", \"assert longestPalindromeSubseq('ab') == 1\", \"assert longestPalindromeSubseq('abcba') == 5\", \"assert longestPalindrom... | {
"split": "train",
"index": 64705,
"acecode_id": "oss_131",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the average number of contacts a person can handle in a day. Write a function `contacts_per_person()` that returns a constant integer value representing the average number of contacts per person per day. In this case, the average is known to be 3... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contacts_per_person() == 30\", \"assert contacts_per_person() == 30\", \"assert contacts_per_person() == 30\", \"assert contacts_per_person() == 30\", \"assert contacts_per_person() == 30\", \"assert contacts_per_person() == 30\", \"assert contacts_per_perso... | {
"split": "train",
"index": 64706,
"acecode_id": "bigcode_python_fns_10141",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary where each key is associated with a list of integers, implement a function that returns a new dictionary containing only the positive integers from the original lists, sorted in ascending order. Each key in the new dictionary should retain its associated list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_positive_and_sort_dict({'a': [-1, 2, -4], 'b': [5, 6]}) == {'a': [2], 'b': [5, 6]}\", \"assert get_positive_and_sort_dict({'x': [5, 3, -5, 2, -3, 3, 9, 123, 1, -10], 'y': [-1, 0, -3]}) == {'x': [1, 2, 3, 3, 5, 9, 123], 'y': []}\", \"assert get_positive_a... | {
"split": "train",
"index": 64707,
"acecode_id": "evol_966",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an unsorted list of integers, implement a function that sorts the list using the merge sort algorithm. The function should take a list of integers as input and return the sorted list. The input list can contain both positive and negative integers, and may also include dup... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sort([3, 1, 2]) == [1, 2, 3]\", \"assert merge_sort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert merge_sort([-1, -3, 2, 0, 5, -2]) == [-3, -2, -1, 0, 2, 5]\", \"assert merge_sort([]) == []\", \"assert merge_sort([1]) == [1]\", \"assert merge_sort([2... | {
"split": "train",
"index": 64708,
"acecode_id": "bigcode_python_fns_42592",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `calculate_even_product(n: int) -> int` that calculates the product of all even numbers from 2 to n (inclusive). If n is less than 2, return 1.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```pyth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_even_product(2) == 2\", \"assert calculate_even_product(4) == 8\", \"assert calculate_even_product(6) == 48\", \"assert calculate_even_product(10) == 3840\", \"assert calculate_even_product(12) == 46080\", \"assert calculate_even_product(15) == 645... | {
"split": "train",
"index": 64709,
"acecode_id": "evol_23732",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that filters out certain fields from a list of data records based on a provided configuration dictionary. This dictionary, named IGNORE, contains keys that represent different data types and lists of fields to be ignored for each type... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_ignored_fields({'history': ['uuid'], 'genome': []}, [{'type': 'history', 'uuid': '123', 'data': 'data1'}, {'type': 'genome', 'uuid': '456', 'data': 'data2'}]) == [{'type': 'history', 'data': 'data1'}, {'type': 'genome', 'uuid': '456', 'data': 'data2'}... | {
"split": "train",
"index": 64710,
"acecode_id": "oss_29850",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns the mode of the list, which is the element that appears most frequently. If there are multiple elements that appear with the same highest frequency, return the smallest one among them. Your function should handle an empty ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_mode([1, 2, 2, 3, 3]) == 2\", \"assert find_mode([1, 1, 2, 2, 3]) == 1\", \"assert find_mode([4, 5, 6, 4, 5, 5]) == 5\", \"assert find_mode([7]) == 7\", \"assert find_mode([]) == None\", \"assert find_mode([1, 2, 2, 3, 3, 1]) == 1\", \"assert find_mode(... | {
"split": "train",
"index": 64711,
"acecode_id": "bigcode_python_fns_30327",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `manage_operations(expressions: List[str]) -> List[str]` that simulates the creation of operations based on given expressions. Each expression is a string representing an operation. The function should create a `CreateOperation` for each ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_operations(['add', 'subtract']) == ['CreateOperation(add)', 'CreateOperation(subtract)']\", \"assert manage_operations(['multiply', 'divide']) == ['CreateOperation(multiply)', 'CreateOperation(divide)']\", \"assert manage_operations(['square', 'cube']... | {
"split": "train",
"index": 64712,
"acecode_id": "oss_2422",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks whether a derived component has an identifier. The derived component should not have an identifier, and if access to the identifier is attempted, it should raise a custom exception called NotSupportedByComponentError. Implemen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_identifier(MyDerivedComponent()) == True\", \"assert check_identifier(MyDerivedComponent()) == True\", \"assert check_identifier(MyDerivedComponent()) == True\", \"assert check_identifier(MyDerivedComponent()) == True\", \"assert check_identifier(MyDer... | {
"split": "train",
"index": 64713,
"acecode_id": "bigcode_python_fns_49597",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `top_three_numbers` that takes a list of integers and returns the top three numbers in descending order without using built-in sorting functions. You must implement your own sorting algorithm to determine the top three numbers. If there are fewer tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert top_three_numbers([33, 16, 2, 27, 45, 21, 5, 55]) == [55, 45, 33]\", \"assert top_three_numbers([1, 2]) == [2, 1]\", \"assert top_three_numbers([10]) == [10]\", \"assert top_three_numbers([]) == []\", \"assert top_three_numbers([5, 4, 3, 2, 1]) == [5, 4, 3]\... | {
"split": "train",
"index": 64714,
"acecode_id": "evol_7483",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of class labels representing the classes to which instances belong. Your task is to write a function that calculates the distribution of instances per class and returns the result as a dictionary. The function should be case-sensitive, meaning that 'A' and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_class_distribution(['A', 'B', 'A', 'C', 'B', 'A']) == {'A': 3, 'B': 2, 'C': 1}\", \"assert calculate_class_distribution(['X', 'Y', 'X', 'Y', 'Z']) == {'X': 2, 'Y': 2, 'Z': 1}\", \"assert calculate_class_distribution(['apple', 'banana', 'apple', 'or... | {
"split": "train",
"index": 64715,
"acecode_id": "oss_475",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns the sum of all even numbers in the list. If there are no even numbers, return 0. \n\nFunction signature: `def sum_of_even_numbers(nums: List[int]) -> int:` \n\n### Input \n- A single parameter `nums`, which is a list of in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_even_numbers([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_even_numbers([1, 3, 5]) == 0\", \"assert sum_of_even_numbers([2, 4, 6, 8]) == 20\", \"assert sum_of_even_numbers([-2, -4, -6]) == -12\", \"assert sum_of_even_numbers([0, 1, 2, 3]) == 2\", \"assert ... | {
"split": "train",
"index": 64716,
"acecode_id": "bigcode_python_fns_23246",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_credit_card(card_number: int) -> bool` that checks if a given credit card number is valid according to the Luhn algorithm. The function should return True if the card number is valid and False otherwise. The card number is provided as an integer. Ens... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_credit_card(4532015112830366) == True\", \"assert check_credit_card(6011514433546201) == True\", \"assert check_credit_card(340000000000009) == True\", \"assert check_credit_card(371449635398431) == True\", \"assert check_credit_card(4111111111111111) ... | {
"split": "train",
"index": 64717,
"acecode_id": "evol_9242",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes three parameters: a street address (string), a city (string), and a postal code (string). This function will create an address representation as a dictionary with keys 'street', 'city', and 'postal_code'. Your function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_address('123 Main St', 'New York', '10001') == {'street': '123 Main St', 'city': 'New York', 'postal_code': '10001'}\", \"assert create_address('456 Elm St', 'Los Angeles', '90001') == {'street': '456 Elm St', 'city': 'Los Angeles', 'postal_code': '90... | {
"split": "train",
"index": 64718,
"acecode_id": "oss_28327",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that applies a given operation to all the methods of a specified class. The function should take two arguments: a class `cls` and a function `fn`. It should iterate through all of the methods in the class and apply the function `fn` to ea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_function_to_members(MyClass, my_function) is None\", \"assert hasattr(MyClass, 'method1')\", \"assert hasattr(MyClass, 'method2')\", \"assert callable(MyClass.method1)\", \"assert callable(MyClass.method2)\"]}"
} | {
"split": "train",
"index": 64719,
"acecode_id": "bigcode_python_fns_45542",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `filter_cells` that filters a list of cells based on specified properties. Each cell is represented as a dictionary with various properties. The function takes in a list of `cells` and a dictionary `filter_properties`. Your task is to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_cells([{'id': 1, 'color': 'red', 'size': 'small'}, {'id': 2, 'color': 'blue', 'size': 'large'}], {'color': 'blue'}) == [{'id': 2, 'color': 'blue', 'size': 'large'}]\", \"assert filter_cells([{'id': 1, 'color': 'red', 'size': 'small'}, {'id': 2, 'color... | {
"split": "train",
"index": 64720,
"acecode_id": "oss_10896",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings where each string represents a line in a tab-separated values (TSV) format, implement a function that converts it into a plain text format by replacing the tab characters with a single space. The function should take a list of these strings as input and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_tsv_to_txt(['Name\\\\tAge\\\\tCountry', 'Alice\\\\t30\\\\tUSA', 'Bob\\\\t25\\\\tCanada']) == ['Name Age Country', 'Alice 30 USA', 'Bob 25 Canada']\", \"assert convert_tsv_to_txt(['Product\\\\tPrice\\\\tQuantity', 'Apple\\\\t1.2\\\\t10', 'Banana\\\\t0... | {
"split": "train",
"index": 64721,
"acecode_id": "bigcode_python_fns_43027",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a nested dictionary or a list of dictionaries, write a function `extract_value(param_name, data, index=0, fallback=None)` that retrieves the value associated with a given key (`param_name`). If the key doesn't exist, the function should return a specified fallback value. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_value('key1', {'key1': 'value1', 'key2': 'value2'}, 0, 'not found') == 'value1'\", \"assert extract_value('key3', {'key1': {'key3': 'value3'}}, 0, 'not found') == 'value3'\", \"assert extract_value('key3', {'key1': {'key2': 'value2'}}, 0, 'not found'... | {
"split": "train",
"index": 64722,
"acecode_id": "bigcode_python_fns_5232",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of lists of integers, write a function that flattens the list into a single list containing all the integers. The input will be a list where each element is also a list of integers. Your function should return a new list that contains all the integers from the inpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flat_list_of_lists([[1, 2], [3, 4]]) == [1, 2, 3, 4]\", \"assert flat_list_of_lists([[5], [6, 7], [8]]) == [5, 6, 7, 8]\", \"assert flat_list_of_lists([[], [1, 2], []]) == [1, 2]\", \"assert flat_list_of_lists([[1, 1], [2, 2], [3, 3]]) == [1, 1, 2, 2, 3, 3]\... | {
"split": "train",
"index": 64723,
"acecode_id": "bigcode_python_fns_22577",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to interpolate channel values in an image processing application. The function should take a dictionary `d` containing channel names as keys and corresponding channel values as values, along with a list of channel names `channels`. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert interpolate_channels({'R': 255, 'G': 0, 'B': 0}, ['R']) == [255]\", \"assert interpolate_channels({'R': 255, 'G': 0, 'B': 0}, ['G']) == [0]\", \"assert interpolate_channels({'R': 255, 'G': 0, 'B': 0}, ['B']) == [0]\", \"assert interpolate_channels({'R': 100,... | {
"split": "train",
"index": 64724,
"acecode_id": "oss_12599",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing daily stock prices, write a function that calculates the maximum profit you can achieve by buying and then selling the stock. You can only complete one transaction (i.e., buy one and sell one share of the stock). The function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_profit([7, 1, 5, 3, 6, 4]) == 5\", \"assert max_profit([7, 6, 4, 3, 1]) == 0\", \"assert max_profit([1, 2, 3, 4, 5]) == 4\", \"assert max_profit([5, 4, 3, 2, 1]) == 0\", \"assert max_profit([3, 2, 6, 5, 0, 3]) == 4\", \"assert max_profit([2, 1]) == 0\", ... | {
"split": "train",
"index": 64725,
"acecode_id": "bigcode_python_fns_7622",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a dictionary containing various configuration options for a software package. The dictionary contains the following keys: `include_package_data`, `entry_points`, `install_requires`, `extras_require`, and `ext_modules... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_package_config({'include_package_data': False, 'entry_points': {}, 'install_requires': [], 'extras_require': {'dev': ['pytest'], 'test': ['pytest']}, 'ext_modules': ['module1']}) == {'no_entry_points': True, 'install_requires_count': 0, 'extras_requi... | {
"split": "train",
"index": 64726,
"acecode_id": "oss_6800",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a set of vertices representing points on the Earth's surface, each represented by its coordinates in a three-dimensional space. Your task is to implement a function that identifies the vertices on the equator (where the z-coordinate is 0) that are in the opposite ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert opposite_hemisphere_vertices([(1, 2, 0), (3, 3, 0), (-3, -3, 0)], 3.0) == [0, 1, 2]\", \"assert opposite_hemisphere_vertices([(1, 0, 0), (0, 1, 0)], 2.0) == [0, 1]\", \"assert opposite_hemisphere_vertices([(1, 1, 0), (-1, -1, 0)], 1.5) == [0, 1]\", \"assert ... | {
"split": "train",
"index": 64727,
"acecode_id": "oss_28581",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to evaluate a postfix expression. A postfix expression is an arithmetic expression in which the operators follow their operands. For example, the infix expression '2 + 3' would be written as '2 3 +'. The operators supported are additi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_postfix([3, 4, '*', 2, '+']) == 14\", \"assert evaluate_postfix([5, 1, 2, '+', 4, '*', '+', 3, '-']) == 14\", \"assert evaluate_postfix([2, 3, '+', 4, '*']) == 20\", \"assert evaluate_postfix([5, 3, 4, '*', '+']) == 17\", \"assert evaluate_postfix([... | {
"split": "train",
"index": 64728,
"acecode_id": "oss_24219",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given two integers, `init_runs` and `Q`, representing the initial number of runs for an optimization experiment and a parameter for the optimization function, respectively. Your task is to implement a function `optimize_experiment(init_runs: int, Q: int) -> str` that si... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert optimize_experiment(200, 60) == 'Optimization successful with init_runs=200 and Q=60'\", \"assert optimize_experiment(500, 200) == 'Optimization successful with init_runs=500 and Q=200'\", \"assert optimize_experiment(199, 70) == 'Invalid init_runs'\", \"ass... | {
"split": "train",
"index": 64729,
"acecode_id": "bigcode_python_fns_7022",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that swaps the elements at two distinct indices without using a temporary variable or the built-in swap function. The function should return the modified list after the swap operation. For example, if the input list is [7, 4, 5, 6]... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert swap_without_temp([7, 4, 5, 6], 0, 2) == [5, 4, 7, 6]\", \"assert swap_without_temp([1, 2, 3, 4], 1, 3) == [1, 4, 3, 2]\", \"assert swap_without_temp([10, 20, 30], 0, 1) == [20, 10, 30]\", \"assert swap_without_temp([100, 200], 0, 1) == [200, 100]\", \"asser... | {
"split": "train",
"index": 64730,
"acecode_id": "evol_26335",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a Python function that returns a new list where each element is the product of all the numbers in the original list except the one at the same index. You must implement this without using the division operation and achieve a time complexity of O(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert productExceptSelf([1, 2, 3, 4, 5]) == [120, 60, 40, 30, 24]\", \"assert productExceptSelf([1, 1, 1, 1]) == [1, 1, 1, 1]\", \"assert productExceptSelf([0, 1, 2, 3]) == [6, 0, 0, 0]\", \"assert productExceptSelf([-1, 1, 0, -2, 3]) == [0, 0, 6, 0, 0]\", \"asser... | {
"split": "train",
"index": 64731,
"acecode_id": "evol_10915",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a schema for a data representation of train stations. The function should return a list of dictionaries, where each dictionary represents a column in the schema with specific properties. The schema should contain two column... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_station_schema() == [{'Station_id': None, 'Name': None}, {'Station_id': None, 'Name': None}]\", \"assert create_station_schema()[0]['Station_id'] is None\", \"assert create_station_schema()[0]['Name'] is None\", \"assert create_station_schema()[1]['St... | {
"split": "train",
"index": 64732,
"acecode_id": "bigcode_python_fns_8248",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `count_frequency_in_matrix(matrix)` that takes a matrix (a list of lists) as input and returns a dictionary representing the frequency of each element in the matrix. The matrix can contain both numerical and non-numerical elements. Ensure that your function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_frequency_in_matrix([[1, 2, 3], [4, 'a', 6], [7, 'a', 9], ['b', 'b', 'b'], [1, 2, 3]]) == {1: 2, 2: 2, 3: 2, 4: 1, 6: 1, 7: 1, 9: 1, 'a': 2, 'b': 3}\", \"assert count_frequency_in_matrix([[None, None, 'Hello'], ['World', 1, 2], ['Hello', 3, 'World'], [... | {
"split": "train",
"index": 64733,
"acecode_id": "evol_23093",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that converts all lowercase letters in a given string to their uppercase equivalents, identifies and replaces any symbols in the string with their corresponding names in specified foreign languages (supporting at least three languages), and handles common spel... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert translate_and_correct('hello & world', 'english') == 'HELLO AND WORLD'\", \"assert translate_and_correct('test @example & check', 'english') == 'TEST AT EXAMPLE AND CHECK'\", \"assert translate_and_correct('i love @coding', 'english') == 'I LOVE AT CODING'\"... | {
"split": "train",
"index": 64734,
"acecode_id": "evol_17941",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing configuration settings for a software application. Each dictionary contains key-value pairs that represent individual settings. Your task is to write a function that filters out any dictionaries that include a key named 'preserv... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_configurations([{'name': 'setting1', 'value': 'true', 'preserve_default': False}, {'name': 'setting2', 'value': 'false', 'preserve_default': True}, {'name': 'setting3', 'value': '42'}, {'name': 'setting4', 'value': 'hello', 'preserve_default': False}... | {
"split": "train",
"index": 64735,
"acecode_id": "oss_36096",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a slice object or a tuple of slice objects, return a tuple of slice objects representing the unflipped indices corresponding to the input slices. An unflipped slice means that if the input slice has a negative step, the output slice should represent the same range, but in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert loc_data_idx(slice(5, 1, -2)) == (slice(1, 6, 2),)\", \"assert loc_data_idx(slice(0, 10, 1)) == (slice(0, 10, 1),)\", \"assert loc_data_idx(slice(3, 0, -1)) == (slice(0, 4, 1),)\", \"assert loc_data_idx(slice(10, 5, -1)) == (slice(5, 11, 1),)\", \"assert loc... | {
"split": "train",
"index": 64736,
"acecode_id": "bigcode_python_fns_14793",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a salt alert server instance. Create a function named `start_salt_alert_server` that takes a dictionary `opts` as input and initializes a server with the given options. The function should set the `publish_port` attribute to `None` and return a di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert start_salt_alert_server({'option1': 'value1', 'option2': 'value2'}) == {'opts': {'option1': 'value1', 'option2': 'value2'}, 'publish_port': None}\", \"assert start_salt_alert_server({'server_name': 'test_server'}) == {'opts': {'server_name': 'test_server'}, ... | {
"split": "train",
"index": 64737,
"acecode_id": "oss_11849",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 3D tensor (a list of lists of lists) consisting of numbers, implement a function `multiply_tensor(tensor)` that returns the product of all the elements in the tensor. If the tensor contains any zero elements, the function should raise a ValueError with the message 'Tens... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_tensor([[[1]], [[2]], [[3]]] ) == 6\", \"assert multiply_tensor([[[2, 3, 4]], [[5, 6, 7]]]) == 5040\", \"assert multiply_tensor([[[1, 1]], [[1, 1]]]) == 1\", \"assert multiply_tensor([[[2]]]) == 2\", \"assert multiply_tensor([[[3.5, 2.0]], [[1.5, 4.... | {
"split": "train",
"index": 64738,
"acecode_id": "evol_13266",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are to create a Python function that generates a list of image file names for each class in a dataset. The function should take in a dictionary representing two sets, 'train' and 'test', where each set contains a list of image file names for different classes. Your task is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_image_lists({'train': {'cat': ['cat1.jpg', 'cat2.jpg'], 'dog': ['dog1.jpg']}, 'test': {'cat': ['cat3.jpg'], 'dog': ['dog2.jpg', 'dog3.jpg']}}) == {'train': {'cat': ['cat1.jpg', 'cat2.jpg'], 'dog': ['dog1.jpg']}, 'test': {'cat': ['cat3.jpg'], 'dog': ... | {
"split": "train",
"index": 64739,
"acecode_id": "oss_2374",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates downloading files from a list of builds. Each build consists of two lists: binaries and sources. Your function should take a list of builds, where each build is represented as a dictionary containing a 'binaries' list a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert download_files([{'binaries': ['file1.bin', 'file2.bin'], 'sources': ['source1.src']}]) == ['Downloaded file1.bin', 'Downloaded file2.bin', 'Downloaded source1.src']\", \"assert download_files([{'binaries': [], 'sources': []}]) == []\", \"assert download_file... | {
"split": "train",
"index": 64740,
"acecode_id": "bigcode_python_fns_4512",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves a list of enabled disk templates based on a given set of parameters. Your function should accept a variable number of arguments (which can be of any type) and return a list containing the enabled disk templates that match t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_enabled_disk_templates('template1', 'template2') == ['template1', 'template2']\", \"assert get_enabled_disk_templates('template3') == ['template3']\", \"assert get_enabled_disk_templates() == []\", \"assert get_enabled_disk_templates('template1', 'templa... | {
"split": "train",
"index": 64741,
"acecode_id": "bigcode_python_fns_23221",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that processes a given SMT-LIB script by replacing certain function names with their simplified versions. Specifically, you need to implement a function `process_smt_script(script: str) -> str` that takes a string representing an SMT-LI... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_smt_script('(declare-fun bvurem_i (Int Int) Int)') == '(declare-fun bvurem (Int Int) Int)'\", \"assert process_smt_script('(declare-fun bvsrem_i (Int Int) Int)') == '(declare-fun bvsrem (Int Int) Int)'\", \"assert process_smt_script('(declare-fun bvu... | {
"split": "train",
"index": 64742,
"acecode_id": "oss_25296",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that extracts and cleans environmental data from a list of strings. Each string may contain information about different environmental variables such as temperature, carbon dioxide emissions, and polar ice sheets. The data can be noisy, wit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_environmental_data(['The temperature is 20 degrees Celsius.']) == [{'variable': 'temperature', 'value': 20.0, 'unit': 'celsius'}]\", \"assert extract_environmental_data(['There was a significant rise in carbon dioxide emissions to 420 ppm.']) == []\"... | {
"split": "train",
"index": 64743,
"acecode_id": "evol_19360",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the square root of a non-negative number without using the built-in square root function. The function should take a single non-negative integer n as input and return the square root of n. The returned value should be accurate to six decimal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(sqrt(0) - 0.0) < 0.000001\", \"assert abs(sqrt(1) - 1.0) < 0.000001\", \"assert abs(sqrt(4) - 2.0) < 0.000001\", \"assert abs(sqrt(9) - 3.0) < 0.000001\", \"assert abs(sqrt(16) - 4.0) < 0.000001\", \"assert abs(sqrt(25) - 5.0) < 0.000001\", \"assert abs(... | {
"split": "train",
"index": 64744,
"acecode_id": "evol_35724",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves the current attenuation value from an attenuator object. The attenuator object has a method called `get_atten()` that returns a floating-point number representing the current attenuation value. Implement a function `get_cur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_current_attenuation(MockAttenuator(0.0)) == 0.0\", \"assert get_current_attenuation(MockAttenuator(1.5)) == 1.5\", \"assert get_current_attenuation(MockAttenuator(-3.2)) == -3.2\", \"assert get_current_attenuation(MockAttenuator(10.0)) == 10.0\", \"asser... | {
"split": "train",
"index": 64745,
"acecode_id": "bigcode_python_fns_28468",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining the final operational state of a system based on a series of state strings provided in a list. Each string can represent one of the following states: 'previous', 'current', or 'both'. Write a function `final_state(states: List[str]) -> str` that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert final_state(['previous', 'current', 'both', 'previous']) == 'both'\", \"assert final_state(['previous', 'previous', 'current']) == 'current'\", \"assert final_state(['current', 'both']) == 'both'\", \"assert final_state(['both', 'previous']) == 'both'\", \"a... | {
"split": "train",
"index": 64746,
"acecode_id": "oss_14275",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are building a simple command-line interface for a text-based adventure game where a player can navigate through a series of rooms. Each room has a description and possible exits. You need to implement a function `move(direction)` that allows the player to move to a differe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert move('east') == 'You find yourself in a cozy living room. There are exits to the north and east. Exits: north, east'\", \"assert move('south') == 'You step into a beautiful garden with colorful flowers. There is an exit to the west. Exits: west'\", \"assert ... | {
"split": "train",
"index": 64747,
"acecode_id": "oss_7237",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of messages in a chat dialog. Each message is represented by a dictionary containing two keys: 'is_bot' (a boolean indicating if the message is from a bot) and 'text' (a string representing the content of the message). Write a function that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_chat_messages([{'is_bot': True, 'text': 'Hello!'}, {'is_bot': False, 'text': 'Hi!'}]) == [('Hello!', True), ('Hi!', False)]\", \"assert process_chat_messages([{'is_bot': False, 'text': 'What is your name?'}, {'is_bot': True, 'text': 'I am a chatbot.'... | {
"split": "train",
"index": 64748,
"acecode_id": "bigcode_python_fns_44659",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_emails(text: str) -> List[str]` that takes a string `text` as input and returns a list of all unique email addresses found within the text. An email address is defined as a sequence of characters that follows the format `local-part@domain`, where the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_emails('Contact us at support@example.com for assistance.') == ['support@example.com']\", \"assert find_emails('You can reach john.doe@example.com or jane.doe@sample.com for more information.') == ['jane.doe@sample.com', 'john.doe@example.com']\", \"ass... | {
"split": "train",
"index": 64749,
"acecode_id": "evol_9843",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of strings, where each string represents a mathematical expression. Your function should evaluate these expressions and return a list of the results. If an expression is invalid, it should return 'Invalid ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_expressions(['2 + 2', '5 * 3', '10 / 2', 'invalid expression']) == [4, 15, 5.0, 'Invalid Expression']\", \"assert evaluate_expressions(['1 + 1', '3 - 2', '4 * 5', '10 / 0']) == [2, 1, 20, 'Invalid Expression']\", \"assert evaluate_expressions(['0 + ... | {
"split": "train",
"index": 64750,
"acecode_id": "oss_31457",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a URL routing configuration for a hospital management application. Your goal is to define two URL patterns: one for listing all hospitals and another for retrieving detailed information about a single hospital by its ID. The URL pattern for listing ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_url_patterns() == [\\\"path('hospitals/', views.HospitalDetailedList.as_view(), name='hospital_list'),\\\", \\\"path('hospital/<int:hospital_id>/', views.HospitalDetailedSingle.as_view(), name='hospital_read'),\\\"]\", \"assert len(get_url_patterns()) ==... | {
"split": "train",
"index": 64751,
"acecode_id": "oss_4690",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_maximum` that returns the maximum value in the list. If the list is empty, the function should return None. The function signature is as follows: `def find_maximum(nums: List[int]) -> Optional[int]:` where `nums` is a list of int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_maximum([1, 2, 3, 4, 5]) == 5\", \"assert find_maximum([-1, -2, -3, -4, -5]) == -1\", \"assert find_maximum([0, -1, -2, -3]) == 0\", \"assert find_maximum([5, 5, 5, 5]) == 5\", \"assert find_maximum([10, 20, 30, 40, 50]) == 50\", \"assert find_maximum([... | {
"split": "train",
"index": 64752,
"acecode_id": "bigcode_python_fns_534",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of DNS records, where each record is represented as a dictionary containing the fields 'rec_id', 'type', 'name', 'content', 'service_mode', 'ttl', and 'prio'. Your task is to implement a function that identifies and returns a list of record IDs that have a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert checkDuplicateRecords('192.0.2.1', [{'rec_id': 1, 'type': 'A', 'name': 'example.com', 'content': '192.0.2.1', 'service_mode': 'active', 'ttl': 3600, 'prio': 10}, {'rec_id': 2, 'type': 'A', 'name': 'example.com', 'content': '192.0.2.1', 'service_mode': 'activ... | {
"split": "train",
"index": 64753,
"acecode_id": "bigcode_python_fns_39709",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of software requirements and extracts specific information. Each requirement is represented as a string in the format \"requirement_name: version_number\". Your function should take a list of such strings as input an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_requirements([\\\"requests: 2.25.1\\\", \\\"flask: 1.1.2\\\", \\\"numpy: 1.20.3\\\"]) == {\\\"requests\\\": \\\"2.25.1\\\", \\\"flask\\\": \\\"1.1.2\\\", \\\"numpy\\\": \\\"1.20.3\\\"}\", \"assert extract_requirements([\\\"django: 3.1.7\\\", \\\"pand... | {
"split": "train",
"index": 64754,
"acecode_id": "oss_22146",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function that identifies the longest unbroken sequence of a single unique character using iterative loops. The function should handle unicode characters consistently. If the input string is empty, return an empty string. Write a function named `longe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_substring('aaabbcc') == 'aaa'\", \"assert longest_substring('abccccd') == 'cccc'\", \"assert longest_substring('') == ''\", \"assert longest_substring('a') == 'a'\", \"assert longest_substring('abcde') == 'a'\", \"assert longest_substring('aabbbaa') ... | {
"split": "train",
"index": 64755,
"acecode_id": "evol_1742",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a corrupt encoding of a three-digit integer number, where the digit in the hundreds place is twice the digit in the ones place and one less than the digit in the tens place. The encoding may contain some missing digits represented by underscores ('_'). Your task i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_numbers('6_2') == []\", \"assert find_numbers('0_0') == []\", \"assert find_numbers('9_8') == []\", \"assert find_numbers('10_') == []\", \"assert find_numbers('3_3') == []\", \"assert find_numbers('1_2') == []\", \"assert find_numbers('3_3') == []\"]}"... | {
"split": "train",
"index": 64756,
"acecode_id": "evol_6161",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given two functions: `DownsamplerBlock(in_channels: int, out_channels: int) -> List[float]` and `non_bottleneck_1d(channels: int, dropout_rate: float, dilation: int) -> List[float]`. Your task is to implement these functions in such a way that they simulate the downsamp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert DownsamplerBlock(64, 128) == [0.5] * (128 // 2)\", \"assert DownsamplerBlock(32, 64) == [0.5] * (64 // 2)\", \"assert non_bottleneck_1d(256, 0.0, 1) == [0.5] * 256\", \"assert DownsamplerBlock(128, 256) == [0.5] * (256 // 2)\", \"assert DownsamplerBlock(16, ... | {
"split": "train",
"index": 64757,
"acecode_id": "oss_34553",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a configuration file represented as an object with the following properties: `exists`, `is_file`, `user`, `group`, and `mode`. Implement a function `check_config_file(config_file: ConfigFile) -> bool` that checks the following conditions: 1. The `exists` property ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_config_file(ConfigFile(True, True, 'airflow', 'airflow', 0o400)) == True\", \"assert check_config_file(ConfigFile(False, True, 'airflow', 'airflow', 0o400)) == False\", \"assert check_config_file(ConfigFile(True, False, 'airflow', 'airflow', 0o400)) ==... | {
"split": "train",
"index": 64758,
"acecode_id": "bigcode_python_fns_49164",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `process_mqtt_message(message: str) -> dict` that takes a JSON formatted string message as input and returns a dictionary parsed from the JSON string. If the input string is not a valid JSON, the function should return an empty dictionary. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_mqtt_message('{\\\"key\\\": \\\"value\\\"}') == {'key': 'value'}\", \"assert process_mqtt_message('{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 30}') == {'name': 'Alice', 'age': 30}\", \"assert process_mqtt_message('{\\\"is_active\\\": true}') == {'is_... | {
"split": "train",
"index": 64759,
"acecode_id": "evol_1943",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string consisting of multiple words separated by spaces, create a function that calculates the number of distinct anagram groups present in the string. The function should ignore punctuation and be case-insensitive when considering anagrams. For example, in the string '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert anagram_count('Listen silent enlist') == 1\", \"assert anagram_count('Hello world') == 0\", \"assert anagram_count('Anagrams are great fun') == 0\", \"assert anagram_count('A man a plan a canal Panama') == 1\", \"assert anagram_count('Listen, silent... enlis... | {
"split": "train",
"index": 64760,
"acecode_id": "evol_19476",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, design an algorithm to calculate all prime Fibonacci numbers that are less than 150. The function should return an array of these prime Fibonacci numbers. Ensure that the function properly handles erroneous inputs by raising a TypeError if the input is not a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prime_fib(1) == []\", \"assert prime_fib(7) == [2, 3, 5]\", \"assert prime_fib(15) == [2, 3, 5, 13]\", \"assert prime_fib(20) == [2, 3, 5, 13]\", \"assert prime_fib(4) == [2, 3]\", \"assert prime_fib(6) == [2, 3, 5]\", \"assert prime_fib(100) == [2, 3, 5, 13... | {
"split": "train",
"index": 64761,
"acecode_id": "evol_10414",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_product_of_five_distinct_primes(n)` that returns True if the input number `n` is the product of five distinct prime numbers, and False otherwise. The input number `n` will be less than 5000.\nPlease reason step by step, then write a self-contained Pytho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_product_of_five_distinct_primes(2310) == True\", \"assert is_product_of_five_distinct_primes(2310) == True\", \"assert is_product_of_five_distinct_primes(2310) == True\", \"assert is_product_of_five_distinct_primes(2310) == True\", \"assert is_product_of_... | {
"split": "train",
"index": 64762,
"acecode_id": "evol_2113",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates a given database provider and its connection configuration. The function `validate_db_provider` takes three parameters: `db_provider`, a string representing the database provider (e.g., 'MySQL', 'PostgreSQL', 'SQLite');... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_db_provider('MySQL', {'host': 'localhost', 'port': 3306}, ['users', 'orders']) == True\", \"assert validate_db_provider('PostgreSQL', {'host': 'localhost', 'port': 5432}, ['products', 'sales']) == True\", \"assert validate_db_provider('SQLite', {'da... | {
"split": "train",
"index": 64763,
"acecode_id": "oss_13487",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function `find_phoenix(text: str) -> bool` that checks if the word 'phoenix' appears at the beginning of the given string. The function should return True if 'phoenix' is at the start of the string, and False otherwise.\nPlease reason step by step, then write a self-con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_phoenix('phoenix rises from the ashes') == True\", \"assert find_phoenix('The phoenix rises from the ashes') == False\", \"assert find_phoenix('phoenix') == True\", \"assert find_phoenix('') == False\", \"assert find_phoenix(' The phoenix') == False\",... | {
"split": "train",
"index": 64764,
"acecode_id": "evol_14737",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a recursive function in Python that calculates the sum of all integers from 1 to n (inclusive). The function should take a single integer n as input and return the total sum. For example, if n is 5, the function should return 15 (1 + 2 + 3 + 4 + 5). If n is 0, the functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_integers(0) == 0\", \"assert sum_integers(1) == 1\", \"assert sum_integers(2) == 3\", \"assert sum_integers(3) == 6\", \"assert sum_integers(4) == 10\", \"assert sum_integers(5) == 15\", \"assert sum_integers(6) == 21\", \"assert sum_integers(7) == 28\",... | {
"split": "train",
"index": 64765,
"acecode_id": "evol_27177",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are developing a grid-based game where players can build walls to define their environment. Implement a function `build_wall` that takes a position of a new wall as input and returns a message indicating the wall has been built. The function should perform the following tas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_wall((0, 0)) == {'wall': {'type': 'wall_built', 'wall': {'position': (0, 0)}}}\", \"assert build_wall((1, 2)) == {'wall': {'type': 'wall_built', 'wall': {'position': (1, 2)}}}\", \"assert build_wall((5, 5)) == {'wall': {'type': 'wall_built', 'wall': {'... | {
"split": "train",
"index": 64766,
"acecode_id": "oss_22679",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the overall performance score for an employee based on various performance metrics. Each performance metric is represented as a tuple containing the metric name and its corresponding score. Your task is to implement a function that computes the o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_overall_performance([('Quality', 90), ('Efficiency', 85), ('Teamwork', 95)]) == 90.0\", \"assert generate_overall_performance([('Quality', 100), ('Efficiency', 100)]) == 100.0\", \"assert generate_overall_performance([('Quality', 70), ('Efficiency',... | {
"split": "train",
"index": 64767,
"acecode_id": "oss_22893",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of IP addresses, both IPv4 and IPv6, write a function that checks if all specified IP addresses are absent from a provided ARP table. The ARP table is represented as a dictionary containing two keys: 'v4' for IPv4 addresses and 'v6' for IPv6 addresses. The function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_ip_addresses_deleted(['192.168.1.1', '2001:db8::1'], {'v4': ['192.168.1.2'], 'v6': ['2001:db8::2']}) == True\", \"assert check_ip_addresses_deleted(['192.168.1.1', '2001:db8::1'], {'v4': ['192.168.1.1'], 'v6': ['2001:db8::2']}) == False\", \"assert che... | {
"split": "train",
"index": 64768,
"acecode_id": "bigcode_python_fns_25539",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that loads a dataset based on a specific task and name. The function will take in three arguments: `task` (string), `name` (string), and `test` (boolean). The function should load a dataset according to the specified task and n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_dataset('task1', 'dataset1', True) == 'Dataset loaded for task1: dataset1, and written to file.'\", \"assert load_dataset('task1', 'dataset2', False) == 'Dataset loaded for task1: dataset2.'\", \"assert load_dataset('task1', 'dataset5', True) == 'Datase... | {
"split": "train",
"index": 64769,
"acecode_id": "oss_21184",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that constructs a string representation of a network host. The function should take two parameters: the host's name and its endpoint. The function should return a string in the format 'Host(name, endpoint)', where 'Host' is a constant... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert host_string('Server1', '192.168.1.1') == 'Host(Server1, 192.168.1.1)'\", \"assert host_string('Server2', '192.168.1.2') == 'Host(Server2, 192.168.1.2)'\", \"assert host_string('Database', '10.0.0.5') == 'Host(Database, 10.0.0.5)'\", \"assert host_string('Web... | {
"split": "train",
"index": 64770,
"acecode_id": "oss_20873",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a given observation containing dialog data. The input is a dictionary with a key 'text' that holds a list of dialog tuples. Each dialog tuple consists of a dialog ID (an integer) and dialog text (a string). Your functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_observation({'text': [(1, 'Hello'), (2, ''), (3, 'How are you?'), (4, '')]}) == [1, 3]\", \"assert process_observation({'text': [(1, 'Hi'), (2, 'Bye'), (3, 'Good morning'), (4, '')]}) == [1, 2, 3]\", \"assert process_observation({'text': [(1, ''), (2... | {
"split": "train",
"index": 64771,
"acecode_id": "oss_527",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that accepts a string representing a mathematical operation and returns the corresponding operation as a Python callable function. The supported operations are 'add', 'subtract', and 'multiply'. If an unsupported operation is provided, th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_operation_fn('add')(2, 3) == 5\", \"assert get_operation_fn('subtract')(5, 2) == 3\", \"assert get_operation_fn('multiply')(3, 4) == 12\", \"assert get_operation_fn('add')(0, 0) == 0\", \"assert get_operation_fn('subtract')(10, 5) == 5\", \"assert get_op... | {
"split": "train",
"index": 64772,
"acecode_id": "bigcode_python_fns_2551",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that finds the best hyperparameters for a support vector machine (SVM) classifier. The hyperparameters include the kernel type (which is fixed as 'rbf'), different gamma values (1e-1, 1e-2, 1e-3, 1e-4), and the regularization paramete... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_best_hyperparameters([{'kernel': 'rbf', 'gamma': 1e-1, 'C': 1}, {'kernel': 'rbf', 'gamma': 1e-1, 'C': 10}, {'kernel': 'rbf', 'gamma': 1e-2, 'C': 100}, {'kernel': 'rbf', 'gamma': 1e-2, 'C': 1000}]) == {'kernel': 'rbf', 'gamma': 1e-2, 'C': 1000}\", \"asse... | {
"split": "train",
"index": 64773,
"acecode_id": "oss_13117",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary `source` where the keys are strings representing attribute names and the values are their corresponding values. You need to implement a function that takes this dictionary, a list of keys, and a prefix string as input. The function should return a new... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prefix_attrs({'a': 1, 'b': 2, 'c': 3}, ['a', 'c'], 'new_') == {'new_a': 1, 'b': 2, 'new_c': 3}\", \"assert prefix_attrs({'x': 10, 'y': 20}, ['x'], 'prefix_') == {'prefix_x': 10, 'y': 20}\", \"assert prefix_attrs({'key1': 'value1', 'key2': 'value2'}, ['key1']... | {
"split": "train",
"index": 64774,
"acecode_id": "bigcode_python_fns_16132",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string consisting of various letters, write a function that calculates the number of distinct palindromic arrangements that can be formed using at least one occurrence of a specified letter in the string. A palindromic arrangement is one that reads the same forwards and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_palindromic_arrangements('ABCDE', 'A') == 0\", \"assert count_palindromic_arrangements('MISSISSIPPI', 'I') == 30\", \"assert count_palindromic_arrangements('AAB', 'A') == 1\", \"assert count_palindromic_arrangements('DAD', 'D') == 1\", \"assert count_p... | {
"split": "train",
"index": 64775,
"acecode_id": "evol_4490",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given two JSON-like dictionaries representing different categories of items, each containing a 'name' key and a 'data' key. Your task is to implement a function that merges these two dictionaries into a single dictionary. The keys of the resulting dictionary should be t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_objects({'name': 'fruits', 'data': []}, {'name': 'vegetables', 'data': []}) == {'fruits': [], 'vegetables': []}\", \"assert merge_objects({'name': 'fruits', 'data': [1, 2, 3]}, {'name': 'vegetables', 'data': ['carrot', 'pea']}) == {'fruits': [1, 2, 3],... | {
"split": "train",
"index": 64776,
"acecode_id": "evol_23563",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary where keys are strings and values are integers, write a function `sort_dict_by_value(input_dict)` that sorts the dictionary by its values in ascending order. If there are duplicate values, the corresponding keys should maintain their original order. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_dict_by_value({'A': 3, 'B': 1, 'C': 2}) == {'B': 1, 'C': 2, 'A': 3}\", \"assert sort_dict_by_value({'apple': 2, 'banana': 1, 'cherry': 2}) == {'banana': 1, 'apple': 2, 'cherry': 2}\", \"assert sort_dict_by_value({'x': -2, 'y': -1, 'z': 0}) == {'x': -2, ... | {
"split": "train",
"index": 64777,
"acecode_id": "evol_28284",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `transform_and_analyze(text: str) -> Tuple[str, Dict[str, int]]` that transforms a given block of text into uppercase. Additionally, the function should analyze the transformed text and return a count of each alphabet used in the text as a dictionary. The i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_and_analyze('hello world') == ('HELLO WORLD', {'H': 1, 'E': 1, 'L': 3, 'O': 2, 'W': 1, 'R': 1, 'D': 1})\", \"assert transform_and_analyze('') == ('', {})\", \"assert transform_and_analyze('12345') == ('12345', {})\", \"assert transform_and_analyze(... | {
"split": "train",
"index": 64778,
"acecode_id": "evol_24784",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of dependencies between migration files and a list of migration operations. Each migration operation is represented as a string in a specific format. Your function should analyze the dependencies and operation... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_migrations([], ['AddField(a, b)']) == ['AddField(a, b)']\", \"assert process_migrations([('a', 'b')], ['RemoveField(b, x)', 'AddField(a, y)']) == ['AddField(a, y)', 'RemoveField(b, x)']\", \"assert process_migrations([('alpha', 'beta')], ['AddField(a... | {
"split": "train",
"index": 64779,
"acecode_id": "oss_24064",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers called 'numbers' and an integer 'delimeter', implement a function that returns a new list where the 'delimeter' is interspersed between each pair of integers in 'numbers'. The final list should not end with the 'delimeter'. You should implement this usi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert corrected_intermix([1, 2, 3], 0) == [1, 0, 2, 0, 3]\", \"assert corrected_intermix([10, 20, 30, 40], 5) == [10, 5, 20, 5, 30, 5, 40]\", \"assert corrected_intermix([0], 7) == [0]\", \"assert corrected_intermix([], 1) == []\", \"assert corrected_intermix([1, ... | {
"split": "train",
"index": 64780,
"acecode_id": "evol_27211",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a permission management system for a web application. Your goal is to write a function `add_permission_to_role` that adds a permission to a specified role. The function should take in three parameters: a string `role_name` representing the name ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_permission_to_role('admin', 'Create roles', 'role_create') == \\\"Permission 'Create roles' added to role 'admin' successfully.\\\"\", \"assert add_permission_to_role('user', 'Edit profile', 'profile_edit') == \\\"Role 'user' does not exist.\\\"\", \"ass... | {
"split": "train",
"index": 64781,
"acecode_id": "oss_4611",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that sets up a bot by performing two operations: checking if a folder exists and checking if a file exists. The function should take in a bot object and return a string indicating the status of the setup process. The setup process sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert setup('bot1') == 'Setup complete'\", \"assert setup('bot2') == 'Setup complete'\", \"assert setup('bot3') == 'Setup complete'\", \"assert setup('bot4') == 'Setup complete'\", \"assert setup('bot5') == 'Setup complete'\", \"assert setup('bot6') == 'Setup comp... | {
"split": "train",
"index": 64782,
"acecode_id": "bigcode_python_fns_27989",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to simulate the report creation process for both comments and articles in a web application. Your function should accept two parameters: a comment report data dictionary and an article report data dictionary. Each dictionary contains the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_reports({'content': 'Comment 1', 'parent_id': 101, 'reported_by_id': 1001}, {'content': 'Article 1', 'parent_id': 201, 'reported_by_id': 2001}) == [{'content': 'Comment 1', 'parent_id': 101, 'reported_by_id': 1001}, {'content': 'Article 1', 'parent_id... | {
"split": "train",
"index": 64783,
"acecode_id": "oss_9049",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D grid of integers representing pixel values of an image. Write a function `pixel_sum(grid: List[List[int]]) -> int` that computes the sum of all pixel values in the grid. The grid is guaranteed to be non-empty and will have at least one row and one column. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pixel_sum([[1, 2], [3, 4]]) == 10\", \"assert pixel_sum([[0]]) == 0\", \"assert pixel_sum([[5, 10, 15], [20, 25, 30]]) == 105\", \"assert pixel_sum([[1, -1], [-1, 1]]) == 0\", \"assert pixel_sum([[2, 3], [4, 5], [6, 7]]) == 27\", \"assert pixel_sum([[100, 20... | {
"split": "train",
"index": 64784,
"acecode_id": "bigcode_python_fns_3068",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function named `get_primes_up_to(n)` that takes an integer `n` as input and returns a list of all prime numbers that are less than or equal to `n`. If the input is less than 2, the function should return an empty list. Implement error handling to manage cases where the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_primes_up_to(100) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]\", \"assert get_primes_up_to(0) == []\", \"assert get_primes_up_to(1) == []\", \"assert get_primes_up_to(2) == [2]\", \"assert get_prime... | {
"split": "train",
"index": 64785,
"acecode_id": "evol_4721",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates the Amazon Resource Name (ARN) for an SNS (Simple Notification Service) topic given a topic name and an optional region. The function should follow these rules: if a region is provided, use it to determine the ARN; if no re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_sns_arn('my_topic') == 'arn:aws:sns:us-east-1:123456789012:my_topic'\", \"assert generate_sns_arn('my_topic', 'us-west-2') == 'arn:aws:sns:us-west-2:123456789012:my_topic'\", \"assert generate_sns_arn('test_topic') == 'arn:aws:sns:us-east-1:12345678... | {
"split": "train",
"index": 64786,
"acecode_id": "bigcode_python_fns_25396",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two sets of 3D coordinates representing molecular structures, represented as two lists of tuples. Each tuple contains three integers representing the x, y, and z coordinates of a point in 3D space. Your task is to implement a function called `compute_min_max_dist`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_min_max_dist([(0, 0, 0)], [(1, 1, 1)], 0, 2) == (1.7320508075688772, 1.7320508075688772)\", \"assert compute_min_max_dist([(1, 1, 1)], [(1, 1, 1)], 0, 5) == (0.0, 0.0)\", \"assert compute_min_max_dist([(0, 0, 0)], [(0, 0, 2)], 1, 5) == (2.0, 2.0)\", ... | {
"split": "train",
"index": 64787,
"acecode_id": "oss_22388",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_secure_passphrase()` that generates a secure passphrase consisting of 20 characters. The passphrase must adhere to the following rules: every 5th character must be a digit (0-9), every 3rd character must be a special character (e.g., !, @, #, etc.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_passphrase(generate_secure_passphrase()) == True\", \"assert len(generate_secure_passphrase()) == 20\", \"assert generate_secure_passphrase()[4].isdigit() == True\", \"assert generate_secure_passphrase()[9].isdigit() == True\", \"assert generate_sec... | {
"split": "train",
"index": 64788,
"acecode_id": "evol_11949",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a function `word_frequency(text: str) -> dict` that takes a string `text` as input and returns a hash-map (dictionary) where the keys are the distinct words present in the text, normalized to lowercase and stripped of any punctuation marks, and the values are the frequenc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_frequency('Hello world! Hello.') == {'hello': 2, 'world': 1}\", \"assert word_frequency('Python is great. Python is fun!') == {'python': 2, 'is': 2, 'great': 1, 'fun': 1}\", \"assert word_frequency('A quick brown fox jumps over the lazy dog.') == {'a': ... | {
"split": "train",
"index": 64789,
"acecode_id": "evol_19612",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing scientific data related to mass measurements over time. Write a Python function `calculate_average_mass` that takes in two lists, `time` and `mass`, representing time values in seconds and corresponding mass values in femtograms. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_mass([1, 2, 3, 4, 5], [10, 20, 15, 25, 30]) == 20.0\", \"assert calculate_average_mass([0, 1, 2], [5, 10, 15]) == 10.0\", \"assert calculate_average_mass([1], [100]) == 100.0\", \"assert calculate_average_mass([10, 20], [30, 50]) == 40.0\",... | {
"split": "train",
"index": 64790,
"acecode_id": "oss_2315",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of two integers, return their sum and a message indicating whether the sum is a prime number or not. If the two integers are the same, return a special message indicating that the numbers are equal. Write a function `add_two_numbers(nums)` where `nums` is a list of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_two_numbers([2, 3]) == (5, 'The sum is a prime number')\", \"assert add_two_numbers([4, 4]) == (8, 'The numbers are equal')\", \"assert add_two_numbers([7, 7]) == (14, 'The numbers are equal')\", \"assert add_two_numbers([5, 1]) == (6, 'The sum is not a ... | {
"split": "train",
"index": 64791,
"acecode_id": "evol_19993",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary represents a survey response. Each response has a 'responses' key, which is a list of dictionaries containing a 'question' key. Your task is to implement a function that filters these survey responses, returning only t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_manufactured_events([{ 'responses': [{'question': 'MANUFACTURED'}]}]) == ([{ 'responses': [{'question': 'MANUFACTURED'}]}], 0)\", \"assert filter_manufactured_events([{ 'responses': [{'question': 'MANUFACTURED'}]}, { 'responses': [{'question': 'MANUFA... | {
"split": "train",
"index": 64792,
"acecode_id": "bigcode_python_fns_28294",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function that finds the shortest contiguous substring of a given input string that contains all unique alphabetic characters present in the string. The input string will consist of alphanumeric characters, and you should ignore non-alphabetic characters when determi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shortest_subsequence('xyzxyz') == 'xyz'\", \"assert shortest_subsequence('abcdefg') == 'abcdefg'\", \"assert shortest_subsequence('a') == 'a'\", \"assert shortest_subsequence('12345abcde6789') == 'abcde'\", \"assert shortest_subsequence('') == ''\", \"assert... | {
"split": "train",
"index": 64793,
"acecode_id": "evol_14570",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function `convertToMinHeap(arr)` that converts the array into a min-heap. The function should return the modified array and the number of swaps made during the conversion. A min-heap is a complete binary tree where the value of each node ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convertToMinHeap([1, 2, 3, 4, 5]) == ([1, 2, 3, 4, 5], 0)\", \"assert convertToMinHeap([]) == ([], 0)\", \"assert convertToMinHeap([2]) == ([2], 0)\", \"assert convertToMinHeap([1, 3, 2]) == ([1, 3, 2], 0)\", \"assert convertToMinHeap([10, 20, 15, 30, 25]) =... | {
"split": "train",
"index": 64794,
"acecode_id": "evol_29548",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, write a function that returns a list containing the Fibonacci sequence up to the number n. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the two preceding ones. Your function should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fib_lista(3) == [0, 1, 1, 2]\", \"assert fib_lista(5) == [0, 1, 1, 2, 3]\", \"assert fib_lista(10) == [0, 1, 1, 2, 3, 5, 8]\", \"assert fib_lista(15) == [0, 1, 1, 2, 3, 5, 8, 13]\", \"assert fib_lista(20) == [0, 1, 1, 2, 3, 5, 8, 13]\", \"assert fib_lista(30... | {
"split": "train",
"index": 64795,
"acecode_id": "bigcode_python_fns_43135",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a Many-to-One relationship between two entities, `Software` and `SoftwareTest`. Each `SoftwareTest` is associated with one `Software`, but a `Software` can have multiple `SoftwareTests`. The function takes a list of `So... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert software_tests_to_dict([{'software_id': 1, 'test_name': 'Test A', 'test_description': 'Description A'}, {'software_id': 1, 'test_name': 'Test B', 'test_description': 'Description B'}, {'software_id': 2, 'test_name': 'Test C', 'test_description': 'Description... | {
"split": "train",
"index": 64796,
"acecode_id": "oss_27607",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a Python function `odd_numbers(lst)` that takes a list of integers (which may include nested lists of integers) and returns a list of the odd integers in descending order. The function should handle exceptions for non-integer inputs and return an appropriate error message... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert odd_numbers([1, 2, 3, 4, 5]) == [5, 3, 1]\", \"assert odd_numbers([10, 21, 32, 43]) == [43, 21]\", \"assert odd_numbers([[1, 2], [3, 4], [5]]) == [5, 3, 1]\", \"assert odd_numbers([100, [101, 102], 103]) == [103, 101]\", \"assert odd_numbers([[-1, -2], [-3, ... | {
"split": "train",
"index": 64797,
"acecode_id": "evol_27517",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integer intervals, find the maximum size of a set S such that the union of S with each interval does not exceed three distinct integers. An integer interval [a, b] represents all consecutive integers from a to b, including both endpoints a and b. Implement the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maximumSizeOfSet([[1,2],[2,3],[2,4],[4,5]]) == 3\", \"assert maximumSizeOfSet([[1,1],[2,2],[3,3]]) == 3\", \"assert maximumSizeOfSet([[1,5],[2,6],[3,7]]) == 2\", \"assert maximumSizeOfSet([[1,3],[3,6],[6,9]]) == 3\", \"assert maximumSizeOfSet([[1,2],[1,3],[2... | {
"split": "train",
"index": 64798,
"acecode_id": "evol_1376",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a simple game of rock-paper-scissors. The function should take two arguments, representing the choices of two players, and return the result of the game based on the standard rules of rock-paper-scissors. The valid c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rock_paper_scissors('rock', 'scissors') == 'Player 1 wins'\", \"assert rock_paper_scissors('paper', 'rock') == 'Player 1 wins'\", \"assert rock_paper_scissors('scissors', 'paper') == 'Player 1 wins'\", \"assert rock_paper_scissors('rock', 'paper') == 'Player... | {
"split": "train",
"index": 64799,
"acecode_id": "oss_19041",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.