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 current group represented as a list of integers and a list of operations, also as a list of integers. Your task is to determine if the current group should be updated based on the provided operations list. If the operations list is empty, return an empty string.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert regroup_if_changed([1, 2, 3], [4, 5, 6]) == '[4, 5, 6]'\", \"assert regroup_if_changed([1, 2, 3], [1, 2, 3]) == '[1, 2, 3]'\", \"assert regroup_if_changed([], [1, 2, 3]) == '[1, 2, 3]'\", \"assert regroup_if_changed([1, 2, 3], []) == ''\", \"assert regroup_i... | {
"split": "train",
"index": 70300,
"acecode_id": "bigcode_python_fns_11324",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that takes a list of dictionaries representing sheets of a spreadsheet and returns the sheet IDs of the first two sheets along with the last filled row index of the second sheet. Each dictionary in the input list contains a 'properties'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_sheet_info([{'properties': {'sheetId': 1}, 'merges': [{'endRowIndex': 5}, {'endRowIndex': 3}]}, {'properties': {'sheetId': 2}, 'merges': [{'endRowIndex': 10}, {'endRowIndex': 7}]}]) == (1, 2, 10)\", \"assert extract_sheet_info([{'properties': {'sheet... | {
"split": "train",
"index": 70301,
"acecode_id": "bigcode_python_fns_42177",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples, where each tuple contains two integers representing the coordinates of points on a 2D plane. Your task is to implement a function that checks if all the points lie on the same vertical line (i.e., they have the same x-coordinate). If they do, ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_points_on_same_vertical_line([(1, 2), (1, 3), (1, 4)]) == True\", \"assert are_points_on_same_vertical_line([(0, 0), (0, 1), (0, -1)]) == True\", \"assert are_points_on_same_vertical_line([(2, 5), (2, -2), (2, 0)]) == True\", \"assert are_points_on_same_... | {
"split": "train",
"index": 70302,
"acecode_id": "bigcode_python_fns_42957",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a generator function that takes a nested list of integers and returns only the prime numbers from it. The nested list can contain integers and other lists at any depth. For example, given the input [23, [45, [7, [18, 9]], 11], 14, [39, 22, [13, 7, [19, [16, 11]]]]], t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list(prime_in_nested_list([1, 2, 3, [4, 5], 6, [7, [8, 9], 10]])) == [2, 3, 5, 7]\", \"assert list(prime_in_nested_list([[2], [4, [6, [8]]], [3, [5, [7]]]])) == [2, 3, 5, 7]\", \"assert list(prime_in_nested_list([10, [11, [12]], 13, [14, [15, [16, 17]]]])) =... | {
"split": "train",
"index": 70303,
"acecode_id": "evol_17347",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the total income from a list of income sources. The function should take a list of incomes as input and return the total amount earned. Each income source is represented as a dictionary with the following keys: 'source': ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_income([{'source': 'Job', 'amount': 2500.0}, {'source': 'Bonus', 'amount': 500.0}, {'source': 'Side Hustle', 'amount': 300.0}]) == 3300.0\", \"assert calculate_total_income([{'source': 'Part-time', 'amount': 1500.0}]) == 1500.0\", \"assert ca... | {
"split": "train",
"index": 70304,
"acecode_id": "oss_33456",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a File Sharing System that allows users to join and leave while managing the chunks of files they own. Each user can own multiple chunks, and the system should efficiently handle requests for specific chunks and requests for all chunks they do n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert file_sharing_system(['join', 'join', 'request', 'requestAll', 'leave'], [[1], [2], [1, 1], [1]]) == [1, 2, [1], [2]]\", \"assert file_sharing_system(['join', 'join', 'request', 'requestAll'], [[1, 2], [3], [1, 1], [1]]) == [1, 2, [1], [2]]\", \"assert file_s... | {
"split": "train",
"index": 70305,
"acecode_id": "evol_372",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a byte sequence, your task is to extract any specified encoding from the first n bytes. The input will be a byte sequence and an optional integer that represents the maximum number of bytes to consider (default is 4096). If a specified encoding is found, return its IANA n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert any_specified_encoding(b'No encoding specified', 4096) == None\", \"assert any_specified_encoding(b'Just some text without encoding', 4096) == None\", \"assert any_specified_encoding(b'ASCII text', 4096) == None\", \"assert any_specified_encoding(b'Plain tex... | {
"split": "train",
"index": 70306,
"acecode_id": "bigcode_python_fns_25977",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a welcome message based on user authentication status. The function `generate_welcome_message` should take a boolean parameter `is_authenticated` which indicates whether the user is logged in or not, and a string parameter ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_welcome_message(False, '') == 'Welcome to test_project'\", \"assert generate_welcome_message(False, 'Charlie') == 'Welcome to test_project'\", \"assert generate_welcome_message(False, 'Eve') == 'Welcome to test_project'\", \"assert generate_welcome_... | {
"split": "train",
"index": 70307,
"acecode_id": "bigcode_python_fns_11808",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the average vitamin content from a two-dimensional array called 'fruits_and_vitamins'. Each subarray contains three elements: the name of a unique fruit (string), its prime vitamin content (string), and the fruit's average vitamin content in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average([['watermelon', 'vitamin A', 15], ['pineapple', 'vitamin C', 50], ['grapefruit', 'vitamin C', 30], ['mango', 'vitamin A', 20], ['blueberry', 'vitamin K', 18]]) == 26.6\", \"assert calculate_average([['pear', 'vitamin C', 30], ['peach', 'vit... | {
"split": "train",
"index": 70308,
"acecode_id": "evol_9241",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that calculates the harmonic mean of a given list of numbers while excluding any negative numbers from the calculation. If the list contains zero, return 'Infinite'. If there are no positive numbers, return 'N/A - No positive numbers'.\nPlease reason ste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert harmonic_mean_positives([2, -3, 4]) == 2.6666666666666665\", \"assert harmonic_mean_positives([3.2, -2.7, 0]) == 'Infinite'\", \"assert harmonic_mean_positives([-1.7, 2, 2]) == 2.0\", \"assert harmonic_mean_positives([-1, -2, -3]) == 'N/A - No positive numbe... | {
"split": "train",
"index": 70309,
"acecode_id": "evol_28170",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating and processing user data for a social media platform. Implement a function `validate_and_process_data(data: dict) -> dict` that performs the following tasks:\n\n1. Validate the input dictionary `data`. The function should check that the dictionary... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_and_process_data({'username': 'user1', 'email': 'user1@example.com', 'age': 25}) == {'username': 'user1', 'email': 'user1@example.com', 'age': 25}\", \"assert validate_and_process_data({'username': 'user2', 'email': 'user2@example.com', 'age': 30, '... | {
"split": "train",
"index": 70310,
"acecode_id": "oss_3235",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function called `generate_complex_string` that generates a random string of exactly 20 characters. The string must include at least one digit (0-9), one lowercase letter (a-z), one uppercase letter (A-Z), and all of the special characters '@', '&', '#', and '*'. The ord... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_complex_string()) == 20\", \"assert any(char.isdigit() for char in generate_complex_string())\", \"assert any(char.islower() for char in generate_complex_string())\", \"assert any(char.isupper() for char in generate_complex_string())\", \"assert... | {
"split": "train",
"index": 70311,
"acecode_id": "evol_785",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a string as input and returns a set of unique characters present in that string, while handling Unicode decoding errors gracefully. If a Unicode decoding error occurs, the function should return None. Implement the function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_characters('hello world') == {'h', 'e', 'l', 'o', ' ', 'w', 'r', 'd'}\", \"assert get_unique_characters('') == set()\", \"assert get_unique_characters('12345') == {'1', '2', '3', '4', '5'}\", \"assert get_unique_characters('aA') == {'a', 'A'}\", \... | {
"split": "train",
"index": 70312,
"acecode_id": "oss_24801",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that capitalizes the first and fourth characters of a given string. The function should take a string as input and return the modified string with the specified characters capitalized. If the input string has fewer than four character... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cap_four('hi') == 'hi'\", \"assert cap_four('cat') == 'cat'\", \"assert cap_four('a') == 'a'\", \"assert cap_four('abc') == 'abc'\", \"assert cap_four('') == ''\", \"assert cap_four('xyz') == 'xyz'\", \"assert cap_four('A') == 'A'\", \"assert cap_four('ABCD'... | {
"split": "train",
"index": 70313,
"acecode_id": "oss_16848",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_queue_from_stacks(operations: List[Tuple[str, int]]) -> List[Union[str, int]]` that simulates a queue using two stacks. The function takes a list of operations where each operation is a tuple. The first element of the tuple indicates the operation t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_queue_from_stacks([('enqueue', 1), ('enqueue', 2), ('dequeue', None), ('enqueue', 3), ('dequeue', None), ('dequeue', None), ('dequeue', None)]) == [1, 2, 3, 'Queue is Empty']\", \"assert create_queue_from_stacks([('enqueue', 5), ('dequeue', None), ('d... | {
"split": "train",
"index": 70314,
"acecode_id": "evol_22037",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of image IDs associated with an idol. Write a function `get_image_ids(idol_id: int, image_data: List[int]) -> List[int]` that returns a list of all image IDs for a given idol ID. The function should filter the provided list of image IDs to only include thos... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_image_ids(1, [(1, 1), (2, 2), (3, 1), (4, 3)]) == [1, 3]\", \"assert get_image_ids(2, [(1, 1), (2, 2), (3, 1), (4, 3)]) == [2]\", \"assert get_image_ids(3, [(1, 1), (2, 2), (3, 1), (4, 3)]) == [4]\", \"assert get_image_ids(4, [(1, 1), (2, 2), (3, 1), (4,... | {
"split": "train",
"index": 70315,
"acecode_id": "bigcode_python_fns_32000",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function named `create_person` that takes two parameters: a string `name` and an integer `age`. The function should return a dictionary representing a person with the given name and age. The dictionary should have keys 'name' and 'age' corresponding to the input par... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_person('Alice', 30) == {'name': 'Alice', 'age': 30}\", \"assert create_person('Bob', 25) == {'name': 'Bob', 'age': 25}\", \"assert create_person('Charlie', 40) == {'name': 'Charlie', 'age': 40}\", \"assert create_person('Diana', 22) == {'name': 'Diana... | {
"split": "train",
"index": 70316,
"acecode_id": "evol_19597",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to validate how much of a trade should be closed based on a given indication. The indication can either be the string 'ALL' (indicating that all of the trade should be closed) or a decimal number in string format representing the numb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validateTradeCloseIndication('ALL', 100.0) == True\", \"assert validateTradeCloseIndication('50.0', 100.0) == True\", \"assert validateTradeCloseIndication('0.1', 100.0) == True\", \"assert validateTradeCloseIndication('99.9', 100.0) == True\", \"assert vali... | {
"split": "train",
"index": 70317,
"acecode_id": "oss_19557",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function to calculate the surface area of circular and spherical sectors. The function should accept a list of tuples, where each tuple contains the radius and central angle of a sector, and a string that indicates the type of sector ('circular' or 'spherical')... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sector_areas([(5, 360)], 'circular') == [78.54]\", \"assert sector_areas([(5, -10)], 'circular') == [None]\", \"assert sector_areas([(5, 400)], 'circular') == [None]\", \"assert sector_areas([(3, -30)], 'spherical') == [None]\", \"assert sector_areas([(3, 37... | {
"split": "train",
"index": 70318,
"acecode_id": "evol_26485",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a non-empty list of integers lst, implement a function that computes two values: the product of all odd elements located at even indices and the sum of all even elements in the list. The function should return these two values as a tuple. The list will always contain at l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply([1]) == (1, 0)\", \"assert multiply([11, 12, 13, 14]) == (143, 26)\", \"assert multiply([1, 1, 1, 1]) == (1, 0)\", \"assert multiply([0, 0, 0, 0]) == (1, 0)\", \"assert multiply([5, 4, 3, 2, 1]) == (15, 6)\"]}"
} | {
"split": "train",
"index": 70319,
"acecode_id": "evol_34467",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the control of a messaging system based on given commands and options. The function should accept a list of command-line arguments that include options for controlling the messaging system and a command to execute. Your... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert control_messaging_system(['-H', 'localhost', 'channel4']) == 'Invalid input'\", \"assert control_messaging_system(['-c', 'invalid', '-H', 'localhost', 'channel5']) == 'Invalid input'\", \"assert control_messaging_system(['-c', '-H', 'localhost', 'channel6'])... | {
"split": "train",
"index": 70320,
"acecode_id": "oss_21132",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function `find_term_occurrence_rate(term: str, collection: List[str]) -> float` that calculates the occurrence rate of a specified term in a list of string literals. The occurrence rate is defined as the number of times the term appears across all strings in ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_term_occurrence_rate('apple', ['apple pie', 'banana split', 'apple tart']) == 0.6666666666666666\", \"assert find_term_occurrence_rate('orange', ['apple', 'banana', 'grape']) == 0.0\", \"assert find_term_occurrence_rate('hello', ['hello world', 'hello t... | {
"split": "train",
"index": 70321,
"acecode_id": "evol_23412",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `parse_samtools_stats(stats_report)` that processes a string `stats_report`, which represents the output of the `samtools stats` command. This report contains various statistics related to the alignment and mapping of sequences. Your func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_samtools_stats('SN raw total sequences: 100000\\\\nSN average length: 150\\\\nSN properly paired in sequencing: 80000 (80.00%)\\\\nSN reads mapped and paired: 85000 (85.00%)') == {'Total number of reads': 100000, 'Average length... | {
"split": "train",
"index": 70322,
"acecode_id": "oss_22127",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary contains numerical values associated with different keys. Your task is to implement a function that calculates the average value for each key across all the dictionaries. The function should return a dictionary with th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average([{'A': 10, 'B': 20}, {'A': 30, 'C': 40}]) == {'A': 20.0, 'B': 20.0, 'C': 40.0}\", \"assert calculate_average([{'A': 1}, {'A': 2}, {'A': 3}, {'B': 4}]) == {'A': 2.0, 'B': 4.0}\", \"assert calculate_average([{'Q': 1, 'R': 2}, {'R': 3, 'S': 4}... | {
"split": "train",
"index": 70323,
"acecode_id": "oss_18545",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a confirmation dialog for updating a software package. The function 'confirm_update' should take no parameters and return a boolean value. The function will display a message to the user indicating whether the update should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert confirm_update() == True\", \"assert confirm_update() == True\", \"assert confirm_update() == True\", \"assert confirm_update() == True\", \"assert confirm_update() == True\", \"assert confirm_update() == True\", \"assert confirm_update() == True\", \"assert... | {
"split": "train",
"index": 70324,
"acecode_id": "bigcode_python_fns_3400",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of documents represented by strings and an author ID, implement a function that filters and returns the documents authored by the specified author ID. Each document is represented as a string in the format 'AuthorID: Document Title'. Your function should take a lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert docs_by_author(['1: First user doc', '2: Second user doc', '2: Third user doc', '1: Fourth user doc'], 2) == ['Second user doc', 'Third user doc']\", \"assert docs_by_author(['2: First user doc', '2: Second user doc', '2: Third user doc'], 2) == ['First user... | {
"split": "train",
"index": 70325,
"acecode_id": "bigcode_python_fns_11889",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a given string of content data, which may contain various encoded or obfuscated elements. Your function should unravel the content based on specific rules: 1) If the string contains any of the words 'function', 'parameter', 'return', 'variable', '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unravelContent('This is a test string with no special commands') == 'This is a test string with no special commands'\", \"assert unravelContent('This string will be compressed and contains streamreader and frombase64string') == 'This string will be decompres... | {
"split": "train",
"index": 70326,
"acecode_id": "bigcode_python_fns_32374",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of file suffixes and returns a new list containing only the specified C++ file suffixes. The input list may also contain comments, which are indicated by a '#' symbol. Your function should ignore any text followi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_cxx_suffixes(['.cpp', '.h', '.py', '# TODO: Ignore this', '.hpp', '.cxx']) == ['.cpp', '.hpp', '.cxx']\", \"assert extract_cxx_suffixes(['.cpp', '# This is a comment', '.hpp', '.cxx']) == ['.cpp', '.hpp', '.cxx']\", \"assert extract_cxx_suffixes(['# ... | {
"split": "train",
"index": 70327,
"acecode_id": "oss_26707",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a predicted scalar value and an array of observed values. Your task is to compute the Mean Squared Error (MSE) between the predicted value and the observed values. The MSE is calculated by taking the square of the difference between the predicted value and each ob... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_mse(10.0, [10.0, 10.0, 10.0]) == 0.0\", \"assert compute_mse(0.0, []) == 0.0\", \"assert compute_mse(15.0, [15.0, 15.0, 15.0]) == 0.0\", \"assert compute_mse(8.0, [8.0, 8.0, 8.0, 8.0]) == 0.0\", \"assert compute_mse(100.0, [50.0, 150.0]) == 25.0\", \... | {
"split": "train",
"index": 70328,
"acecode_id": "bigcode_python_fns_6115",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Write a function `is_valid_password(password: str) -> bool` that checks whether a given password meets the following criteria: The password must be exactly 16 characters long, contain at least one uppercase letter, one lowercase letter, one digit, and one special symbol (exclud... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_password('A1b!cdefghijkl') == False\", \"assert is_valid_password('1234567890123456') == False\", \"assert is_valid_password('abcdefghijklmnoP') == False\", \"assert is_valid_password('Short1!') == False\", \"assert is_valid_password('NoSpecialChar1... | {
"split": "train",
"index": 70329,
"acecode_id": "evol_5827",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the weights of items. Your task is to find the maximum weight that can be achieved by selecting a subset of these items such that the total weight does not exceed a given limit. Implement a function `max_weight_with_limit(weights: L... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_weight_with_limit([1, 2, 3, 4, 5], 10) == 10\", \"assert max_weight_with_limit([10, 20, 30], 25) == 20\", \"assert max_weight_with_limit([1, 2, 3, 4, 5], 5) == 5\", \"assert max_weight_with_limit([5, 10, 15], 5) == 5\", \"assert max_weight_with_limit([1,... | {
"split": "train",
"index": 70330,
"acecode_id": "bigcode_python_fns_8958",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that simulates a series of delays based on an index value. Your task is to implement a function `simulate_delays(n: int) -> List[int]` that takes an integer `n` as input and returns a list of integers representing the delay times for each index from 0 t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_delays(1) == [1.00]\", \"assert simulate_delays(2) == [1.00, 1.10]\", \"assert simulate_delays(3) == [1.00, 1.10, 1.20]\", \"assert simulate_delays(4) == [1.00, 1.10, 1.20, 1.30]\", \"assert simulate_delays(5) == [1.00, 1.10, 1.20, 1.30, 1.40]\", \"... | {
"split": "train",
"index": 70331,
"acecode_id": "bigcode_python_fns_5901",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function in Python that reverses each word in a given sentence while preserving the position of special characters and numbers. Each word should be reversed in place, but any special characters or numbers within those words should remain in their original positions. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_words('The quick brown fox') == 'ehT kciuq nworb xof'\", \"assert reverse_words('Hello, world!') == 'olleH, dlrow!'\", \"assert reverse_words('A man, a plan, a canal: Panama') == 'A nam, a nalp, a lanac: amanaP'\", \"assert reverse_words('racecar 123... | {
"split": "train",
"index": 70332,
"acecode_id": "evol_2220",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary contains two keys: 'condition' and 'value'. Your task is to write a function that takes this list as input and returns a new list containing only the dictionaries where the 'condition' is equal to 0. The output list sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_condition_zero([{'condition': 0, 'value': 10}, {'condition': 1, 'value': 20}, {'condition': 0, 'value': 30}, {'condition': 2, 'value': 40}]) == [{'condition': 0, 'value': 10}, {'condition': 0, 'value': 30}]\", \"assert filter_condition_zero([{'conditi... | {
"split": "train",
"index": 70333,
"acecode_id": "oss_2130",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that converts a given JSON object to an XML string using a specified tag for list elements. The function should support nested JSON structures with varying depth levels. The function signature is as follows: `def json_to_xml(obj: dict, tag: str) -> str:`. For e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert json_to_xml({'fruit': {'apple': 1, 'banana': 2}}, 'item') == '<fruit><apple>1</apple><banana>2</banana></fruit>'\", \"assert json_to_xml({'info': {'contact': {'email': 'example@example.com', 'phone': '123-456-7890'}}}, 'detail') == '<info><contact><email>exa... | {
"split": "train",
"index": 70334,
"acecode_id": "evol_33632",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with monitoring water levels at various stations. You are provided with a list of stations, where each station has a name and a water level. Your goal is to implement a function that takes this list of stations and a water level limit as input. The function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert monitor_water_levels([{'name': 'Station1', 'water_level': 5}, {'name': 'Station2', 'water_level': 7}, {'name': 'Station3', 'water_level': 4}], 6) == (['Station2'], 5.333333333333333, 'Station2')\", \"assert monitor_water_levels([{'name': 'StationA', 'water_l... | {
"split": "train",
"index": 70335,
"acecode_id": "oss_29412",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a validation system for a student registration application. The application requires three fields: student ID, password, and confirmation of the password. The validation rules for each field are as follows: 1. Student ID: Should start with 'PB' foll... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_registration_form('PB12345678', 'Password123', 'Password123') == (True, True, True)\", \"assert validate_registration_form('PB87654321', 'abc123', 'abc123') == (True, True, True)\", \"assert validate_registration_form('PB1234567', 'Password123', 'Pa... | {
"split": "train",
"index": 70336,
"acecode_id": "oss_27778",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing a list of URI statuses to determine how many URIs are successfully resolving and how many are not. A URI is considered resolving if its status code is either 200 or 302, and unresolving if its status code is 404. Your task is to implement a functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_uri_statuses([('test.com', 200), ('test.org', 302), ('test.net', 301)]) == (2, 0)\", \"assert count_uri_statuses([('foo.com', 404), ('bar.org', 404)]) == (0, 2)\", \"assert count_uri_statuses([('baz.com', 500), ('qux.org', 200), ('quux.net', 302), ('co... | {
"split": "train",
"index": 70337,
"acecode_id": "oss_16622",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a sequence of transformations on an initial input value. The function, `run_pipeline`, takes two parameters: a list of functions (`stage_functions`) and an initial input value (`input_data`). Each function in the `stage... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run_pipeline([lambda x: x + 1, lambda x: x * 2], 3) == 8\", \"assert run_pipeline([lambda x: x - 1, lambda x: x * 3], 5) == 12\", \"assert run_pipeline([], 10) == 10\", \"assert run_pipeline([lambda x: x, lambda x: x], 7) == 7\", \"assert run_pipeline([lambd... | {
"split": "train",
"index": 70338,
"acecode_id": "oss_248",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers `vector` and a list of lists `sets`, partition the `vector` according to the indices specified in each inner list of `sets`. Return a list of lists where each inner list corresponds to the elements of `vector` selected by the indices in the respective i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert partition_vector([1, 2, 3, 4, 5], [[0, 1], [2, 3], [4]]) == [[1, 2], [3, 4], [5]]\", \"assert partition_vector([10, 20, 30, 40], [[0, 2], [1, 3]]) == [[10, 30], [20, 40]]\", \"assert partition_vector([5, 6, 7], [[], [0]]) == [[], [5]]\", \"assert partition_v... | {
"split": "train",
"index": 70339,
"acecode_id": "bigcode_python_fns_21125",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a dictionary containing the count of each unique integer in the list. The function should be named 'count_unique_integers'. The input is a list of integers, and the output should be a dictionary w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_integers([1, 2, 2, 3, 1]) == {1: 2, 2: 2, 3: 1}\", \"assert count_unique_integers([4, 5, 4, 6, 4]) == {4: 3, 5: 1, 6: 1}\", \"assert count_unique_integers([]) == {}\", \"assert count_unique_integers([7]) == {7: 1}\", \"assert count_unique_intege... | {
"split": "train",
"index": 70340,
"acecode_id": "oss_26791",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and an integer target value. Your function should return a list of all unique pairs of integers from the input list that sum up to the target value. Each pair should be returned as a tuple in ascending or... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_pairs_with_sum([1, 1, 2, 2, 3, 3], 4) == [(1, 3), (2, 2)]\", \"assert find_pairs_with_sum([1, 2, 3, 4, 5, 6], 7) == [(1, 6), (2, 5), (3, 4)]\", \"assert find_pairs_with_sum([-1, 0, 1, 2, -2, -1], 0) == [(-2, 2), (-1, 1)]\", \"assert find_pairs_with_sum(... | {
"split": "train",
"index": 70341,
"acecode_id": "bigcode_python_fns_4922",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that returns the Fibonacci number at a specific position n (0-indexed). The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n > 1. Your function should take an integer n as input and return the Fibonacci number a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2... | {
"split": "train",
"index": 70342,
"acecode_id": "evol_11825",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `codeblock` that takes a single parameter `request` and returns the value of `request.param`. The `request` parameter will be an object that contains a property `param`. Your function should extract and return this value. The `request` ob... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert codeblock({'param': 'test1'}) == 'test1'\", \"assert codeblock({'param': 'example'}) == 'example'\", \"assert codeblock({'param': 'hello world'}) == 'hello world'\", \"assert codeblock({'param': '12345'}) == '12345'\", \"assert codeblock({'param': 'special_c... | {
"split": "train",
"index": 70343,
"acecode_id": "bigcode_python_fns_48716",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a car rental system. Implement a function `car_availability(cars: List[Tuple[str, str, int, bool]]) -> List[str]` that takes a list of cars, where each car is represented as a tuple containing the make, model, year, and availability status (True for... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert car_availability([('Toyota', 'Camry', 2019, True), ('Honda', 'Civic', 2020, False), ('Ford', 'Focus', 2018, True)]) == ['Toyota Camry (2019)', 'Ford Focus (2018)']\", \"assert car_availability([('Toyota', 'Camry', 2019, False), ('Honda', 'Civic', 2020, False... | {
"split": "train",
"index": 70344,
"acecode_id": "oss_26311",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a simple encryption and decryption process using a Caesar cipher. The Caesar cipher is a type of substitution cipher in which each letter in the plaintext is shifted a certain number of places down or up the alphabet... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert caesar_cipher('Hello, World!', 3, 'encrypt') == 'Khoor, Zruog!'\", \"assert caesar_cipher('Khoor, Zruog!', 3, 'decrypt') == 'Hello, World!'\", \"assert caesar_cipher('abcd', 1, 'encrypt') == 'bcde'\", \"assert caesar_cipher('bcde', 1, 'decrypt') == 'abcd'\",... | {
"split": "train",
"index": 70345,
"acecode_id": "oss_2205",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of sentences and a tokenizer that can encode these sentences based on a specified language and encoding mode. Implement a function `encode_sentences(sentences: List[str], tokenizer: Dict[str, List[str]], language: str, mode: str) -> Tuple[List[List[int]], i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert encode_sentences(['Hello', 'world'], {'Hello': [1], 'world': [2]}, 'en', 'BPE') == ([[1], [2]], 1)\", \"assert encode_sentences(['I love coding'], {'I': [8], 'love': [9], 'coding': [10]}, 'en', 'BPE') == ([[8, 9, 10]], 3)\", \"assert encode_sentences(['Hello... | {
"split": "train",
"index": 70346,
"acecode_id": "bigcode_python_fns_49163",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves specific disk information from a cloud provider based on a provided disk name and index. The function will use a unified client interface to communicate with different cloud providers. Implement the function `get_disk_i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_disk_info('disk1', 0, MockUnityClient()) == {'name': 'disk1', 'index': 0}\", \"assert get_disk_info('disk2', 1, MockUnityClient()) == {'name': 'disk2', 'index': 1}\", \"assert get_disk_info('disk6', 3, MockUnityClient()) == None\", \"assert get_disk_info... | {
"split": "train",
"index": 70347,
"acecode_id": "oss_14949",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that takes a list of dictionaries, where each dictionary represents a quiz question with a 'question' key. The function should extract the questions from the list and return a new list containing only the questions as strings. If the input list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_questions([]) == []\", \"assert extract_questions([{ 'question': 'What is the capital of France?' }]) == ['What is the capital of France?']\", \"assert extract_questions([{ 'question': 'What is 2 + 2?' }, { 'question': 'What is the color of the sky?'... | {
"split": "train",
"index": 70348,
"acecode_id": "evol_15824",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple inventory management system for a player in a text-based adventure game. Implement a function `manage_inventory(actions: List[str]) -> List[str]` that takes a list of string actions representing the player's inventory actions and returns ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_inventory(['take sword', 'drop sword', 'show inventory']) == ['']\", \"assert manage_inventory(['take shield', 'drop axe', 'show inventory']) == ['shield']\", \"assert manage_inventory(['take sword', 'take shield', 'drop sword', 'show inventory']) == ... | {
"split": "train",
"index": 70349,
"acecode_id": "oss_35340",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, determine if the list is monotonic decreasing. A list is considered monotonic decreasing if each element is less than or equal to the previous element. Implement a function `is_monotonic_decreasing(nums: List[int]) -> bool` that returns True if the lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_monotonic_decreasing([5, 4, 4, 3, 2]) == True\", \"assert is_monotonic_decreasing([5, 5, 5]) == True\", \"assert is_monotonic_decreasing([5, 4, 3, 2, 1]) == True\", \"assert is_monotonic_decreasing([1, 2, 3, 4, 5]) == False\", \"assert is_monotonic_decrea... | {
"split": "train",
"index": 70350,
"acecode_id": "bigcode_python_fns_48487",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement the function `mystical_or_monotonous(s: str, t: int, num_operations: int) -> bool`. The function determines whether a given string `s`, consisting of lowercase English letters, is 'mystical'. A string is considered mystical if it meets two criteria: (1) the string mus... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mystical_or_monotonous('aa', 2, 0) == True\", \"assert mystical_or_monotonous('aba', 4, 0) == True\", \"assert mystical_or_monotonous('a', 1, 0) == True\", \"assert mystical_or_monotonous('aaa', 3, 0) == True\", \"assert mystical_or_monotonous('level', 61, 1... | {
"split": "train",
"index": 70351,
"acecode_id": "evol_18265",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given phone number is valid based on specific criteria. A phone number is considered valid if it starts with '15'. Write a function `is_valid_phone_number(phone_number: str) -> bool` that returns `True` if the phone numbe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_phone_number('1501234567') == True\", \"assert is_valid_phone_number('1512345678') == True\", \"assert is_valid_phone_number('1234567890') == False\", \"assert is_valid_phone_number('172030964') == False\", \"assert is_valid_phone_number('15') == Tr... | {
"split": "train",
"index": 70352,
"acecode_id": "bigcode_python_fns_44845",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer n, implement a function `is_truncatable(n: int) -> bool` that determines if n is a truncatable prime. A truncatable prime is a prime number that remains prime when digits are successively removed from either end. For example, 3797 is a truncatable prime... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_truncatable(3797) == True\", \"assert is_truncatable(317) == True\", \"assert is_truncatable(797) == True\", \"assert is_truncatable(17) == False\", \"assert is_truncatable(373) == True\", \"assert is_truncatable(31) == False\", \"assert is_truncatable(13... | {
"split": "train",
"index": 70353,
"acecode_id": "oss_22202",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the transfer of assets between different types of accounts in a financial application. Implement a function that takes the following parameters: 'fromAccountType', 'toAccountType', 'asset', and 'amount'. The function should validate the transfer c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transfer_assets('SPOT', 'USDT_FUTURE', 'BTC', 0.5) == 'Transfer successful'\", \"assert transfer_assets('COIN_FUTURE', 'SPOT', 'ETH', 1.0) == 'Transfer successful'\", \"assert transfer_assets('SPOT', 'COIN_FUTURE', 'LTC', 2.5) == 'Transfer successful'\", \"a... | {
"split": "train",
"index": 70354,
"acecode_id": "bigcode_python_fns_41956",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a font table which contains information about the glyph names and their corresponding Unicode values. Your task is to implement a function that checks if the font has proper whitespace glyph names for space and non-breaking space. The fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_whitespace_glyphs({'post': {'formatType': 2.0}, 'cmap': {'tables': [{'isUnicode': lambda: True, 'cmap': {32: 'space', 160: 'nbsp'}}]}}) == ['Font has **proper** whitespace glyph names.']\", \"assert check_whitespace_glyphs({'post': {'formatType': 2.0},... | {
"split": "train",
"index": 70355,
"acecode_id": "bigcode_python_fns_2419",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `mis_MU` and `norm_MU`, representing the estimated base intensities of misinformation and normal content for a group of users. Your task is to implement a function `find_users_no_bad_intentions(mis_MU: List[int], norm_MU: List[int]) -> List[... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_users_no_bad_intentions([0, 2, 0, 0], [0, 0, 1, 1]) == [2, 3]\", \"assert find_users_no_bad_intentions([1, 0, 0, 0], [0, 1, 2, 3]) == [1, 2, 3]\", \"assert find_users_no_bad_intentions([0, 0, 0, 0], [1, 1, 1, 1]) == [0, 1, 2, 3]\", \"assert find_users_n... | {
"split": "train",
"index": 70356,
"acecode_id": "bigcode_python_fns_33922",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of strings, `list_a` and `list_b`, each representing tags. Your task is to implement a function that returns a human-readable string describing the changes between these two lists. The output string should specify which tags were added and which tags wer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert diff_tags(['tag1', 'tag2'], ['tag1', 'tag2']) == 'no changes required.'\", \"assert diff_tags(['tag1'], ['tag1']) == 'no changes required.'\", \"assert diff_tags(['tag1', 'tag3'], ['tag1', 'tag3']) == 'no changes required.'\", \"assert diff_tags(['tagA'], ['... | {
"split": "train",
"index": 70357,
"acecode_id": "bigcode_python_fns_21438",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing a hierarchical structure. Each string consists of a sequence of elements separated by a hyphen, where the indentation level of each element indicates its position in the hierarchy. Your task is to write a function that sorts the elem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_hierarchy(['- foo', ' - bar', ' - xoo']) == ['xoo', 'bar', 'foo']\", \"assert sort_hierarchy(['- a', ' - b', ' - c', ' - d']) == ['c', 'b', 'd', 'a']\", \"assert sort_hierarchy(['- root', ' - child1', ' - grandchild1', ' - child2']) == ['g... | {
"split": "train",
"index": 70358,
"acecode_id": "oss_24011",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of employee records, where each record is represented as a dictionary containing the following keys: 'id' (integer), 'name' (string), 'department' (string), and 'salary' (integer). Write a function that takes this list of employee records and a department n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_employee_names_by_department([{'id': 1, 'name': 'Alice', 'department': 'Engineering', 'salary': 70000}, {'id': 2, 'name': 'Bob', 'department': 'Marketing', 'salary': 50000}, {'id': 3, 'name': 'Charlie', 'department': 'Engineering', 'salary': 60000}], 'En... | {
"split": "train",
"index": 70359,
"acecode_id": "oss_12677",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with designing a program that can process SQL-like queries for various database systems. Your goal is to create a function `execute_query(executor_type: str, query: str) -> str` that takes in two parameters: a string representing the type of database executor (on... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_query('Hive', 'SELECT * FROM table') == 'Executing Hive query: SELECT * FROM table'\", \"assert execute_query('Presto', 'SELECT count(*) FROM table') == 'Executing Presto query: SELECT count(*) FROM table'\", \"assert execute_query('MySQL', 'SELECT n... | {
"split": "train",
"index": 70360,
"acecode_id": "oss_3633",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simplified variable storage system. Your goal is to write a function `variable_storage_operations(operations: List[Tuple[str, str, Optional[Any]]]) -> Dict[str, Any]` that simulates adding, retrieving, and deleting variables. The function take... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert variable_storage_operations([('add', 'x', 10), ('get', 'x')]) == {'x': 10}\", \"assert variable_storage_operations([('add', 'y', 'hello'), ('get', 'y')]) == {'y': 'hello'}\", \"assert variable_storage_operations([('add', 'z', 3.14), ('get', 'z')]) == {'z': 3... | {
"split": "train",
"index": 70361,
"acecode_id": "oss_6615",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that extracts and returns the node with the smallest value that fulfills two specific condition functions from a given array of non-negative integers representing a tree branch. The function should return the result in the format [smallest_value, index]. If... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pluck([5, 3, 8, 1, 2], lambda x: x > 0, lambda x: x % 2 == 0) == [2, 4]\", \"assert pluck([], lambda x: x > 0, lambda x: x < 10) == []\", \"assert pluck([1, 2, 3, 4, 5], lambda x: x < 6, lambda x: x % 2 == 1) == [1, 0]\", \"assert pluck([8, 9, 10], lambda x:... | {
"split": "train",
"index": 70362,
"acecode_id": "evol_6656",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a record represented as a dictionary containing details of a deposit. The dictionary will have a key '_deposit' which maps to another dictionary containing the key 'id' that represents the deposit identifier. Your task is to implement a function called `fetch_depo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_deposit_id({'_deposit': {'id': 12345}}) == '12345'\", \"assert fetch_deposit_id({'_deposit': {'id': 'abcde'}}) == 'abcde'\", \"assert fetch_deposit_id({'_deposit': {}}) == ''\", \"assert fetch_deposit_id({'id': 67890}) == ''\", \"assert fetch_deposit_i... | {
"split": "train",
"index": 70363,
"acecode_id": "bigcode_python_fns_8724",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are provided with a list of deposit and withdrawal operations on a bank account, which starts with a zero balance. The operations can be integers, strings representing integers, or tuples containing both. If a tuple is encountered, the first element represents the amount fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert below_zero([(2, '3'), 1, (2, '2')]) == False\", \"assert below_zero([1, 2, '-4', 5, (3, '-2')]) == True\", \"assert below_zero([1, '2', -3], True) == True\", \"assert below_zero([1, 2, 3]) == False\", \"assert below_zero([1, '2', 3, (1, '1')]) == False\", \"... | {
"split": "train",
"index": 70364,
"acecode_id": "evol_23427",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes command-line arguments for running package tests. Specifically, the function should take a list of command-line arguments and parse them to determine if the option for outputting results in XML format is specified. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_arguments(['--junit', 'results.xml']) == True\", \"assert parse_arguments(['--junit', '', 'other_arg']) == True\", \"assert parse_arguments(['other_arg']) == False\", \"assert parse_arguments(['--junit', '']) == True\", \"assert parse_arguments(['--jun... | {
"split": "train",
"index": 70365,
"acecode_id": "oss_18790",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `global_attributes()` that returns a dictionary containing global attributes related to dataset conventions. The dictionary should include the following keys and their respective values: \n- `Conventions`: A string indicating the conventi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert global_attributes() == {'Conventions': 'CF-1.6 ACDD-1.3', 'standard_name_vocabulary': 'CF Standard Name Table v32', 'history': '2023-10-01: Created by test_program with command line: test_command', 'source': 'Created by test_program with command line: test_c... | {
"split": "train",
"index": 70366,
"acecode_id": "bigcode_python_fns_16905",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You have an initial power of `P`, an initial score of `0`, and a bag of `tokens` where `tokens[i]` is the value of the `ith` token (0-indexed). Your goal is to maximize your total score by potentially playing each token in one of two ways: If your current power is at least `tok... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bagOfTokensScore([100], 50) == 0\", \"assert bagOfTokensScore([100, 200], 150) == 1\", \"assert bagOfTokensScore([100, 200, 300, 400], 200) == 1\", \"assert bagOfTokensScore([50, 150, 300], 100) == 1\", \"assert bagOfTokensScore([10, 20, 30, 40], 50) == 2\",... | {
"split": "train",
"index": 70367,
"acecode_id": "evol_18338",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `complex_median` that accepts a list or a set containing integers, floats, or complex numbers and returns the median of the elements. The function should return `None` if the input is neither a list nor a set. The median should be computed without sorting t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert complex_median([3, 1, 2, 4, 5]) == 3\", \"assert complex_median([1, 2, 2, 4, 5]) == 2\", \"assert complex_median([]) == None\", \"assert complex_median([1]) == 1\", \"assert complex_median([(1+2j)]) == (1+2j)\", \"assert complex_median([1.5, 2.5, 3.5]) == 2.... | {
"split": "train",
"index": 70368,
"acecode_id": "evol_21133",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom access control mechanism for a web application. Create a function that checks whether a user has permission to access a certain user detail view based on the following rules: a user has permission if they are a superuser or if they are ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_permission({'is_superuser': True, 'username': 'admin'}, 'user1') == True\", \"assert check_permission({'is_superuser': False, 'username': 'user1'}, 'user1') == True\", \"assert check_permission({'is_superuser': False, 'username': 'user1'}, 'user2') == ... | {
"split": "train",
"index": 70369,
"acecode_id": "oss_36480",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of migration dependencies and returns a dictionary mapping each app to its corresponding dependencies. You are given a list of tuples, where each tuple represents a migration dependency. Each tuple contains tw... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_migration_dependencies([('main', '0081_v360_notify_on_start'), ('auth', '0001_initial')]) == {'main': ['0081_v360_notify_on_start'], 'auth': ['0001_initial']}\", \"assert process_migration_dependencies([('main', '0081_v360_notify_on_start'), ('main',... | {
"split": "train",
"index": 70370,
"acecode_id": "oss_3986",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a single parameter and determines if the given input is greater than 10, less than 10, or equal to 10. The function should return the string 'Greater than 10' if the input is greater than 10, 'Less than 10' if the input is less than 10, 'Equal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_to_ten(15) == 'Greater than 10'\", \"assert compare_to_ten(5) == 'Less than 10'\", \"assert compare_to_ten(10) == 'Equal to 10'\", \"assert compare_to_ten(-1) == 'Less than 10'\", \"assert compare_to_ten(20.5) == 'Greater than 10'\", \"assert compare... | {
"split": "train",
"index": 70371,
"acecode_id": "evol_6828",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a blog entry in XML format, implement a function `parse_blog_data(xml_string: str) -> Dict[str, str]` that parses the XML and extracts the blog's title, tagline, language, site URL, and blog URL. The function should return a dictionary with the keys ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_blog_data('<blog><title>My Blog</title><description>A personal blog</description><language>en</language><base_site_url>http://example.com</base_site_url><base_blog_url>http://example.com/blog</base_blog_url></blog>') == {'title': 'My Blog', 'tagline': ... | {
"split": "train",
"index": 70372,
"acecode_id": "bigcode_python_fns_46974",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a random number generator represented as a string that specifies the type and seed of the generator. The generator can either be 'RandomState' or 'Generator', followed by an integer seed value. Your task is to implement a function that takes a generator string as ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert copy_generator_string('RandomState 42') == 'RandomState 42'\", \"assert copy_generator_string('Generator 100') == 'Generator 100'\", \"assert copy_generator_string('RandomState 0') == 'RandomState 0'\", \"assert copy_generator_string('Generator 1234') == 'Ge... | {
"split": "train",
"index": 70373,
"acecode_id": "bigcode_python_fns_14683",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `make_palindrome(s: str) -> str` that creates the lexicographically smallest palindrome starting with the supplied string. The function should ignore case, spaces, and punctuation. The input string will have a maximum length of 250 characters. Return the re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_palindrome('A man, a plan, a canal: Panama') == 'amanaplanacanalpanama'\", \"assert make_palindrome('racecar') == 'racecar'\", \"assert make_palindrome('') == ''\", \"assert make_palindrome(' ') == ''\", \"assert make_palindrome('Able was I ere I saw ... | {
"split": "train",
"index": 70374,
"acecode_id": "evol_31608",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers `nums` that represents a run-length encoding, implement a function `decompressRLElist(nums)` that returns the unpacked list. Each consecutive pair of elements `[freq, val] = [nums[2*i], nums[2*i+1]]` represents `freq` occurrences of the value `val`. You... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decompressRLElist([1, 2, 3, 4]) == [2, 4, 4, 4]\", \"assert decompressRLElist([1, 1, 2, 3]) == [1, 3, 3]\", \"assert decompressRLElist([2, 5, 1, 6]) == [5, 5, 6]\", \"assert decompressRLElist([4, 0]) == [0, 0, 0, 0]\", \"assert decompressRLElist([3, 9, 2, 1]... | {
"split": "train",
"index": 70375,
"acecode_id": "evol_1439",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file names and a repository name. Your task is to create a list of file objects from the given file names. Each file object should contain the following attributes: the original file name, the sanitized name (which is the file name without any non-alphab... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_file_objects(['file1.txt', 'file_2.doc', 'sample_file.pdf'], 'my_repo') == [{'original_name': 'file1.txt', 'sanitized_name': 'file', 'extension': 'txt'}, {'original_name': 'file_2.doc', 'sanitized_name': 'file', 'extension': 'doc'}, {'original_name': ... | {
"split": "train",
"index": 70376,
"acecode_id": "bigcode_python_fns_22607",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a string containing both alphabetic and numeric characters. The function should separate the numeric values (as floating-point numbers) from the alphabetic strings and return a tuple containing a list of these floating-point numbers and a list of the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_string('Alpha 12.1 Beta 10.2 Gamma 6.3 Delta 5.4') == ([12.1, 10.2, 6.3, 5.4], ['Alpha', 'Beta', 'Gamma', 'Delta'])\", \"assert split_string('Hello 3.14 World 2.71') == ([3.14, 2.71], ['Hello', 'World'])\", \"assert split_string('1.5 2.0 3.5') == ([1.5... | {
"split": "train",
"index": 70377,
"acecode_id": "evol_14906",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the management of a simple SQLite database connection. The function `get_db_connection(db_name)` should check if a database connection exists in a simulated environment. If it does not exist, it should create a new SQLite d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_db_connection('test.db') == 'Connected to test.db'\", \"assert get_db_connection('production.db') == 'Connected to production.db'\", \"assert get_db_connection('test.db') == 'Connected to test.db'\", \"assert get_db_connection('development.db') == 'Conne... | {
"split": "train",
"index": 70378,
"acecode_id": "oss_27492",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of strings that may contain comments and empty lines. Write a function `get_active_lines(lines: List[str], comment_char: str = '#') -> List[str]` that returns all non-empty lines from the list after removing any comments based on the specif... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_active_lines(['First line', ' ', '# Comment line', 'Inline comment # comment', ' Whitespace ', 'Last line']) == ['First line', 'Inline comment', 'Whitespace', 'Last line']\", \"assert get_active_lines(['# Only comment', '# Another com... | {
"split": "train",
"index": 70379,
"acecode_id": "bigcode_python_fns_49753",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `analyze_sentiment(text_content: str) -> str` that takes a string input representing a piece of text and returns a sentiment analysis result. The sentiment analysis should categorize the text into one of three categories: 'Positive', 'Negative', or 'Neutral... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_sentiment('I am feeling great today!') == 'Positive'\", \"assert analyze_sentiment('This is a terrible mistake.') == 'Negative'\", \"assert analyze_sentiment('The weather is okay.') == 'Neutral'\", \"assert analyze_sentiment('I had a good day.') == '... | {
"split": "train",
"index": 70380,
"acecode_id": "evol_16394",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes a web module by registering routes based on a given endpoint path. The function should take a string parameter called `path`, which represents the URL endpoint path. If the `path` does not start with a '/', you should pre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert init('docs') == '/docs'\", \"assert init('/docs') == '/docs'\", \"assert init('api') == '/api'\", \"assert init('/api') == '/api'\", \"assert init('') == '/'\", \"assert init('/home') == '/home'\", \"assert init('user/profile') == '/user/profile'\", \"assert... | {
"split": "train",
"index": 70381,
"acecode_id": "bigcode_python_fns_47277",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two functions, `op` and `backwards`, represented as lists of integers. The function `op` represents an operation's output during a forward pass, while `backwards` represents the output during a backward pass. Your task is to implement a function `set_backwards_pas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_backwards_pass([1, 2, 3], [3, 2, 1]) == [3, 2, 3]\", \"assert set_backwards_pass([5, 6, 7], [1, 2, 3]) == [5, 6, 7]\", \"assert set_backwards_pass([0, 0, 0], [1, 1, 1]) == [1, 1, 1]\", \"assert set_backwards_pass([], []) == []\", \"assert set_backwards_p... | {
"split": "train",
"index": 70382,
"acecode_id": "bigcode_python_fns_13884",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes a list of language identifiers (ISO 639-3 codes) and returns a dictionary that maps each unique language identifier to its corresponding two-letter BCP-47 code. If a two-letter code does not exist for a language, the function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert map_languages(['eng', 'cmn', 'fra', 'spa']) == {'eng': 'en', 'cmn': 'zh', 'fra': 'fr', 'spa': 'es'}\", \"assert map_languages(['eng', 'deu', 'fra', 'spa']) == {'eng': 'en', 'deu': 'deu', 'fra': 'fr', 'spa': 'es'}\", \"assert map_languages(['jpn', 'kor', 'eng... | {
"split": "train",
"index": 70383,
"acecode_id": "bigcode_python_fns_18637",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function that sorts the array and returns the smallest and largest numbers in the array. The function should take one parameter: an array of integers. The output should be a tuple containing the smallest and largest integers.\nPlease reason s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_extremes([2, 5, 1, 7, 3, 9, 3]) == (1, 9)\", \"assert find_extremes([10, -1, 0, 5]) == (-1, 10)\", \"assert find_extremes([4, 4, 4]) == (4, 4)\", \"assert find_extremes([1]) == (1, 1)\", \"assert find_extremes([3, 3, 3, 3, 3]) == (3, 3)\", \"assert find... | {
"split": "train",
"index": 70384,
"acecode_id": "evol_28283",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a mapping of various attributes to their corresponding integer IDs. Write a function `create_id_maps()` that takes no parameters and returns a dictionary containing mappings for the following categories: 'Allegiance', 'Conf... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_id_maps() == {'Allegiance': {'eddn1': 1, 'eddn2': 2}, 'ConflictState': {'eddn1': 3, 'eddn2': 4}, 'Economy': {'eddn1': 5, 'eddn2': 6}, 'FactionState': {'eddn1': 7, 'eddn2': 8}, 'Government': {'eddn1': 9, 'eddn2': 10}, 'Happiness': {'eddn1': 11, 'eddn2'... | {
"split": "train",
"index": 70385,
"acecode_id": "bigcode_python_fns_49345",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `balanced_parentheses(s: str) -> bool` that checks if the input string `s` contains balanced parentheses. A string is considered 'balanced' if it meets the following conditions: it contains an equal number of open '(' and close ')' parentheses, every open p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert balanced_parentheses('') == True\", \"assert balanced_parentheses('(') == False\", \"assert balanced_parentheses(')') == False\", \"assert balanced_parentheses('()') == True\", \"assert balanced_parentheses(')(') == False\", \"assert balanced_parentheses('((... | {
"split": "train",
"index": 70386,
"acecode_id": "evol_19686",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats various types of log messages. The function should take a dictionary with keys 'message', 'source', 'tag', 'time', 'timestamp_desc', 'timezone', and 'user', and return a formatted string that includes all these components in ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_log_message({'message': 'System started', 'source': 'Main', 'tag': 'INFO', 'time': '12:00', 'timestamp_desc': 'No issues', 'timezone': 'UTC', 'user': 'admin'}) == \\\"Message: _FormatMessage: System started, Source: _FormatSource: Main, Tag: _FormatTa... | {
"split": "train",
"index": 70387,
"acecode_id": "oss_36212",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `multiple_of_eight(n: int, d: int) -> List[int]` that returns the first 'n' two-digit integers that are divisible by 8 and end with a specified digit 'd'. The function should return a list of these integers. If there are fewer than 'n' integers that meet th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiple_of_eight(0, 1) == []\", \"assert multiple_of_eight(2, 9) == []\", \"assert multiple_of_eight(1, 1) == []\", \"assert multiple_of_eight(5, 9) == []\", \"assert multiple_of_eight(1, 4) == [24]\"]}"
} | {
"split": "train",
"index": 70388,
"acecode_id": "evol_24938",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that counts the frequency of each character in a given string. The function should return a dictionary where the keys are the characters and the values are their respective counts. The input string can contain letters, digits, punctua... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert character_frequency('Hello World!') == {'h': 1, 'e': 1, 'l': 3, 'o': 2, ' ': 1, 'w': 1, 'r': 1, 'd': 1, '!': 1}\", \"assert character_frequency('Test 123!') == {'t': 2, 'e': 1, 's': 1, '1': 1, '2': 1, '3': 1, ' ': 1, '!': 1}\", \"assert character_frequency('... | {
"split": "train",
"index": 70389,
"acecode_id": "oss_20259",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing file names in a directory. Each file name ends with '.models' and contains a protein name followed by an underscore and a model identifier. Your task is to extract the unique protein names from the list of file names and return them ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_protein_names(['proteinA_1.models', 'proteinB_2.models', 'proteinA_3.models']) == ['proteinA', 'proteinB']\", \"assert extract_protein_names(['proteinC_1.models', 'proteinA_2.models', 'proteinC_3.models']) == ['proteinA', 'proteinC']\", \"assert extr... | {
"split": "train",
"index": 70390,
"acecode_id": "bigcode_python_fns_3644",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a byte string that represents a line of input encoded in ASCII. Your task is to create a function `decode_ascii_line(line: bytes) -> str` that decodes the byte string and returns it as a regular string. The input will be a byte string that is guaranteed to be vali... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode_ascii_line(b'Hello, World!') == 'Hello, World!'\", \"assert decode_ascii_line(b'\\\\x48\\\\x65\\\\x6c\\\\x6c\\\\x6f') == 'Hello'\", \"assert decode_ascii_line(b'Python is awesome!') == 'Python is awesome!'\", \"assert decode_ascii_line(b'1234567890') ... | {
"split": "train",
"index": 70391,
"acecode_id": "oss_30629",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates pushing code changes to a remote Git repository. The function should take three parameters: a GitHub token (string), a target repository (string), and a target branch (string). The function should return a formatted string ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert push_changes('my_token', 'my_repo', 'main') == ('git remote set-url origin https://x-access-token:my_token@github.com/my_repo', 'git push origin main')\", \"assert push_changes('abc123', 'my_project', 'develop') == ('git remote set-url origin https://x-acces... | {
"split": "train",
"index": 70392,
"acecode_id": "bigcode_python_fns_24592",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing survey data for students in a university system. Your function should take a dictionary containing student information and enrollment details. The dictionary can have the following keys: 'student' (a list of student information), 'enrollments' (a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_survey_data({'student': ['12345', 'John Doe', 'password', 'Fall 2021', 'Spring 2022', 'Spring 2025', 3], 'enrollments': [['12345', 'CS101', 'Fall 2021', 'A', 4], ['12345', 'CS102', 'Spring 2022', 'B', 4]], 'tracks': [['12345', 'Computer Science', 12,... | {
"split": "train",
"index": 70393,
"acecode_id": "bigcode_python_fns_6222",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function `anagram_permutations(string1: str, string2: str) -> Tuple[str, int]` that determines if two strings are anagrams of each other and also calculates how many permutations of the first string can be created which are anagrams of the second string. The function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert anagram_permutations('abc', 'bca') == ('The strings are anagrams of each other', 6)\", \"assert anagram_permutations('aabb', 'abab') == ('The strings are anagrams of each other', 6)\", \"assert anagram_permutations('abcd', 'dcba') == ('The strings are anagra... | {
"split": "train",
"index": 70394,
"acecode_id": "evol_26354",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program to analyze the total times of athletes in a race. Write a Python function `calculate_average_times` that takes in a 2D list of integers where each row represents an athlete's total times for each lap and calculates the average time for eac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_times([[60, 55, 50, 0, 0], [58, 56, 0, 0, 0], [57, 54, 52, 49, 0]]) == [55.00, 57.00, 53.00]\", \"assert calculate_average_times([[0, -1, -2], [60, 70, 80], [0, 0, 0]]) == [None, 70.00, None]\", \"assert calculate_average_times([[10, 20, 30... | {
"split": "train",
"index": 70395,
"acecode_id": "oss_24853",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a string called 'pipeline' which represents a pipeline of operations in a specific order, and a string called 'builder' representing a builder identifier. Your task is to combine these two strings into a single string that follows the format 'builder -> pipeline'.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_pipeline('Builder1', 'OperationA') == 'Builder1 -> OperationA'\", \"assert combine_pipeline('Builder2', 'OperationB') == 'Builder2 -> OperationB'\", \"assert combine_pipeline('Builder3', '') == 'Invalid input'\", \"assert combine_pipeline('', 'Operat... | {
"split": "train",
"index": 70396,
"acecode_id": "bigcode_python_fns_702",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with expanding a shorthand CSS font-variant property into its longhand properties. The shorthand property can take various tokens such as 'normal', 'small-caps', 'all-small-caps', 'inherit', etc. Your function should take a single string input representing the sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert expand_font_variant('normal') == ['font-variant: normal']\", \"assert expand_font_variant('small-caps') == ['font-variant: small-caps']\", \"assert expand_font_variant('all-small-caps') == ['font-variant: all-small-caps']\", \"assert expand_font_variant('inh... | {
"split": "train",
"index": 70397,
"acecode_id": "bigcode_python_fns_11581",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that generates an array of length N from a given list of values, while rotating each subsequent array element by a specified constant K. The function should handle cases where N is greater than the length of the given list and where K exceeds the length of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rotation_array([1, 2, 3, 4, 5], 10, 2) == [3, 4, 5, 1, 2, 3, 4, 5, 1, 2]\", \"assert rotation_array([1, 2, 3], 5, 1) == [2, 3, 1, 2, 3]\", \"assert rotation_array([10, 20, 30], 6, 5) == [30, 10, 20, 30, 10, 20]\", \"assert rotation_array([1], 5, 0) == [1, 1,... | {
"split": "train",
"index": 70398,
"acecode_id": "evol_1181",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a positive integer to a Roman numeral or a Roman numeral to an integer. The conversion types are 'int_to_roman' or 'roman_to_int'. The input integer must be between 1 and 1000, and the Roman numeral must be valid. If the input is invalid, rais... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_number(19, 'int_to_roman') == 'xix'\", \"assert convert_number(152, 'int_to_roman') == 'clii'\", \"assert convert_number('cdxxvi', 'roman_to_int') == 426\", \"assert convert_number(1, 'int_to_roman') == 'i'\", \"assert convert_number(1000, 'int_to_ro... | {
"split": "train",
"index": 70399,
"acecode_id": "evol_6768",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.