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 managing a simple cloud storage service similar to Amazon S3. Implement a function called `manage_cloud_service` that takes in the following parameters: `bucket_name` (string), `operation` (string), `file_name` (optional string), and `max_keys` (optional int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_cloud_service('test_bucket', 'upload', 'file.txt') == 'Uploading file.txt to test_bucket.'\", \"assert manage_cloud_service('test_bucket', 'download', 'file.txt') == 'Downloading file.txt from test_bucket.'\", \"assert manage_cloud_service('test_bucke... | {
"split": "train",
"index": 78600,
"acecode_id": "evol_14027",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the operation of a water heater system. The water heater can operate in different modes and has a target temperature. You need to implement a function `update_water_heater_state(current_mode: str, target_temp: int, current_temp: int) -> str` that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_water_heater_state('AUTO', 45, 30) == 'heating'\", \"assert update_water_heater_state('AUTO', 45, 45) == 'off'\", \"assert update_water_heater_state('AUTO', 45, 60) == 'off'\", \"assert update_water_heater_state('ON', 45, 30) == 'heating'\", \"assert ... | {
"split": "train",
"index": 78601,
"acecode_id": "bigcode_python_fns_34107",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a decorator function `importlib_only(fxn)` that will skip the execution of a function when a specific condition is met. The condition is determined by a boolean variable `using___import__`. If `using___import__` is True, then the function should be ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert importlib_only(lambda: 'Hello, World!')() == 'Hello, World!' if not using___import__ else None\", \"assert importlib_only(lambda: 'Test')() == 'Test' if not using___import__ else None\", \"assert importlib_only(lambda: 1 + 1)() == 2 if not using___import__ e... | {
"split": "train",
"index": 78602,
"acecode_id": "bigcode_python_fns_19581",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the amount of traffic sent from a T1 router to a server over a period of time. Your task is to implement a function `calculate_total_traffic(traffic: List[int]) -> int` that calculates the total amount of traffic sent during this pe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_traffic([10, 20, 30]) == 60\", \"assert calculate_total_traffic([0, 0, 0]) == 0\", \"assert calculate_total_traffic([5]) == 5\", \"assert calculate_total_traffic([]) == 0\", \"assert calculate_total_traffic([1, 2, 3, 4, 5]) == 15\", \"assert ... | {
"split": "train",
"index": 78603,
"acecode_id": "bigcode_python_fns_34908",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates an empty datastore JSON string. The function should take a string input representing the file path where the datastore will be written. If the input string is not None, the function should return a JSON representation of an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_empty_datastore('path/to/datastore.json') == '[]'\", \"assert generate_empty_datastore('another/path/to/datastore.json') == '[]'\", \"assert generate_empty_datastore(None) == None\", \"assert generate_empty_datastore('') == '[]'\", \"assert generate... | {
"split": "train",
"index": 78604,
"acecode_id": "bigcode_python_fns_39572",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `divisible_by_two(numbers)` that returns a list of Boolean values. Each Boolean value should indicate whether the corresponding integer in the input list is divisible by two. The function should handle both positive and negative in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert divisible_by_two([1, 2, 3, 4, 5]) == [False, True, False, True, False]\", \"assert divisible_by_two([0, -1, -2, 3, 4]) == [True, False, True, False, True]\", \"assert divisible_by_two([10, 15, 20, 25, 30]) == [True, False, True, False, True]\", \"assert divi... | {
"split": "train",
"index": 78605,
"acecode_id": "evol_28371",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `hex_to_char(hex_value: str) -> str` that takes a hexadecimal string representing a Unicode character beyond the basic ASCII range and returns its corresponding character. The input hexadecimal string will be in the format of a valid hexadecimal number (e.g., '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hex_to_char('03B1') == '\\u03b1'\", \"assert hex_to_char('03A9') == '\\u03a9'\", \"assert hex_to_char('221E') == '\\u221e'\", \"assert hex_to_char('1F600') == '\\ud83d\\ude00'\", \"assert hex_to_char('03B2') == '\\u03b2'\", \"assert hex_to_char('03C0') == '\... | {
"split": "train",
"index": 78606,
"acecode_id": "evol_11146",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings representing the names of epithelial cells, implement a function that returns the number of unique epithelial cell names in the list. Each name is case-sensitive, meaning 'Cell' and 'cell' are considered different. Your function should take a list of str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_cells(['Cell', 'cell', 'CELL', 'cell']) == 3\", \"assert count_unique_cells(['Epithelial', 'Epithelial', 'Epithelial']) == 1\", \"assert count_unique_cells(['A', 'B', 'C', 'A', 'B']) == 3\", \"assert count_unique_cells(['One', 'Two', 'Three']) =... | {
"split": "train",
"index": 78607,
"acecode_id": "bigcode_python_fns_45510",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of file names as input and renames them by replacing any spaces in the file names with underscores. The function should log the renaming action, displaying the original file name and the new file name. It should return a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rename_files(['file name 1.txt', 'another file.doc', 'test file.pdf']) == [('file name 1.txt', 'file_name_1.txt'), ('another file.doc', 'another_file.doc'), ('test file.pdf', 'test_file.pdf')]\", \"assert rename_files(['example file.txt', 'my document.docx']... | {
"split": "train",
"index": 78608,
"acecode_id": "oss_25996",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a string consisting of words separated by a specified delimiter, write a function that splits the string into individual words and returns a list of these words. If the input string is empty, return an empty list. If the delimiter is not found, the return list should cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_string('apple,banana,cherry', ',') == ['apple', 'banana', 'cherry']\", \"assert split_string('apple-banana-cherry', '-') == ['apple', 'banana', 'cherry']\", \"assert split_string('one|two|three|four', '|') == ['one', 'two', 'three', 'four']\", \"assert... | {
"split": "train",
"index": 78609,
"acecode_id": "bigcode_python_fns_47303",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `foo(nums_data)` that adds 2 to each integer in the list and filters out the prime numbers from the resulting list. The function should return a new list that contains only the non-prime numbers in the same order as they appear aft... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert foo([1, 2, 3]) == [4]\", \"assert foo([4, 6, 8]) == [6, 8, 10]\", \"assert foo([10, 12, 14]) == [12, 14, 16]\", \"assert foo([]) == []\", \"assert foo([8, 9, 10]) == [10, 12]\", \"assert foo([100, 101, 102]) == [102, 104]\", \"assert foo([3, 4, 5, 6]) == [6,... | {
"split": "train",
"index": 78610,
"acecode_id": "evol_27616",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string representing a resampling method and returns the corresponding index of that method from a predefined list of valid resampling methods. The valid methods are: ['nearest', 'bilinear', 'cubic', 'cubic_spline', 'lanczos']. If the input stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_resampling_index('nearest') == 0\", \"assert get_resampling_index('bilinear') == 1\", \"assert get_resampling_index('cubic') == 2\", \"assert get_resampling_index('cubic_spline') == 3\", \"assert get_resampling_index('lanczos') == 4\", \"assert get_resam... | {
"split": "train",
"index": 78611,
"acecode_id": "bigcode_python_fns_1176",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a nested list of integers and an optional integer parameter `levels`. Your task is to implement a function `flatten(value: list, levels: Optional[int] = None) -> list` that flattens the list according to the specified levels. If `levels` is not provided (or is `No... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten([1, 2, [3, [4, 5, [6]], 7]]) == [1, 2, 3, 4, 5, 6, 7]\", \"assert flatten([1, 2, [3, [4, 5], 6]]) == [1, 2, 3, 4, 5, 6]\", \"assert flatten([1, [2, [3, 4]], 5], levels=1) == [1, 2, [3, 4], 5]\", \"assert flatten([[1, 2], [3, [4, 5]]], levels=2) == [1... | {
"split": "train",
"index": 78612,
"acecode_id": "bigcode_python_fns_43642",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with checking the availability of network devices on a system. Write a function called `device_exists` that takes a string parameter `device`, which represents the name of a network device. The function should return `True` if the device exists (simulating that t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert device_exists('eth0') == True\", \"assert device_exists('wlan0') == True\", \"assert device_exists('lo') == True\", \"assert device_exists('eth1') == False\", \"assert device_exists('wlan1') == False\", \"assert device_exists('usb0') == False\", \"assert dev... | {
"split": "train",
"index": 78613,
"acecode_id": "bigcode_python_fns_41372",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that accepts an integer and returns 'prime' if it is a prime number, and 'composite' if it is not. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. A composite number is a natural number greate... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_prime(2) == 'prime'\", \"assert check_prime(3) == 'prime'\", \"assert check_prime(4) == 'composite'\", \"assert check_prime(5) == 'prime'\", \"assert check_prime(6) == 'composite'\", \"assert check_prime(7) == 'prime'\", \"assert check_prime(8) == 'com... | {
"split": "train",
"index": 78614,
"acecode_id": "evol_32364",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `is_valid_iban(iban: str) -> bool` that checks if a given International Bank Account Number (IBAN) is valid. An IBAN is valid if it meets the following criteria: 1. It starts with two uppercase letters representing the country code. 2. It is fol... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_iban('GB29NWBK60161331926819') == True\", \"assert is_valid_iban('DE89370400440532013000') == True\", \"assert is_valid_iban('FR1420041010050500013M02606') == True\", \"assert is_valid_iban('ES9121000418450200051332') == True\", \"assert is_valid_ib... | {
"split": "train",
"index": 78615,
"acecode_id": "bigcode_python_fns_34392",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a program that evaluates the satisfiability of logical formulas represented as strings. The logical formulas consist of uppercase letters as variables and the logical operators \"&&\" for logical AND, \"||\" for logical OR, \"!\" for logical NOT... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process('A || !A') == 'Formula is satisfiable'\", \"assert process('A && !A') == 'Formula is not satisfiable'\", \"assert process('A <=> A') == 'Formula is satisfiable'\", \"assert process('!A <=> A') == 'Formula is not satisfiable'\", \"assert process('!A |... | {
"split": "train",
"index": 78616,
"acecode_id": "oss_3531",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a string s consisting of only '0's and '1's, write a function that calculates the number of ways to split the string into three non-empty parts such that each part has the same number of '1's. If it is not possible to split, return 0. The result should be returned modulo ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert numWays('111') == 0\", \"assert numWays('10101') == 0\", \"assert numWays('111000') == 0\", \"assert numWays('111000000') == 0\", \"assert numWays('101110') == 0\", \"assert numWays('101110101') == 2\", \"assert numWays('000111000') == 0\", \"assert numWays(... | {
"split": "train",
"index": 78617,
"acecode_id": "evol_19775",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a GitHub repository name in the format 'username/repo_name'. Write a function that extracts and returns the username and the repository name as a tuple. If the input does not contain a '/', return None. The username is the part before the '/'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_repo_info('octocat/Hello-World') == ('octocat', 'Hello-World')\", \"assert extract_repo_info('user/repo_name') == ('user', 'repo_name')\", \"assert extract_repo_info('') == None\", \"assert extract_repo_info('octocat/') == None\", \"assert extract_re... | {
"split": "train",
"index": 78618,
"acecode_id": "bigcode_python_fns_12829",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of package dependencies and returns a dictionary containing the package names as keys and their respective versions as values. The input list will consist of strings in the format 'package_name>=version_number... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_versions(['batchspawner>=0.9.0.dev0', 'numpy>=1.19.2', 'pandas>=1.1.3']) == {'batchspawner': '0.9.0.dev0', 'numpy': '1.19.2', 'pandas': '1.1.3'}\", \"assert extract_versions(['requests>=2.25.1', 'beautifulsoup4>=4.9.3']) == {'requests': '2.25.1', 'be... | {
"split": "train",
"index": 78619,
"acecode_id": "oss_37176",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of dictionaries, calculate the aggregated sum of all values associated with keys that start with 'price'. The keys may include 'price', 'price_1', 'price_2', and so on. If a dictionary does not contain any of these keys, it should be ignored. Your function should r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_price_sum([{'price': 5, 'price_1': 10}, {'price': 7}, {'price_3': 20}]) == 42\", \"assert calculate_price_sum([{'price': 1}, {'price_1': 2, 'price_2': 3}, {'price_3': 4}]) == 10\", \"assert calculate_price_sum([{'price': 0}, {'price_1': 0}, {'price... | {
"split": "train",
"index": 78620,
"acecode_id": "evol_13195",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a tuple of positive numerical values, implement a function that calculates the geometric mean of the numbers in the tuple. If the tuple is empty, return 0. The geometric mean is defined as the nth root of the product of n numbers, where n is the count of numbers in the tu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert geometric_mean((1, 2, 3, 4, 5)) == 2.605171084697352\", \"assert geometric_mean((2, 8)) == 4.0\", \"assert geometric_mean((3, 3, 3)) == 3.0\", \"assert geometric_mean((1, 1, 1, 1)) == 1.0\", \"assert geometric_mean((50, 100)) == 70.71067811865476\", \"assert... | {
"split": "train",
"index": 78621,
"acecode_id": "evol_13285",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a two-dimensional matrix of size n x m, where n and m are positive integers, write a function that calculates the number of distinct paths from the bottom-left corner to the top-right corner of the matrix. You can only move either up or to the right at any point in time. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert num_of_routes(5, 5) == 70\", \"assert num_of_routes(1, 1) == 1\", \"assert num_of_routes(2, 3) == 3\", \"assert num_of_routes(3, 2) == 3\", \"assert num_of_routes(3, 3) == 6\", \"assert num_of_routes(4, 4) == 20\", \"assert num_of_routes(2, 2) == 2\", \"asse... | {
"split": "train",
"index": 78622,
"acecode_id": "evol_34812",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given two lists, `main_list` and `prefix_list`, write a function `is_prefix(main_list, prefix_list)` that determines whether `main_list` starts with all the elements of `prefix_list`. The function should return True if `main_list` starts with `prefix_list`, and False otherwise.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_prefix([1, 2, 3, 4], [1, 2]) == True\", \"assert is_prefix([1, 2, 3, 4], [1, 2, 3]) == True\", \"assert is_prefix([1, 2, 3, 4], [2]) == False\", \"assert is_prefix([1, 2, 3, 4], []) == True\", \"assert is_prefix([], [1]) == False\", \"assert is_prefix([],... | {
"split": "train",
"index": 78623,
"acecode_id": "bigcode_python_fns_31704",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of valid schedules, where each schedule is represented as a list of slots. Each slot can accommodate a certain class identified by an index, and the class availability is denoted by a binary value (1 for available, 0 for not available). Your task is to impl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_schedules_by_class(0, 1, [[1, 0, 1], [0, 1, 0], [1, 1, 1]]) == [[1, 0, 1], [1, 1, 1]]\", \"assert filter_schedules_by_class(1, 1, [[1, 1, 1], [1, 1, 1], [0, 0, 0]]) == [[1, 1, 1], [1, 1, 1]]\", \"assert filter_schedules_by_class(2, 1, [[0, 0, 0], [0, ... | {
"split": "train",
"index": 78624,
"acecode_id": "bigcode_python_fns_26921",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of robots and a maximum allowed distance they can travel, epsilon. Each robot has a current position represented by its nearest node coordinates (x, y) and a random target position (vrand) that it should steer towards. Implement a function that updates the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert steer([{'nearestNode': [0, 0], 'vrand': [1, 1], 'uMax': 2.0, 'discretization': [5, 5]}], 1.0) == [[0, 0]]\", \"assert steer([{'nearestNode': [2, 2], 'vrand': [5, 5], 'uMax': 3.0, 'discretization': [10, 10]}], 2.0) == [[3, 3]]\", \"assert steer([{'nearestNode... | {
"split": "train",
"index": 78625,
"acecode_id": "bigcode_python_fns_4342",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of words, implement a function that returns a list of groups of anagrams. Each group should contain words that are anagrams of each other. The order of the groups and the order of words within each group do not matter. You need to implement the function `find_anagr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_anagrams([\\\"bat\\\", \\\"cat\\\", \\\"tac\\\", \\\"tab\\\"]) == [[\\\"bat\\\", \\\"tab\\\"], [\\\"cat\\\", \\\"tac\\\"]]\", \"assert find_anagrams([\\\"listen\\\", \\\"silent\\\", \\\"enlist\\\", \\\"inlets\\\"]) == [[\\\"listen\\\", \\\"silent\\\", \... | {
"split": "train",
"index": 78626,
"acecode_id": "evol_29188",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that computes and returns the total sum of squared values for each number in a given list that is both negative and even. The function should exclude any positive numbers or non-integer values from this computation. If the list is empty, the function should re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert negative_even_squares_sum([-2, -4, -6, -8]) == 120\", \"assert negative_even_squares_sum([-1, -3, -2]) == 4\", \"assert negative_even_squares_sum([5, -2]) == 4\", \"assert negative_even_squares_sum([0]) == 0\", \"assert negative_even_squares_sum([]) == 0\", ... | {
"split": "train",
"index": 78627,
"acecode_id": "evol_6348",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of actions represented as strings and a list of expected nodes represented as strings. Your task is to verify that every expected node has a corresponding action in the list. If a node is missing an action, return the first missing node. If all expected nod... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_actions(['action1', 'action2'], ['action1', 'action2']) is None\", \"assert verify_actions(['action1'], ['action1', 'action2']) == 'action2'\", \"assert verify_actions([], ['action1', 'action2']) == 'action1'\", \"assert verify_actions(['action1', 'ac... | {
"split": "train",
"index": 78628,
"acecode_id": "bigcode_python_fns_42308",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of buildings in a skyline. Your task is to implement a function that returns the maximum area of a rectangle that can be formed by selecting consecutive buildings. The rectangle's height must be equal to the shortest bui... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_rectangle_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_rectangle_area([1, 1, 1, 1]) == 4\", \"assert max_rectangle_area([4, 2, 0, 3, 2, 5]) == 6\", \"assert max_rectangle_area([6, 2, 5, 4, 5, 1, 6]) == 12\", \"assert max_rectangle_area([1, 2, 3, 4, 5])... | {
"split": "train",
"index": 78629,
"acecode_id": "bigcode_python_fns_12598",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to determine whether the current time falls within a defined trade window for a financial trading system. The trade window is defined as the time period between 9:00 AM and 3:00 PM, excluding the first 5 minutes of the morning (9:00 A... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_trade_window(datetime(2023, 10, 23, 9, 0)) == False\", \"assert is_trade_window(datetime(2023, 10, 23, 9, 5)) == True\", \"assert is_trade_window(datetime(2023, 10, 23, 14, 54)) == True\", \"assert is_trade_window(datetime(2023, 10, 23, 14, 59)) == False\... | {
"split": "train",
"index": 78630,
"acecode_id": "oss_15891",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a string as input and returns a new string where all lowercase letters are transformed into uppercase letters. The function should not modify any other characters in the string, such as spaces, punctuation, or digits. For example, the input 'hello wo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_uppercase('hello world!') == 'HELLO WORLD!'\", \"assert to_uppercase('this is a test.') == 'THIS IS A TEST.'\", \"assert to_uppercase('Python 3.8 is great!') == 'PYTHON 3.8 IS GREAT!'\", \"assert to_uppercase('UPPERCASE LETTERS') == 'UPPERCASE LETTERS'\",... | {
"split": "train",
"index": 78631,
"acecode_id": "evol_3069",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of 2D patches, each represented as a 2D array, your task is to aggregate these patches into a single 2D array representing an image. Each patch has a fixed size and you are also provided with their starting locations in the original image. If patches overlap, the o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert aggregate_patches([[[1]], [[2]], [[3]], [[4]]], [2, 2], [[0, 0], [0, 1], [1, 0], [1, 1]]) == [[1, 2], [3, 4]]\", \"assert aggregate_patches([[[1, 0], [0, 0]], [[0, 1], [1, 0]]], [2, 2], [[0, 0], [0, 0]]) == [[1, 1], [1, 0]]\", \"assert aggregate_patches([[[1... | {
"split": "train",
"index": 78632,
"acecode_id": "bigcode_python_fns_46909",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a string 's' representing a sequence of RNA nucleotides, where each nucleotide is represented by a character in the string ('A', 'C', 'G', 'U'). Your task is to implement a function that calculates the number of unique base pairings in the RNA sequence. A base pai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_base_pairings('AUGC') == 2\", \"assert count_unique_base_pairings('AUCGAU') == 3\", \"assert count_unique_base_pairings('ACGUACGU') == 4\", \"assert count_unique_base_pairings('ACG') == 1\", \"assert count_unique_base_pairings('UUAAGG') == 2\", ... | {
"split": "train",
"index": 78633,
"acecode_id": "bigcode_python_fns_10383",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a string of merit variables separated by spaces. Your task is to implement a function called `process_merit_variables(merit_variables: str) -> List[str]` that takes this string as input and returns a list of individual variables. However, you need to filter out an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_merit_variables('Variable1 CTBVariable2 Variable3') == ['Variable1', 'Variable3']\", \"assert process_merit_variables('CTB123 CTB456') == []\", \"assert process_merit_variables('CTB CTB CTB') == []\", \"assert process_merit_variables('Layer1 Layer2 C... | {
"split": "train",
"index": 78634,
"acecode_id": "oss_10663",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function in Python that calculates the average of the first five elements from a given integer-based list. If the list contains fewer than five elements, return None. The function should handle cases where the input list is empty or contains invalid data gracefully.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert first_five_and_average([2, 4, 6, 8, 10, 12, 14]) == 6.0\", \"assert first_five_and_average([1, 2, 3]) == None\", \"assert first_five_and_average([5]) == None\", \"assert first_five_and_average([]) == None\", \"assert first_five_and_average([10, 20, 30, 40, 5... | {
"split": "train",
"index": 78635,
"acecode_id": "evol_31711",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that counts the occurrences of each word in a given string. The program should ignore punctuation and consider words with different capitalizations as the same word. Your program should return a dictionary containing the word count for eac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_word_occurrences('The quick brown fox jumps over the lazy dog. The dog barks, and the fox runs away.') == {'and': 1, 'away': 1, 'barks': 1, 'brown': 1, 'dog': 2, 'fox': 2, 'jumps': 1, 'lazy': 1, 'over': 1, 'quick': 1, 'runs': 1, 'the': 4}\", \"assert c... | {
"split": "train",
"index": 78636,
"acecode_id": "oss_17835",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string representation of a whole number, converts it to an integer, and returns a list of its prime factors in ascending order. The input string will always represent a valid positive integer.\nPlease reason step by step, then write a self-cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorize_string('1') == []\", \"assert factorize_string('2') == [2]\", \"assert factorize_string('3') == [3]\", \"assert factorize_string('4') == [2, 2]\", \"assert factorize_string('5') == [5]\", \"assert factorize_string('6') == [2, 3]\", \"assert factori... | {
"split": "train",
"index": 78637,
"acecode_id": "evol_13705",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an XML tree represented as a dictionary and a schema dictionary, implement a function `tag_exists(xml_dict: dict, schema_dict: dict, tag: str, contains: str = None, not_contains: str = None) -> bool` that checks if a specified tag exists in the XML tree according to the r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert tag_exists({'filmPos': {}}, {'filmPos': {}}, 'filmPos') == True\", \"assert tag_exists({'calculationSetup': {}}, {'calculationSetup': {}}, 'calculationSetup') == True\", \"assert tag_exists({'ldaU': {'species': {}}}, {'ldaU': {}}, 'ldaU', contains='species')... | {
"split": "train",
"index": 78638,
"acecode_id": "bigcode_python_fns_40841",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that determines whether a given integer is a palindrome. A palindrome is a number that remains the same when its digits are reversed. For example, 121 is a palindrome, while 123 is not. The function should take an integer as input and return True if it is a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome(121) == True\", \"assert is_palindrome(12321) == True\", \"assert is_palindrome(123) == False\", \"assert is_palindrome(0) == True\", \"assert is_palindrome(1) == True\", \"assert is_palindrome(10) == False\", \"assert is_palindrome(11) == True... | {
"split": "train",
"index": 78639,
"acecode_id": "evol_24273",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and a target integer. Your task is to implement a function that determines if any two integers in the list sum up to the target integer. You should return a boolean value: true if such a pair exists, and false otherwise. The function should have... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_pair_with_sum([1, 2, 3, 4, 5], 5) == True\", \"assert has_pair_with_sum([10, 15, 3, 7], 17) == True\", \"assert has_pair_with_sum([1, 2, 3, 4, 5], 10) == False\", \"assert has_pair_with_sum([0, -1, 2, -3, 1], -2) == True\", \"assert has_pair_with_sum([-1... | {
"split": "train",
"index": 78640,
"acecode_id": "bigcode_python_fns_24688",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes motion tracking data. The function should take in the following parameters: \n- `times` (list of float): A list of time values representing the instances at which events occur during the experiment. \n- `events` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_event_indices([0.1, 0.5, 1.0], [0.6, 1.0], [[1, 2], [3, 4], [5, 6]], ['r', 'g']) == [2, 2]\", \"assert find_event_indices([0.2, 0.4, 0.6, 0.8], [1.0], [[1, 1], [2, 2], [3, 3], [4, 4]], ['b']) == [-1]\", \"assert find_event_indices([0.0, 0.1, 0.2, 0.3], ... | {
"split": "train",
"index": 78641,
"acecode_id": "oss_37081",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to format a title based on a given maximum length. The function should truncate the title if it exceeds the maximum length and append '...' to the end if it has been truncated. Implement the function with the following signature: \n\n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert formatTitle('Python', 10) == 'Python'\", \"assert formatTitle('Python Programming', 20) == 'Python Programming'\", \"assert formatTitle('Data Science', 15) == 'Data Science'\", \"assert formatTitle('Hello World', 11) == 'Hello World'\", \"assert formatTitle(... | {
"split": "train",
"index": 78642,
"acecode_id": "oss_35843",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves catalog nodes based on provided input and a flag indicating whether to use a catalog. Write a function `get_catalog_nodes(input_txt: dict, use_catalog: bool, catalog_path: str) -> list` that takes the following paramete... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_catalog_nodes({'source3': {'metadata': 'meta2'}}, False, 'path/to/catalog') == []\", \"assert get_catalog_nodes({'source4': {'columns': ['col3', 'col4']}}, False, 'path/to/catalog') == []\", \"assert get_catalog_nodes({}, False, 'path/to/catalog') == []\... | {
"split": "train",
"index": 78643,
"acecode_id": "oss_21768",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of records, where each record is a dictionary containing various key-value pairs. Your task is to implement a function that extracts a specific key's values from each record and returns a list of dictionaries, each containing the specified key and its corre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_key_values([{'Id':'001'}, {'Id':'002'}], 'Id') == [{'Id':'001'}, {'Id':'002'}]\", \"assert extract_key_values([{'id':'A'}, {'id':'B'}, {'id':'C'}], 'id') == [{'id':'A'}, {'id':'B'}, {'id':'C'}]\", \"assert extract_key_values([{'Name':'Alice'}, {'Name... | {
"split": "train",
"index": 78644,
"acecode_id": "bigcode_python_fns_29972",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `should_bail_out(status_codes: List[int]) -> bool`. This function takes a list of HTTP status codes and determines whether a process should bail out after three consecutive 503 status codes. The function should return `True` if there ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert should_bail_out([503, 503, 503, 200]) == True\", \"assert should_bail_out([200, 200, 200]) == False\", \"assert should_bail_out([503, 503, 200, 503]) == False\", \"assert should_bail_out([503, 503, 503]) == True\", \"assert should_bail_out([503, 200, 503, 50... | {
"split": "train",
"index": 78645,
"acecode_id": "bigcode_python_fns_9471",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a string representation of a mathematical function based on its arguments, number of arguments, and child nodes. The function should take three parameters: a list of argument names (strings), an integer representing the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert function_repr(['x', 'y'], 2, ['f(x)', 'g(y)']) == 'Function(x, y, 2, [f(x), g(y)])'\", \"assert function_repr([], 0, ['g()']) == 'Function([], 0, [g()])'\", \"assert function_repr(['x', 'y', 'z'], 3, ['h(x, y)', 'i(z)']) == 'Function(x, y, z, 3, [h(x, y), i(... | {
"split": "train",
"index": 78646,
"acecode_id": "oss_18329",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given the root node of a binary search tree, implement a function `rangeSumBST(root, low, high)` that computes the cumulative sum of the values of all nodes that fall within a specified range `[low, high]`. The binary search tree can contain nodes ranging from `[1, 2 * 10^4]`. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rangeSumBST(TreeNode(10, TreeNode(5, TreeNode(3), TreeNode(7)), TreeNode(15, None, TreeNode(18))), 7, 15) == 32\", \"assert rangeSumBST(TreeNode(5, TreeNode(3), TreeNode(7)), 6, 10) == 7\", \"assert rangeSumBST(TreeNode(10), 10, 10) == 10\", \"assert rangeSu... | {
"split": "train",
"index": 78647,
"acecode_id": "evol_14505",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of patient IDs, a list of labels for each patient, and a list of feature values associated with those patients. Your task is to implement a function that takes these three lists as input and returns a dictionary that summarizes the number of patients and th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert summarize_patient_data(['P001', 'P002', 'P003'], [1, 0, 1], [[0.1, 0.2], [0.3, 0.4], [0.5, 0.6]]) == {'total_patients': 3, 'unique_labels': [0, 1], 'label_distribution': {1: 2, 0: 1}}\", \"assert summarize_patient_data(['P004', 'P005'], [1, 1], [[1.0, 1.1], ... | {
"split": "train",
"index": 78648,
"acecode_id": "bigcode_python_fns_44183",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `get_trace_value(trace_token: str, trace_email: str, trace_log: bool) -> Union[str, None]` that returns a specific trace header value based on the provided parameters. The function should prioritize the values in the following order: if `trace_t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_trace_value('abc123', '', False) == 'token:abc123'\", \"assert get_trace_value('', 'user@example.com', False) == 'email:user@example.com'\", \"assert get_trace_value('', '', True) == 'log'\", \"assert get_trace_value('', '', False) == None\", \"assert ge... | {
"split": "train",
"index": 78649,
"acecode_id": "bigcode_python_fns_30939",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates basic operations of a bank account. The function should take an initial balance and a list of operations to perform on the account. The operations include deposits and withdrawals. The function should return the final b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_account_operations(1000, [('deposit', 500), ('withdraw', 200)]) == (1300, 2)\", \"assert bank_account_operations(0, [('withdraw', 100), ('deposit', 100)]) == (100, 1)\", \"assert bank_account_operations(1000, [('deposit', 100), ('deposit', 100)]) == (12... | {
"split": "train",
"index": 78650,
"acecode_id": "oss_8146",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with verifying a set of configuration constants. You need to implement a function, `validate_config`, that takes a dictionary of configuration variables as input. Each variable should have a non-empty string value. Your function should return a list of strings in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_config({'ECF_MICRO': 'value', 'ECF_HOME': 'value', 'ECF_JOB_CMD': 'value', 'ECF_KILL_CMD': 'value', 'ECF_STATUS_CMD': 'value', 'ECF_URL_CMD': 'value', 'ECF_LOG': 'value'}) == []\", \"assert validate_config({'ECF_MICRO': '', 'ECF_HOME': 'value', 'ECF... | {
"split": "train",
"index": 78651,
"acecode_id": "oss_6970",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `compare_values(x, y, error_margin=0.00001)` that compares two numerical values or pairs of numerical values. The function should return 'subordinate' if the first value is less than the second value, 'superior' if the first value is greater than the second... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_values(1, 2) == 'subordinate'\", \"assert compare_values(2, 1) == 'superior'\", \"assert compare_values(1.00001, 1.00002) == 'identical'\", \"assert compare_values(1.00001, 1.00001) == 'identical'\", \"assert compare_values(1.0, 1.0) == 'identical'\"... | {
"split": "train",
"index": 78652,
"acecode_id": "evol_7411",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a nested list, implement a function that creates a new list where each numeric element is multiplied by 2. If the element is a list itself, the function should recursively apply this operation to the inner list. The function should return a new list without modifying the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert amplify_list_elements([1, 2, [3, 4], 5]) == [2, 4, [6, 8], 10]\", \"assert amplify_list_elements([0, -1, [2, -3], 4]) == [0, -2, [4, -6], 8]\", \"assert amplify_list_elements([[1], [2, [3]]]) == [[2], [4, [6]]]\", \"assert amplify_list_elements([10, [20, [30... | {
"split": "train",
"index": 78653,
"acecode_id": "evol_33337",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `char_frequency` that takes an input string and returns a dictionary containing the frequency of each unique character in the string, ignoring case differences. The function should count all characters, including letters, numbers, and special characters. Fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert char_frequency('') == {}\", \"assert char_frequency('!@#$$%^&*()') == {'!': 1, '@': 1, '#': 1, '$': 2, '%': 1, '^': 1, '&': 1, '*': 1, '(': 1, ')': 1}\", \"assert char_frequency('Hello World!') == {'h': 1, 'e': 1, 'l': 3, 'o': 2, ' ': 1, 'w': 1, 'r': 1, 'd':... | {
"split": "train",
"index": 78654,
"acecode_id": "evol_11861",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a two-dimensional list of numbers, write a function `median(data)` that returns a list containing the median of each column of the input list. If the number of elements in a column is odd, return the middle element. If it is even, return the average of the two middle elem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median([[1, 2, 3], [4, 5, None], [7, 8, 9]]) == [4.0, 5.0, 6.0]\", \"assert median([[None, None], [1.5, 2.5], [3.5, 4.5]]) == [2.5, 3.5]\", \"assert median([[1, 2], [3, 4], [5, 6]]) == [3.0, 4.0]\", \"assert median([[None], [1], [2], [3]]) == [2.0]\", \"asse... | {
"split": "train",
"index": 78655,
"acecode_id": "bigcode_python_fns_21478",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a function `next_triangular_pentagonal_hexagonal()` that finds the next triangular number which is also both pentagonal and hexagonal, starting from the number 40755. The function should return this number.\nPlease reason step by step, then write a self-contained Python s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert next_triangular_pentagonal_hexagonal() > 40755\", \"assert next_triangular_pentagonal_hexagonal() > 40700\", \"assert next_triangular_pentagonal_hexagonal() % 3 == 0\", \"assert next_triangular_pentagonal_hexagonal() > 41000\", \"assert next_triangular_penta... | {
"split": "train",
"index": 78656,
"acecode_id": "evol_11751",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `longest_uninterrupted_chain(my_string: str) -> Tuple[str, int]` that returns the longest uninterrupted chain of identical alphabets within a given string. The function should return a tuple containing the character that forms the longest chain and the leng... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_uninterrupted_chain('abccdeefghj') == ('c', 2)\", \"assert longest_uninterrupted_chain('aaaabbaaaccc') == ('a', 4)\", \"assert longest_uninterrupted_chain('abcdefgh') == ('a', 1)\", \"assert longest_uninterrupted_chain('aabbccddeeff') == ('a', 2)\", ... | {
"split": "train",
"index": 78657,
"acecode_id": "evol_35224",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function 'sum_of_elements' that returns the sum of all the elements in the list.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block."
}
] | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_elements([1, 5, 0, -9, 3]) == 0\", \"assert sum_of_elements([10, 20, 30]) == 60\", \"assert sum_of_elements([-1, -2, -3]) == -6\", \"assert sum_of_elements([0, 0, 0]) == 0\", \"assert sum_of_elements([1]) == 1\", \"assert sum_of_elements([]) == 0\", \... | {
"split": "train",
"index": 78658,
"acecode_id": "evol_3573",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing hosts in a network. Each dictionary contains the following keys: 'host_name', 'platform', 'os_version', and 'production'. Your task is to filter out the hosts that are marked as production (i.e., 'production' key is True) and re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_production_hosts([{'host_name': 'host1', 'platform': 'linux', 'os_version': '1.0', 'production': True}, {'host_name': 'host2', 'platform': 'windows', 'os_version': '10', 'production': False}, {'host_name': 'host3', 'platform': 'linux', 'os_version': '... | {
"split": "train",
"index": 78659,
"acecode_id": "bigcode_python_fns_23637",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `first_n_primes(n: int) -> List[int]` that returns the first `n` prime numbers. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. The function should return a list containing the first `n` pr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert first_n_primes(0) == []\", \"assert first_n_primes(1) == [2]\", \"assert first_n_primes(2) == [2, 3]\", \"assert first_n_primes(3) == [2, 3, 5]\", \"assert first_n_primes(4) == [2, 3, 5, 7]\", \"assert first_n_primes(5) == [2, 3, 5, 7, 11]\", \"assert first_... | {
"split": "train",
"index": 78660,
"acecode_id": "evol_36162",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `divide(num1, num2)` that takes two numbers as input and returns the result of dividing `num1` by `num2`. If `num2` is zero, the function should return 'Error: Division by zero is not allowed.' If either `num1` or `num2` is not a number, the function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert divide(10, 0) == 'Error: Division by zero is not allowed.'\", \"assert divide(10, 'a') == 'Error: Invalid input type.'\", \"assert divide('a', 5) == 'Error: Invalid input type.'\", \"assert divide(10, 2) == 5\", \"assert divide(10.0, 2) == 5.0\", \"assert di... | {
"split": "train",
"index": 78661,
"acecode_id": "evol_34598",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers where each integer represents the height of a bar in a histogram. Write a function `max_area` that computes the maximum rectangular area that can be formed within the histogram. The width of each bar is 1. You need to return the maximum area cal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_area([1, 1, 1, 1]) == 4\", \"assert max_area([4, 2, 0, 3, 2, 5]) == 6\", \"assert max_area([5, 4, 1, 2]) == 8\", \"assert max_area([0]) == 0\", \"assert max_area([1, 2, 3, 4, 5]) == 9\", \"assert max_area([1... | {
"split": "train",
"index": 78662,
"acecode_id": "bigcode_python_fns_21431",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing a list of event data from a fictional event tracking system. Each event is represented as a string in the format 'event_type,timestamp,user_id'. Your goal is to implement a function that takes a list of event strings and performs the following task... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_events(['click,1598912234,user123']) == {'total_events': 1, 'unique_users': 1, 'average_time_gap': 0}\", \"assert analyze_events(['click,1598912234,user123', 'click,1598912254,user123']) == {'total_events': 2, 'unique_users': 1, 'average_time_gap': 2... | {
"split": "train",
"index": 78663,
"acecode_id": "oss_20154",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of k-points, each represented as a tuple of three floats (x, y, z), your task is to filter out the k-points that have a non-zero z-component and return a list of unique 2D k-points (x, y) with a z-component of zero. The output list should maintain the order of firs... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_z_kpoints([(1.0, 2.0, 0.0), (3.0, 4.0, 0.0), (5.0, 6.0, 1.0), (1.0, 2.0, 0.0)]) == [(1.0, 2.0), (3.0, 4.0)]\", \"assert remove_z_kpoints([(0.0, 0.0, 0.0), (0.0, 0.0, 0.0)]) == [(0.0, 0.0)]\", \"assert remove_z_kpoints([(1.0, 1.0, 1.0), (1.0, 1.0, 0.0)... | {
"split": "train",
"index": 78664,
"acecode_id": "bigcode_python_fns_46516",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Determine the pseudo square root (PSR) of a given integer n, defined as the largest divisor of n that does not exceed the square root of n. Write a function `pseudo_square_root(n: int) -> int` that takes an integer n and returns its PSR.\nPlease reason step by step, then write ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pseudo_square_root(12) == 3\", \"assert pseudo_square_root(3102) == 47\", \"assert pseudo_square_root(1) == 1\", \"assert pseudo_square_root(9) == 3\", \"assert pseudo_square_root(16) == 4\", \"assert pseudo_square_root(25) == 5\", \"assert pseudo_square_roo... | {
"split": "train",
"index": 78665,
"acecode_id": "evol_28409",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `extract_words_with_consecutive_vowels(mywords)` that takes a list of strings `mywords` as input and returns a list of words that contain more than 2 consecutive vowels. Vowels include 'a', 'e', 'i', 'o', 'u' and their accented versions. The function should onl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_words_with_consecutive_vowels(['test', 'string', 'apple']) == []\", \"assert extract_words_with_consecutive_vowels(['a', 'e', 'i', 'o', 'u']) == []\", \"assert extract_words_with_consecutive_vowels(['aeeiioo', 'xyz', 'aeiou']) == ['aeeiioo', 'aeiou']... | {
"split": "train",
"index": 78666,
"acecode_id": "evol_26432",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `merge_strings(string1: str, string2: str) -> str` that takes two strings as input and returns a new string containing the first three alphabetical characters from each input string. If either input string has fewer than three alphabetical characters at the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_strings('hello', 'world') == 'helwor'\", \"assert merge_strings('abc123', 'def456') == 'abcdef'\", \"assert merge_strings('XyZ', '123') == 'XyZ'\", \"assert merge_strings('', '') == ''\", \"assert merge_strings('!@#$', '!!!') == ''\", \"assert merge_st... | {
"split": "train",
"index": 78667,
"acecode_id": "evol_2071",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a message that can be represented as either a byte string (bytes) or a byte array (bytearray), write a function `msg_bytes` that converts the input message into a bytes representation. If the input is already in bytes format, return it as is. If the input is a bytearray, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert msg_bytes(b'hello') == b'hello'\", \"assert msg_bytes(bytearray(b'hello')) == b'hello'\", \"assert msg_bytes(b'') == b''\", \"assert msg_bytes(bytearray(b'')) == b''\", \"assert msg_bytes(b'12345') == b'12345'\", \"assert msg_bytes(bytearray(b'12345')) == b'... | {
"split": "train",
"index": 78668,
"acecode_id": "bigcode_python_fns_29209",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function 'subStr' that takes a string, a start index, an end index, and an optional parameter 'step'. The function should return a substring between the start and end index, and if 'step' is provided, return every nth character in that substring where n is the value of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert subStr('hello world', 0, 5) == 'hello'\", \"assert subStr('abcdefg', 1, 5, 2) == 'bd'\", \"assert subStr('python', 0, 6, 1) == 'python'\", \"assert subStr('python', 0, 6, 3) == 'ph'\", \"assert subStr('', 0, 1) == 'Error: The string is empty.'\", \"assert su... | {
"split": "train",
"index": 78669,
"acecode_id": "evol_35535",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a list of words for a specific language based on certain configurations. Implement a function `generate_language_words(lang: str, levels: List[List[int]]) -> List[str]` that takes a language identifier as a string and a list of levels configuratio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_language_words('spanish', [[1], [2]]) == ['manzana', 'pl\\u00e1tano', 'cereza']\", \"assert generate_language_words('english', [[4], [1]]) == ['apple', 'banana', 'cherry', 'date', 'elderberry']\", \"assert generate_language_words('english', [[8]]) =... | {
"split": "train",
"index": 78670,
"acecode_id": "bigcode_python_fns_14615",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Generate an array of all the multiples of 3 that are less than 30, and sort them in descending order without using any built-in sort methods.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block."
}... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_multiples_of_3_descending() == [27, 24, 21, 18, 15, 12, 9, 6, 3]\", \"assert generate_multiples_of_3_descending() == [27, 24, 21, 18, 15, 12, 9, 6, 3]\", \"assert generate_multiples_of_3_descending() == [27, 24, 21, 18, 15, 12, 9, 6, 3]\", \"assert ... | {
"split": "train",
"index": 78671,
"acecode_id": "evol_20249",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that reads a list of airport codes and categorizes them based on their type. You need to implement a function called `categorize_airports(airport_codes: List[str]) -> Dict[str, List[str]]`. The function will take a list of airport codes a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_airports(['IAD', 'JFK', 'LAX', 'DCA']) == {'International': ['IAD'], 'Domestic': ['DCA'], 'Private': ['JFK', 'LAX']}\", \"assert categorize_airports([]) == {'International': [], 'Domestic': [], 'Private': []}\", \"assert categorize_airports(['IAB'... | {
"split": "train",
"index": 78672,
"acecode_id": "bigcode_python_fns_41191",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the scores of different models evaluated over multiple epochs. Your task is to implement a function `best_model_epoch(scores: List[int]) -> Tuple[int, int]` that returns a tuple containing the epoch number (1-indexed) and the highes... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert best_model_epoch([80, 85, 85, 90, 75]) == (4, 90)\", \"assert best_model_epoch([60, 70, 80, 90, 95]) == (5, 95)\", \"assert best_model_epoch([100, 90, 90, 90, 90]) == (1, 100)\", \"assert best_model_epoch([50, 50, 50, 50]) == (1, 50)\", \"assert best_model_e... | {
"split": "train",
"index": 78673,
"acecode_id": "bigcode_python_fns_11792",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a chronological timestamp in the format 'yyyy-mm-dd', write a function that reformats this timestamp into a specified model format represented as a string. The only valid model formats are 'dd/mm/yyyy', 'mm/dd/yyyy', and 'yyyy-mm-dd'. Implement a function 'transmute_times... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transmute_timestamp('2021-02-14', 'dd/mm/yyyy') == '14/02/2021'\", \"assert transmute_timestamp('2021-02-14', 'mm/dd/yyyy') == '02/14/2021'\", \"assert transmute_timestamp('2021-02-14', 'yyyy-mm-dd') == '2021-02-14'\", \"assert transmute_timestamp('2022-01-0... | {
"split": "train",
"index": 78674,
"acecode_id": "evol_18814",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_inventory(items: List[str]) -> Dict[str, int]` that takes a list of item names (strings) and returns a dictionary representing the inventory. The keys of the dictionary should be the item names, and the values should be the counts of each item in th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_inventory(['sword', 'shield', 'potion']) == {'sword': 1, 'shield': 1, 'potion': 1}\", \"assert create_inventory(['sword', 'sword', 'shield']) == {'sword': 2, 'shield': 1}\", \"assert create_inventory(['potion', 'potion', 'potion']) == {'potion': 3}\",... | {
"split": "train",
"index": 78675,
"acecode_id": "evol_28262",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the total profit from a series of stock transactions. You will be given two lists: one representing the buying prices and the other representing the selling prices of stocks. Each index in the buying prices corresponds to the same index in the se... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_profit([], []) == 0\", \"assert calculate_total_profit([10], [15]) == 5\", \"assert calculate_total_profit([5, 10, 15], [10, 15, 20]) == 15\", \"assert calculate_total_profit([7, 8], [5, 10]) == 0\", \"assert calculate_total_profit([3, 6, 9],... | {
"split": "train",
"index": 78676,
"acecode_id": "oss_9381",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing a dataset that consists of information about pilot markers. The dataset is represented as a list of dictionaries, where each dictionary contains the pilot's id, name, and a measurement value. Write a function that takes this dataset as input and re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_pilot_data([{'id': 1, 'name': 'Pilot A', 'measurement': 15.0}, {'id': 2, 'name': 'Pilot B', 'measurement': 10.0}, {'id': 3, 'name': 'Pilot C', 'measurement': 20.0}], 12.0) == (15.0, [{'id': 1, 'name': 'Pilot A', 'measurement': 15.0}, {'id': 3, 'name'... | {
"split": "train",
"index": 78677,
"acecode_id": "oss_24902",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given two integers m and n representing the dimensions of a multiplication matrix, and an integer k, write a function `findKthNumber(m, n, k)` that returns the k-th least number in the multiplication matrix where the i-th row and j-th column element is given by i * j. The matri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findKthNumber(3, 3, 5) == 3\", \"assert findKthNumber(2, 3, 6) == 6\", \"assert findKthNumber(1, 1, 1) == 1\", \"assert findKthNumber(1, 5, 3) == 3\", \"assert findKthNumber(4, 4, 10) == 6\", \"assert findKthNumber(5, 5, 15) == 9\", \"assert findKthNumber(2,... | {
"split": "train",
"index": 78678,
"acecode_id": "evol_34299",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a dataset of volcanic ash top heights represented as a list of floats. Write a function `average_ash_height(dset: List[float]) -> float` that calculates and returns the average height of the ash from the dataset. The dataset will contain at least one height value.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_ash_height([1.0, 2.0, 3.0]) == 2.0\", \"assert average_ash_height([5.5, 6.5, 7.5, 8.5]) == 7.0\", \"assert average_ash_height([0.0, 10.0]) == 5.0\", \"assert average_ash_height([1.1, 2.2, 3.3, 4.4, 5.5]) == 3.3\", \"assert average_ash_height([10.0]) ... | {
"split": "train",
"index": 78679,
"acecode_id": "bigcode_python_fns_6206",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `s`, write a function that converts each character in the string to its corresponding 8-bit binary representation. The function should return a single string where each 8-bit binary representation is separated by a newline character. If the input string is empty,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_bin('A') == '01000001'\", \"assert to_bin('AB') == '01000001\\\\n01000010'\", \"assert to_bin('') == ''\", \"assert to_bin('!') == '00100001'\", \"assert to_bin('abc') == '01100001\\\\n01100010\\\\n01100011'\", \"assert to_bin('123') == '00110001\\\\n0011... | {
"split": "train",
"index": 78680,
"acecode_id": "bigcode_python_fns_41385",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function `has_required_role(user_role: str, required_roles: List[str]) -> bool` that checks if a user has one of the required roles. The function should take in a string `user_role` representing the role of the user and a list of strings `required_roles` representing t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_required_role('admin', ['admin', 'editor', 'viewer']) == True\", \"assert has_required_role('editor', ['admin', 'editor', 'viewer']) == True\", \"assert has_required_role('viewer', ['admin', 'editor', 'viewer']) == True\", \"assert has_required_role('gue... | {
"split": "train",
"index": 78681,
"acecode_id": "bigcode_python_fns_18411",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a package name and a version number, return the URL and the SHA256 digest for fetching the package. The URL follows the pattern 'https://example.com/some/tarball-{version}.tar.gz' for versions '2.0' and '2.1'. For versions '2.2' and '2.3', the URL follows the pattern 'htt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_package_info('git-url-top-level', '2.0') == ('https://example.com/some/tarball-2.0.tar.gz', '0' * 62 + '20')\", \"assert fetch_package_info('git-url-top-level', '2.1') == ('https://example.com/some/tarball-2.1.tar.gz', '0' * 62 + '21')\", \"assert fetc... | {
"split": "train",
"index": 78682,
"acecode_id": "bigcode_python_fns_10015",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function named `assign_and_print` that assigns the value 5 to the variable `a` and the value 'Hello' to the variable `b`. The function should return a tuple containing the values of `a` and `b` in that order. The values should be assigned and returned without any print ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert assign_and_print() == (5, 'Hello')\", \"assert assign_and_print() == (5, 'Hello')\", \"assert assign_and_print() == (5, 'Hello')\", \"assert assign_and_print() == (5, 'Hello')\", \"assert assign_and_print() == (5, 'Hello')\", \"assert assign_and_print() == (... | {
"split": "train",
"index": 78683,
"acecode_id": "oss_11543",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that converts all the strings in a given list to uppercase and sorts the list in order of the length of the strings in descending order. If strings have the same lengths, sort them in alphabetical order. Consider the empty string and white spaces as valid stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_strings(['hello', 'world', 'test', 'python', 'a', 'b']) == ['PYTHON', 'HELLO', 'WORLD', 'TEST', 'A', 'B']\", \"assert sort_strings(['', ' ', ' ']) == [' ', ' ', '']\", \"assert sort_strings(['longest', 'short', 'tiny', 'medium']) == ['LONGEST', 'MED... | {
"split": "train",
"index": 78684,
"acecode_id": "evol_6133",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You have a bank account with an initial balance of 0. You will perform a series of transactions, where each transaction can be either a deposit (positive integer) or a withdrawal (negative integer). Write a function `minimum_balance(operations: List[int]) -> int` that calculate... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minimum_balance([]) == 0\", \"assert minimum_balance([1, 2, 3]) == 0\", \"assert minimum_balance([1, -1]) == 0\", \"assert minimum_balance([-1, 1]) == -1\", \"assert minimum_balance([-3, 1, 2]) == -3\", \"assert minimum_balance([-1, -2, -3]) == -6\", \"asser... | {
"split": "train",
"index": 78685,
"acecode_id": "evol_23421",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a given list of strings is sorted in strictly descending alphabetical order. The function should return True if the list is sorted in this manner, and False otherwise. For example, if the input list is ['z', 'y', 'x'], the function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_descending_alphabetical_order(['z', 'y', 'x']) == True\", \"assert is_descending_alphabetical_order(['c', 'b', 'a']) == True\", \"assert is_descending_alphabetical_order(['apple', 'banana', 'grape']) == False\", \"assert is_descending_alphabetical_order([... | {
"split": "train",
"index": 78686,
"acecode_id": "evol_20643",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of category names and a user ID, and returns a list of unique categories that can be added for the specified user. A category is considered unique if it has not been previously added by the same user. The function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_unique_categories([], 1) == []\", \"assert add_unique_categories(['health', 'health'], 2) == ['health']\", \"assert add_unique_categories(['technology', 'gadgets'], 4) == ['technology', 'gadgets']\", \"assert add_unique_categories(['art', 'art', 'photogr... | {
"split": "train",
"index": 78687,
"acecode_id": "bigcode_python_fns_49255",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a 1D domain of length L = 1.0 for a steady-state heat conduction problem. The thermal conductivity k is set to 1.0, and there is a heat source term Q equal to 1.0. The boundary conditions are defined as follows: a Dirichlet boundary condition at x=0 with temperatu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(compute_temperature_distribution()) == 10\", \"assert compute_temperature_distribution()[0] == 1.0\", \"assert all(0 <= temp <= 1 for temp in compute_temperature_distribution())\", \"assert compute_temperature_distribution()[1] < compute_temperature_dist... | {
"split": "train",
"index": 78688,
"acecode_id": "oss_36565",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates the total volume of cubes given their side lengths. Each cube is represented by a single digit, and the volume of a cube is the cube of its side length. The input string consists of space-separated single-digit numb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_cube_volume('0') == 0\", \"assert total_cube_volume('1') == 1\", \"assert total_cube_volume('2') == 8\", \"assert total_cube_volume('3') == 27\", \"assert total_cube_volume('4') == 64\", \"assert total_cube_volume('5') == 125\", \"assert total_cube_vol... | {
"split": "train",
"index": 78689,
"acecode_id": "oss_3222",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string `s`, implement a function that returns the length of the longest palindromic subsequence in `s`. A subsequence is defined as a sequence that can be derived from another sequence by deleting some elements or none at all, without changing the order of the remaining... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_palindrome_subseq('babad') == 3\", \"assert longest_palindrome_subseq('cbbd') == 2\", \"assert longest_palindrome_subseq('a') == 1\", \"assert longest_palindrome_subseq('ac') == 1\", \"assert longest_palindrome_subseq('bbbab') == 4\", \"assert longes... | {
"split": "train",
"index": 78690,
"acecode_id": "evol_23816",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a route size `size` and four city indices: `it1`, `it2`, `it3`, and `it4`. Write a function `is_valid_tour(size: int, it1: int, it2: int, it3: int, it4: int) -> bool` that checks whether the tour defined by these indices is valid. A tour is considered valid if the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_tour(7, 2, 5, 6, 0) == False\", \"assert is_valid_tour(8, 3, 7, 5, 6) == False\", \"assert is_valid_tour(10, 5, 9, 4, 6) == False\", \"assert is_valid_tour(12, 3, 9, 8, 4) == False\", \"assert is_valid_tour(15, 1, 2, 3, 5) == False\", \"assert is_va... | {
"split": "train",
"index": 78691,
"acecode_id": "bigcode_python_fns_18285",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Design a function `add_and_query_range(left: int, right: int, step: int, query_left: int, query_right: int) -> bool` that simulates adding a half-open interval `[left, right)` with a step of `step`, and then checks if every number in the interval `[query_left, query_right)` is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_and_query_range(10, 20, 2, 13, 15) == False\", \"assert add_and_query_range(10, 20, 2, 16, 17) == True\", \"assert add_and_query_range(1, 10, 2, 1, 5) == False\", \"assert add_and_query_range(5, 15, 3, 10, 15) == False\", \"assert add_and_query_range(0, ... | {
"split": "train",
"index": 78692,
"acecode_id": "evol_25758",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of dictionaries representing songs, where each dictionary contains the keys 'title' and 'year', implement a function `get_release_year(songs: List[Dict[str, Union[str, int]]], songidx: int = 0) -> int` that returns the release year of the song at the specified inde... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_release_year([{'title': 'Song A', 'year': 1995}, {'title': 'Song B', 'year': 2000}], 0) == 1995\", \"assert get_release_year([{'title': 'Song A', 'year': 1995}, {'title': 'Song B', 'year': 2000}], 1) == 2000\", \"assert get_release_year([{'title': 'Song ... | {
"split": "train",
"index": 78693,
"acecode_id": "bigcode_python_fns_3347",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function in Python that takes two strings, 'sample' and 'target', and checks if all the characters in the 'target' string exist in the 'sample' string. The function should return True if all characters are found, otherwise return False. Optimize the function for perfor... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_chars('hello world', 'llo') == True\", \"assert check_chars('hello world', 'world') == True\", \"assert check_chars('hello world', 'hello') == True\", \"assert check_chars('hello world', 'z') == False\", \"assert check_chars('abc', 'cba') == True\", \"... | {
"split": "train",
"index": 78694,
"acecode_id": "evol_14111",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of genomes, where each genome is represented as a dictionary containing two keys: 'accuracy' (a float representing the accuracy of the genome) and 'name' (a string representing the name of the genome). Your task is to implement a function that sorts these g... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_genomes([{'name': 'GenomeA', 'accuracy': 0.9}, {'name': 'GenomeB', 'accuracy': 0.8}, {'name': 'GenomeC', 'accuracy': 0.9}]) == [{'name': 'GenomeA', 'accuracy': 0.9}, {'name': 'GenomeC', 'accuracy': 0.9}, {'name': 'GenomeB', 'accuracy': 0.8}]\", \"assert... | {
"split": "train",
"index": 78695,
"acecode_id": "bigcode_python_fns_12126",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats a list of floating-point numbers to a string representation with two decimal places. The function should take a list of floats as input and return a new list where each float is converted to a string formatted to two decimal ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_floats([1.234, 2.34567, None, 4.0]) == ['1.23', '2.35', None, '4.00']\", \"assert format_floats([0.1, 0.12345, 2.0, None, 3.5]) == ['0.10', '0.12', '2.00', None, '3.50']\", \"assert format_floats([100.0, 200.555, 300.1]) == ['100.00', '200.56', '300.1... | {
"split": "train",
"index": 78696,
"acecode_id": "bigcode_python_fns_23158",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of responses where each response is represented as a dictionary containing a key 'time_total' which is a float representing the total time in seconds taken for a request. Your task is to implement a function that takes this list of responses and returns a l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_time_totals([{'time_total': 3.14159}]) == ['3.14 seconds']\", \"assert format_time_totals([{'time_total': 1.0}, {'time_total': 2.5}, {'time_total': 3.678}]) == ['1.00 seconds', '2.50 seconds', '3.68 seconds']\", \"assert format_time_totals([{'time_tot... | {
"split": "train",
"index": 78697,
"acecode_id": "bigcode_python_fns_4806",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `extract_values(element)` that takes a single argument, which can be a dictionary, a list, or a single value. The function should recursively extract all values from the input while maintaining the order of the original structure. The input can contain nest... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_values({'a': 1, 'b': 2}) == [1, 2]\", \"assert extract_values([1, 2, 3]) == [1, 2, 3]\", \"assert extract_values({'a': [1, 2], 'b': {'c': 3}}) == [1, 2, 3]\", \"assert extract_values([{'a': 1}, {'b': 2}, {'c': 3}]) == [1, 2, 3]\", \"assert extract_va... | {
"split": "train",
"index": 78698,
"acecode_id": "evol_28517",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string of XML data representing a set of DICOM studies. Your task is to parse this XML string and extract the DICOM study information into a list of dictionaries. Each dictionary should represent a study with its relevant attributes. The XML format will always c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_dicom_studies('<studies><study id=\\\"1\\\" name=\\\"Study A\\\" date=\\\"2021-01-01\\\"/><study id=\\\"2\\\" name=\\\"Study B\\\" date=\\\"2021-01-02\\\"/></studies>') == [{'id': '1', 'name': 'Study A', 'date': '2021-01-01'}, {'id': '2', 'name': 'Stud... | {
"split": "train",
"index": 78699,
"acecode_id": "bigcode_python_fns_25543",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.