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": "Implement a function that takes two integers as input and returns their greatest common divisor (GCD). The GCD of two integers is the largest positive integer that divides both numbers without leaving a remainder. You can assume that the input integers are non-negative. Write a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gcd(30, 45) == 15\", \"assert gcd(48, 18) == 6\", \"assert gcd(56, 98) == 14\", \"assert gcd(101, 10) == 1\", \"assert gcd(0, 5) == 5\", \"assert gcd(5, 0) == 5\", \"assert gcd(0, 0) == 0\", \"assert gcd(25, 5) == 5\", \"assert gcd(14, 28) == 14\", \"assert ... | {
"split": "train",
"index": 70800,
"acecode_id": "evol_25915",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two strings, `action` and `cm_venv_name`, and an optional string `ex_cmd`. The `action` string can be one of the following: '--daemon', '--stop-daemon', or '--reload'. The `cm_venv_name` represents the name of a virtual environment. Your task is to compose a comma... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compose_command('--daemon', 'CM', None) == 'workon CM; cd /mnt/cm; sh run.sh --daemon'\", \"assert compose_command('--stop-daemon', 'CM', 'echo Stopping') == 'workon CM; cd /mnt/cm; echo Stopping; sh run.sh --stop-daemon'\", \"assert compose_command('--reloa... | {
"split": "train",
"index": 70801,
"acecode_id": "bigcode_python_fns_37262",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks the correctness of the scope of delimiters in a multi-line string. The delimiters to be checked are the dollar sign ($) and the at symbol (@). The function should return True if the delimiters are correctly scoped and Fals... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_scope_correct_if_delimiter_not_at_bol('$@\\\"') == True\", \"assert is_scope_correct_if_delimiter_not_at_bol('$@\\\"') == True\", \"assert is_scope_correct_if_delimiter_not_at_bol('$$@\\\"') == False\", \"assert is_scope_correct_if_delimiter_not_at_bol('$... | {
"split": "train",
"index": 70802,
"acecode_id": "oss_10180",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a 2D matrix of integers, implement a function that returns the elements of the matrix in spiral order. The function should take a single argument, which is the matrix, and return a list of integers representing the spiral order traversal of the matrix. Your implementation... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert spiral_matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [1, 2, 3, 6, 9, 8, 7, 4, 5]\", \"assert spiral_matrix([[1]]) == [1]\", \"assert spiral_matrix([[1, 2], [3, 4]]) == [1, 2, 4, 3]\", \"assert spiral_matrix([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]]) == [1... | {
"split": "train",
"index": 70803,
"acecode_id": "evol_17489",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that describes a processing task. The dictionary contains a key 'data_id' which represents an identifier for the main data input, and a key 'inputs' which is a list of additional input names. Your task is to implement a function that returns a list of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_process_list({'data_id': '123', 'inputs': ['input1', 'input2']}) == (['123', 'input1', 'input2'], ['process_chain_123'])\", \"assert get_process_list({'data_id': '456', 'inputs': []}) == (['456'], ['process_chain_456'])\", \"assert get_process_list({'dat... | {
"split": "train",
"index": 70804,
"acecode_id": "bigcode_python_fns_21079",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers and two bounds, lower_bound and upper_bound. The function should return the sum of the numbers in the list that are between the lower_bound (inclusive) and the upper_bound (exclusive), as well as the count of how many numbers f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_and_count_within_bounds([1, 2, 3, 4, 5], 2, 5) == (9, 3)\", \"assert sum_and_count_within_bounds([10, 20, 30, 40, 50], 15, 45) == (90, 3)\", \"assert sum_and_count_within_bounds([1, 2, 3, 4, 5, 6], 0, 10) == (21, 6)\", \"assert sum_and_count_within_bound... | {
"split": "train",
"index": 70805,
"acecode_id": "evol_13941",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes two integers, `a` and `b`, as input and returns their sum. The sum should be computed using a helper function that adds the two integers. Your function should handle the case where both integers are negative, zero, or po... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_two_numbers(1, 2) == 3\", \"assert sum_two_numbers(-1, -2) == -3\", \"assert sum_two_numbers(0, 0) == 0\", \"assert sum_two_numbers(5, 10) == 15\", \"assert sum_two_numbers(-5, 5) == 0\", \"assert sum_two_numbers(-10, 10) == 0\", \"assert sum_two_numbers... | {
"split": "train",
"index": 70806,
"acecode_id": "oss_21918",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a context object and a list of items, and outputs a configuration documentation string based on the provided items. The context object contains a method 'doc' that accepts a variable number of arguments and returns a formatted ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_config_doc(MockContext(), ['item1', 'item2']) == 'Configuration for item1, item2'\", \"assert generate_config_doc(MockContext(), ['itemA']) == 'Configuration for itemA'\", \"assert generate_config_doc(MockContext(), []) == 'Configuration for '\", \"... | {
"split": "train",
"index": 70807,
"acecode_id": "bigcode_python_fns_26375",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple stack data structure. The stack should support the standard operations: push, pop, peek, is_empty, and size. Your function should take a list of operations and return the results of these operations in the order th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert stack_operations(['push 5', 'push 10', 'pop']) == [10]\", \"assert stack_operations(['push 3', 'peek']) == [3]\", \"assert stack_operations(['push 4', 'push 5', 'is_empty']) == [False]\", \"assert stack_operations(['push 1', 'pop', 'pop']) == [1, None]\", \"... | {
"split": "train",
"index": 70808,
"acecode_id": "oss_23946",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a user registration system where each user must have a unique email address. Write a function `create_user(username: str, email: str, password: str, first_name: str, last_name: str) -> str` that takes in the user's username, email, password, first n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_user('NEW_USER', 'admin@django.com', '123', 'First', 'Last') == 'Email already in use'\", \"assert create_user('NEW_USER', 'user@example.com', '123', 'First', 'Last') == 'Email already in use'\", \"assert create_user('NEW_USER1', 'newuser1@example.com... | {
"split": "train",
"index": 70809,
"acecode_id": "bigcode_python_fns_41228",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `create_new_instance()` that initializes a new instance of a system. The instance creation should simulate a successful initialization if a random number generated between 0 and 10 is greater than 2. If the number is less than or equal to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_new_instance() in ['instance_1', 'instance_2', 'instance_3', 'instance_4', 'instance_5', 'instance_6', 'instance_7', 'instance_8', 'instance_9', 'instance_10']\", \"assert create_new_instance() in ['instance_1', 'instance_2', 'instance_3', 'instance_4... | {
"split": "train",
"index": 70810,
"acecode_id": "bigcode_python_fns_13339",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given an array of integers, where each integer represents a unique item id expected to be in a sequence starting from 0 up to n-1 (where n is the size of the array). Your task is to count how many items in the array are out of the expected order. An item is considered o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_disordered([0, 1, 2, 3, 4]) == 0\", \"assert count_disordered([0, 2, 1, 4, 3]) == 4\", \"assert count_disordered([]) == 0\", \"assert count_disordered([0]) == 0\", \"assert count_disordered([1]) == 1\", \"assert count_disordered([0, 4, 3, 2, 1]) == 4\"... | {
"split": "train",
"index": 70811,
"acecode_id": "bigcode_python_fns_7426",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of numerical features, write a function `normalize(features)` that scales the values in the list to a range of [0, 1]. The input will be a list of floats or integers, and the output should be a list of floats where each value is transformed according to the formula... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize([10, 20, 30]) == [0.0, 0.5, 1.0]\", \"assert normalize([1, 1, 1]) == [0.0, 0.0, 0.0]\", \"assert normalize([5, 15, 25]) == [0.0, 0.5, 1.0]\", \"assert normalize([100, 200, 300]) == [0.0, 0.5, 1.0]\", \"assert normalize([0]) == [0.0]\", \"assert nor... | {
"split": "train",
"index": 70812,
"acecode_id": "bigcode_python_fns_21736",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given time array and returns a formatted string representing the time in the 'YY-MM-DD HH:MM:SS' format. The time array is a list containing the year, month, day, hour, minute, and second in that order. You need to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_time([2023, 5, 15, 14, 30, 0]) == '23-05-15 14:30:00'\", \"assert format_time([2020, 1, 1, 0, 0, 0]) == '20-01-01 00:00:00'\", \"assert format_time([2021, 12, 31, 23, 59, 59]) == '21-12-31 23:59:59'\", \"assert format_time([2022, 7, 4, 12, 0, 0]) == '... | {
"split": "train",
"index": 70813,
"acecode_id": "oss_7139",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, write a function that determines whether the number is even or odd. The function should return True if the number is even and False if the number is odd. You do not need to handle any user input or output; simply implement the function. \n\nFunction Signatur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_even(0) == True\", \"assert is_even(1) == False\", \"assert is_even(2) == True\", \"assert is_even(3) == False\", \"assert is_even(4) == True\", \"assert is_even(5) == False\", \"assert is_even(-1) == False\", \"assert is_even(-2) == True\", \"assert is_e... | {
"split": "train",
"index": 70814,
"acecode_id": "oss_34709",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates a unique identifier for each user in a system based on their name and age. The function should take two parameters: a string `name` and an integer `age`. The identifier should be constructed as follows: If the user's... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_user_id('Jo', 25) == 'JoXX25'\", \"assert generate_user_id('Tom', 30) == 'Tom30'\", \"assert generate_user_id('Johnathan', 40) == 'Johan40'\", \"assert generate_user_id('An', 22) == 'AnXX22'\", \"assert generate_user_id('Max', 15) == 'Max15'\", \"as... | {
"split": "train",
"index": 70815,
"acecode_id": "oss_17794",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a string `s`, return the longest non-overlapping duplicated substring. A duplicated substring is defined as a contiguous substring that appears 2 or more times in `s`, without any overlapping occurrences. If no such substring exists, return an empty string. The length of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_dup_substring('abcd') == ''\", \"assert longest_dup_substring('ababcabc') == 'abc'\", \"assert longest_dup_substring('xyzxyz') == 'xyz'\", \"assert longest_dup_substring('abcdefg') == ''\", \"assert longest_dup_substring('a') == ''\", \"assert longes... | {
"split": "train",
"index": 70816,
"acecode_id": "evol_27888",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Write a function `shortest_substring(s: str) -> Tuple[int, str]` that locates and extracts the shortest substring containing all distinct characters in a given string. The function should handle special characters, spaces, and numbers, and it should also return (0, '') if the i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shortest_substring('abcd') == (4, 'abcd')\", \"assert shortest_substring('a') == (1, 'a')\", \"assert shortest_substring('') == (0, '')\", \"assert shortest_substring('abcabcbb') == (3, 'abc')\", \"assert shortest_substring('!@#$%^&*()') == (10, '!@#$%^&*()'... | {
"split": "train",
"index": 70817,
"acecode_id": "evol_13890",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list of integers representing an image matrix and an integer indicating the degrees of rotation (positive for counter-clockwise), write a function that rotates the image by the specified degrees while replicating the border pixels. The function should return a new 2D... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rotate([[1, 2], [3, 4]], 180) == [[4, 3], [2, 1]]\", \"assert rotate([[1, 2], [3, 4]], 0) == [[1, 2], [3, 4]]\", \"assert rotate([[1]], 90) == [[1]]\", \"assert rotate([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 180) == [[9, 8, 7], [6, 5, 4], [3, 2, 1]]\", \"assert r... | {
"split": "train",
"index": 70818,
"acecode_id": "bigcode_python_fns_22079",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Write a function that extracts the values of the 'alt' attributes from all <a> tags in a given HTML string. The function should handle improperly formed tags or missing closing tags gracefully without crashing. Return a list of extracted 'alt' values. If an <a> tag does not hav... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_alt('<a href=\\\"http://example.com\\\" alt=\\\"Example Link\\\">Example</a>') == ['Example Link']\", \"assert extract_alt('<html><body><a href=\\\"http://example.com\\\">Example</a></body></html>') == []\", \"assert extract_alt('<a href=\\\"http://e... | {
"split": "train",
"index": 70819,
"acecode_id": "evol_18073",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the creation of a user in a web application. The function should take four parameters: first name (`fname`), last name (`lname`), email (`email`), and password (`password`). The function needs to ensure that the following r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_user('John', 'Doe', 'john.doe@example.com', 'securepassword123') == hash('john.doe@example.com')\", \"assert create_user('Jane', '', 'jane.doe@example.com', 'mypassword') == hash('jane.doe@example.com')\", \"assert create_user('Charlie', 'White', 'cha... | {
"split": "train",
"index": 70820,
"acecode_id": "oss_18517",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes two sets as input and returns a tuple containing the symmetric difference between the two sets, the unique elements present only in the first set, the unique elements present only in the second set, the sorted union of both sets, and the inter... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_set_operations({10, 20, 30}, {20, 40, 50}) == ({10, 30, 40, 50}, {10, 30}, {40, 50}, [10, 20, 30, 40, 50], {20})\", \"assert get_set_operations({1, 2}, {2, 3}) == ({1, 3}, {1}, {3}, [1, 2, 3], {2})\", \"assert get_set_operations(set(), {1, 2, 3}) == ({1,... | {
"split": "train",
"index": 70821,
"acecode_id": "evol_29119",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to filter and load calendar events based on specific criteria. Each event is represented by an instance of a class called CalendarEvent, which has the following attributes: id (unique identifier), user (owner of the event), calendar (... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_calendar_events([CalendarEvent(1, 1, 'work', False)], {1}) == [CalendarEvent(1, 1, 'work', False)]\", \"assert load_calendar_events([CalendarEvent(1, 1, 'work', True)], {1}) == []\", \"assert load_calendar_events([CalendarEvent(1, 1, 'work', False), Cal... | {
"split": "train",
"index": 70822,
"acecode_id": "oss_16680",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes an IP address and a port number as input and returns the corresponding base URL in the format 'http://<IP>:<port>'. The input will always be a valid IP address in the form of 'X.X.X.X' where 'X' is a number between 0 and 255, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_base_url('1.1.1.1', 8124) == 'http://1.1.1.1:8124'\", \"assert generate_base_url('192.168.0.1', 80) == 'http://192.168.0.1:80'\", \"assert generate_base_url('255.255.255.255', 65535) == 'http://255.255.255.255:65535'\", \"assert generate_base_url('1... | {
"split": "train",
"index": 70823,
"acecode_id": "bigcode_python_fns_40554",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that renames a worksheet in a spreadsheet application. The function, `rename_worksheet(sheet_id: int, new_name: str) -> str`, takes in two parameters: an integer `sheet_id` representing the unique identifier of the worksheet, and a string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rename_worksheet(1, 'Budget 2023') == 'Budget 2023'\", \"assert rename_worksheet(2, 'Q1 Report') == 'Q1 Report'\", \"assert rename_worksheet(3, 'Monthly Expenses') == 'Monthly Expenses'\", \"assert rename_worksheet(4, '') == 'Invalid Name'\", \"assert rename... | {
"split": "train",
"index": 70824,
"acecode_id": "bigcode_python_fns_12311",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple vision processing system. Implement a function `process_vision` that takes an instance of `VisionSubclass` and returns the value of the `value` attribute of that instance. If the `value` attribute is None, return the string 'No value provid... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_vision(VisionSubclass(10)) == 10\", \"assert process_vision(VisionSubclass(-5)) == -5\", \"assert process_vision(VisionSubclass(0)) == 0\", \"assert process_vision(VisionSubclass()) == 'No value provided'\", \"assert process_vision(VisionSubclass(Non... | {
"split": "train",
"index": 70825,
"acecode_id": "oss_25372",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a command-line interface configuration for a machine learning model training script using the `argparse` module. The function should accept the following parameters:\n\n- `colorspace_features`: A list of available color... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_arg_parser(['RGB', 'HSV'], ['ET-regr', 'RF'], ['sqrt', 'log2'])._option_string_actions['--colorspace_features'].default == ''\", \"assert create_arg_parser(['RGB', 'HSV'], ['ET-regr', 'RF'], ['sqrt', 'log2'])._option_string_actions['--forest_method'].... | {
"split": "train",
"index": 70826,
"acecode_id": "oss_3778",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given two strings, 'a' and 'b', consisting of lowercase letters. Your task is to determine the minimum number of operations required to make the two strings anagrams of each other. An operation is defined as removing a character from either string. Implement the functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minimumOperations('abc', 'cba') == 0\", \"assert minimumOperations('abc', 'def') == 6\", \"assert minimumOperations('aabbcc', 'abc') == 3\", \"assert minimumOperations('listen', 'silent') == 0\", \"assert minimumOperations('triangle', 'integral') == 0\", \"a... | {
"split": "train",
"index": 70827,
"acecode_id": "evol_19304",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing the attributes of a model. Your task is to create a function that takes a model class and a dictionary as input. The function should check if the dictionary can be used to instantiate an object of the given model class by converting its k... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_model_instance(ModelClass, {'modelName': 'test', 'modelValue': 10}) == ModelClass(model_name='test', model_value=10)\", \"assert isinstance(get_model_instance(ModelClass, {'modelName': 'example', 'modelValue': 20}), ModelClass)\", \"assert get_model_inst... | {
"split": "train",
"index": 70828,
"acecode_id": "bigcode_python_fns_46446",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Write a function `count_occurrences` that takes an element and a list (which may contain nested lists) as input and returns the number of occurrences of the specified element in the list. The function should be able to handle various data types including integers, strings, and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_occurrences(3, [1, 2, 3, [3, 3, 4], 5]) == 3\", \"assert count_occurrences('apple', ['apple', 'banana', ['apple', 'orange']]) == 2\", \"assert count_occurrences(1, [1, 1, 1, [1, 1], 2]) == 5\", \"assert count_occurrences((1, 2), [1, (1, 2), 2, [3, (1, ... | {
"split": "train",
"index": 70829,
"acecode_id": "evol_23605",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the factorial of a non-negative integer. The function should raise a TypeError if the input is not an integer and a ValueError if the input is a negative integer. The function should return the factorial of the integer if it is non-negative.... | 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": 70830,
"acecode_id": "evol_17798",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the insertion of gene entries into a database table. The function will take a list of tuples where each tuple contains a gene ID (a string) and a strand (a string, either '+' or '-'). Your function should return a list of u... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert_genes([('gene1', '+'), ('gene2', '-'), ('gene1', '-')]) == ['gene1', 'gene2']\", \"assert insert_genes([('gene3', '+'), ('gene3', '+'), ('gene4', '-')]) == ['gene3', 'gene4']\", \"assert insert_genes([('geneA', '+'), ('geneB', '+'), ('geneA', '+'), ('... | {
"split": "train",
"index": 70831,
"acecode_id": "bigcode_python_fns_47073",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a functional employee management system. Create a function `manage_employees(employee_data, action, *args)` that takes a list of employee dictionaries and performs one of the specified actions: hiring a new employee, promoting an existing employ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_employees([], 'hire', 'Alice', 30, 'Engineer', 70000) == [{'name': 'Alice', 'age': 30, 'position': 'Engineer', 'salary': 70000}]\", \"assert manage_employees([{'name': 'Alice', 'age': 30, 'position': 'Engineer', 'salary': 70000}], 'promote', 'Alice', ... | {
"split": "train",
"index": 70832,
"acecode_id": "evol_31417",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers as input and returns the maximum and minimum values from that list as a tuple. The function should be able to handle an empty list by returning (None, None).\nPlease reason step by step, then write a self-contained Python solut... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_min([5, 4, 7, 1, 2]) == (7, 1)\", \"assert find_max_min([-5, -1, -10, -3]) == (-1, -10)\", \"assert find_max_min([0, 0, 0]) == (0, 0)\", \"assert find_max_min([1]) == (1, 1)\", \"assert find_max_min([10, 20, 30, 40, 50]) == (50, 10)\", \"assert find... | {
"split": "train",
"index": 70833,
"acecode_id": "evol_10141",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `compare_history_optimizer(history: List[int], optimizer: List[int]) -> str` that compares two optimization results represented by two lists of integers. The function should return 'History beats Optimizer' if the first list (history) ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_history_optimizer([1, 2, 3], [2, 3, 4]) == 'History beats Optimizer'\", \"assert compare_history_optimizer([3, 2, 1], [2, 1, 0]) == 'Optimizer is better or equal'\", \"assert compare_history_optimizer([1, 1, 1], [1, 1, 1]) == 'Optimizer is better or ... | {
"split": "train",
"index": 70834,
"acecode_id": "bigcode_python_fns_13233",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string and a list of character pairs, implement a function that calculates the frequency of occurrence of each character pair and the individual occurrence of the characters within those pairs. The function should return two dictionaries: one for the frequencies of the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_frequency('abcde', ['xy', 'de', 'ab']) == ({'xy': 0, 'de': 1, 'ab': 1}, {'a': 1, 'b': 1, 'c': 1, 'd': 1, 'e': 1})\", \"assert compute_frequency('!@#$%^&*()', ['!@', '#$', '%^']) == ({'!@': 1, '#$': 1, '%^': 1}, {'!': 1, '@': 1, '#': 1, '$': 1, '%': 1... | {
"split": "train",
"index": 70835,
"acecode_id": "evol_14019",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing markdown file contents, where each string contains tasks in the format 'Task: <task_name> - Description: <task_description>'. Your goal is to extract the unique task names from the list of markdown strings and return them as a sorted... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_unique_tasks([\\\"Task: Task1 - Description: This is task 1.\\\", \\\"Task: Task2 - Description: This is task 2.\\\", \\\"Task: Task1 - Description: This is another description for task 1.\\\"]) == ['Task1', 'Task2']\", \"assert extract_unique_tasks(... | {
"split": "train",
"index": 70836,
"acecode_id": "bigcode_python_fns_12296",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function named `catch_exceptions` that takes another function `func` as its first argument, followed by any number of positional and keyword arguments. The function should execute `func` with the provided arguments. If `func` raises any exceptions... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert catch_exceptions(lambda x: x / 0, 1) == 'division by zero'\", \"assert catch_exceptions(lambda: 1 + 1) == 2\", \"assert catch_exceptions(lambda: [1, 2, 3][3]) == 'list index out of range'\", \"assert catch_exceptions(lambda x: x ** 2, 3) == 9\", \"assert cat... | {
"split": "train",
"index": 70837,
"acecode_id": "bigcode_python_fns_9703",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a string, write a function that returns a dictionary containing the count of each unique character present in the string. Each character should be treated case-sensitive, and the dictionary should include all characters including spaces and punctuation. Implement the foll... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert character_count('Hello, World!') == {'H': 1, 'e': 1, 'l': 3, 'o': 2, ',': 1, ' ': 1, 'W': 1, 'r': 1, 'd': 1, '!': 1}\", \"assert character_count('aaaAAA') == {'a': 3, 'A': 3}\", \"assert character_count('12345') == {'1': 1, '2': 1, '3': 1, '4': 1, '5': 1}\",... | {
"split": "train",
"index": 70838,
"acecode_id": "evol_27880",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers and calculates both the GCD (greatest common divisor) and the LCM (least common multiple) of the integers in the list. The function should return a tuple containing the GCD and LCM. The input list will contain more than two int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_gcd_lcm([12, 15, 9]) == (3, 180)\", \"assert find_gcd_lcm([2, 4, 8, 16]) == (2, 16)\", \"assert find_gcd_lcm([5, 10, 15, 20]) == (5, 60)\", \"assert find_gcd_lcm([7, 14, 21]) == (7, 42)\", \"assert find_gcd_lcm([1, 2, 3, 4, 5]) == (1, 60)\", \"assert fi... | {
"split": "train",
"index": 70839,
"acecode_id": "evol_12746",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a year and a month, write a function `days_in_month(year: int, month: int) -> int` that returns the number of days in that month for the specified year. If the month is not valid (less than 1 or greater than 12), return -1. Note that February has 29 days in leap years and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert days_in_month(2020, 2) == 29\", \"assert days_in_month(2021, 2) == 28\", \"assert days_in_month(2000, 2) == 29\", \"assert days_in_month(1900, 2) == 28\", \"assert days_in_month(2000, 1) == 31\", \"assert days_in_month(2021, 4) == 30\", \"assert days_in_mont... | {
"split": "train",
"index": 70840,
"acecode_id": "bigcode_python_fns_27568",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the unique integers from the original list, in the order they first appeared. Implement the function `unique_integers(arr: List[int]) -> List[int]:` where `arr` is t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 3, 2, 1, 4]) == [1, 2, 3, 4]\", \"assert unique_integers([5, 5, 5, 5]) == [5]\", \"assert unique_integers([10, 20, 10, 30, 20]) == [10, 20, 30]\", \"assert unique_integers([]) == []\", \"assert unique_integers([1]) == [1]\", \"assert u... | {
"split": "train",
"index": 70841,
"acecode_id": "bigcode_python_fns_33424",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes in a configuration dictionary and a server string. Your function should return a list of project names based on the provided configuration and server settings. The configuration dictionary will contain a key 'projects' whic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_project_names({'projects': [{'name': 'Project A', 'server': 'server1'}, {'name': 'Project B', 'server': 'server2'}, {'name': 'Project C', 'server': 'server1'}]}, 'server1') == ['Project A', 'Project C']\", \"assert get_project_names({'projects': [{'name'... | {
"split": "train",
"index": 70842,
"acecode_id": "bigcode_python_fns_5349",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a URL for a search query based on specific parameters. The function should take in the following arguments: a query string, an optional collection name, a starting record number, a maximum number of records to return, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_url('test query', None, 1, 10, 'dc') == 'http://services.kb.nl/mdo/oai?query=test+query&operation=searchRetrieve&startRecord=1&maximumRecords=10&recordSchema=dc'\", \"assert build_url('example', 'collection1', 5, 20, 'dc') == 'http://services.kb.nl/mdo... | {
"split": "train",
"index": 70843,
"acecode_id": "evol_1242",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a dictionary contains a specific key. If the key is present, the function should return the value associated with that key. If the key is not present, the function should raise a KeyError with a message indicating that the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_value_from_dict({'a': 1, 'b': 2}, 'a') == 1\", \"assert get_value_from_dict({'name': 'Alice', 'age': 30}, 'age') == 30\", \"assert get_value_from_dict({'x': 10, 'y': 20}, 'y') == 20\", \"assert get_value_from_dict({'foo': 'bar'}, 'foo') == 'bar'\", \"ass... | {
"split": "train",
"index": 70844,
"acecode_id": "bigcode_python_fns_28098",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `setup_logging(verbose: int) -> str` that configures a simple logging system based on the given verbosity level. The function should return a message indicating the logging level that has been set. The logging levels are defined as fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert setup_logging(0) == 'WARNING'\", \"assert setup_logging(1) == 'INFO'\", \"assert setup_logging(2) == 'DEBUG'\", \"assert setup_logging(3) == 'DEBUG'\", \"assert setup_logging(10) == 'DEBUG'\", \"assert setup_logging(100) == 'DEBUG'\", \"assert setup_logging(... | {
"split": "train",
"index": 70845,
"acecode_id": "bigcode_python_fns_32493",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of colormap names represented as strings. Your task is to create a function that returns the number of unique colormaps from the provided list. A colormap is considered unique if it appears at least once in the list. Implement a function called `count_uniqu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_colormaps(['viridis', 'plasma', 'inferno', 'magma', 'cividis']) == 5\", \"assert count_unique_colormaps(['viridis', 'viridis', 'plasma', 'plasma']) == 2\", \"assert count_unique_colormaps(['gray', 'gray', 'gray']) == 1\", \"assert count_unique_c... | {
"split": "train",
"index": 70846,
"acecode_id": "bigcode_python_fns_41516",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of tensors (represented as nested lists) and a list of lengths, implement a function that concatenates the first 'length' elements from each tensor in the list into a single tensor. Each tensor is a list of lists where the inner lists represent vectors. You must en... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concatenate_tensors([[[1, 2], [3, 4]], [[5, 6], [7, 8]]], [2, 2]) == [[1, 2], [3, 4], [5, 6], [7, 8]]\", \"assert concatenate_tensors([[[1, 2]], [[3, 4], [5, 6]]], [1, 1]) == [[1, 2], [3, 4]]\", \"assert concatenate_tensors([[[1, 2], [3, 4]]], [1]) == [[1, 2... | {
"split": "train",
"index": 70847,
"acecode_id": "bigcode_python_fns_4325",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `get_cache_type(name: str) -> str` that identifies the type of cache based on the provided cache name. The cache name can be prefixed with either 'resource://' or 'file://'. If the name starts with 'resource://', the function should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_cache_type('resource://my_cache') == 'resource'\", \"assert get_cache_type('file://my_file_cache') == 'file'\", \"assert get_cache_type('file://') == 'file'\", \"assert get_cache_type('resource://') == 'resource'\", \"assert get_cache_type('') == 'defaul... | {
"split": "train",
"index": 70848,
"acecode_id": "bigcode_python_fns_2701",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given `n` engineers numbered from 1 to `n` and three arrays: `speed`, `efficiency`, and `cost`, where `speed[i]`, `efficiency[i]`, and `cost[i]` represent the speed, efficiency, and cost for the i-th engineer respectively. Your task is to implement a function `maxPerfor... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxPerformance(6, [5,5,5,5,5,5], [10,10,10,10,10,10], [1,1,1,1,1,1], 3, 5) == 30\", \"assert maxPerformance(3, [1,1,1], [1,1,1], [1,1,1], 2, 2) == 2\", \"assert maxPerformance(5, [1,1,1,1,1], [5,4,3,2,1], [1,1,1,1,1], 3, 3) == 9\", \"assert maxPerformance(6,... | {
"split": "train",
"index": 70849,
"acecode_id": "evol_30016",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a list of dictionaries representing financial entities and returns a list of names of entities where the amount is greater than a specified threshold. Each dictionary in the list contains the keys 'id', 'name', and 'amou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_funding_entities([{'id': 1, 'name': 'Funding A', 'amount': 100}, {'id': 2, 'name': 'Funding B', 'amount': 200}], 150) == ['Funding B']\", \"assert filter_funding_entities([{'id': 1, 'name': 'Funding C', 'amount': 300}, {'id': 2, 'name': 'Funding D', '... | {
"split": "train",
"index": 70850,
"acecode_id": "oss_24362",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple HTTP response preparation. The function should have the following signature: `def prepare_http_response(message: str, code: int = 200, content_type: str = 'text/plain') -> dict:`. This function should take in three... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prepare_http_response('Hello, World!') == {'protocol_version': 'HTTP/1.1', 'headers': {'Content-Type': 'text/plain', 'Content-Length': '13', 'Access-Control-Allow-Headers': '*', 'Access-Control-Allow-Methods': '*'}, 'message': 'Hello, World!'}\", \"assert pr... | {
"split": "train",
"index": 70851,
"acecode_id": "oss_24936",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes user information and generates a request body for a user. The function `get_request_body_from_user` takes a `User` object as input and returns a dictionary representing the request body. The `User` class has the followi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_request_body_from_user(User('john_doe', 'john@example.com', ['read', 'write'])) == {'username': 'john_doe', 'email': 'john@example.com', 'permissions': ['read', 'write']}\", \"assert get_request_body_from_user(User('jane_smith', 'jane@example.com', ['rea... | {
"split": "train",
"index": 70852,
"acecode_id": "oss_12790",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a natural language understanding (NLU) response represented as a JSON object. Your job is to implement a function `extract_entities_and_relations` that takes the NLU response as input and returns a list of entities and relations extracted from it.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_entities_and_relations({\\\"entities\\\": [{\\\"type\\\": \\\"PERSON\\\", \\\"text\\\": \\\"John Doe\\\"}], \\\"relations\\\": [{\\\"type\\\": \\\"WORKS_AT\\\", \\\"entity1\\\": \\\"John Doe\\\", \\\"entity2\\\": \\\"Company X\\\"}]}) == [(\\\"PERSON... | {
"split": "train",
"index": 70853,
"acecode_id": "oss_21469",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that validates an API key and returns information about the status of the request. Implement a function `validate_api_key(api_key: str) -> dict` that takes an API key as input and performs the following actions: if the API key matches a predefined valid... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_api_key('VALID_API_KEY') == {'success': True, 'api_key': True, 'result': 'Data retrieved successfully', 'time_taken': 20}\", \"assert validate_api_key('INVALID_API_KEY') == {'success': False, 'api_key': False}\", \"assert validate_api_key(' ') == {'... | {
"split": "train",
"index": 70854,
"acecode_id": "bigcode_python_fns_2147",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function that returns a list of strings, where each string indicates the count of ASCII characters in the corresponding input string. Each response should state 'the number of ASCII characters is X in the string Y of the input.', where X is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ascii_check(['Test%$', 'ASCII@!']) == ['the number of ASCII characters is 6 in the string 1 of the input.', 'the number of ASCII characters is 7 in the string 2 of the input.']\", \"assert ascii_check(['123#', 'Hello_*']) == ['the number of ASCII characters ... | {
"split": "train",
"index": 70855,
"acecode_id": "evol_9595",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns a summary of the unique duplicated integers in the list, along with the count of their occurrences. The function should return a list of tuples, where each tuple contains a duplicated integer and its count. If there are no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_duplicates([1, 2, 3, 4, 5]) == []\", \"assert find_duplicates([1, 2, 3, 1, 2, 3]) == [(1, 2), (2, 2), (3, 2)]\", \"assert find_duplicates([5, 5, 5, 6, 6, 7]) == [(5, 3), (6, 2)]\", \"assert find_duplicates([0, -1, -1, 0, 2, 3]) == [(0, 2), (-1, 2)]\", \... | {
"split": "train",
"index": 70856,
"acecode_id": "bigcode_python_fns_28377",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates the correctness of a given list of filters for a specific path in a web application. The function should take the path and the list of filters as input and return a boolean value indicating whether the filters are valid... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_filters_for_path('/documents', [{'include': 'pdf'}, {'exclude': 'temp'}, {'limit': 1024}]) == True\", \"assert validate_filters_for_path('/images', [{'include': 'jpg'}, {'exclude': 'temp.png'}, {'limit': 2048}]) == True\", \"assert validate_filters_... | {
"split": "train",
"index": 70857,
"acecode_id": "oss_12188",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to analyze genomic sample data. The function takes two lists of samples: `inputs` and `backgrounds`, and generates a report based on the samples provided. The function should perform the following steps:\n1. If the `backgrounds` list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_genomic_report(['sample1', 'sample2'], ['background1']) == [{'input': 'sample1', 'background': 'background1', 'message': 'Report generated for sample1'}, {'input': 'sample2', 'background': 'background1', 'message': 'Report generated for sample2'}]\"... | {
"split": "train",
"index": 70858,
"acecode_id": "oss_10685",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an integer array `nums` and an integer `k`. Your task is to implement a function that returns the maximum absolute sum of any subarray of `nums` that contains exactly `k` elements. The absolute sum of a subarray is defined as the absolute value of the sum of its e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxAbsoluteSum([1,-3,2,3,-4], 2) == 5\", \"assert maxAbsoluteSum([2,-5,1,-4,3,-2], 3) == 8\", \"assert maxAbsoluteSum([-1, -2, -3, -4], 2) == 7\", \"assert maxAbsoluteSum([0, 0, 0, 0], 1) == 0\", \"assert maxAbsoluteSum([5, -1, 2, -3], 3) == 6\", \"assert ma... | {
"split": "train",
"index": 70859,
"acecode_id": "evol_16319",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing indexed items. Write a function `count_indexed_items` that takes this list as input and returns the total number of indexed items in the list. The function should handle the case of an empty list by returning 0. \n\nFunction Signatu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_indexed_items([]) == 0\", \"assert count_indexed_items([1, 2, 3]) == 3\", \"assert count_indexed_items([10, 20, 30, 40, 50]) == 5\", \"assert count_indexed_items([-1, -2, -3]) == 3\", \"assert count_indexed_items([0]) == 1\", \"assert count_indexed_ite... | {
"split": "train",
"index": 70860,
"acecode_id": "bigcode_python_fns_41164",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that generates a list of all possible pairs of consecutive elements extracted from a list or a multi-dimensional array. The function should return a dictionary where the keys represent the pairs and the values correspond to the indices of the pairs in the orig... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_consecutive_pairs([1, 2, 3, 4]) == ([(1, 2), (2, 3), (3, 4), (4, 1)], {(1, 2): [(0, 1)], (2, 3): [(1, 2)], (3, 4): [(2, 3)], (4, 1): [(3, 0)]})\", \"assert get_consecutive_pairs(['a', 'b', 'c', 'd']) == ([('a', 'b'), ('b', 'c'), ('c', 'd'), ('d', 'a')], ... | {
"split": "train",
"index": 70861,
"acecode_id": "evol_14285",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates basic analytic data. The function should take in two parameters: `metadata` (a dictionary representing the analytic metadata) and `query` (a string representing the analytic query). The `metadata` dictionary should have... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_analytic({'key': 'value'}, 'SELECT * FROM table') == True\", \"assert validate_analytic({'type': 'aggregate'}, 'SELECT COUNT(*) FROM table') == True\", \"assert validate_analytic({}, 'SELECT * FROM table') == False\", \"assert validate_analytic({'ke... | {
"split": "train",
"index": 70862,
"acecode_id": "oss_20409",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes a list of community crime records and processes it to remove any records that contain missing values. Each record is represented as a list of numerical values, and the last value in each record represents the target variable (th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_crime_data([[1.0, 2.0, 3.0, '?' ], [4.0, 5.0, 6.0, 7.0], [8.0, 9.0, 10.0, 11.0]]) == ([[4.0, 5.0, 6.0], [8.0, 9.0, 10.0]], [7.0, 11.0])\", \"assert process_crime_data([[1.0, 2.0, 3.0, 4.0], [5.0, '?', 6.0, 7.0], [8.0, 9.0, 10.0, 11.0]]) == ([[1.0, 2.... | {
"split": "train",
"index": 70863,
"acecode_id": "bigcode_python_fns_38495",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function `remove_recurring_numbers(arr)` that returns a list of unique integers from the input array. The order of the unique integers in the output list should be the same as their first occurrence in the input array. For example, given ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_recurring_numbers([1, 2, 1, 2, 3]) == [1, 2, 3]\", \"assert remove_recurring_numbers([4, 5, 4, 6, 5]) == [4, 5, 6]\", \"assert remove_recurring_numbers([7, 8, 9, 7, 8]) == [7, 8, 9]\", \"assert remove_recurring_numbers([10, 11, 12, 10, 12, 11]) == [10... | {
"split": "train",
"index": 70864,
"acecode_id": "evol_34054",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of items, each represented as a dictionary. Each item has a 'properties' key that contains a list of integers, an 'actions' key that is a string, and an 'events' key that contains a dictionary of events. Write a function `validate_items(items: List[Dict[str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_items([{'properties': [1, 2, 3], 'actions': 'hello', 'events': {'overheating': {'forms': 0.5}}}]) == [True]\", \"assert validate_items([{'properties': [1, 2, 3], 'actions': 'hi', 'events': {'overheating': {'forms': 0.5}}}]) == [False]\", \"assert va... | {
"split": "train",
"index": 70865,
"acecode_id": "bigcode_python_fns_18835",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a 2D array of mixed data types, write a function that checks each element to determine if it can be interpreted as an integer. If so, return a list of tuples where each tuple contains the integer and a boolean indicating whether that integer is a prime number. Special cas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_integers_and_primes([[1, 'a'], ['b', 2, '-2', '0', '11']]) == [(2, True), (11, True)]\", \"assert check_integers_and_primes([[3, '5', 'cat', '7'], ['dog', '0', '-3']]) == [(3, True), (5, True), (7, True)]\", \"assert check_integers_and_primes([[15, 16,... | {
"split": "train",
"index": 70866,
"acecode_id": "evol_30899",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes the output of a version control command and extracts relevant information. The function should parse the output of a simulated version control diff command and identify the staged files for commit. The staged files are thos... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_staged_files('diff --git a/file1.txt b/file1.txt\\\\nindex 83db48f..f735c7f 100644\\\\n--- a/file1.txt\\\\n+++ b/file1.txt\\\\n') == ['file1.txt']\", \"assert find_staged_files('diff --git a/file2.txt b/file2.txt\\\\ndiff --git a/file3.txt b/file3.txt\\... | {
"split": "train",
"index": 70867,
"acecode_id": "oss_24322",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that parses a list of strings representing programming language classifiers and returns a dictionary containing the count of each unique programming language and its corresponding version. Each string is formatted as 'Programming L... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_language_classifiers(['Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Java', 'Programming Language :: Java :: 8']) == {'Python': {'3.6': 1, '3.7': 1}, 'Java': {None: 1, '8': 1}}\", \"assert par... | {
"split": "train",
"index": 70868,
"acecode_id": "oss_27489",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the square root of a given non-negative integer without using any built-in square root functions. The function should take a single integer input and return the calculated square root as a float. The computation should continue until the dif... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert babylonian_sqrt(0) == 0.0\", \"assert abs(babylonian_sqrt(1) - 1.0) < 0.000001\", \"assert abs(babylonian_sqrt(4) - 2.0) < 0.000001\", \"assert abs(babylonian_sqrt(9) - 3.0) < 0.000001\", \"assert abs(babylonian_sqrt(16) - 4.0) < 0.000001\", \"assert abs(bab... | {
"split": "train",
"index": 70869,
"acecode_id": "evol_18126",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program to process and display information based on a given car number plate. The program should take a car number plate as input and return the corresponding details of the car owner in the following format: { 'Name': 'Owner's Name', 'Address': '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_car_details('HR26DK8337') == {'Name': 'harish', 'Address': 'ministori visual tech in bangalore in vijayanagar', 'Phone': '9582645123'}\", \"assert get_car_details('KLOLCC 5995') == {'Name': 'chandran', 'Address': 'manthon niyali megalaya-552326', 'Phone'... | {
"split": "train",
"index": 70870,
"acecode_id": "oss_36553",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `select_random_service(services: List[str]) -> str` that takes a list of Azure service names and returns a randomly selected service from the list. If the list is empty, return an empty string.\nPlease reason step by step, then write a self-contained Python... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_random_service(['Compute', 'Storage', 'Networking']) in ['Compute', 'Storage', 'Networking']\", \"assert select_random_service(['Database', 'AI', 'IoT']) in ['Database', 'AI', 'IoT']\", \"assert select_random_service(['Web', 'Mobile', 'Analytics']) in... | {
"split": "train",
"index": 70871,
"acecode_id": "evol_18537",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two dates, `d_end` and `d_start`, calculate the year fraction between these two dates. The function should consider whether a trading calendar or a standard calendar should be used for the year count. If a trading calendar is used, assume there are 252 trading days in a y... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert year_fraction('2023-01-01', '2022-12-31', dates_string=True, trading_calendar=True) == 0.003968253968253968\", \"assert year_fraction('2022-12-30', '2022-12-29', dates_string=True, trading_calendar=True) == 0.003968253968253968\", \"assert year_fraction('202... | {
"split": "train",
"index": 70872,
"acecode_id": "bigcode_python_fns_1331",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that accepts a list of tuples, where each tuple contains a key-value pair. Your function should return an OrderedDict (a dictionary that maintains the order of keys based on their insertion) constructed from the provided list of tuples. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert construct_ordered_dict([('a', 1), ('b', 2), ('c', 3)]) == OrderedDict([('a', 1), ('b', 2), ('c', 3)])\", \"assert construct_ordered_dict([('x', 10), ('y', 20)]) == OrderedDict([('x', 10), ('y', 20)])\", \"assert construct_ordered_dict([('first', 'A'), ('seco... | {
"split": "train",
"index": 70873,
"acecode_id": "bigcode_python_fns_45261",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that checks whether every element in a given two-dimensional array is in ascending order, both across each individual row and down each column. The function should also handle erroneous input gracefully by returning an informative message. Consider s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_sorted_2d([]) == True\", \"assert is_sorted_2d([[1]]) == True\", \"assert is_sorted_2d([[1, 2, 3], [4, 5, 6]]) == True\", \"assert is_sorted_2d([[1, 2, 3], [3, 4, 5]]) == True\", \"assert is_sorted_2d([[1, 2], [5, 4]]) == False\", \"assert is_sorted_2d([[... | {
"split": "train",
"index": 70874,
"acecode_id": "evol_23628",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a binary tree, determine if it is univalued (all nodes have the same value) and if its depth is less than or equal to a given integer `d`. Implement a function `isUnivaluedAndDepthLessThan_d(root: TreeNode, d: int) -> bool` that returns `true` if both conditions are satis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isUnivaluedAndDepthLessThan_d(TreeNode(1, TreeNode(1), TreeNode(1)), 2) == True\", \"assert isUnivaluedAndDepthLessThan_d(TreeNode(2, TreeNode(2), TreeNode(2, TreeNode(2))), 3) == True\", \"assert isUnivaluedAndDepthLessThan_d(TreeNode(2, TreeNode(2), TreeNo... | {
"split": "train",
"index": 70875,
"acecode_id": "evol_2049",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string 'name', return a modified string that appends '_std_secgroup' to the name. Additionally, the function should include a default description 'standard security group'. The function should return a dictionary with the following keys: 'name' (the modified name), 'des... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_security_group('my_group') == {'name': 'my_group_std_secgroup', 'description': 'standard security group', 'rules': [{'rule_name': 'ping_rule', 'ip_protocol': 'icmp', 'from_port': -1, 'to_port': -1}, {'rule_name': 'ssh_rule', 'ip_protocol': 'tcp', 'fro... | {
"split": "train",
"index": 70876,
"acecode_id": "bigcode_python_fns_2692",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple package management system that can handle the installation and removal of packages. The package manager should support adding new packages and removing existing packages. Each package can have a name and a version.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_packages([('add', 'pkgA'), ('add', 'pkgB'), ('remove', 'pkgC')]) == [('pkgA', '1.0'), ('pkgB', '1.0')]\", \"assert manage_packages([('add', 'pkgA'), ('remove', 'pkgA'), ('remove', 'pkgA')]) == []\", \"assert manage_packages([('add', 'pkgA'), ('add', '... | {
"split": "train",
"index": 70877,
"acecode_id": "oss_14118",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of transcripts, where each transcript is represented as a dictionary with keys 'gene_ID' and 'transcript_ID'. Your task is to implement a function that filters the transcripts based on a specified dataset name. The function should return a list of transcrip... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_known_transcripts([{'gene_ID': 1, 'transcript_ID': 1, 'dataset': 'dataset_1'}, {'gene_ID': 1, 'transcript_ID': 2, 'dataset': 'dataset_2'}], 'dataset_1') == [{'gene_ID': 1, 'transcript_ID': 1, 'dataset': 'dataset_1'}]\", \"assert get_known_transcripts([{'... | {
"split": "train",
"index": 70878,
"acecode_id": "bigcode_python_fns_41833",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of words, implement a function that initializes a vocabulary from the list. The function should return a dictionary mapping each unique word to its corresponding index in the order they appear in the list, and a list of the words in the same order. Each word should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_vocabulary(['dog', 'cat', 'dog', '', 'cat']) == ({'dog': 0, 'cat': 1}, ['dog', 'cat'])\", \"assert initialize_vocabulary(['apple', 'banana', 'apple', 'orange']) == ({'apple': 0, 'banana': 1, 'orange': 2}, ['apple', 'banana', 'orange'])\", \"assert... | {
"split": "train",
"index": 70879,
"acecode_id": "bigcode_python_fns_7736",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `factorial_and_zeroes(n: int) -> Tuple[int, int]` that calculates the factorial of a given non-negative integer `n` and the number of trailing zeroes in that factorial. The function should return a tuple where the first element is the factorial of `n` and t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial_and_zeroes(0) == (1, 0)\", \"assert factorial_and_zeroes(1) == (1, 0)\", \"assert factorial_and_zeroes(2) == (2, 0)\", \"assert factorial_and_zeroes(3) == (6, 0)\", \"assert factorial_and_zeroes(4) == (24, 0)\"]}"
} | {
"split": "train",
"index": 70880,
"acecode_id": "evol_4433",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a sorted array of distinct integers and a target integer, implement a function that performs a binary search to find the index of the target integer in the array. If the target integer is not found, return -1. The function should not use any in-built Python functions or l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_search([1, 2, 3, 4, 5], 3) == 2\", \"assert binary_search([10, 20, 30, 40, 50], 10) == 0\", \"assert binary_search([5, 10, 15, 20, 25], 25) == 4\", \"assert binary_search([1, 3, 5, 7, 9], 1) == 0\", \"assert binary_search([1, 3, 5, 7, 9], 9) == 4\", \... | {
"split": "train",
"index": 70881,
"acecode_id": "evol_2098",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that counts the occurrences of each unique element in a list. The function should take a list as input, which may contain a mixture of numeric and string data types, and return a dictionary where the keys are the unique elements and the values are the count... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_elements([5, 5, 2, 2, 2, 8, 8, 9, 9, 9, 9]) == {5: 2, 2: 3, 8: 2, 9: 4}\", \"assert count_elements(['apple', 'banana', 'apple', 'orange']) == {'apple': 2, 'banana': 1, 'orange': 1}\", \"assert count_elements([1, 2, 2, 3, 1, 1]) == {1: 3, 2: 2, 3: 1}\",... | {
"split": "train",
"index": 70882,
"acecode_id": "evol_35630",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to prepare two dictionaries: one mapping IDs to labels and another mapping IDs to numerical values. The function should take in four parameters: a list of IDs (`ID_train`), a dictionary mapping IDs to numerical values (`X_num_tr`), a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prepare_id_dicts([1, 2, 3], {1: 10, 2: 20, 3: 30}, {1: 'img1', 2: 'img2', 3: 'img3'}, {1: 'label1', 2: 'label2', 3: 'label3'}) == ({1: 'label1', 2: 'label2', 3: 'label3'}, {1: 10, 2: 20, 3: 30})\", \"assert prepare_id_dicts([4, 5, 6], {4: 40, 5: 50, 6: 60}, ... | {
"split": "train",
"index": 70883,
"acecode_id": "oss_18896",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that encodes a given string input into bytes using UTF-8 encoding and returns the resulting byte string. The function should ignore any additional keyword arguments provided. Implement the function `encode_to_bytes(data: str, **kwargs) ->... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert encode_to_bytes('Hello, World!') == b'Hello, World!'\", \"assert encode_to_bytes('Python') == b'Python'\", \"assert encode_to_bytes('') == b''\", \"assert encode_to_bytes('123456') == b'123456'\", \"assert encode_to_bytes('!@#$%^&*()') == b'!@#$%^&*()'\", \"... | {
"split": "train",
"index": 70884,
"acecode_id": "bigcode_python_fns_32076",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing DNA sequence identifiers based on given rules. Your function should implement the following functionality: Given a list of lines representing DNA sequences and a sample identifier, modify the sequence identifiers according to specific rules. Imple... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_sequence_identifiers(['>seq1', 'ATCGATCG', '>seq2', '>seq3'], 'sample1') == ['sample1_contig_seq1', 'sample1_contig_seq2', 'sample1_contig_seq3']\", \"assert process_sequence_identifiers(['>seqA', '', '>seqB'], 'sample2') == ['sample2_contig_seqA', '... | {
"split": "train",
"index": 70885,
"acecode_id": "oss_32847",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given three strings, job_id, run_id, and extra_run_id, create a function that generates a filename for a log file based on the following format: 'job_id_run_id_extra_run_id.log'. The generated filename should not contain any spaces or special characters other than underscores, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_log_filename('job123', 'run456', 'extra789') == 'job123_run456_extra789.log'\", \"assert generate_log_filename('job_A', 'run_B', 'extra_C') == 'job_A_run_B_extra_C.log'\", \"assert generate_log_filename('alpha', 'beta', 'gamma') == 'alpha_beta_gamma... | {
"split": "train",
"index": 70886,
"acecode_id": "bigcode_python_fns_40456",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `sum_of_primes(collection: List[int]) -> int` that takes a list of integers and returns the sum of all prime numbers in the list. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. For example, th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_primes([10, 20, 19, 2, 7]) == 28\", \"assert sum_of_primes([1, 4, 6, 8]) == 0\", \"assert sum_of_primes([3, 5, 7]) == 15\", \"assert sum_of_primes([11, 13, 17, 19]) == 60\", \"assert sum_of_primes([4, 6, 8, 9]) == 0\", \"assert sum_of_primes([2, 3, 5,... | {
"split": "train",
"index": 70887,
"acecode_id": "evol_33697",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that accepts a list of rows and a header for a CSV file. The function should generate a CSV formatted string that includes the header followed by each row of data. Each row is represented as a list of values. The function should return th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_csv(['A', 'B', 'C'], [[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == 'A,B,C\\\\n1,2,3\\\\n4,5,6\\\\n7,8,9'\", \"assert generate_csv(['Name', 'Age'], [['Alice', 30], ['Bob', 25]]) == 'Name,Age\\\\nAlice,30\\\\nBob,25'\", \"assert generate_csv(['Product', 'Pric... | {
"split": "train",
"index": 70888,
"acecode_id": "bigcode_python_fns_3541",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the status of ports in a network (where 0 indicates a down port and 1 indicates an up port), implement a function `get_up_ports_count(status_list)` that returns the count of ports that are in the 'up' state. The function should take the lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_up_ports_count([1, 0, 1, 1]) == 3\", \"assert get_up_ports_count([0, 0, 0, 0]) == 0\", \"assert get_up_ports_count([1, 1, 1, 1]) == 4\", \"assert get_up_ports_count([1]) == 1\", \"assert get_up_ports_count([0]) == 0\", \"assert get_up_ports_count([1, 1, ... | {
"split": "train",
"index": 70889,
"acecode_id": "bigcode_python_fns_17146",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the unique integers from the original list in the order they first appeared. Write a function `get_unique_integers(arr: List[int]) -> List[int]` that implements this fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_integers([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert get_unique_integers([5, 5, 5, 5]) == [5]\", \"assert get_unique_integers([-1, -2, -2, -3, -4, -4, -5]) == [-1, -2, -3, -4, -5]\", \"assert get_unique_integers([0, 1, 2, 0, 1, 2]) == [0... | {
"split": "train",
"index": 70890,
"acecode_id": "oss_3652",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that simulates a simple vending machine. The vending machine will have a set of available items: 'cola' priced at 1.5, 'chips' priced at 1.0, and 'candy' priced at 1.75. The function should take the item name and the amount of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert vending_machine('cola', 1.5) == 'Item Dispensed: cola'\", \"assert vending_machine('cola', 1.0) == 'Insufficient funds. Please insert 0.5 more.'\", \"assert vending_machine('chips', 1.0) == 'Item Dispensed: chips'\", \"assert vending_machine('chips', 0.5) ==... | {
"split": "train",
"index": 70891,
"acecode_id": "oss_16261",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of bars in a histogram. Your task is to write a function that returns the area of the largest rectangle that can be formed in the histogram. The function should take a list of integers as input, where each integer repres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largestRectangleArea([2, 1, 5, 6, 2, 3]) == 10\", \"assert largestRectangleArea([1, 1, 1, 1]) == 4\", \"assert largestRectangleArea([]) == 0\", \"assert largestRectangleArea([5]) == 5\", \"assert largestRectangleArea([4, 2, 0, 3, 2, 5]) == 6\", \"assert larg... | {
"split": "train",
"index": 70892,
"acecode_id": "bigcode_python_fns_18932",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given an undirected graph with `n` nodes and weighted edges. The graph is represented by an integer `n` and an array `edges`, where each element `edges[i] = [ai, bi, wi]` indicates that there is an edge between nodes `ai` and `bi` with a weight `wi`. Your task is to imp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert numComponents(5, [[0,1,2],[1,2,3],[3,4,1]], 4) == 1\", \"assert numComponents(5, [[0,1,1],[1,2,1],[2,3,1],[3,4,1]], 3) == 1\", \"assert numComponents(3, [[0,1,5],[1,2,6]], 10) == 1\", \"assert numComponents(4, [[0,1,2],[1,2,2],[2,3,3]], 4) == 1\", \"assert n... | {
"split": "train",
"index": 70893,
"acecode_id": "evol_26891",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `collateFooBar(n)` that takes an integer `n` as input and returns a list containing all integers from 0 to n-1. If n is less than or equal to 0, the function should return an empty list. Do not use any unnecessary boolean flags in your implementation.\nPlea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert collateFooBar(5) == [0, 1, 2, 3, 4]\", \"assert collateFooBar(0) == []\", \"assert collateFooBar(-3) == []\", \"assert collateFooBar(1) == [0]\", \"assert collateFooBar(2) == [0, 1]\", \"assert collateFooBar(10) == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\", \"assert ... | {
"split": "train",
"index": 70894,
"acecode_id": "evol_146",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that calculates the probability of an object q to fly based on its balance and weight. The object q has a higher probability to fly if it is balanced (it is a palindromic list) and the sum of its elements is less than the maximum possible weight w. The gravity ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert will_it_fly([1, 2], 5, 9.8) == 0.4\", \"assert will_it_fly([3, 2, 3], 1, 9.8) == 0\", \"assert will_it_fly([3, 2, 3], 9, 9.8) == 1\", \"assert will_it_fly([3], 5, 9.8) == 1\", \"assert will_it_fly([1, 2, 1], 5, 10) == 1\", \"assert will_it_fly([3, 3, 3], 10,... | {
"split": "train",
"index": 70895,
"acecode_id": "evol_28302",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Celia has a large container that contains coins of four distinct varieties: A, B, C, and D. She wants to estimate the prevalence of each type of coin in her container. Implement a function `most_prevalent_coin(container: List[str]) -> str` that takes a list of coins as input an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert most_prevalent_coin(['A', 'B', 'C', 'A', 'D', 'A']) == 'A'\", \"assert most_prevalent_coin(['B', 'B', 'C', 'C', 'C', 'D']) == 'C'\", \"assert most_prevalent_coin(['D', 'D', 'A', 'B', 'B', 'B']) == 'B'\", \"assert most_prevalent_coin(['A', 'A', 'A', 'B', 'B']... | {
"split": "train",
"index": 70896,
"acecode_id": "evol_6371",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of timestamps represented as strings in ISO 8601 format, return the timestamp that is one minute later than the latest timestamp in the list. If the list is empty, return None. The input timestamps are guaranteed to be in valid ISO 8601 format. For example, if the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_next_timestamp(['2023-10-01T12:00:00Z', '2023-10-01T12:01:00Z']) == '2023-10-01T12:02:00Z'\", \"assert get_next_timestamp(['2023-10-01T12:59:00Z', '2023-10-01T12:58:00Z']) == '2023-10-01T13:00:00Z'\", \"assert get_next_timestamp(['2023-10-01T23:59:00Z'])... | {
"split": "train",
"index": 70897,
"acecode_id": "bigcode_python_fns_45202",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list `img` representing an image where each element can either be '1' (indicating an occupied pixel) or an empty space (indicating a free pixel). You need to implement a function `place_fractal(p_x: int, p_y: int, img: List[List[str]]) -> None` that attempts ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert place_fractal(1, 1, [['0', '0', '0'], ['0', '0', '0'], ['0', '0', '0']]) == None\", \"assert place_fractal(0, 0, [['0', '0', '0'], ['0', '1', '0'], ['0', '0', '0']]) == None\", \"assert place_fractal(1, 1, [['0', '0', '0'], ['0', '0', '0'], ['0', '0', '0']])... | {
"split": "train",
"index": 70898,
"acecode_id": "bigcode_python_fns_21646",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given list of character ranges and returns the total number of unique characters covered by these ranges. Each range is represented as a tuple of two integers (start, end), where 'start' is inclusive and 'end' is e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_coverage([(0, 1), (1, 2), (2, 3)]) == 3\", \"assert calculate_total_coverage([(0, 5)]) == 5\", \"assert calculate_total_coverage([(5, 10)]) == 5\", \"assert calculate_total_coverage([(0, 10), (5, 15)]) == 15\", \"assert calculate_total_covera... | {
"split": "train",
"index": 70899,
"acecode_id": "oss_12114",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.