data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are given a list of predictions and a list of true labels for a classification task. Your task is to generate a summary report that contains the number of correct predictions, the number of incorrect predictions, and a list of the incorrectly predicted items. Implement a fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_summary([1, 0, 1, 1], [1, 0, 0, 1]) == (3, 1, [2])\", \"assert generate_summary([2, 2, 2, 2], [2, 2, 2, 2]) == (4, 0, [])\", \"assert generate_summary([0, 1, 2, 1], [1, 1, 2, 0]) == (2, 2, [0, 3])\", \"assert generate_summary([1, 2, 3], [1, 2, 3]) =...
{ "split": "train", "index": 71000, "acecode_id": "bigcode_python_fns_8598", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `find_max(words: List[str], case_sensitive: bool = False) -> str` that takes a list of distinct strings as input and returns the word with the highest count of unique characters. If there are ties, return the lexicographically earliest word. The function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max(['hello', 'world', 'python']) == 'python'\", \"assert find_max(['hello', 'Hello']) == 'Hello'\", \"assert find_max(['abcd', 'dcba', 'efgh']) == 'abcd'\", \"assert find_max(['test', 'set', 'seta']) == 'seta'\", \"assert find_max(['unique', 'character...
{ "split": "train", "index": 71001, "acecode_id": "evol_13983", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the roots of a quadratic equation given by the coefficients a, b, and c, which can potentially have complex roots. The function should return the roots as a tuple. For example, given the coefficients a=1, b=-3, c=2, the function should retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_roots(1, 2, 1) == ((-1+0j), (-1+0j))\", \"assert find_roots(1, -2, 1) == ((1+0j), (1+0j))\", \"assert find_roots(1, 4, 4) == ((-2+0j), (-2+0j))\", \"assert find_roots(1, 0, 1) == ((0+1j), (0-1j))\", \"assert find_roots(3, 6, 3) == ((-1+0j), (-1+0j))\", ...
{ "split": "train", "index": 71002, "acecode_id": "evol_36226", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns a new list containing the distinct elements from the original list, sorted in descending order.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dissect_and_sort([4, 2, 6, 8, 5, 9, 1]) == [9, 8, 6, 5, 4, 2, 1]\", \"assert dissect_and_sort([1, 1, 1, 1]) == [1]\", \"assert dissect_and_sort([3, 2, 1, 3, 2, 1]) == [3, 2, 1]\", \"assert dissect_and_sort([]) == []\", \"assert dissect_and_sort([10, 5, 10, 2...
{ "split": "train", "index": 71003, "acecode_id": "evol_13418", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the addition of a cog to a client in a chat application framework. The function `add_cog` takes two parameters: `client`, which is an instance of a client, and `cog_name`, a string that represents the name of the cog to...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_cog({'cogs': []}, 'Jail') == 'Cog Jail has been added.'\", \"assert add_cog({'cogs': ['Jail']}, 'Jail') == 'Cog Jail is already loaded.'\", \"assert add_cog({'cogs': ['ChatBot']}, 'Jail') == 'Cog Jail has been added.'\", \"assert add_cog({'cogs': ['Jail'...
{ "split": "train", "index": 71004, "acecode_id": "bigcode_python_fns_36062", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a checkpoint filename based on the given parameters. The function should take the following inputs: a string `logdir` representing the directory path where checkpoints should be saved, and an integer `global_step` which...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_checkpoint_filename('checkpoints', 5000) == 'checkpoints/step-005K.pth'\", \"assert generate_checkpoint_filename('logs', 10000) == 'logs/step-010K.pth'\", \"assert generate_checkpoint_filename('models', 100) == 'models/step-000K.pth'\", \"assert gen...
{ "split": "train", "index": 71005, "acecode_id": "bigcode_python_fns_1780", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the retrieval of a number of specific items between two given dates. The function should generate a random integer between 1 and 100 (inclusive) to represent the number of items found between the specified dates. You need t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_num_items_between_dates('2022-01-01', '2022-01-31') >= 1 and get_num_items_between_dates('2022-01-01', '2022-01-31') <= 100\", \"assert get_num_items_between_dates('2022-02-01', '2022-02-28') >= 1 and get_num_items_between_dates('2022-02-01', '2022-02-28...
{ "split": "train", "index": 71006, "acecode_id": "oss_32581", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that initializes a simple application by returning the provided application object. The function should take a single parameter, `app`, which represents the application to be initialized. Your function should return the same application o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert init_app('my_app') == 'my_app'\", \"assert init_app(123) == 123\", \"assert init_app([1, 2, 3]) == [1, 2, 3]\", \"assert init_app({'key': 'value'}) == {'key': 'value'}\", \"assert init_app(None) == None\", \"assert init_app(True) == True\", \"assert init_app...
{ "split": "train", "index": 71007, "acecode_id": "bigcode_python_fns_29432", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to verify the integrity of a resource instance. You need to create a custom exception class named `ResourceNotFound`, which should be a subclass of the built-in `Exception` class. Additionally, you should define a class named `Resourc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_resource(ResourceNotFound(), Resource()) == True\", \"assert verify_resource(ResourceNotFound(), Resource()) == True\", \"assert verify_resource(ResourceNotFound(), Resource()) == True\", \"assert verify_resource(ResourceNotFound(), Resource()) == Tru...
{ "split": "train", "index": 71008, "acecode_id": "oss_3114", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function that takes a list of numbers and formats each number such that periods are used as decimal markers and commas are used as thousands separators. If the number is a float, it should be formatted to two decimal places. If the number is an integer, it should be fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_numbers([1234567]) == ['1.234.567']\", \"assert format_numbers([0]) == ['0']\", \"assert format_numbers([-5000]) == ['-5.000']\", \"assert format_numbers([1000000000]) == ['1.000.000.000']\", \"assert format_numbers([1.5, 2.35]) == ['1,50', '2,35']\",...
{ "split": "train", "index": 71009, "acecode_id": "evol_25976", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a string consisting of the characters '<' and '>', determine if the brackets are correctly balanced. A string is considered balanced if every '<' has a corresponding '>' that appears after it. Implement the function `correct_bracketing(brackets: str) -> bool` that returns...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert correct_bracketing('<>') == True\", \"assert correct_bracketing('<<>>') == True\", \"assert correct_bracketing('<><>') == True\", \"assert correct_bracketing('><') == False\", \"assert correct_bracketing('<<>') == False\", \"assert correct_bracketing('><<>>'...
{ "split": "train", "index": 71010, "acecode_id": "evol_2610", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a datetime object and a rounding unit, write a function that returns a new datetime object rounded to the nearest specified unit. The rounding units are as follows: 1 for seconds, 2 for minutes, 3 for hours, 4 for days, 5 for months, and 6 for years. The function should n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert round_to_unit(datetime.datetime(2023, 3, 15, 12, 30, 45), 1) == datetime.datetime(2023, 3, 15, 12, 30, 45)\", \"assert round_to_unit(datetime.datetime(2023, 3, 15, 12, 30, 45), 3) == datetime.datetime(2023, 3, 15, 12, 0, 0)\", \"assert round_to_unit(datetime...
{ "split": "train", "index": 71011, "acecode_id": "bigcode_python_fns_37439", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program that generates a random order of presentation for a list of participants in a competition. Write a Python function called `generate_presentation_order` that takes a list of participant names as input and returns a randomly shuffled order o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_presentation_order(['Alice', 'Bob', 'Charlie']) != ['Alice', 'Bob', 'Charlie']\", \"assert generate_presentation_order(['Alice', 'Bob']) != ['Alice', 'Bob']\", \"assert generate_presentation_order(['John', 'Doe', 'Jane', 'Smith']) != ['John', 'Doe',...
{ "split": "train", "index": 71012, "acecode_id": "oss_32638", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines the optimal scheduling value based on a given step. The function should take an integer `step` as input. If `step` is less than or equal to a predefined threshold `change_n_optimize_at`, the function should return the valu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert n_optimize_fn(0) == 10\", \"assert n_optimize_fn(5) == 10\", \"assert n_optimize_fn(15) == 20\", \"assert n_optimize_fn(20) == 20\", \"assert n_optimize_fn(25) == 20\", \"assert n_optimize_fn(-1) == 10\", \"assert n_optimize_fn(1) == 10\", \"assert n_optimiz...
{ "split": "train", "index": 71013, "acecode_id": "bigcode_python_fns_34502", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a fleet of workers, where each worker has a numeric value associated with it. Your task is to calculate the average value of the workers in the fleet. Implement a function `worker_numeric_avg(fleet: List[int]) -> float` that takes a list of integers, `fleet`, repr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert worker_numeric_avg([10, 20, 30]) == 20.0\", \"assert worker_numeric_avg([5, 15, 25, 35]) == 20.0\", \"assert worker_numeric_avg([1, 2, 3, 4, 5]) == 3.0\", \"assert worker_numeric_avg([100, 200, 300]) == 200.0\", \"assert worker_numeric_avg([-10, 0, 10]) == 0...
{ "split": "train", "index": 71014, "acecode_id": "bigcode_python_fns_45329", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two strings, determine if they are anagrams of each other. Two strings are anagrams if they contain the same characters in the same frequency, but possibly in a different order. Implement a function `are_anagrams(str1: str, str2: str) -> bool` that returns True if the str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_anagrams('bombe', 'bemob') == True\", \"assert are_anagrams('listen', 'silent') == True\", \"assert are_anagrams('triangle', 'integral') == True\", \"assert are_anagrams('evil', 'vile') == True\", \"assert are_anagrams('fluster', 'restful') == True\", \"...
{ "split": "train", "index": 71015, "acecode_id": "evol_7054", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `find_max_sum_subarray(arr: List[int], k: int) -> int` that returns the maximum sum of any contiguous subarray of size `k`. If the input list has fewer than `k` elements, return `0`.\nPlease reason step by step, then write a self-conta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_sum_subarray([1, 2, 3, 4, 5], 2) == 9\", \"assert find_max_sum_subarray([-1, -2, -3, -4], 2) == -3\", \"assert find_max_sum_subarray([10, 2, 1, 3, 5], 1) == 10\", \"assert find_max_sum_subarray([], 3) == 0\", \"assert find_max_sum_subarray([1, 2, 3]...
{ "split": "train", "index": 71016, "acecode_id": "bigcode_python_fns_25836", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple client connection system. Your goal is to create a function `get_new_client` that simulates the creation of a client connected to a server on a specified port. The function takes in two parameters: `insecure_port` (an integer representi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_new_client(8886, False) == 'Client created and connected to port 8886'\", \"assert get_new_client(5000, True) == 'Client created and connected to port 5000'\", \"assert get_new_client(8080, False) == 'Client created and connected to port 8080'\", \"asser...
{ "split": "train", "index": 71017, "acecode_id": "oss_2008", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `fix_zeros(arr)` that takes a list, which may contain nested lists and various data types (integers, strings, floats, etc.), and moves all occurrences of the integer zero to the end of their respective lists while maintaining the order of all non-zero eleme...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fix_zeros([1, 0, 2, 0, 3]) == [1, 2, 3, 0, 0]\", \"assert fix_zeros([0, 0, 0]) == [0, 0, 0]\", \"assert fix_zeros([1, 2, 3]) == [1, 2, 3]\", \"assert fix_zeros([0, 1, 2]) == [1, 2, 0]\", \"assert fix_zeros([]) == []\", \"assert fix_zeros([0]) == [0]\", \"ass...
{ "split": "train", "index": 71018, "acecode_id": "evol_10006", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function `is_palindrome_after_concatenation(s1: str, s2: str) -> str` that takes two distinct strings `s1` and `s2`. The function should reverse each string, concatenate them, and return 'It is a Palindrome' if the resulting string is a palindrome, otherwise return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome_after_concatenation('NOON', 'LEON') == 'It is not a Palindrome'\", \"assert is_palindrome_after_concatenation('abc', 'cba') == 'It is a Palindrome'\", \"assert is_palindrome_after_concatenation('hello', 'world') == 'It is not a Palindrome'\", \...
{ "split": "train", "index": 71019, "acecode_id": "evol_22441", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, each representing a location in the format 'latitude,longitude'. You are also given a dictionary that maps these location strings to their corresponding geoIds. Write a function that takes in a location string and the mapping dictionary, and ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_geoId('37.7749,-122.4194', {'37.7749,-122.4194': 'geoId1', '34.0522,-118.2437': 'geoId2'}) == 'geoId1'\", \"assert get_geoId('34.0522,-118.2437', {'37.7749,-122.4194': 'geoId1', '34.0522,-118.2437': 'geoId2'}) == 'geoId2'\", \"assert get_geoId('40.7128,-...
{ "split": "train", "index": 71020, "acecode_id": "bigcode_python_fns_40861", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `warn(msg: str) -> None` that takes a single string parameter `msg` and prints the message to alert users of potential issues. Your function should not return any value, but it should print the message exactly as provided. The input strin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert warn('Low disk space') is None\", \"assert warn('Unauthorized access attempt detected') is None\", \"assert warn('System overheating!') is None\", \"assert warn('Backup completed successfully.') is None\", \"assert warn('Network connectivity issues.') is Non...
{ "split": "train", "index": 71021, "acecode_id": "bigcode_python_fns_20960", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `prime_factorial(arr)` that takes an array of integers as input and returns a list of strings for each prime number in the array, where each string is formatted as '{number} is prime and its factorial is {factorial}'. A number is considered prime if it is great...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prime_factorial([2, 3, 4, 5, 6]) == ['2 is prime and its factorial is 2', '3 is prime and its factorial is 6', '5 is prime and its factorial is 120']\", \"assert prime_factorial([1, 4, 6]) == []\", \"assert prime_factorial([7, 8, 9, 10]) == ['7 is prime and ...
{ "split": "train", "index": 71022, "acecode_id": "evol_8761", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a 2D array of complex numbers representing eigenvectors and a 1D array of complex numbers representing a wave function, write a function `calc_amplitude_and_population(eigenvecs: List[List[complex]], wave_func: List[complex]) -> Tuple[List[complex], List[float]]` that cal...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calc_amplitude_and_population([[1, 0], [0, 1]], [1, 1]) == ([1, 1], [1.0, 1.0])\", \"assert calc_amplitude_and_population([[1+1j, 0], [0, 1-1j]], [1+1j, 0]) == ([2j, 0j], [4.0, 0.0])\", \"assert calc_amplitude_and_population([[1, 2], [3, 4]], [1, 0]) == ([1,...
{ "split": "train", "index": 71023, "acecode_id": "bigcode_python_fns_302", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a positive integer `nb_conv`. Your task is to write a function `calculate_tensor_count(nb_conv)` that returns the total number of tensors that would be retrieved from a TensorFlow graph based on the given `nb_conv` value. The function should iterate through the ra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_tensor_count(1) == 0\", \"assert calculate_tensor_count(2) == 5\", \"assert calculate_tensor_count(3) == 10\", \"assert calculate_tensor_count(4) == 15\", \"assert calculate_tensor_count(5) == 20\", \"assert calculate_tensor_count(6) == 25\", \"ass...
{ "split": "train", "index": 71024, "acecode_id": "oss_17849", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function called `extract_last_element` that takes a list as input and extracts the last element from it. The function should handle the following conditions: if the input is not a list, return 'Error: Input must be a list.'; if the list is empty, return 'Erro...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_last_element('not a list') == 'Error: Input must be a list.'\", \"assert extract_last_element(123) == 'Error: Input must be a list.'\", \"assert extract_last_element([]) == 'Error: Input list is empty.'\", \"assert extract_last_element(['apple']) == ...
{ "split": "train", "index": 71025, "acecode_id": "evol_16812", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `generate_random_number()` that generates a random 8-digit number. The function should return an integer between 10000000 and 99999999, inclusive.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert 10000000 <= generate_random_number() <= 99999999\", \"assert 10000000 <= generate_random_number() <= 99999999\", \"assert 10000000 <= generate_random_number() <= 99999999\", \"assert 10000000 <= generate_random_number() <= 99999999\", \"assert 10000000 <= ge...
{ "split": "train", "index": 71026, "acecode_id": "evol_8320", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that adds a new field to a user model represented as a dictionary. The model is defined as a dictionary with keys representing field names and values representing field data. Your function should add a new field `is_verified` with a defau...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_is_verified_field({'username': 'john_doe', 'email': 'john@example.com'}) == {'username': 'john_doe', 'email': 'john@example.com', 'is_verified': False}\", \"assert add_is_verified_field({'username': 'jane_smith', 'email': 'jane@example.com'}) == {'userna...
{ "split": "train", "index": 71027, "acecode_id": "oss_19293", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that filters and sorts a given dictionary based on specified criteria and returns the top k key-value pairs. You need to implement a function named `filter_sort_dict` that takes the following parameters: \n\n- `dic`: a dictiona...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_sort_dict({'a': 3, 'b': 1, 'c': 2, 'd': 5, 'e': 4}, 'value', 3, False) == {'b': 1, 'c': 2, 'a': 3}\", \"assert filter_sort_dict({'a': 1, 'b': 2, 'c': 3}, 'key', 2, True) == {'c': 3, 'b': 2}\", \"assert filter_sort_dict({'x': 10, 'y': 20, 'z': 15}, 'va...
{ "split": "train", "index": 71028, "acecode_id": "oss_20295", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of integers as input and returns a new list where each integer is transformed by a specific operation. The operation is as follows: if the integer is even, divide it by 2; if the integer is odd, multiply it by 3 and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_list([]) == []\", \"assert transform_list([2]) == [1]\", \"assert transform_list([3]) == [10]\", \"assert transform_list([4]) == [2]\", \"assert transform_list([5]) == [16]\", \"assert transform_list([6, 7, 8]) == [3, 22, 4]\", \"assert transform_l...
{ "split": "train", "index": 71029, "acecode_id": "bigcode_python_fns_43151", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `squared(num)` that takes a single parameter `num`. The function should return the square of `num` if it is a numeric value (either an integer or a float). If `num` is not a numeric value, the function should return an error message: 'Error: Input must be a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert squared(5) == 25\", \"assert squared(0) == 0\", \"assert squared(-3) == 9\", \"assert squared(2.5) == 6.25\", \"assert squared(-2.5) == 6.25\", \"assert squared('5') == 'Error: Input must be a numerical value'\", \"assert squared(True) == 1\", \"assert squar...
{ "split": "train", "index": 71030, "acecode_id": "evol_24261", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that simulates a simple game of rock-paper-scissors. The function will take two inputs: the user's choice and the computer's choice. The choices will be represented as strings: 'rock', 'paper', or 'scissors'. Your function should determine...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert determine_winner('rock', 'scissors') == 'You win!'\", \"assert determine_winner('rock', 'paper') == 'You lose!'\", \"assert determine_winner('paper', 'rock') == 'You win!'\", \"assert determine_winner('paper', 'scissors') == 'You lose!'\", \"assert determine...
{ "split": "train", "index": 71031, "acecode_id": "oss_26367", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of state contributions represented as tuples, where each tuple contains the name of a state and its respective contribution amount. Your task is to implement a function `get_leading_states(contributions: List[Tuple[str, float]]) -> Tuple[List[float], List[s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_leading_states([('Florida', 300), ('american samoa', 400), ('New York', 500)]) == ([500.0, 300.0], ['New York', 'Florida'])\", \"assert get_leading_states([('Ohio', 700), ('Illinois', 600), ('virgin islands', 800)]) == ([700.0, 600.0], ['Ohio', 'Illinois...
{ "split": "train", "index": 71032, "acecode_id": "bigcode_python_fns_10138", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a list of floating-point numbers representing predicted probability values for a positive class and a list of threshold ranges, write a function `find_indices_in_ranges(data: List[float], ranges: List[float], top_k: int) -> List[List[int]]` that returns a list of lists of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_indices_in_ranges([0.2, 0.4, 0.7, 0.9], [0.0, 0.5, 1.0], -1) == [[0, 1], [2, 3]]\", \"assert find_indices_in_ranges([], [0.0, 0.5, 1.0], 2) == [[], []]\", \"assert find_indices_in_ranges([0.25, 0.75, 0.25, 0.25], [0.0, 0.5, 1.0], 3) == [[0, 2, 3], [1]]\...
{ "split": "train", "index": 71033, "acecode_id": "bigcode_python_fns_12699", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a dictionary representing a plot configuration for a data visualization, write a function that checks if the plot type is 'number' and if the value associated with 'data' is a unique identifier. If the identifier corresponds to multiple values in the dataset, the function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_unique_identifier({'type': 'number', 'data': 'bigfoot', 'value': {'field': 'number'}}) == True\", \"assert check_unique_identifier({'type': 'string', 'data': 'bigfoot', 'value': {'field': 'number'}}) == False\", \"assert check_unique_identifier({'type'...
{ "split": "train", "index": 71034, "acecode_id": "bigcode_python_fns_9003", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a grid of size m x n, and a list of positions where land is added to the grid. Each position is represented as a pair of integers [x, y]. Each time a land is added, it may connect to adjacent lands (up, down, left, right), and you need to return the number of isla...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert numIslands2(3, 3, [[0,0], [0,1], [1,1], [1,0], [2,2]]) == [1, 1, 1, 1, 2]\", \"assert numIslands2(2, 2, [[0,0], [0,1], [1,0], [1,1]]) == [1, 1, 1, 1]\", \"assert numIslands2(1, 1, [[0,0]]) == [1]\", \"assert numIslands2(3, 3, [[0,0], [1,0], [2,0], [2,1], [1,...
{ "split": "train", "index": 71035, "acecode_id": "evol_7849", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that returns the number of days for which performance data will be redownloaded. The function should not take any inputs and must return a string representing the number of days. For this problem, the required number of days is fixed at 3...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert redownload_window() == '30'\", \"assert redownload_window() == '30'\", \"assert redownload_window() == '30'\", \"assert redownload_window() == '30'\", \"assert redownload_window() == '30'\", \"assert redownload_window() == '30'\", \"assert redownload_window(...
{ "split": "train", "index": 71036, "acecode_id": "bigcode_python_fns_21956", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of items, each represented by a dictionary with an 'ID' and 'value' key. Your task is to implement a function that takes a list of these dictionaries and a specific 'ID'. The function should return a new list containing only the dictionaries that match the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_items_by_id([{'ID': '1', 'value': 'A'}, {'ID': '2', 'value': 'B'}, {'ID': '1', 'value': 'C'}], '1') == [{'ID': '1', 'value': 'A'}, {'ID': '1', 'value': 'C'}]\", \"assert filter_items_by_id([{'ID': '1', 'value': 'A'}, {'ID': '2', 'value': 'B'}, {'ID': ...
{ "split": "train", "index": 71037, "acecode_id": "bigcode_python_fns_31913", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents a box with a 'score' key. Your task is to implement a function `sort_boxes(boxes: List[Dict[str, Union[str, float]]]) -> List[Dict[str, Union[str, float]]]` that sorts the list of boxes in descending order b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_boxes([{'score': 3.0}, {'score': 1.0}, {'score': 2.0}]) == [{'score': 3.0}, {'score': 2.0}, {'score': 1.0}]\", \"assert sort_boxes([{'score': 5.0}, {'score': 5.0}, {'score': 2.0}]) == [{'score': 5.0}, {'score': 5.0}, {'score': 2.0}]\", \"assert sort_box...
{ "split": "train", "index": 71038, "acecode_id": "bigcode_python_fns_24949", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple resource management system that simulates opening and closing a connection to a resource. Your task is to write a function `manage_resource` that simulates the following behavior: When the function is called, it should open a connection...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_resource(False) == None\", \"assert manage_resource(True) == None\", \"assert manage_resource(True) == None\", \"assert manage_resource(False) is None\", \"assert manage_resource(True) is None\", \"assert manage_resource(True) == None\", \"assert mana...
{ "split": "train", "index": 71039, "acecode_id": "oss_11267", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that removes a specific item from a collection of discussion topics. The function should take in the following parameters: a string `collection_item_id` representing the ID of the collection item, and a string `topic_id` representing the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_topic('item1', 'topic1') == 'Topic deleted successfully.'\", \"assert delete_topic('item1', 'topic2') == 'Topic not found.'\", \"assert delete_topic('item3', 'topic4') == 'Topic not found.'\", \"assert delete_topic('item4', 'topic1') == 'Topic not fou...
{ "split": "train", "index": 71040, "acecode_id": "bigcode_python_fns_8044", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing an ONNX node, which contains an attribute 'dilations' that can either have two or three integer values. Your task is to implement a function `get_dilations(onnx_node)` that extracts the dilation values from this dictionary. The function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_dilations({'dilations': [2, 3]}) == (2, 3, 1)\", \"assert get_dilations({'dilations': [1, 2, 3]}) == (1, 2, 3)\", \"assert get_dilations({'dilations': []}) == (1, 1, 1)\", \"assert get_dilations({}) == (1, 1, 1)\", \"assert get_dilations({'dilations': [5...
{ "split": "train", "index": 71041, "acecode_id": "oss_1382", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the behavior of a simple mock API for a heating, ventilation, and air conditioning (HVAC) system. Your function should take a machine IP address as input and return a dictionary representing the current temperature, humidity, and mode of operation...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert mock_hvac_response('192.168.1.1') == {'temperature': 22, 'humidity': 45, 'mode': 'cooling'}\", \"assert mock_hvac_response('10.0.0.1') == {'temperature': 22, 'humidity': 45, 'mode': 'cooling'}\", \"assert mock_hvac_response('255.255.255.255') == {'temperatur...
{ "split": "train", "index": 71042, "acecode_id": "bigcode_python_fns_7487", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that checks if a given string contains the character 'z' followed by at least two 'y's. The function should return True if such a pattern exists; otherwise, it should return False.\nPlease reason step by step, then write a self-contained Python solution. Gi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_z_followed_by_two_ys('zyy') == True\", \"assert has_z_followed_by_two_ys('zyyy') == True\", \"assert has_z_followed_by_two_ys('zy') == False\", \"assert has_z_followed_by_two_ys('xyzzyy') == True\", \"assert has_z_followed_by_two_ys('zzzz') == False\", \...
{ "split": "train", "index": 71043, "acecode_id": "evol_15470", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dashboards represented as dictionaries, where each dictionary contains the following keys: 'uid' (a unique identifier for the dashboard), 'folderUid' (an identifier for the folder the dashboard belongs to, or '.' if it is in the root), and 'type' (the ty...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert organize_dashboards([{'uid': '1', 'folderUid': '.', 'type': 'dashboard'}, {'uid': '2', 'folderUid': 'folder1', 'type': 'dashboard'}, {'uid': '3', 'folderUid': 'folder1', 'type': 'dashboard'}, {'uid': '4', 'folderUid': '.', 'type': 'dashboard'}]) == {'.': ['1...
{ "split": "train", "index": 71044, "acecode_id": "bigcode_python_fns_22419", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the diagonals of a matrix. Your task is to implement a function that modifies the diagonalization method to 'cg' if the current method is 'david'. If the current method is not 'david', return the current method without any changes. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_diagonalization_method('david') == ('cg', True)\", \"assert handle_diagonalization_method('cg') == ('cg', True)\", \"assert handle_diagonalization_method('other') == ('other', False)\", \"assert handle_diagonalization_method('david') == ('cg', True)\"...
{ "split": "train", "index": 71045, "acecode_id": "bigcode_python_fns_3157", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that accepts a string representing a service key and returns a message indicating whether the configuration of the service was successful or not. The service key must be exactly 32 characters long and can only contain alphanumeric charact...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert configure_service_key('abcdefgh12345678ijklmnop') == 'Invalid service key'\", \"assert configure_service_key('shortkey') == 'Invalid service key'\", \"assert configure_service_key('this_key_is_way_too_long_for_the_service') == 'Invalid service key'\", \"asse...
{ "split": "train", "index": 71046, "acecode_id": "bigcode_python_fns_41201", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `initialize_security_client(provisioning_host: str, registration_id: str, id_scope: str, symmetric_key: str) -> dict` that initializes a symmetric key security client with the provided parameters. The parameters include `provisioning_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_security_client('example.azure-devices.net', 'device-001', '0ne00000000', 'abc123def456') == {'provisioning_host': 'example.azure-devices.net', 'registration_id': 'device-001', 'id_scope': '0ne00000000', 'symmetric_key': 'abc123def456'}\", \"asser...
{ "split": "train", "index": 71047, "acecode_id": "oss_8577", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the startup process of a server. Write a function `start_server(host: str, port: int, options: dict, timeout: int = 10) -> bool` that determines if the server can start successfully within a given timeout period. The server can successfully start ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert start_server('localhost', 8080, {'verify_ssl': True}) == True\", \"assert start_server('example.com', 65535, {'verify_ssl': True}) == True\", \"assert start_server('example.com', 1, {'verify_ssl': False}) == True\", \"assert start_server('localhost', 80, {'v...
{ "split": "train", "index": 71048, "acecode_id": "bigcode_python_fns_9250", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries called `objects`, where each dictionary represents an object with a bounding box and associated text. Your task is to implement a function `remove_empty_objects(objects: List[Dict[str, Union[Dict[str, int], str]]]) -> List[Dict[str, Union[Di...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_empty_objects([{'bbox': {'x': 1, 'y': 1, 'width': 2, 'height': 2}, 'text': 'Hello'}, {'bbox': {'x': 2, 'y': 2, 'width': 2, 'height': 2}, 'text': ''}]) == [{'bbox': {'x': 1, 'y': 1, 'width': 2, 'height': 2}, 'text': 'Hello'}]\", \"assert remove_empty_o...
{ "split": "train", "index": 71049, "acecode_id": "bigcode_python_fns_35024", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a parameter `p`, write a function `is_numeric(p)` that determines if the parameter is numeric. A numeric parameter is defined as any value that can be converted to a float without raising a ValueError. The function should return `True` if `p` is numeric and `False` otherw...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_numeric(3) == True\", \"assert is_numeric(3.14) == True\", \"assert is_numeric(-2.5) == True\", \"assert is_numeric('5') == True\", \"assert is_numeric('0.001') == True\", \"assert is_numeric('3.14') == True\", \"assert is_numeric('-2') == True\", \"asser...
{ "split": "train", "index": 71050, "acecode_id": "bigcode_python_fns_20836", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that parses a list of strings representing key-value pairs in a configuration format. Each string may represent either a key-value pair in the format 'key: value' or a comment that starts with a '#' symbol and should be ignored...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_config_data(['# This is a comment', 'key1: value1']) == {'key1': 'value1'}\", \"assert parse_config_data(['key1: value1', 'key2: value2']) == {'key1': 'value1', 'key2': 'value2'}\", \"assert parse_config_data(['# comment line', 'key: value']) == {'key'...
{ "split": "train", "index": 71051, "acecode_id": "oss_17177", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that validates a URL against a specified format string and returns a formatted URL if it matches. The function should take a URL and a format string as input and return the formatted URL if the URL matches the specified format. If ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_and_format_url('https://www.example.com/home', '{protocol}://www.example.com/{path}') == 'https://www.example.com/home'\", \"assert validate_and_format_url('http://www.test.com/about', '{protocol}://www.test.com/{path}') == 'http://www.test.com/abou...
{ "split": "train", "index": 71052, "acecode_id": "oss_26992", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `get_positive_and_sort(l: list) -> list` that returns a new list containing only the positive numbers from the input list, sorted in ascending order. The output list should not contain any duplicate values. You need to implement this f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_positive_and_sort([-1, 2, -4, 5, 6]) == [2, 5, 6]\", \"assert get_positive_and_sort([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) == [1, 2, 3, 5, 9, 123]\", \"assert get_positive_and_sort([]) == []\", \"assert get_positive_and_sort([-1, -2, -3]) == []\", \"as...
{ "split": "train", "index": 71053, "acecode_id": "evol_31664", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `create_binary_mask` that takes in the list and three tuples representing minimum and maximum thresholds for filtering the values. The function should return a binary list where each element is 1 if the corresponding value in the i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_binary_mask([1, 2, 3, 4, 5], (0, 5), (0, 5), (0, 5)) == [1, 1, 1, 1, 1]\", \"assert create_binary_mask([], (0, 5), (0, 5), (0, 5)) == []\", \"assert create_binary_mask([0, 0, 0, 0, 0], (0, 0), (0, 0), (0, 0)) == [1, 1, 1, 1, 1]\", \"assert create_bina...
{ "split": "train", "index": 71054, "acecode_id": "bigcode_python_fns_43555", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the heights of bars in a histogram, write a function `largestRectangleArea(heights)` that computes the area of the largest rectangle that can be formed within the histogram. The width of each bar is 1, and the height of the rectangle is lim...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert largestRectangleArea([2,1,5,6,2,3]) == 10\", \"assert largestRectangleArea([1,1]) == 2\", \"assert largestRectangleArea([4,2,0,3,2,5]) == 6\", \"assert largestRectangleArea([1,2,3,4,5]) == 9\", \"assert largestRectangleArea([5,4,3,2,1]) == 9\", \"assert larg...
{ "split": "train", "index": 71055, "acecode_id": "bigcode_python_fns_883", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a function `verify_number(n: int) -> bool` that takes an integer n as input and verifies whether it satisfies the following conditions: \n\n1. It is a three-digit number.\n2. The digit in the hundredths place is twice the digit in the ones place.\n3. The digit in the tens...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_number(420) == False\", \"assert verify_number(150) == False\", \"assert verify_number(234) == False\", \"assert verify_number(123) == False\", \"assert verify_number(300) == False\", \"assert verify_number(204) == False\", \"assert verify_number(510)...
{ "split": "train", "index": 71056, "acecode_id": "evol_6399", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the movement of a rectangle in a window. Write a function `move_rectangle(x: int, y: int, width: int, height: int, vel: int, win_width: int, win_height: int) -> Tuple[int, int]` that takes the initial position (x, y), dimensions (width, height), v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert move_rectangle(400, 300, 50, 50, 5, 800, 600) == (400, 305)\", \"assert move_rectangle(400, 0, 50, 50, -5, 800, 600) == (400, 0)\", \"assert move_rectangle(400, 300, 50, 50, -5, 800, 600) == (400, 295)\", \"assert move_rectangle(400, 5, 50, 50, -10, 800, 600...
{ "split": "train", "index": 71057, "acecode_id": "oss_18979", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a custom activation function for a neural network, named 'CustomReLU'. The CustomReLU function should return 0 for any input value less than or equal to 0, and for any input value greater than 0, it should return the square of that input value. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_relu(-2) == 0\", \"assert custom_relu(-1) == 0\", \"assert custom_relu(0) == 0\", \"assert custom_relu(1) == 1\", \"assert custom_relu(2) == 4\", \"assert custom_relu(3) == 9\", \"assert custom_relu(4) == 16\", \"assert custom_relu(5) == 25\", \"asser...
{ "split": "train", "index": 71058, "acecode_id": "oss_15651", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of filenames, implement a function `gather_files(filenames: List[str]) -> List[str]` that returns a new list containing the filenames that have been 'touched'. A file is considered 'touched' if its name ends with the string '_done'. The output list should maintain ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert gather_files(['file1', 'file2_done', 'file3', 'file4_done']) == ['file2_done', 'file4_done']\", \"assert gather_files(['report_done', 'summary', 'data_done']) == ['report_done', 'data_done']\", \"assert gather_files(['test', 'test_done', 'sample_file', 'anot...
{ "split": "train", "index": 71059, "acecode_id": "bigcode_python_fns_16632", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a custom Python decorator that logs the arguments and return value of a function. Your decorator should print the function name, its arguments, and the return value whenever the function is called. Implement the function `log_function(func)` tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_function(lambda a, b: a + b)(3, 5) == 8\", \"assert log_function(lambda a, b: a * b)(4, 6) == 24\", \"assert log_function(lambda a: a ** 2)(2) == 4\", \"assert log_function(lambda a, b, c: a + b + c)(1, 2, 3) == 6\", \"assert log_function(lambda x: x)(5)...
{ "split": "train", "index": 71060, "acecode_id": "oss_484", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a class called DecodeSteps which has two attributes: action_types (a list of strings) and action_ids (a list of integers). Write a function `get_labels(decode_steps: DecodeSteps) -> dict` that takes an instance of DecodeSteps as input and returns a dictionary cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_labels(DecodeSteps(['jump', 'run'], [1, 2])) == {'target_action_types': ['jump', 'run'], 'target_action_ids': [1, 2]}\", \"assert get_labels(DecodeSteps([], [])) == {'target_action_types': [], 'target_action_ids': []}\", \"assert get_labels(DecodeSteps([...
{ "split": "train", "index": 71061, "acecode_id": "bigcode_python_fns_20377", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_surface_area(shape: str, *dimensions: float) -> float` that calculates the surface area of different 3D polyhedra based on the provided shape and its dimensions. The function should accept a string `shape` which can be one of the following: 'cube...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_surface_area('cube', 3) == 54.0\", \"assert calculate_surface_area('sphere', 5) == 314.1592653589793\", \"assert calculate_surface_area('cube', 1) == 6.0\", \"assert calculate_surface_area('sphere', 1) == 12.566370614359172\", \"assert calculate_su...
{ "split": "train", "index": 71062, "acecode_id": "evol_8007", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two integer arrays, `a` and `b`, of the same length `n`. Your task is to create a new array based on the following rules: For each index `i` from `0` to `n-1`, if `b[i]` is less than `128`, the value at the new array's index `i` should be `a[i] * (b[i] * 2)`. Othe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_arrays([0, 0, 0], [100, 50, 150]) == [0, 0, 0]\", \"assert transform_arrays([5, 10, 15], [128, 128, 128]) == [0, 0, 0]\", \"assert transform_arrays([10, 20, 30], [127, 128, 129]) == [2540, 0, 60]\", \"assert transform_arrays([10, 10, 10], [100, 100...
{ "split": "train", "index": 71063, "acecode_id": "bigcode_python_fns_42115", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the scores for various topics based on a given dictionary. Each topic has associated scores for different measures. Write a function `calculate_topic_scores(run_scores: Dict[str, Dict[str, float]]) -> List[Tuple[str, List[float]]]` that takes a d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_topic_scores({'topic1': {'measure1': 0.9, 'measure2': 0.8, 'measure3': 0.1}, 'topic2': {'measure1': 0.7, 'measure2': 0.6, 'measure3': 0.2}}) == [('measure1', [0.9, 0.7]), ('measure2', [0.8, 0.6])]\", \"assert calculate_topic_scores({'topicA': {'mea...
{ "split": "train", "index": 71064, "acecode_id": "bigcode_python_fns_29647", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a function that creates a job configuration for a build process. The function takes various keyword arguments to customize the job configuration. Your task is to implement a function `get_job_config_build_for_branch` that accepts these keyword arguments and return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_job_config_build_for_branch(a=1, b=2) == {'type': 'copr_build', 'trigger': 'commit', 'branch': 'build-branch', 'scratch': True, 'a': 1, 'b': 2}\", \"assert get_job_config_build_for_branch(user='admin') == {'type': 'copr_build', 'trigger': 'commit', 'bran...
{ "split": "train", "index": 71065, "acecode_id": "bigcode_python_fns_8866", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function `get_hashes` that takes a package requirement in the format \"package_name==version\" and returns a unique hash string for that package version. The generated hash should be a SHA-256 hash of the package requirement. Ensure that the hash is unique for ea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_hashes('cffi==1.9.1') != get_hashes('matplotlib==2.0.2')\", \"assert get_hashes('numpy==1.21.0') != get_hashes('numpy==1.20.0')\", \"assert get_hashes('pandas==1.3.0') != get_hashes('pandas==1.2.0')\", \"assert get_hashes('requests==2.25.1') != get_hashe...
{ "split": "train", "index": 71066, "acecode_id": "oss_26013", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, implement a function that flips the case of each alphabetic character, replaces vowels with specific symbols, modifies odd digits to their factorials, and duplicates special characters. The mapping for vowels is as follows: 'a' -> 'ȃ', 'e' -> 'Ɛ', 'i' -> 'ɨ', 'o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flip_case_replace_vowels_and_modify_odd_numbers('1') == '1'\", \"assert flip_case_replace_vowels_and_modify_odd_numbers('2') == '2'\", \"assert flip_case_replace_vowels_and_modify_odd_numbers('3') == '6'\", \"assert flip_case_replace_vowels_and_modify_odd_nu...
{ "split": "train", "index": 71067, "acecode_id": "evol_11929", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given two lists of numbers, A and B, and two weights a and b, both of which are positive integers. Your task is to implement a function that calculates the weighted average of the two lists by combining their respective elements according to their weights. The function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert weighted_average(3, [10, 20], 5, [30, 40]) == [22.5, 32.5]\", \"assert weighted_average(2, [0, 0], 3, [1, 1]) == [0.6, 0.6]\", \"assert weighted_average(1, [2], 1, [3]) == [2.5]\", \"assert weighted_average(2, [5, 10], 3, [15, 20]) == [11.0, 16.0]\", \"asser...
{ "split": "train", "index": 71068, "acecode_id": "bigcode_python_fns_6332", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that verifies a result structure based on a given expected structure. The function `parse_result` should take a result represented as a tuple containing a tuple and a dictionary. The expected structure is defined by a sequence of valu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert DataStructure(['a', 'b', 'c']).parse_result((1, 2, 3), {'a': 1, 'b': 2, 'c': 3}) == ((1, 2, 3), {'a': 1, 'b': 2, 'c': 3})\", \"assert DataStructure(['x', 'y']).parse_result((10, 20), {'x': 10, 'y': 20}) == ((10, 20), {'x': 10, 'y': 20})\", \"assert DataStruc...
{ "split": "train", "index": 71069, "acecode_id": "oss_23892", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given an integer array `nums`, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order. Return the length of the shortest such subarray. If no such subarray exists, return 0. If the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert findUnsortedSubarray([2,6,4,8,10,9,15]) == 5\", \"assert findUnsortedSubarray([1,2,3,4]) == 0\", \"assert findUnsortedSubarray([1]) == 0\", \"assert findUnsortedSubarray([3,3,3]) == 0\", \"assert findUnsortedSubarray([5,4,3,2,1]) == 5\", \"assert findUnsorte...
{ "split": "train", "index": 71070, "acecode_id": "evol_8563", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of checkpoint file names, each file name is formatted as 'model_epochX.ckpt' where X is an integer representing the epoch number. Your task is to write a function that takes this list as input and returns the checkpoint file name with the highest epoch number along...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_newest_ckpt(['model_epoch1.ckpt', 'model_epoch2.ckpt', 'model_epoch3.ckpt']) == ('model_epoch3.ckpt', 3)\", \"assert get_newest_ckpt(['model_epoch5.ckpt', 'model_epoch5.ckpt', 'model_epoch1.ckpt']) == ('model_epoch5.ckpt', 5)\", \"assert get_newest_ckpt(...
{ "split": "train", "index": 71071, "acecode_id": "bigcode_python_fns_42420", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer `columnNumber`, convert it to its corresponding Excel Sheet Column Title. The mapping is such that A corresponds to 1, B corresponds to 2, ..., Z corresponds to 26, AA corresponds to 27, AB corresponds to 28, and so forth. Implement a function `convertToTitle(c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convertToTitle(1) == 'A'\", \"assert convertToTitle(2) == 'B'\", \"assert convertToTitle(3) == 'C'\", \"assert convertToTitle(26) == 'Z'\", \"assert convertToTitle(27) == 'AA'\", \"assert convertToTitle(28) == 'AB'\", \"assert convertToTitle(52) == 'AZ'\", \...
{ "split": "train", "index": 71072, "acecode_id": "evol_13126", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `canTransform(str1: str, str2: str) -> Tuple[bool, int]` that determines if two given alphanumeric strings are anagrams of each other, considering case sensitivity and spaces. Additionally, if they are anagrams, return the minimum number of character swaps requ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert canTransform('hello', 'billion') == (False, 0)\", \"assert canTransform('abcd', 'abce') == (False, 0)\", \"assert canTransform('', '') == (True, 0)\", \"assert canTransform('A', 'a') == (False, 0)\", \"assert canTransform(' ', ' ') == (True, 0)\", \"assert c...
{ "split": "train", "index": 71073, "acecode_id": "evol_11509", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given an object, implement a function `ensure_listable` that checks if the object is a list, tuple, or set. If it is, return it as is. If it is not, wrap it in a list and return the new list. The function should handle any type of object appropriately. You can assume that the i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ensure_listable(5) == [5]\", \"assert ensure_listable('hello') == ['hello']\", \"assert ensure_listable([1, 2, 3]) == [1, 2, 3]\", \"assert ensure_listable((4, 5, 6)) == (4, 5, 6)\", \"assert ensure_listable({7, 8, 9}) == {7, 8, 9}\", \"assert ensure_listabl...
{ "split": "train", "index": 71074, "acecode_id": "bigcode_python_fns_24473", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to create a custom user model to handle user authentication in a web application. The user model should include the following attributes: 'id' (an integer representing the user's unique identifier), 'username' (a string representing the user's username), 'password' (a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert User(1, 'user1', 'pass123', 'user1@example.com').get_id() == '1'\", \"assert User(2, 'user2', 'pass456', 'user2@example.com').get_id() == '2'\", \"assert User(3, 'user3', 'pass789', 'user3@example.com').get_id() == '3'\", \"assert User(4, 'user4', 'pass101',...
{ "split": "train", "index": 71075, "acecode_id": "oss_37575", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `snake_game(grid_size: Tuple[int, int], initial_position: Tuple[int, int], initial_direction: str, steps: List[str]) -> Tuple[int, int]`. This function simulates a simplified version of the Snake game on a grid. Given the size of the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert snake_game((6, 6), (3, 3), 'up', ['up', 'up', 'up', 'down', 'down', 'left', 'left', 'right', 'right']) == (0, 1)\", \"assert snake_game((5, 5), (1, 1), 'down', ['down', 'down', 'left', 'left', 'down', 'right', 'up', 'up']) == (0, 1)\", \"assert snake_game((5...
{ "split": "train", "index": 71076, "acecode_id": "oss_32056", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple function that simulates the prediction of a medical condition based on a set of observations. The function should take in a list of observations, where each observation is a floating-point number representing a medical measurement. The func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_observations([0.2, 0.4, 0.6, 0.5, 0.1]) == ['non-sepsis', 'non-sepsis', 'sepsis', 'sepsis', 'non-sepsis']\", \"assert classify_observations([0.75, 0.3, 0.99]) == ['sepsis', 'non-sepsis', 'sepsis']\", \"assert classify_observations([0.5, 0.5, 0.5]) =...
{ "split": "train", "index": 71077, "acecode_id": "bigcode_python_fns_42742", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function that manages a list of tasks and executes them only after the necessary parameters are prepared. The function, named `execute_tasks`, should take a list of task names as input and return a list of results indicating the execution status of each ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_tasks([]) == []\", \"assert execute_tasks(['Task 1']) == ['Task Task 1 executed successfully']\", \"assert execute_tasks(['Task 1', 'Task 2']) == ['Task Task 1 executed successfully', 'Task Task 2 executed successfully']\", \"assert execute_tasks(['T...
{ "split": "train", "index": 71078, "acecode_id": "oss_12605", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a nested dictionary representing distribution artefacts, where each key is a tenant and its value is another dictionary mapping media packages to a list of artefacts, write a function that counts the total number of artefacts across all tenants and media packages. The fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_distribution_artefacts({'tenant1': {'media1': ['artefact1', 'artefact2'], 'media2': ['artefact3']}, 'tenant2': {'media1': ['artefact4']}}) == 4\", \"assert count_distribution_artefacts({'tenant1': {'media1': []}, 'tenant2': {}}) == 0\", \"assert count_...
{ "split": "train", "index": 71079, "acecode_id": "bigcode_python_fns_27832", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing a list of code snippets to identify the flow control structures used within them. Each code snippet is represented as a string in a list. You need to implement a function that takes this list of code snippets as input and returns a dictionary summa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_flow_control_structures(['if x > 0:', 'for i in range(10):', 'while True:']) == {'if': 1, 'for': 1, 'while': 1}\", \"assert analyze_flow_control_structures(['if a:', 'if b:', 'for j in range(5):']) == {'if': 2, 'for': 1, 'while': 0}\", \"assert analy...
{ "split": "train", "index": 71080, "acecode_id": "oss_21498", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing angles in degrees. Your task is to implement a function that takes an index as an argument and returns the corresponding angle from the list. The list contains the following angles: -90, -45, 0, 45, and 90 degrees. If the index is o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_angle(0) == -90\", \"assert get_angle(1) == -45\", \"assert get_angle(2) == 0\", \"assert get_angle(3) == 45\", \"assert get_angle(4) == 90\", \"assert get_angle(-1) == 'Index out of bounds'\", \"assert get_angle(5) == 'Index out of bounds'\", \"assert g...
{ "split": "train", "index": 71081, "acecode_id": "bigcode_python_fns_3479", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the scores of a game, write a function `calculate_average_score(scores)` that calculates the average score of the game, excluding the highest and lowest scores. The function should take in a list of integers `scores` (2 <= len(scores) <= 10...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_score([10, 20, 30, 40, 50]) == 30.00\", \"assert calculate_average_score([1, 2, 3]) == 2.00\", \"assert calculate_average_score([5, 5, 5, 5, 5]) == 5.00\", \"assert calculate_average_score([100, 200, 300, 400, 500]) == 300.00\", \"assert ca...
{ "split": "train", "index": 71082, "acecode_id": "oss_219", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a table of water usage and bathing numbers for a household of 4 people based on a fixed schedule. The function should return a 2D array (list of lists) that contains the water usage data for various scenarios, where eac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_table_m_1_a_5() == [[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [4, 0, 0, 4, 0, 0, 0, 0], [6, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], ...
{ "split": "train", "index": 71083, "acecode_id": "bigcode_python_fns_48425", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple game environment where a player can take random actions. Implement a function `simulate_game(actions: List[str], rounds: int) -> List[str]` that takes a list of possible actions and a number of rounds. The function should return a list of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_game(['move', 'jump', 'shoot'], 3) != simulate_game(['move', 'jump', 'shoot'], 3)\", \"assert len(simulate_game(['move', 'jump'], 5)) == 5\", \"assert all(action in ['move', 'jump'] for action in simulate_game(['move', 'jump'], 5))\", \"assert len(s...
{ "split": "train", "index": 71084, "acecode_id": "bigcode_python_fns_4932", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `manage_row(action: str, id: int, data: dict) -> str` that performs a Create, Read, Update, or Delete operation on a database table. The `action` parameter can be one of the following: 'create', 'read', 'update', or 'delete'. The `id` parameter is used for ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_row('create', 1, {'name': 'Alice', 'age': 30}) == 'Row created'\", \"assert manage_row('read', 1, {}) == 'Row not found'\", \"assert manage_row('create', 2, {'name': 'Bob', 'age': 25}) == 'Row created'\", \"assert manage_row('read', 2, {}) == 'Row not...
{ "split": "train", "index": 71085, "acecode_id": "evol_34048", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of IP address ranges and their corresponding country codes. Each entry in the list is a tuple containing the start IP address, end IP address, and the country code. Write a function `locate_country_code(ip_ranges: List[Tuple[int, int, str]], attack_ip: int)...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert locate_country_code([(10, 20, 'US'), (30, 40, 'CA'), (50, 60, 'MX')], 15) == 'US'\", \"assert locate_country_code([(10, 20, 'US'), (30, 40, 'CA'), (50, 60, 'MX')], 35) == 'CA'\", \"assert locate_country_code([(10, 20, 'US'), (30, 40, 'CA'), (50, 60, 'MX')], ...
{ "split": "train", "index": 71086, "acecode_id": "bigcode_python_fns_44422", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `s`, write a function `transform_name(s: str) -> str` that transforms the input string to lowercase and replaces any non-alphanumeric character (except for underscores) with an underscore. The function should return the transformed string. For example, if the inp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_name('Hello World!') == 'hello_world_'\", \"assert transform_name('Python3.8') == 'python3_8'\", \"assert transform_name('Data@Science') == 'data_science'\", \"assert transform_name('LeetCode#2023') == 'leetcode_2023'\", \"assert transform_name('Us...
{ "split": "train", "index": 71087, "acecode_id": "bigcode_python_fns_973", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a functionality to manage electronic credit transfers. You need to implement a function `calculate_total_transfer_amount(transfers: List[Tuple[int, str, str, float, str]], account: str) -> float` that calculates the total amount of credit transf...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_transfer_amount([(1, 'A123', 'B456', 100.0, '2023-01-01T10:00:00'), (2, 'A123', 'C789', 200.0, '2023-01-02T10:00:00'), (3, 'B456', 'A123', 50.0, '2023-01-03T10:00:00')], 'A123') == 300.0\", \"assert calculate_total_transfer_amount([(1, 'A123'...
{ "split": "train", "index": 71088, "acecode_id": "oss_20941", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a string as input and returns a new string where the first character of the input string is converted to uppercase. If the input string is empty, the function should return an empty string. Implement the function `capitalize_fi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert capitalize_first_character('example input') == 'Example input'\", \"assert capitalize_first_character('hello world') == 'Hello world'\", \"assert capitalize_first_character('python programming') == 'Python programming'\", \"assert capitalize_first_character(...
{ "split": "train", "index": 71089, "acecode_id": "evol_8559", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `check_odd_indices(lst)` that checks if all elements at odd indices in the given list are odd numbers. The function should return `True` if all odd-indexed elements are odd, and `False` otherwise. If the list is empty, return `True`.\nPlease reason step by ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_odd_indices([]) == True\", \"assert check_odd_indices([1]) == True\", \"assert check_odd_indices([1, 2]) == False\", \"assert check_odd_indices([1, 3, 5]) == True\", \"assert check_odd_indices([1, 1, 1, 1]) == True\", \"assert check_odd_indices([1, 1, ...
{ "split": "train", "index": 71090, "acecode_id": "evol_21646", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a function `count_uppercase_vowels(sentence: str) -> int` that takes a string `sentence` as input and returns the total number of uppercase vowels ('A', 'E', 'I', 'O', 'U') present in the string. The function should iterate through each character in the string and count o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_uppercase_vowels('AEIOU') == 5\", \"assert count_uppercase_vowels('abcdefg') == 0\", \"assert count_uppercase_vowels('ThIs Is A TeSt') == 3\", \"assert count_uppercase_vowels('Python Programming') == 0\", \"assert count_uppercase_vowels('This is a test...
{ "split": "train", "index": 71091, "acecode_id": "evol_26734", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function that returns the second smallest unique number in the array. The function should handle cases where the array may contain duplicate numbers and negative integers. If there are less than two unique numbers, return a message indica...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert second_smallest([1, 2, 3, 4, 5]) == 2\", \"assert second_smallest([5, 5, 5, 5, 5]) == 'Array has less than 2 unique numbers!'\", \"assert second_smallest([3, 3, 3, 3, 2, 2]) == 3\", \"assert second_smallest([0, 0, 0, 0, 0]) == 'Array has less than 2 unique n...
{ "split": "train", "index": 71092, "acecode_id": "evol_15343", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a binary matrix represented as a list of lists, where each element is either 0 or 1, write a function `find_smallest_rectangle(matrix: List[List[int]]) -> List[Tuple[int, int]]` that returns the coordinates of the top-left and bottom-right corners of the smallest rectangl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_smallest_rectangle([[0, 0, 0], [0, 1, 0], [0, 0, 0]]) == [(1, 1), (1, 1)]\", \"assert find_smallest_rectangle([[1, 1], [1, 1]]) == [(0, 0), (1, 1)]\", \"assert find_smallest_rectangle([[0, 0], [0, 0]]) == []\", \"assert find_smallest_rectangle([[1, 1, 1...
{ "split": "train", "index": 71093, "acecode_id": "bigcode_python_fns_45414", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to update the state of a specific task within a directed acyclic graph (DAG). The function should take the following parameters: a list of tasks, where each task is represented by a dictionary with 'task_id' and 'state'; the 'task_id'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_task_state([{'task_id': 'task1', 'state': 'PENDING'}, {'task_id': 'task2', 'state': 'RUNNING'}], 'task1', 'SUCCESS') == [{'task_id': 'task1', 'state': 'SUCCESS'}, {'task_id': 'task2', 'state': 'RUNNING'}]\", \"assert set_task_state([{'task_id': 'task1', ...
{ "split": "train", "index": 71094, "acecode_id": "oss_19143", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing subpopulation indices. Your task is to implement a function `check_consecutive_indices` that checks whether these indices form a consecutive sequence starting from 0 up to the length of the list minus one. If the indices are not con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_consecutive_indices([0, 1, 2, 3]) is None\", \"assert check_consecutive_indices([0]) is None\", \"assert check_consecutive_indices([]) is None\", \"assert check_consecutive_indices([0, 1, 2]) is None\", \"assert check_consecutive_indices([0, 1]) is Non...
{ "split": "train", "index": 71095, "acecode_id": "oss_28889", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that reverses the order of a list of branding policy IDs. The branding policy IDs are provided in a specific order, and your goal is to write a function that takes this list and returns a new list where the IDs are in the reverse orde...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reorder_branding_policies(['policy1', 'policy2', 'policy3', 'policy4']) == ['policy4', 'policy3', 'policy2', 'policy1']\", \"assert reorder_branding_policies(['a', 'b', 'c', 'd', 'e']) == ['e', 'd', 'c', 'b', 'a']\", \"assert reorder_branding_policies(['one'...
{ "split": "train", "index": 71096, "acecode_id": "oss_1200", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `factorial(n: int) -> int` that calculates the factorial of a non-negative integer `n`. The factorial of a non-negative integer `n` is the product of all positive integers less than or equal to `n`, and is denoted by `n!`. You can assume that the input `n` is a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(...
{ "split": "train", "index": 71097, "acecode_id": "evol_18534", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `convert_bytes_to_megabytes` that takes an integer `file_size_bytes` representing the size of a file in bytes and converts it to megabytes (MB). The conversion should follow the standard where 1 MB is equal to 1,048,576 bytes. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_bytes_to_megabytes(0) == 0.00\", \"assert convert_bytes_to_megabytes(1048576) == 1.00\", \"assert convert_bytes_to_megabytes(2097152) == 2.00\", \"assert convert_bytes_to_megabytes(3145728) == 3.00\", \"assert convert_bytes_to_megabytes(4194304) == 4...
{ "split": "train", "index": 71098, "acecode_id": "bigcode_python_fns_12096", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary representing a context and a template, implement a function that checks whether the specified template contains valid resolver information in the context. The context is a dictionary with a key 'container_type' that indicates the type of container, and the co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_template({'container_type': 'type1', 'type1': {'info': {'namespace1': {'template': 'template1'}}}}, {'namespace': 'namespace1', 'resolver_map': {'template1': []}}) == 'template1'\", \"assert check_template({'container_type': 'type1', 'type1': {'info': ...
{ "split": "train", "index": 71099, "acecode_id": "bigcode_python_fns_25550", "num_tests": 16 }