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 tasked with assembling the most proficient basketball team for an upcoming tournament. The proficiency of a team is determined by the cumulative scores of all its players. However, a conflict arises when a younger player has a score that is strictly higher than an older...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxScore([1,3,5,10,15], [1,2,3,4,5]) == 34\", \"assert maxScore([1,2,3,4], [1,2,3,4]) == 10\", \"assert maxScore([10,20,30], [10,20,30]) == 60\", \"assert maxScore([1,1,1], [3,3,3]) == 3\", \"assert maxScore([5,10,15,20], [5,10,15,20]) == 50\", \"assert maxS...
{ "split": "train", "index": 68600, "acecode_id": "evol_22355", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a job queue system that can handle multiple jobs and ensure that no duplicate jobs are added to the queue. Your task is to write a function that takes a new job as input and a list representing the current job queue. The function should add the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_job_to_queue('job1', ['job1', 'job2', 'job3']) == \\\"Job 'job1' is already in the queue.\\\"\", \"assert add_job_to_queue('job2', ['job1', 'job2', 'job3']) == \\\"Job 'job2' is already in the queue.\\\"\", \"assert add_job_to_queue('job3', ['job1', 'job...
{ "split": "train", "index": 68601, "acecode_id": "oss_19008", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the Euclidean distance between two points in 3D space. Each point is represented by its coordinates (x, y, z) in the Cartesian coordinate system. The function should take two tuples, each containing three integers repr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_distance((1, 2, 3), (4, 5, 6)) == 5.196152422706632\", \"assert calculate_distance((0, 0, 0), (1, 1, 1)) == 1.7320508075688772\", \"assert calculate_distance((1, 1, 1), (1, 1, 1)) == 0.0\", \"assert calculate_distance((3, 4, 5), (0, 0, 0)) == 7.071...
{ "split": "train", "index": 68602, "acecode_id": "oss_7086", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, write a function that finds the only composite number in the array that is less than 20. If no such number exists, return -1. A composite number is defined as a positive integer that has at least one positive divisor other than one or itself.\nPlease...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_composite_number([11, 13, 16, 23, 29, 37, 41]) == 16\", \"assert find_composite_number([4, 6, 8, 10]) == 4\", \"assert find_composite_number([2, 3, 5, 7, 11]) == -1\", \"assert find_composite_number([9, 15, 18, 20]) == 9\", \"assert find_composite_numbe...
{ "split": "train", "index": 68603, "acecode_id": "evol_32923", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an unordered array of integers, implement a function that sorts the array in ascending order. The function should not use any built-in sorting functions and must utilize an efficient sorting methodology that minimizes memory usage. You need to ensure that your solution ha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert quicksort([3, 2, 1]) == [1, 2, 3]\", \"assert quicksort([1, 2, 3]) == [1, 2, 3]\", \"assert quicksort([5, 2, 9, 1, 5, 6]) == [1, 2, 5, 5, 6, 9]\", \"assert quicksort([0, -1, -2, 2, 1]) == [-2, -1, 0, 1, 2]\", \"assert quicksort([4, 4, 4, 4]) == [4, 4, 4, 4]\...
{ "split": "train", "index": 68604, "acecode_id": "evol_16970", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the durations of different activities in a parallel process. Your task is to determine the total time taken for the entire process to complete, which is defined as the maximum duration among all activities. Implement the function `t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_parallel_time([14, 5, 220]) == 220\", \"assert total_parallel_time([1, 2, 3, 4, 5]) == 5\", \"assert total_parallel_time([10, 20, 30]) == 30\", \"assert total_parallel_time([7]) == 7\", \"assert total_parallel_time([100, 200, 50, 25]) == 200\", \"asser...
{ "split": "train", "index": 68605, "acecode_id": "bigcode_python_fns_27165", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a Python function that identifies the first prime number in a provided list of numerical values. The function should handle edge cases, such as when the list is empty or when it contains non-integer values. If there are no prime numbers in the list, the function should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert first_prime([2, 3, 5, 7, 11]) == 2\", \"assert first_prime([4, 6, 8, 9]) == 'There is no prime number in the list.'\", \"assert first_prime([10, 12, 14, 15]) == 'There is no prime number in the list.'\", \"assert first_prime([]) == 'There is no prime number ...
{ "split": "train", "index": 68606, "acecode_id": "evol_30714", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that converts a Unicode code point to its corresponding glyph name. A glyph is a specific shape or design of a character, and each glyph has a unique name associated with it in the Unicode standard. Your function should take a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cp_glyph(65, 'Unknown') == 'LATIN CAPITAL LETTER A'\", \"assert cp_glyph(97, 'Unknown') == 'LATIN SMALL LETTER A'\", \"assert cp_glyph(8364, 'Unknown') == 'EURO SIGN'\", \"assert cp_glyph(100000, 'Not Found') == 'Not Found'\", \"assert cp_glyph(128512, 'No N...
{ "split": "train", "index": 68607, "acecode_id": "oss_24042", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the installation of multiple versions of Node.js based on a given configuration. The function should take in a list of Node.js versions and return a list of strings representing the installation commands for each version. E...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert install_node_versions(['14.17.0', '16.0.0']) == ['nvm install 14.17.0', 'nvm install 16.0.0']\", \"assert install_node_versions(['12.22.1']) == ['nvm install 12.22.1']\", \"assert install_node_versions([]) == []\", \"assert install_node_versions(['10.24.1', ...
{ "split": "train", "index": 68608, "acecode_id": "bigcode_python_fns_35340", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that computes the Fibonacci series up to a specified limit 'n', where 'n' is the number of elements in the series. The function should return a list containing the first 'n' elements of the Fibonacci sequence.\nPlease reason step by step, then write a self-...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_fibonacci_series(0) == []\", \"assert compute_fibonacci_series(1) == [0]\", \"assert compute_fibonacci_series(2) == [0, 1]\", \"assert compute_fibonacci_series(3) == [0, 1, 1]\", \"assert compute_fibonacci_series(4) == [0, 1, 1, 2]\", \"assert comput...
{ "split": "train", "index": 68609, "acecode_id": "evol_24782", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, determine if it's possible to divide this list into two subsets such that the sum of the elements in both subsets is equal. Implement a function that returns True if such a partition exists, and False otherwise.\nPlease reason step by step, then write ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_partition([1, 5, 11, 5]) == True\", \"assert can_partition([2, 2, 2, 2]) == True\", \"assert can_partition([1, 1, 1, 1, 1, 1]) == True\", \"assert can_partition([1, 2, 3, 5]) == False\", \"assert can_partition([10, 10, 10, 10]) == True\", \"assert can_pa...
{ "split": "train", "index": 68610, "acecode_id": "evol_8835", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simplified version of a settings management system for a desktop application. Your task is to create a function called `manage_settings()` that simulates saving the current settings and closing the application. The function should return a lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_settings() == ['Settings saved', 'Application closed']\", \"assert manage_settings() == ['Settings saved', 'Application closed']\", \"assert manage_settings() == ['Settings saved', 'Application closed']\", \"assert manage_settings() == ['Settings save...
{ "split": "train", "index": 68611, "acecode_id": "oss_415", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `stack_properties` that takes a list of integers representing the elements of a stack and an integer representing the maximum size of the stack. The function should return a tuple with two boolean values: the first value should indicate whether the s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert stack_properties([1, 2, 3], 3) == (True, True)\", \"assert stack_properties([1, 2, 3], 4) == (False, True)\", \"assert stack_properties([3, 2, 1], 3) == (True, False)\", \"assert stack_properties([], 0) == (True, True)\", \"assert stack_properties([5], 1) ==...
{ "split": "train", "index": 68612, "acecode_id": "evol_23418", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program to validate the format of a given date string. The date string should adhere to one of two specific formats, represented by regular expressions `d1` and `d2`. Your program should determine if the given date string matches either of these f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_date_format('2022-12-31', r'\\\\d{4}-\\\\d{2}-\\\\d{2}', r'\\\\d{2}/\\\\d{2}/\\\\d{4}') == True\", \"assert validate_date_format('12/31/2022', r'\\\\d{4}-\\\\d{2}-\\\\d{2}', r'\\\\d{2}/\\\\d{2}/\\\\d{4}') == True\", \"assert validate_date_format('20...
{ "split": "train", "index": 68613, "acecode_id": "oss_35351", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `find_base_and_exponent(number: int) -> Tuple[Optional[int], Optional[int]]` that takes an integer `number` as input and returns a tuple containing the base and the exponent such that `base ** exponent` equals `number`. If no such base and exponent exist, r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_base_and_exponent(8) == (2, 3)\", \"assert find_base_and_exponent(27) == (3, 3)\", \"assert find_base_and_exponent(16) == (2, 4)\", \"assert find_base_and_exponent(1) == (None, None)\", \"assert find_base_and_exponent(64) == (2, 6)\", \"assert find_base...
{ "split": "train", "index": 68614, "acecode_id": "evol_12628", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a packet filtering system that inspects a list of network packets and sets the verdict for each packet based on certain conditions. Write a function `filter_packets(packets: List[Dict[str, Any]]) -> List[str]` that processes a list of packets, w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_packets([{'type': 'HTTP', 'size': 1200}, {'type': 'DNS', 'size': 1600}]) == ['ACCEPT', 'DROP']\", \"assert filter_packets([{'type': 'HTTPS', 'size': 1400}, {'type': 'SMTP', 'size': 3000}]) == ['ACCEPT', 'DROP']\", \"assert filter_packets([{'type': 'TC...
{ "split": "train", "index": 68615, "acecode_id": "oss_18389", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns a new list containing only the unique elements from the input list, while preserving their original order. The function should eliminate any duplicates and should not use any external libraries. For example, given the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 3, 3, 4, 4, 5, 6, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert unique_elements([1, 1, 1, 1, 1]) == [1]\", \"assert unique_elements([]) == []\", \"assert unique_elements([5, 5, 5, 6, 7, 7, 8]) == [5, 6, 7, 8]\", \"assert unique_elements([10, 2...
{ "split": "train", "index": 68616, "acecode_id": "oss_7495", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of file names and a list of filenames that are considered valid. Your task is to identify the orphan files. Orphan files are defined as those that are present in the first list but not in the second list. Implement a function called `find_orphan_files(sourc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_orphan_files(['file1.txt', 'file2.txt', 'file3.txt'], ['file2.txt', 'file4.txt']) == ['file1.txt', 'file3.txt']\", \"assert find_orphan_files(['image.jpg', 'document.pdf', 'presentation.pptx'], ['document.pdf']) == ['image.jpg', 'presentation.pptx']\", ...
{ "split": "train", "index": 68617, "acecode_id": "bigcode_python_fns_4538", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples representing coordinates in a 3D space where each tuple consists of three integers (x, y, z). Your task is to process these coordinates by applying a specified transformation based on the following criteria:\n\n1. If the list contains duplicate co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_coordinates([(1, 2, 3), (4, 5, 6), (1, 2, 3)]) == [(0, 0, 0), (3, 3, 3)]\", \"assert process_coordinates([(0, 0, 0), (0, 0, 0), (0, 0, 0)]) == [(0, 0, 0)]\", \"assert process_coordinates([(1, 2, 3), (1, 2, 3), (1, 2, 3)]) == [(0, 0, 0)]\", \"assert p...
{ "split": "train", "index": 68618, "acecode_id": "bigcode_python_fns_7340", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with finding the best combination of challenges to complete based on a given set of preferences and combinations. Each challenge has a cost associated with it, determined by its index in the preferences list. The cost of a challenge is defined as its index in the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_best_challenge_combo(['A'], ['A'], [[0]]) == [0]\", \"assert find_best_challenge_combo(['A', 'B'], ['A', 'B'], [[0], [1]]) == [0]\", \"assert find_best_challenge_combo(['A', 'B', 'C'], ['A', 'B', 'C'], [[0, 1], [1, 2], [0, 2]]) == [0, 1]\", \"assert fin...
{ "split": "train", "index": 68619, "acecode_id": "bigcode_python_fns_23094", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function `extract_section(webpage: str, section_title: str) -> str` that takes in a string representing the HTML content of a webpage and a section title. The function should return the content of the specified section if it exists, or an empty string if the section...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_section('<h1>Introduction</h1><p>Content of introduction.</p><h2>History</h2><p>History content.</p>', 'History') == '<p>History content.</p>'\", \"assert extract_section('<h1>Overview</h1><p>Overview content.</p><h2>Details</h2><p>Details content.</...
{ "split": "train", "index": 68620, "acecode_id": "evol_23721", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that downscales an image represented by its dimensions to fit within a specified maximum width and height. The input parameters are the original image's width and height, along with the maximum allowable width and height. Your functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert downscale_image_dimensions(1200, 800, 600, 400) == (600, 400)\", \"assert downscale_image_dimensions(800, 600, 600, 400) == (533, 400)\", \"assert downscale_image_dimensions(300, 400, 600, 400) == (300, 400)\", \"assert downscale_image_dimensions(600, 400, 6...
{ "split": "train", "index": 68621, "acecode_id": "oss_18189", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_min_integer(nested_list)` that takes a list of arbitrarily nested lists and integers as input and returns the smallest integer value found within the nested structure. If there are no integers in the input, the function should return None. Ignore any ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_min_integer([1, 2, [3, 4, [5, 6]], 0]) == 0\", \"assert find_min_integer([[1, 2], [3, 4], [5]]) == 1\", \"assert find_min_integer(['a', 'b', [1, 2, 3], 'c']) == 1\", \"assert find_min_integer([]) == None\", \"assert find_min_integer([[[[[3]]]], [[[-1]],...
{ "split": "train", "index": 68622, "acecode_id": "evol_2880", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function `check_dataset(dataset: str) -> None` that checks if the provided dataset name is valid. Implement the function to ensure that the input is a string and that it belongs to a predefined list of available datasets. If the input is not a string, raise a Ty...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_dataset('dataset1') is None\", \"assert check_dataset('dataset2') is None\", \"assert check_dataset('dataset3') is None\", \"assert check_dataset('dataset1') is None\", \"assert check_dataset('dataset2') is None\", \"assert check_dataset('dataset3') is...
{ "split": "train", "index": 68623, "acecode_id": "bigcode_python_fns_24838", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns a new list containing only the even numbers from the original list. The order of the even numbers in the new list should be the same as their order in the original list. You should implement a function named `filter_even_n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([0, -1, -2, -3, -4]) == [0, -2, -4]\", \"assert filter_even_numbers([5, 7, 9]) == []\", \"assert filter_even_numbers(...
{ "split": "train", "index": 68624, "acecode_id": "bigcode_python_fns_6350", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of bucket names as strings. Write a function that deletes all empty buckets from the list. An empty bucket is defined as a bucket that does not contain any items. Your function should return a new list containing only the names of non-empty buckets. Impleme...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_empty_buckets(['bucket1', 'bucket2', 'bucket3'], {'bucket1': [], 'bucket2': ['item1'], 'bucket3': []}) == ['bucket2']\", \"assert delete_empty_buckets(['bucketA', 'bucketB'], {'bucketA': ['itemA'], 'bucketB': []}) == ['bucketA']\", \"assert delete_emp...
{ "split": "train", "index": 68625, "acecode_id": "bigcode_python_fns_22180", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a decimal number, which may include a recurring decimal part enclosed in parentheses. Your task is to implement a function that converts this decimal into a fraction represented by two integers: the numerator and the denominator. If the decim...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decimal_to_fraction('0.5') == (1, 2)\", \"assert decimal_to_fraction('2') == (2, 1)\", \"assert decimal_to_fraction('0.2') == (1, 5)\", \"assert decimal_to_fraction('1.75') == (7, 4)\", \"assert decimal_to_fraction('0.(5)') == (5, 9)\", \"assert decimal_to_f...
{ "split": "train", "index": 68626, "acecode_id": "evol_18058", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with modeling the growth of a predator-prey relationship in an ecosystem. Given the current state of two compartments represented as quantities, the first being a predator compartment (A) and the second a prey compartment (B), you need to calculate the change in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_change([0.0, 100.0], 0, 1, 5.0, 10.0) == 0.0\", \"assert calculate_change([100.0, 0.0], 0, 1, 10.0, 5.0) == 0.0\", \"assert calculate_change([1.0, 1.0], 0, 1, 1.0, 1.0) == 0.5\", \"assert calculate_change([0.5, 0.5], 0, 1, 1.5, 0.5) == 0.375\", \"a...
{ "split": "train", "index": 68627, "acecode_id": "bigcode_python_fns_18258", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Write a function that generates a sequence of Fibonacci numbers up to n numbers, where n is a positive integer greater than 2. Ensure that your implementation handles potential overflow issues for a 64-bit signed integer. The function should return the Fibonacci sequence as a l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(7) == [0, 1, 1, 2, 3, 5, 8]\", \"assert fibonacci(8) == [0, 1, 1, 2, 3, 5, 8, ...
{ "split": "train", "index": 68628, "acecode_id": "evol_15430", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer a, write a function `prime_triplet_product(a)` that returns a tuple of three distinct prime numbers that multiply to a. If a is not a product of three distinct prime numbers, return 'Not a product of 3 distinct prime numbers.'. The input integer a must ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prime_triplet_product(30) == (2, 3, 5)\", \"assert prime_triplet_product(105) == (3, 5, 7)\", \"assert prime_triplet_product(77) == 'Not a product of 3 distinct prime numbers.'\", \"assert prime_triplet_product(100) == 'Not a product of 3 distinct prime numb...
{ "split": "train", "index": 68629, "acecode_id": "evol_25443", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given the root of a binary tree and an integer k, write a function `nodeInTree(root, k)` that checks if a node with the value k exists in the binary tree. The function should return True if the node exists, and False otherwise. Each node in the binary tree has a unique integer ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert nodeInTree(TreeNode(1, TreeNode(2), TreeNode(3)), 2) == True\", \"assert nodeInTree(TreeNode(1, TreeNode(2), TreeNode(3)), 4) == False\", \"assert nodeInTree(TreeNode(1, TreeNode(2, TreeNode(4), TreeNode(5)), TreeNode(3)), 4) == True\", \"assert nodeInTree(T...
{ "split": "train", "index": 68630, "acecode_id": "bigcode_python_fns_2462", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that determines the type of a given input string. The function should identify whether the input string is a valid representation of a string in Python 3. Specifically, if the input string is of type `str`, the function should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert identify_string_type('hello') == 'valid string'\", \"assert identify_string_type('') == 'valid string'\", \"assert identify_string_type('123') == 'valid string'\", \"assert identify_string_type('True') == 'valid string'\", \"assert identify_string_type('None...
{ "split": "train", "index": 68631, "acecode_id": "oss_21712", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the fading of lights on a series of arms, where each arm can have multiple light colors represented by brightness values. The function should take an integer n (the number of arms) and a list of brightness values (an intege...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fade_lights(3, [110, 110, 110]) == [100, 100, 100]\", \"assert fade_lights(2, [70, 80]) == [60, 70]\", \"assert fade_lights(4, [0, 0, 0, 0]) == [0, 0, 0, 0]\", \"assert fade_lights(5, [20, 30, 40, 50, 60]) == [10, 20, 30, 40, 50]\", \"assert fade_lights(1, [...
{ "split": "train", "index": 68632, "acecode_id": "bigcode_python_fns_47109", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing lines of text. Your task is to implement a function that processes each string and performs a transformation on it by removing any leading or trailing whitespace. The function should return a new list containing the modified strings....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_lines([' hello ', ' world ', ' python ']) == ['hello', 'world', 'python']\", \"assert process_lines([' test ', ' ', ' leading and trailing ']) == ['test', '', 'leading and trailing']\", \"assert process_lines(['no spaces', ' spaces at s...
{ "split": "train", "index": 68633, "acecode_id": "oss_15936", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a given string is a palindrome. A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization). Write a function `is_p...
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('step on ...
{ "split": "train", "index": 68634, "acecode_id": "bigcode_python_fns_2359", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of numbers, implement a function to calculate the standard deviation without using any pre-built functions or libraries like numpy. The standard deviation should be calculated using the formula: \\( \\sigma = \\sqrt{\\frac{\\sum (x_i - \\mu)^2}{N - 1}} \\), where \...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_std_dev([1, 2, 3, 4, 5]) == 1.5811388300841898\", \"assert calculate_std_dev([1, 1, 1, 1]) == 0.0\", \"assert calculate_std_dev([100, 200, 300]) == 100.0\", \"assert calculate_std_dev([4, 4, 4, 4, 4]) == 0.0\", \"assert calculate_std_dev([1, 2]) ==...
{ "split": "train", "index": 68635, "acecode_id": "evol_22887", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with processing nodes within pathways. Each pathway is represented as a dictionary, where the keys are pathway identifiers and the values are lists of dictionaries representing nodes. Each node may have various labels associated with it, including fields named 'l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_node_label({'pathway1': [{'label-oe': {'pid1': 'value1'}, 'label-ue': {'pid2': 'value2'}}, {'label-oe': {'pid3': 'value3'}, 'label-ue': {}}]}, 'old_label', 'onekernel', 'pid1') == None\", \"assert update_node_label({'pathway1': [{'label-oe': {'pid1': ...
{ "split": "train", "index": 68636, "acecode_id": "oss_2341", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `start_by_process_name(process_name: str, args: List[str] = None) -> str` that simulates the starting of a process based on the provided process name and optional additional arguments. If no additional arguments are provided, the function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert start_by_process_name('processA') == 'Started processA with no additional arguments.'\", \"assert start_by_process_name('processB', ['--flag']) == 'Started processB with arguments: --flag.'\", \"assert start_by_process_name('processD', []) == 'Started proces...
{ "split": "train", "index": 68637, "acecode_id": "oss_18344", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given two strings, `user` and `actor`, determine if the `user` is following the `actor`. You should implement a function `is_following(user: str, actor: str) -> bool` that simulates the following behavior: if the `user` string ends with the same character as the `actor` string,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_following('alice', 'bob') == False\", \"assert is_following('henry', 'i') == False\", \"assert is_following('ivan', 'j') == False\", \"assert is_following('jack', 'k') == True\", \"assert is_following('larry', 'm') == False\", \"assert is_following('olive...
{ "split": "train", "index": 68638, "acecode_id": "bigcode_python_fns_21162", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a method to add a new value to a binary search tree (BST). A binary search tree is a data structure where each node contains a value, a left child, and a right child. The left child's value must be less than its parent's value, and the right chi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_value(10) == None\", \"assert add_value(5) == None\", \"assert add_value(15) == None\", \"assert add_value(3) == None\", \"assert add_value(7) == None\", \"assert add_value(12) == None\", \"assert add_value(18) == None\", \"assert add_value(1) == None\",...
{ "split": "train", "index": 68639, "acecode_id": "oss_507", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the positions of the knee, ankle, and foot in a 3D space represented by coordinates (x, y, z), write a function `convertFoot(kneePosition: Tuple[int, int, int], anklePosition: Tuple[int, int, int], footPosition: Tuple[int, int, int]) -> Tuple[int, int, int]` that converts...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convertFoot((1, 2, 3), (4, 5, 6), (7, 8, 9)) == (4, 5, 6)\", \"assert convertFoot((0, 0, 0), (1, 1, 1), (2, 2, 2)) == (1, 1, 1)\", \"assert convertFoot((-1, -2, -3), (4, 5, 6), (7, 8, 9)) == (3, 3, 4)\", \"assert convertFoot((10, 20, 30), (40, 50, 60), (70, ...
{ "split": "train", "index": 68640, "acecode_id": "bigcode_python_fns_10139", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that swaps the first and last elements in a list. If the list is empty or contains only one element, return the list unchanged. Implement the function as `def swap_first_last(lst):` where `lst` is a list of elements.\nPlease reason step by step, then wri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert swap_first_last([]) == []\", \"assert swap_first_last([1]) == [1]\", \"assert swap_first_last([1, 2]) == [2, 1]\", \"assert swap_first_last(['a', 'b', 'c']) == ['c', 'b', 'a']\", \"assert swap_first_last([0, 1, 2, 3]) == [3, 1, 2, 0]\", \"assert swap_first_l...
{ "split": "train", "index": 68641, "acecode_id": "evol_6537", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that verifies if a given cryptocurrency wallet address is valid based on a specific pattern for Bitcoin addresses. A valid Bitcoin address starts with either a '1' or a '3', followed by 25 to 34 alphanumeric characters, which can include lowercase letters (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_bitcoin_address('1BoatSLRHtKNngkdXEeobR76b53LETtpyT') == True\", \"assert verify_bitcoin_address('3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy') == True\", \"assert verify_bitcoin_address('1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa') == True\", \"assert verify_bitcoin_...
{ "split": "train", "index": 68642, "acecode_id": "evol_27705", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, `phone_locations` and `bounder_locations`. Each list contains integers representing elevation data at various timestamps. Your task is to calculate the average elevation for both lists and return a tuple containing the average elevation of t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_elevations([100, 200, 300], [150, 250, 350]) == (200.0, 250.0)\", \"assert calculate_average_elevations([], [150, 250, 350]) == (None, 250.0)\", \"assert calculate_average_elevations([100, 200, 300], []) == (200.0, None)\", \"assert calcula...
{ "split": "train", "index": 68643, "acecode_id": "bigcode_python_fns_6725", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `count_uppercase_vowels` that takes a string as input and counts the number of uppercase vowels ('A', 'E', 'I', 'O', 'U') located at even index positions in the string. If the input is not a string, the function should return -1. Ignore any special characte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_uppercase_vowels('aBCdEf') == 1\", \"assert count_uppercase_vowels('abcdefg') == 0\", \"assert count_uppercase_vowels('dBBE') == 0\", \"assert count_uppercase_vowels(123456) == -1\", \"assert count_uppercase_vowels('AEIOU') == 3\", \"assert count_upper...
{ "split": "train", "index": 68644, "acecode_id": "evol_35160", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a string representation of two integers separated by a space, adds these two integers together, and returns the result as a string. Implement the function `add_numbers(input_string: str) -> str`, which takes a single input para...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_numbers('3 5') == '8'\", \"assert add_numbers('10 20') == '30'\", \"assert add_numbers('-1 1') == '0'\", \"assert add_numbers('0 0') == '0'\", \"assert add_numbers('100 200') == '300'\", \"assert add_numbers('999 1') == '1000'\", \"assert add_numbers('50...
{ "split": "train", "index": 68645, "acecode_id": "bigcode_python_fns_30933", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a version control system transaction commit. The function `commit_transaction` takes three parameters: a repository identifier (a string), a transaction identifier (a string), and a boolean flag indicating whether the c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert commit_transaction('repo1', 'txn1', True) == 'Transaction committed successfully.'\", \"assert commit_transaction('repo1', 'txn1', False) == 'Transaction failed to commit.'\", \"assert commit_transaction('repo2', 'txn2', True) == 'Transaction committed succe...
{ "split": "train", "index": 68646, "acecode_id": "bigcode_python_fns_29921", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that adds a path or a list of paths to a collection of valid paths, ensuring that no duplicates are added. Your function should take a parameter `new_path` which can be a single string representing a path or a list of strings represen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_paths('path/to/resource') == ['path/to/resource']\", \"assert add_paths(['path/to/resource1', 'path/to/resource2']) == ['path/to/resource1', 'path/to/resource2']\", \"assert add_paths('path/to/resource1') == ['path/to/resource1']\", \"assert add_paths(['...
{ "split": "train", "index": 68647, "acecode_id": "bigcode_python_fns_17611", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary called `intersphinx_mapping` where the keys are strings representing the names of different libraries or tools, and the values are tuples containing a URL and an optional prefix. Your task is to implement a function `non_null_urls(mapping)` that takes...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert non_null_urls({'a': ('http://example.com', None), 'b': (None, None)}) == ['a']\", \"assert non_null_urls({'lib1': (None, 'prefix1'), 'lib2': ('http://lib2.com', 'prefix2')}) == ['lib2']\", \"assert non_null_urls({'libA': (None, None), 'libB': (None, None)}) ...
{ "split": "train", "index": 68648, "acecode_id": "oss_32683", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the difference between the largest and smallest numbers in a given list of integers. If the list is empty, return 'No values provided'.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a si...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_disparity([3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]) == 8\", \"assert calculate_disparity([-10, -20, -5, -1]) == 19\", \"assert calculate_disparity([100, 200, 300]) == 200\", \"assert calculate_disparity([0, 0, 0]) == 0\", \"assert calculate_disparity([7])...
{ "split": "train", "index": 68649, "acecode_id": "evol_18551", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the Cartesian coordinates of a point in 3D space represented by its x, y, and z components, write a function that converts these coordinates to spherical coordinates. The spherical coordinates consist of three values: r (the radial distance from the origin), phi (the azim...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cart2spherical(0, 0, 0) == (0, 0, 0)\", \"assert cart2spherical(0, 1, 0) == (1.0, 1.5707963267948966, 1.5707963267948966)\", \"assert cart2spherical(0, 0, 1) == (1.0, 0.0, 0.0)\", \"assert cart2spherical(0, -1, 0) == (1.0, -1.5707963267948966, 1.570796326794...
{ "split": "train", "index": 68650, "acecode_id": "bigcode_python_fns_44901", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that determines if all elements in the list are unique. The function should return True if all elements are unique, and False otherwise. The input list can have duplicates, and its length can range from 0 to 100. You need to implement ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_elements_unique([]) == True\", \"assert are_elements_unique([1]) == True\", \"assert are_elements_unique([1, 2, 3]) == True\", \"assert are_elements_unique([1, 2, 2]) == False\", \"assert are_elements_unique([1, 1, 1]) == False\", \"assert are_elements_u...
{ "split": "train", "index": 68651, "acecode_id": "bigcode_python_fns_27151", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function named `animation_update` that simulates a simple animation update system. The function should take variable arguments and follow these rules: If no arguments are passed, the function should return a string 'Animation updated with self...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert animation_update() == 'Animation updated with self'\", \"assert animation_update(1) == 'Animation updated with self and 1'\", \"assert animation_update(None) == 'Animation updated with self and None'\", \"assert animation_update(True) == 'Animation updated w...
{ "split": "train", "index": 68652, "acecode_id": "oss_12315", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of strings `words` from a new alien language's dictionary, where the strings are sorted lexicographically according to the unknown rules of this language. Additionally, you are given a list of frequencies `freq` corresponding to each string in `words` and a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert alienOrder(['z','x'], [1,2], [('x', 'z')]) == 'xz'\", \"assert alienOrder(['abc', 'bcd', 'cde'], [1,1,1], []) == 'abcde'\", \"assert alienOrder(['a', 'b', 'c'], [3, 1, 2], []) == 'abc'\", \"assert alienOrder(['a', 'ab', 'abc'], [1, 2, 3], []) == 'abc'\", \"a...
{ "split": "train", "index": 68653, "acecode_id": "evol_35248", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the average of a list of numbers. The function should take a list of integers as input and return the average of all the numbers in the list. If the list is empty, the function should return 0. Implement the function `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average([]) == 0\", \"assert calculate_average([1]) == 1.0\", \"assert calculate_average([1, 2, 3]) == 2.0\", \"assert calculate_average([10, 20, 30, 40]) == 25.0\", \"assert calculate_average([-1, -2, -3]) == -2.0\", \"assert calculate_average([0]...
{ "split": "train", "index": 68654, "acecode_id": "oss_5924", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing geographical data for weather stations. Implement a function `parse_station_line(line)` that takes a single string `line` representing station data formatted as \"station_name latitude longitude\". Your function should extract the station name, la...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_station_line('StationA 34.56 -78.90') == ('StationA', 34.56, -78.90)\", \"assert parse_station_line('StationB 45.00 -120.00') == ('StationB', 45.00, -120.00)\", \"assert parse_station_line('Weather 50.5 -100.1') == ('Weather', 50.5, -100.1)\", \"assert...
{ "split": "train", "index": 68655, "acecode_id": "oss_25295", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of file paths and their associated GitHub star ranges, and returns a sorted list of file paths based on the average of the star ranges provided. You are given a list of tuples, where each tuple contains a file...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_files_by_stars([('a.py', '1-10'), ('b.py', '5-15'), ('c.py', '2-6')]) == ['c.py', 'a.py', 'b.py']\", \"assert sort_files_by_stars([('fileX.py', '10-50'), ('fileY.py', '10-50'), ('fileZ.py', '10-50')]) == ['fileX.py', 'fileY.py', 'fileZ.py']\", \"assert ...
{ "split": "train", "index": 68656, "acecode_id": "oss_9456", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a 16-bit unsigned integer, write a function that returns the number of 1's in its binary representation (also known as the Hamming weight). The input integer will be between 0 and 65535 inclusive. Implement a function named `hamming_weight(value: int) -> int` that takes t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hamming_weight(0) == 0\", \"assert hamming_weight(1) == 1\", \"assert hamming_weight(2) == 1\", \"assert hamming_weight(3) == 2\", \"assert hamming_weight(15) == 4\", \"assert hamming_weight(16) == 1\", \"assert hamming_weight(31) == 5\", \"assert hamming_we...
{ "split": "train", "index": 68657, "acecode_id": "bigcode_python_fns_31854", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a hierarchical classifier in Python. A hierarchical classifier organizes multiple classifiers into a hierarchical structure to make predictions. Your task is to implement a function `predict_class(cat_clfs, cd, input_data)` that makes prediction...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict_class({'animal': MockClassifier('lion'), 'vehicle': MockClassifier('car'), 'fruit': MockClassifier('apple')}, {'living_thing': ['animal', 'plant'], 'animal': ['mammal', 'bird'], 'mammal': ['carnivore', 'herbivore']}, 'input_data') == 'lion'\", \"asse...
{ "split": "train", "index": 68658, "acecode_id": "oss_15860", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that embeds a given value into a specified coordinate position within a 3D matrix. The function should take a 3D list (matrix), the value to be embedded, and a tuple of coordinates (x, y, z). If the coordinates are out of bounds, the function should return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert embed_value_3D_matrix([[[0]*2]*2]*2, 3, (2, 2, 2)) == [[[0, 0], [0, 0]], [[0, 0], [0, 0]]]\", \"assert embed_value_3D_matrix([[[1, 2], [3, 4]], [[5, 6], [7, 8]]], 9, (0, 1, 1)) == [[[1, 2], [3, 9]], [[5, 6], [7, 8]]]\", \"assert embed_value_3D_matrix([[[0]*1...
{ "split": "train", "index": 68659, "acecode_id": "evol_34390", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a list of package names based on a given list of input strings. Each input string represents a package name in a specific format where it can either contain uppercase letters, lowercase letters, or digits. Your function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_package_names(['Alpha', 'beta', 'Alpha', 'gamma123']) == ['Alpha', 'beta', 'gamma123']\", \"assert generate_package_names(['Package1', 'package1', 'PACKAGE1']) == ['PACKAGE1', 'Package1', 'package1']\", \"assert generate_package_names(['123', 'abc',...
{ "split": "train", "index": 68660, "acecode_id": "bigcode_python_fns_28828", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `dividir(h: int, t: int) -> int` that performs integer division of two integers without using the division operator (`/` or `//`). The function should take two integer inputs, `h` (the dividend) and `t` (the divisor), and return the result of dividing `h` b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dividir(10, 3) == 3\", \"assert dividir(10, -3) == -3\", \"assert dividir(-10, 3) == -3\", \"assert dividir(-10, -3) == 3\", \"assert dividir(0, 1) == 0\", \"assert dividir(0, -1) == 0\", \"assert dividir(7, 2) == 3\", \"assert dividir(7, -2) == -3\", \"asse...
{ "split": "train", "index": 68661, "acecode_id": "oss_29069", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `set_jit_fusion_options(version: str) -> Dict[str, bool]`. This function simulates the configuration of JIT (Just-In-Time) layer fusion options based on the provided version string of PyTorch. Your function should take a single string inp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_jit_fusion_options('1.10.0a0+0aef44c') == {'profiling_executor': True, 'profiling_mode': True, 'can_fuse_on_cpu': False, 'can_fuse_on_gpu': False, 'texpr_fuser_enabled': False, 'nvfuser_enabled': True}\", \"assert set_jit_fusion_options('1.9.0') == {'pro...
{ "split": "train", "index": 68662, "acecode_id": "bigcode_python_fns_1723", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing book IDs and a list of dictionaries where each dictionary contains the metadata of a book, including its ID, author, title, and image URL. Write a function `get_book_info(book_ids: List[int], books: List[Dict[str, Union[int, str]]])...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_book_info([1], [{'book_id': 1, 'authors': 'Author A', 'title': 'Title A', 'image_url': 'url_A'}]) == (['Author A'], ['Title A'], ['url_A'])\", \"assert get_book_info([1, 2], [{'book_id': 1, 'authors': 'Author A', 'title': 'Title A', 'image_url': 'url_A'}...
{ "split": "train", "index": 68663, "acecode_id": "bigcode_python_fns_27606", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given four distinct mathematical collections groupA, groupB, groupC, and groupD, implement a function that determines the common elements (intersection) among these sets. The function should also accept an optional parameter to exclude one of the groups from the intersection. I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert common_elements({1, 2, 3, 4, 5}, {4, 5, 6, 7, 8}, {5, 6, 7, 8, 9}, {5, 10, 11, 12, 13}) == {5}\", \"assert common_elements({1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12}) == set()\", \"assert common_elements({1, 2, 3}, {1, 2, 3}, {1, 2, 3}, {1, 2, 3}, exclude...
{ "split": "train", "index": 68664, "acecode_id": "evol_22637", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves the 'start_text' attribute from a given configuration object. The configuration object is a dictionary with a key 'start_text' that holds a string value. Your function should take this configuration object as input and retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_start_text({'start_text': 'Hello World'}) == 'Hello World'\", \"assert get_start_text({'start_text': 'Sample Text'}) == 'Sample Text'\", \"assert get_start_text({'start_text': ''}) == ''\", \"assert get_start_text({'other_key': 'Value'}) == ''\", \"asser...
{ "split": "train", "index": 68665, "acecode_id": "bigcode_python_fns_5792", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers and returns a dictionary where the keys are the unique integers from the list and the values are their respective counts in the list. The order of the keys in the dictionary does not matter.\nPlease reason step by step, then wr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_elements([1, 2, 2, 3, 1]) == {1: 2, 2: 2, 3: 1}\", \"assert count_elements([5, 5, 5, 5]) == {5: 4}\", \"assert count_elements([]) == {}\", \"assert count_elements([10, 20, 10, 30, 20]) == {10: 2, 20: 2, 30: 1}\", \"assert count_elements([1]) == {1: 1}\...
{ "split": "train", "index": 68666, "acecode_id": "evol_559", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers that represent the costs of different items in a store. Your task is to implement a function `get_affordable_items(costs: List[int], budget: int) -> List[int]` that returns a list of indices of the items that you can afford without exceeding you...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_affordable_items([5, 10, 15], 5) == [0]\", \"assert get_affordable_items([1, 2, 3, 4, 5], 0) == []\", \"assert get_affordable_items([50, 50, 50, 50], 200) == [0, 1, 2, 3]\", \"assert get_affordable_items([100, 200, 300], 100) == [0]\", \"assert get_affor...
{ "split": "train", "index": 68667, "acecode_id": "bigcode_python_fns_24857", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given the coordinates of two points in a 2D plane: (x1, y1) and (x2, y2). Your task is to write a function that calculates the Euclidean distance between these two points. The Euclidean distance is defined as the square root of the sum of the squares of the differences ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert euclidean_distance(0, 0, 3, 4) == 5.0\", \"assert euclidean_distance(1, 1, 1, 1) == 0.0\", \"assert euclidean_distance(-1, -1, -4, -5) == 5.0\", \"assert euclidean_distance(2, 3, 5, 7) == 5.0\", \"assert euclidean_distance(0, 0, 0, 0) == 0.0\", \"assert eucl...
{ "split": "train", "index": 68668, "acecode_id": "bigcode_python_fns_22488", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes an integer `num` and two optional keyword arguments: `multiplier` (default value is 2) and `addend` (default value is 5). The function should return the result of `num` multiplied by `multiplier`, and then added to `addend`. If `multiplier` and `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert example_function(3) == 11\", \"assert example_function(3, multiplier=3) == 14\", \"assert example_function(3, addend=10) == 16\", \"assert example_function(3, multiplier=4, addend=1) == 13\", \"assert example_function(0) == 5\", \"assert example_function(-1)...
{ "split": "train", "index": 68669, "acecode_id": "evol_21705", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a list of operations from a given list of mathematical expressions. Each expression can be an addition or multiplication involving two operands (which can be integers or variables). Your goal is to write a Python functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_operations(['x + 5']) == [('ADD', 'x', 5)]\", \"assert generate_operations(['3 + y', '2 * 7']) == [('ADD', 3, 'y'), ('MUL', 2, 7)]\", \"assert generate_operations(['a * b']) == [('MUL', 'a', 'b')]\", \"assert generate_operations(['1 + 2', '3 + 4']) ...
{ "split": "train", "index": 68670, "acecode_id": "oss_36754", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `create_transaction(version: int, flag: bool, ins: list, outs: list, witness: list, locktime: int) -> dict` that simulates the creation of a Segregated Witness (SegWit) transaction. The function should take the following parameters: \...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_transaction(1, True, ['input1'], ['output1'], ['witness1'], 0) == {'version': 1, 'flag': True, 'inputs': ['input1'], 'outputs': ['output1'], 'witness': ['witness1'], 'locktime': 0}\", \"assert create_transaction(2, False, ['input2', 'input3'], ['outpu...
{ "split": "train", "index": 68671, "acecode_id": "oss_14044", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function that calculates the total value of a group in a portfolio based on cash and shares held. The function takes a dictionary `context` with the following keys: `from_col`, `to_col`, `last_cash`, `last_shares`, `last_val_price`, and `group`. The `last_cash` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_group_value({'from_col': 'A', 'to_col': 'B', 'last_cash': {'group1': 100.0}, 'last_shares': 10, 'last_val_price': 5.0, 'group': 'group1', 'cash_sharing': True}) == 150.0\", \"assert get_group_value({'from_col': 'A', 'to_col': 'B', 'last_cash': {'group2':...
{ "split": "train", "index": 68672, "acecode_id": "bigcode_python_fns_29790", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `generate_remarks(score)` that returns distinct evaluation remarks based on the value of the `score` variable. The function should return remarks that reflect the performance level as follows: If the score is less than 0 or greater than 100, or if the score...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_remarks(95) == 'Excellent performance, outstanding work!'\", \"assert generate_remarks(85) == 'Good performance, keep up the good work.'\", \"assert generate_remarks(45) == 'Poor performance, needs improvement.'\", \"assert generate_remarks(None) ==...
{ "split": "train", "index": 68673, "acecode_id": "evol_12473", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n, write a function `fibonacci(n)` that returns the nth number in the Fibonacci sequence. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n > 1. Your function should return the nth Fibonacci number.\nPlease reaso...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2...
{ "split": "train", "index": 68674, "acecode_id": "evol_12185", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a command line for executing a specified CrossHair command based on the current state of a code editor. The function should take two inputs: a boolean indicating whether a file is currently open, and a string representi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_command_line(True, 'CHECK', 'example.py') == 'crosshair check example.py'\", \"assert generate_command_line(True, 'CHECK_AT', 'example.py', 10) == 'crosshair check example.py:10'\", \"assert generate_command_line(True, 'WATCH', 'example.py') == 'cro...
{ "split": "train", "index": 68675, "acecode_id": "bigcode_python_fns_3935", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function `get_cube(n: int) -> int` that takes an integer n (1 ≤ n ≤ 1000) as input and returns the cube of n. If the input n is not within the valid range, return -1. The function should handle calculations in real-time, meaning if the cube of n has not been calc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_cube(1) == 1\", \"assert get_cube(2) == 8\", \"assert get_cube(3) == 27\", \"assert get_cube(4) == 64\", \"assert get_cube(5) == 125\", \"assert get_cube(10) == 1000\", \"assert get_cube(20) == 8000\", \"assert get_cube(30) == 27000\", \"assert get_cube(...
{ "split": "train", "index": 68676, "acecode_id": "evol_1266", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `update_auto_scaling_group` that simulates the adjustment of the minimum size and desired capacity of an Auto Scaling Group in a cloud environment. The function takes two parameters: `min_size` (an integer) and `desired_capacit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_auto_scaling_group(0, 0) == 0\", \"assert update_auto_scaling_group(5, 10) == 0\", \"assert update_auto_scaling_group(3, 3) == 0\", \"assert update_auto_scaling_group(10, 0) == 0\", \"assert update_auto_scaling_group(4, 5) == 0\", \"assert update_auto...
{ "split": "train", "index": 68677, "acecode_id": "bigcode_python_fns_4070", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of organic compound names. Your task is to write a function that sorts these compound names based on the number of carbon atoms in each compound. The number of carbon atoms in a compound can be determined by counting the occurrences of the string 'ane' at t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_compounds(['octane', 'decane', 'hexane']) == ['decane', 'hexane', 'octane']\", \"assert sort_compounds(['methanol', 'ethanol', 'propanol']) == ['ethanol', 'methanol', 'propanol']\", \"assert sort_compounds(['ethene', 'propene', 'butene']) == ['butene', ...
{ "split": "train", "index": 68678, "acecode_id": "oss_4964", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function that accepts a list and an integer k as inputs. The function should return a new list that is a copy of the input list but with the k'th element removed. If k is negative, remove the k'th element from the end of the list. If k exceeds the length of the list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_list([], 5) == [5]\", \"assert custom_list([1, 2, 3, 4, 5], 2) == [1, 2, 4, 5]\", \"assert custom_list([10, 20, 30], -1) == [10, 20]\", \"assert custom_list([10, 20, 30], 3) == [30, 20, 10]\", \"assert custom_list([1, 2, 3], 0) == [2, 3]\", \"assert c...
{ "split": "train", "index": 68679, "acecode_id": "evol_33198", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_symmetric(matrix)` that takes a square matrix as input and returns `True` if the matrix is symmetric along its main diagonal (i.e., for all elements matrix[i][j] = matrix[j][i]), and `False` otherwise. The matrix is represented as a list of lists, where...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_symmetric([[1, 2, 3], [2, 4, 5], [3, 5, 6]]) == True\", \"assert is_symmetric([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) == True\", \"assert is_symmetric([[1, 2], [2, 1]]) == True\", \"assert is_symmetric([[1, 2], [3, 4]]) == False\", \"assert is_symmetric([[5]])...
{ "split": "train", "index": 68680, "acecode_id": "evol_15245", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of image file names and generates corresponding labels based on the render numbers extracted from the file names. The file names are formatted in such a way that the render number can be found before the last undersc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_images(['image_1_info.png', 'image_2_info.png', 'image_3_info.png'], 'render') == ([1, 2, 3], [1, 2, 3])\", \"assert process_images(['image_1_info.png'], 'render') == ([1], [1])\", \"assert process_images([], 'render') == ([], [])\", \"assert process...
{ "split": "train", "index": 68681, "acecode_id": "bigcode_python_fns_3120", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given an array of integers. Implement a function that determines if there are any duplicate elements in the array. Your solution should have a time complexity of O(n log n) and should not use any external libraries or built-in functions. The function should return True ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert detect_duplicates([1, 2, 3, 4, 5]) == False\", \"assert detect_duplicates([1, 2, 3, 4, 5, 1]) == True\", \"assert detect_duplicates([10, 20, 30, 40, 50]) == False\", \"assert detect_duplicates([10, 20, 10, 40]) == True\", \"assert detect_duplicates([]) == Fa...
{ "split": "train", "index": 68682, "acecode_id": "evol_33906", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are required to implement a function that takes a positive integer n and returns the factorial of n. The function should first validate the input to ensure it is a positive integer. If the input is invalid, it should return 'invalid'. Otherwise, compute and return the facto...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(5) == 120\", \"assert factorial(0) == 'invalid'\", \"assert factorial(-3) == 'invalid'\", \"assert factorial(1) == 1\", \"assert factorial(10) == 3628800\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", ...
{ "split": "train", "index": 68683, "acecode_id": "evol_8063", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two points represented as tuples of integers (x1, y1) and (x2, y2) in a 2D space, and a distance 'd', write a function `find_point_at_distance(point1: Tuple[int, int], point2: Tuple[int, int], d: float) -> Tuple[float, float]` that returns a new point (as a tuple) located...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_point_at_distance((1, 1), (1, 5), 2) == (1.0, 3.0)\", \"assert find_point_at_distance((0, 0), (0, 5), 5) == (0.0, 5.0)\", \"assert find_point_at_distance((1, 1), (4, 1), 1) == (2.0, 1.0)\", \"assert find_point_at_distance((0, 0), (0, 0), 1) == (0, 0)\",...
{ "split": "train", "index": 68684, "acecode_id": "bigcode_python_fns_18299", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes a list of integers. The function should take in a list of integers, double each integer, and return a new list containing the original integers along with their doubled values as tuples. Each tuple should contain...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_numbers([1, 2, 3]) == [(1, 2), (2, 4), (3, 6)]\", \"assert process_numbers([-1, -2, -3]) == [(-1, -2), (-2, -4), (-3, -6)]\", \"assert process_numbers([0]) == [(0, 0)]\", \"assert process_numbers([]) == []\", \"assert process_numbers([5, 10, 15]) == ...
{ "split": "train", "index": 68685, "acecode_id": "oss_8092", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `load_modules(*args)` that takes a variable number of string arguments, each representing the name of a module. The function should return a list of modules that were successfully loaded. A module is considered successfully loaded if ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_modules('module1', 'module2') == ['module1', 'module2']\", \"assert load_modules('module1', '', 'module2') == ['module1', 'module2']\", \"assert load_modules('', '', '') == []\", \"assert load_modules('module1', 'module2', 'module3') == ['module1', 'mod...
{ "split": "train", "index": 68686, "acecode_id": "bigcode_python_fns_45570", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries, where each dictionary represents an entry with 'date' and 'close' keys, write a function that removes entries with missing 'date' or 'close' values. The function should return a new list of dictionaries with the 'close' values indexed by their corr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert index_close_data([{'date': '2023-10-01', 'close': 100}, {'date': '2023-10-02', 'close': None}, {'date': '2023-10-01', 'close': 100}]) == [{'date': '2023-10-01', 'close': 100}]\", \"assert index_close_data([{'date': None, 'close': 100}, {'date': '2023-10-02',...
{ "split": "train", "index": 68687, "acecode_id": "bigcode_python_fns_10725", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `bank_account_simulation(transactions: List[Tuple[str, int]]) -> Tuple[int, int]` that simulates a simple banking system. The function will take a list of transactions, where each transaction is represented as a tuple. The first element o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_account_simulation([('deposit', 100), ('withdraw', 50), ('withdraw', 60)]) == (50, 3)\", \"assert bank_account_simulation([('deposit', 200), ('withdraw', 300)]) == (200, 2)\", \"assert bank_account_simulation([('deposit', 150), ('withdraw', 100), ('with...
{ "split": "train", "index": 68688, "acecode_id": "oss_26757", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that converts a temperature from Kelvin to Fahrenheit. The function should take one parameter, 'kelvin', which represents the temperature in Kelvin. The conversion formula from Kelvin to Fahrenheit is: F = (K - 273.15) * 9/5 + 32. The function should return the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert kelvin_to_fahrenheit(273.15) == 32.0\", \"assert kelvin_to_fahrenheit(0) == -459.67\", \"assert kelvin_to_fahrenheit(373.15) == 212.0\", \"assert kelvin_to_fahrenheit(300) == 80.33\", \"assert kelvin_to_fahrenheit(400) == 260.33\", \"assert kelvin_to_fahrenh...
{ "split": "train", "index": 68689, "acecode_id": "evol_28856", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a 2D list of numerical data and a 2D list of one-hot encoded target labels, implement a function that extracts a specified number of data entries for each unique target label. The function should return two lists: one containing the extracted data and the other containing...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_data_by_target([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]], [[1, 0], [1, 0], [0, 1]], 2) == ([[1.0, 2.0], [3.0, 4.0]], [[1, 0], [1, 0]])\", \"assert extract_data_by_target([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0], [7.0, 8.0]], [[1, 0], [1, 0], [0, 1], [0, 1]], 1...
{ "split": "train", "index": 68690, "acecode_id": "bigcode_python_fns_26351", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given the number of ranks in the x direction and the 2D coordinates of a rank (x, y), calculate the unique rank index in a 2D Cartesian topology. The unique rank index is determined by the formula: rank = (y * num_ranks_x) + x, where 'num_ranks_x' is the number of ranks in the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_rank(4, 2, 3) == 14\", \"assert calculate_rank(3, 0, 0) == 0\", \"assert calculate_rank(5, 4, 1) == 9\", \"assert calculate_rank(2, 1, 1) == 3\", \"assert calculate_rank(1, 0, 5) == 5\", \"assert calculate_rank(10, 9, 9) == 99\", \"assert calculate...
{ "split": "train", "index": 68691, "acecode_id": "bigcode_python_fns_48224", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates a form field based on specific criteria. The function should take three parameters: `size` (an integer representing the maximum allowed length of the input value), `show_label` (a boolean indicating whether the label fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_form_field(10, True, 'Hello') == True\", \"assert validate_form_field(5, True, 'Hello World') == False\", \"assert validate_form_field(8, False, 'Hello') == True\", \"assert validate_form_field(None, True, 'Hello') == True\", \"assert validate_form_...
{ "split": "train", "index": 68692, "acecode_id": "oss_5919", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves all the reason codes associated with a given application ID from a predefined list of application reason code entries. Each entry consists of an application ID and a corresponding reason code. Write a function `get_reason_c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_reason_codes_for_application(1) == ['REASON_A', 'REASON_B']\", \"assert get_reason_codes_for_application(2) == ['REASON_C']\", \"assert get_reason_codes_for_application(5) == []\", \"assert get_reason_codes_for_application(8) == []\", \"assert get_reason...
{ "split": "train", "index": 68693, "acecode_id": "oss_2913", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes in a list of file names and a file extension as input, and returns a list of file names that have the specified extension. If no files with the specified extension are found, the function should return a message indicati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_files_by_extension(['file1.txt', 'file2.txt', 'file3.csv', 'file4.txt'], 'txt') == ['file1.txt', 'file2.txt', 'file4.txt']\", \"assert find_files_by_extension(['doc.pdf', 'image.png', 'notes.txt', 'summary.docx'], 'txt') == ['notes.txt']\", \"assert fin...
{ "split": "train", "index": 68694, "acecode_id": "oss_5283", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `s` which consists of lowercase or uppercase letters, return the length of the longest palindrome that can be built with those letters. The palindrome must have a unique center (i.e., no double letters at the center). Letters are case sensitive, meaning that 'A' ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longestPalindrome('a') == 1\", \"assert longestPalindrome('racecar') == 7\", \"assert longestPalindrome('abcde') == 1\", \"assert longestPalindrome('Aabbcc') == 5\", \"assert longestPalindrome('abcdefg') == 1\", \"assert longestPalindrome('aabbccdde') == 9\"...
{ "split": "train", "index": 68695, "acecode_id": "evol_31829", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `create_student` that takes in four parameters: `name` (string), `age` (integer), `grade` (string), and `subject_grade` (dictionary). The function should create a student object based on the provided details. The function should raise exceptions for the fol...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_student('Alice', 18, 'A', {'Maths': 'B'}) is not None\", \"assert create_student('Bob', 20, 'C', {'Science': 'A', 'Maths': 'B'}) is not None\", \"assert create_student('Charlie', 24, 'B', {'English': 'C'}) is not None\", \"assert create_student('David...
{ "split": "train", "index": 68696, "acecode_id": "evol_3035", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a color normalization algorithm for a given image represented as a 2D list of RGB values. Color normalization is a process that aims to standardize the color distribution of an image, making it more consistent and reducing variations caused by f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_color([[(255, 0, 0), (0, 255, 0)], [(0, 0, 255), (255, 255, 255)]]) == [[(255, 0, 0), (0, 255, 0)], [(0, 0, 255), (255, 255, 255)]]\", \"assert normalize_color([[(0, 0, 0), (255, 255, 255)]]) == [[(0, 0, 0), (255, 255, 255)]]\", \"assert normalize_...
{ "split": "train", "index": 68697, "acecode_id": "oss_28824", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function `compare_documents(doc1: str, doc2: str) -> Tuple[Dict[str, int], Dict[str, List[str]]]` that compares two input documents and returns a dictionary containing the count of unique words that are common to both documents and a dictionary mapping each common w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_documents('Sample text one.', 'Sample text two.') == ({'sample': 2, 'text': 2}, {'sample': ['Sample text one.', 'Sample text two.'], 'text': ['Sample text one.', 'Sample text two.']})\", \"assert compare_documents('Hello there.', 'Goodbye there.') ==...
{ "split": "train", "index": 68698, "acecode_id": "evol_3998", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines whether a given URL string starts with 'file://'. Implement a function called 'is_file_url' that takes a string parameter 'url' and returns True if the URL starts with 'file://', and False otherwise. The function should ha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_file_url('file://path/to/resource') == True\", \"assert is_file_url('http://example.com') == False\", \"assert is_file_url('file:///home/user/file.txt') == True\", \"assert is_file_url('ftp://example.com/resource') == False\", \"assert is_file_url('file:/...
{ "split": "train", "index": 68699, "acecode_id": "bigcode_python_fns_46105", "num_tests": 16 }