data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that constructs a custom exception message. The function should take a string input representing the message and return a new instance of a custom exception class called `CustomException`. This exception class should inherit from t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_custom_exception('Error occurred!').args[0] == 'Error occurred!'\", \"assert create_custom_exception('File not found').args[0] == 'File not found'\", \"assert create_custom_exception('Invalid input').args[0] == 'Invalid input'\", \"assert create_custo... | {
"split": "train",
"index": 80600,
"acecode_id": "oss_2597",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `square_numbers(nums: List[int]) -> List[int]` that takes a list of integers and returns a new list containing the squares of each integer from the input list. The output list should maintain the same order as the input list. If the input list is empty, ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_numbers([]) == []\", \"assert square_numbers([1]) == [1]\", \"assert square_numbers([-1]) == [1]\", \"assert square_numbers([0]) == [0]\", \"assert square_numbers([1, 2, 3]) == [1, 4, 9]\", \"assert square_numbers([-2, -1, 0, 1, 2]) == [4, 1, 0, 1, 4]... | {
"split": "train",
"index": 80601,
"acecode_id": "evol_5997",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates the factorial of a given non-negative integer. The function should take an integer n as input and return the factorial of n. If n is negative, the function should return 'Factorial is not defined for negative number... | 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": 80602,
"acecode_id": "oss_15668",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of stock data. Each stock is represented as a dictionary containing its 'code' (a string) and 'name' (a string). Your function should take a list of such stock dictionaries and return a new list containing only t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_tradable_stocks([{'code': 'HK001', 'name': 'Stock A'}, {'code': 'HK002', 'name': 'Stock B'}, {'code': 'US003', 'name': 'Stock C'}]) == ['Stock A', 'Stock B']\", \"assert filter_tradable_stocks([{'code': 'US001', 'name': 'Stock D'}, {'code': 'HK004', '... | {
"split": "train",
"index": 80603,
"acecode_id": "oss_23906",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the pixel values of an image in grayscale. Write a function 'shrink_image' that takes this list and a scaling factor, and returns a new list of integers that represents the pixel values of the image after scaling it down by the give... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shrink_image([100], 1) == [100]\", \"assert shrink_image([], 2) == []\", \"assert shrink_image([1, 2, 3, 4, 5], 5) == [3]\", \"assert shrink_image([100, 200], 2) == [150]\", \"assert shrink_image([10, 20, 30, 40, 50], 1) == [10, 20, 30, 40, 50]\"]}"
} | {
"split": "train",
"index": 80604,
"acecode_id": "bigcode_python_fns_19659",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that visualizes the time spent on a task for a team of developers. Your program should take a floating-point number representing the time spent on a task as input. If the time spent is greater than or equal to 1.0, you should append a spec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert time_tracking_visualization(0.5) == '0.5'\", \"assert time_tracking_visualization(1.0) == '1.0 ~'\", \"assert time_tracking_visualization(1.5) == '1.5 ~'\", \"assert time_tracking_visualization(2.3) == '2.3 ~'\", \"assert time_tracking_visualization(3.0) == ... | {
"split": "train",
"index": 80605,
"acecode_id": "oss_36586",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the head of a singly linked list and an integer k, reverse the list in groups of k nodes, and return the modified list. If the number of nodes is not a multiple of k, leave the remaining nodes as is. Write a function `reverseKGroup(head: ListNode, k: int) -> ListNode:` th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverseKGroup(ListNode(1), 1).val == 1\", \"assert reverseKGroup(ListNode(1, ListNode(2)), 2).val == 2\", \"assert reverseKGroup(ListNode(1, ListNode(2, ListNode(3))), 3).val == 3\", \"assert reverseKGroup(ListNode(1, ListNode(2, ListNode(3, ListNode(4)))), ... | {
"split": "train",
"index": 80606,
"acecode_id": "evol_31853",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the functionality of a jewelry e-commerce application by handling operations related to jewelry items and a shopping cart. Write a function `jewelry_app_operations` that takes a list of operations and executes them on a sim... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert jewelry_app_operations([{ 'operation': 'create', 'name': 'Diamond Ring', 'price': 500, 'material': 'Gold', 'category': 'Rings' }, { 'operation': 'add', 'name': 'Diamond Ring', 'quantity': 1 }, { 'operation': 'total' }]) == 500\", \"assert jewelry_app_operati... | {
"split": "train",
"index": 80607,
"acecode_id": "oss_15992",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers [7, 11, 19, 22], write a function that generates all the permutations of this list and returns those permutations that are sorted in ascending order. Your function must implement one of the sorting algorithms and not use any built-in sorting functions.\... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sorted_permutations([7, 11, 19, 22]) == [(7, 11, 19, 22)]\", \"assert sorted_permutations([1, 2, 3]) == [(1, 2, 3)]\", \"assert sorted_permutations([8, 9, 10, 11]) == [(8, 9, 10, 11)]\", \"assert sorted_permutations([1, 2, 3, 4]) == [(1, 2, 3, 4)]\", \"asser... | {
"split": "train",
"index": 80608,
"acecode_id": "evol_21746",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns a new list containing each non-prime integer from the input list tripled. Prime numbers should be excluded from the output list.\nPlease reason step by step, then write a self-contained Python solution. Give your final... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_nums([11, 13, 17]) == []\", \"assert process_nums([15, 16, 18]) == [45, 48, 54]\", \"assert process_nums([]) == []\", \"assert process_nums([29, 33, 35]) == [99, 105]\", \"assert process_nums([10, 12, 14]) == [30, 36, 42]\", \"assert process_nums([25... | {
"split": "train",
"index": 80609,
"acecode_id": "evol_26221",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `caesar_cipher` that encrypts a given plaintext message using the Caesar cipher technique. The Caesar cipher shifts each letter in the message by a specified number of positions in the alphabet. Your function should take two parameters: a string `mes... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert caesar_cipher('abc', 3) == 'def'\", \"assert caesar_cipher('xyz', 3) == 'abc'\", \"assert caesar_cipher('Hello, World!', 13) == 'Uryyb, Jbeyq!'\", \"assert caesar_cipher('Python 3.10', 5) == 'Udymts 3.10'\", \"assert caesar_cipher('Edge Cases?', 0) == 'Edge ... | {
"split": "train",
"index": 80610,
"acecode_id": "oss_21262",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple URL path generator for an API structure. You will implement a function `get_full_path` that returns the full path of an API endpoint based on its reference and its parent's reference. The full path should be constructed by concatenating the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_full_path(['api']) == '/api'\", \"assert get_full_path(['api', 'users']) == '/api/users'\", \"assert get_full_path(['api', 'posts', 'comments']) == '/api/posts/comments'\", \"assert get_full_path(['api', 'users', 'details']) == '/api/users/details'\", \"... | {
"split": "train",
"index": 80611,
"acecode_id": "oss_5518",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that accepts a list of words and returns a list of lists, where each inner list contains words that are anagrams of each other. The function should be able to handle any input list of words, including potential edge cases such as empty strings or single-cha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert group_anagrams(['cat', 'dog', 'tac', 'god']) == [['cat', 'tac'], ['dog', 'god']]\", \"assert group_anagrams(['listen', 'silent', 'enlist']) == [['listen', 'silent', 'enlist']]\", \"assert group_anagrams(['', '']) == [['', '']]\", \"assert group_anagrams(['a'... | {
"split": "train",
"index": 80612,
"acecode_id": "evol_12750",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that extracts the version number from a given filename string. The version number is denoted by a lowercase 'v' followed by a sequence of digits, which may include periods as separators (e.g., '1.0.0'). Your function should tak... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_version_number('file_v1.2.3.txt') == '1.2.3'\", \"assert get_version_number('document_v2.txt') == '2'\", \"assert get_version_number('v3.4.5') == '3.4.5'\", \"assert get_version_number('example_v1.0.0_file.txt') == '1.0.0'\", \"assert get_version_number(... | {
"split": "train",
"index": 80613,
"acecode_id": "oss_33549",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of four key points representing the corners of a rectangular mask in the following format: points = [top, right, bottom, left], where each point is a tuple of two integers (x, y). You also have three additional points: left chin nose connection, right chin ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mask_position([(0, 0), (4, 0), (4, 3), (0, 3)], (1, 1), (3, 1), (2, 0)) == 'normal position'\", \"assert mask_position([(2, 2), (6, 2), (6, 5), (2, 5)], (3, 3), (5, 3), (4, 2)) == 'normal position'\", \"assert mask_position([(0, 0), (2, 0), (2, 2), (0, 2)], ... | {
"split": "train",
"index": 80614,
"acecode_id": "bigcode_python_fns_21757",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and a target integer, implement a function that returns a list of all indices where the target integer can be found in the list. The function should be defined as follows: def find_indexes(num_list: List[int], val: int) -> List[int]:\nPlease reason step... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_indexes([1,2,3,2,4,2,5,2,3,2,1], 2) == [1, 3, 5, 7, 9]\", \"assert find_indexes([1,1,1,1,1], 1) == [0, 1, 2, 3, 4]\", \"assert find_indexes([5,4,3,2,1], 6) == []\", \"assert find_indexes([], 1) == []\", \"assert find_indexes([1,2,3,4,5], 3) == [2]\", \"... | {
"split": "train",
"index": 80615,
"acecode_id": "evol_9503",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_vehicle` that takes in parameters for a vehicle's type (either 'automobile' or 'bus'), its make, model, year, registration number, and additional attributes specific to the vehicle type. The function should return a string representation of the vehi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_vehicle('automobile', 'Ford', 'Fiesta', 2018, 'AB1234CD', 4, 'Hatchback') == '2018 Ford Fiesta (Reg: AB1234CD), Doors: 4, Body: Hatchback'\", \"assert create_vehicle('bus', 'Mercedes-Benz', 'Citaro', 2016, 'EF5678GH', 50, 'City Bus') == '2016 Mercedes... | {
"split": "train",
"index": 80616,
"acecode_id": "evol_5367",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that performs a sequence of set operations on two input tuples containing integers. The function should take three parameters: two tuples of integers and a tuple of operation strings. The operations are represented as strings and can be \"union\", \"intersectio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert tuple_operations((1, 2, 3), (2, 3, 4), ('union',)) == [[1, 2, 3, 4]]\", \"assert tuple_operations((1, 2, 3), (2, 3, 4), ('intersection',)) == [[2, 3]]\", \"assert tuple_operations((1, 2, 3), (4, 5, 6), ('symmetric_difference',)) == [[1, 2, 3, 4, 5, 6]]\", \"... | {
"split": "train",
"index": 80617,
"acecode_id": "evol_15434",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given the lengths of the sides and the diagonal of a quadrilateral, implement a function `rectangle_properties(a, b, c, d, e)` that returns a tuple containing the area of the quadrilateral, its type ('Square' or 'Rectangle'), the length of the diagonal, and the angle between th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rectangle_properties(0, 2, 0, 2, 2) == -1\", \"assert rectangle_properties(-1, 2, -1, 2, 2) == -1\", \"assert rectangle_properties(5, 5, 5, 5, 5) == -1\", \"assert rectangle_properties(6, 8, 6, 8, 10.00) == (48.00, 'Rectangle', 10.00, 90)\", \"assert rectang... | {
"split": "train",
"index": 80618,
"acecode_id": "evol_35104",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `set_result_contract(contracts, contract_id, result)` that sets the result for a specific contract. The function takes a dictionary `contracts` representing existing contracts, a `contract_id` for the specific contract to update, and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_result_contract({'1': None, '2': None}, '1', 'Approved') == {'1': 'Approved', '2': None}\", \"assert set_result_contract({'1': None, '2': None}, '2', 'Rejected') == {'1': None, '2': 'Rejected'}\", \"assert set_result_contract({'1': None, '2': None}, '1',... | {
"split": "train",
"index": 80619,
"acecode_id": "oss_4704",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of ebuild strings representing Chrome versions. Each ebuild string is formatted as 'chrome-<version>.ebuild', where <version> can either contain a stable version number (like '1.0.0') or an unstable version denoted by '9999'. Write a functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_chrome_candidates(['chrome-9999.ebuild', 'chrome-1.0.0.ebuild', 'chrome-1.0.1.ebuild']) == ('chrome-9999.ebuild', ['chrome-1.0.0.ebuild', 'chrome-1.0.1.ebuild'])\", \"assert find_chrome_candidates(['chrome-1.1.0.ebuild', 'chrome-9999.ebuild']) == ('chro... | {
"split": "train",
"index": 80620,
"acecode_id": "bigcode_python_fns_25849",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the total oil production from various OPEC countries over a specific period. Given a list of monthly oil production values for several countries, your goal is to implement a function that takes in a list of dictionaries, where each dictionary rep... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_production([{'date': '2021-01-01', 'Saudi Arabia': 10.5, 'Iraq': 4.5}, {'date': '2021-02-01', 'Saudi Arabia': 11.0, 'Iraq': 4.0}]) == {'Saudi Arabia': 21.5, 'Iraq': 8.5}\", \"assert calculate_total_production([{'date': '2021-01-01', 'Iran': 4... | {
"split": "train",
"index": 80621,
"acecode_id": "bigcode_python_fns_10482",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to filter out certain file paths from a list. The file paths are represented as strings, and you are provided with a list of excluded paths. Your function should remove all file paths from the input list that start with any of the exc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert _remove_excluded_paths(['/a/b/c.py', '/a/b/d.py', '/x/y/z.py'], ['/a/b']) == ['/x/y/z.py']\", \"assert _remove_excluded_paths(['/a/b/c.py', '/a/b/d.py', '/x/y/z.py'], ['/a/b/c.py']) == ['/a/b/d.py', '/x/y/z.py']\", \"assert _remove_excluded_paths(['/a/b/c.py... | {
"split": "train",
"index": 80622,
"acecode_id": "oss_1397",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are required to create a Python function that processes a list of musical terms and generates a frequency chart. The function should take a list of musical terms as input and return a 2D list representing the frequency of each term, sorted alphabetically, along with the hea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_frequency_chart(['Ambitus', 'Pieces', 'Ambitus', 'Pieces', 'Pieces']) == [['Ambitus', 'Amount'], ['Ambitus', 2], ['Pieces', 3]]\", \"assert generate_frequency_chart(['Note', 'Chord', 'Note']) == [['Ambitus', 'Amount'], ['Chord', 1], ['Note', 2]]\", ... | {
"split": "train",
"index": 80623,
"acecode_id": "oss_31265",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `factorial(n)` that computes the factorial of a given integer `n` using recursion. If the input is a negative integer, the function should return 1. If `n` is 0, the function should also return 1. If the input is not an integer, the function should return '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(5) == 120\", \"assert factorial(0) == 1\", \"assert factorial(-3) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(6) == 720\", \"assert factorial(7)... | {
"split": "train",
"index": 80624,
"acecode_id": "evol_14076",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "In a banking system, there are two types of accounts being offered: one attracts an annual interest rate of 4% and the other 2%. For a certain customer, the sum of the amounts in both accounts equals $300 and the total interest earned after one year is $9. Write a Python functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_account_balance(15, 300) == None\", \"assert find_account_balance(18, 300) == None\", \"assert find_account_balance(14, 300) == None\", \"assert find_account_balance(17, 300) == None\", \"assert find_account_balance(20, 300) == None\"]}"
} | {
"split": "train",
"index": 80625,
"acecode_id": "evol_10545",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes application configurations based on the environment and type of application. The function should take three parameters: `app_env` (string), `app_kind` (string), and `conf_dir` (string). The `app_env` parameter repres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert setup_config('production', 'web', '/path/to/config') == ['/path/to/config/etc/production/common.conf', '/path/to/config/etc/production/web.conf']\", \"assert setup_config('development', 'API', '/config') == ['/config/etc/development/common.conf', '/config/et... | {
"split": "train",
"index": 80626,
"acecode_id": "oss_16669",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_heap_type(i: int) -> str` that returns the type of heap to be used for managing integers based on the value of `i`. If `i` is less than or equal to 3, return 'BitVectorHeap'. For any value of `i` greater than 3, return 'FlatHeap'.\nPlease reason step b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_heap_type(0) == 'BitVectorHeap'\", \"assert get_heap_type(1) == 'BitVectorHeap'\", \"assert get_heap_type(2) == 'BitVectorHeap'\", \"assert get_heap_type(3) == 'BitVectorHeap'\", \"assert get_heap_type(4) == 'FlatHeap'\", \"assert get_heap_type(5) == 'Fl... | {
"split": "train",
"index": 80627,
"acecode_id": "bigcode_python_fns_44943",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string as input and returns the number of times the letter 'a' appears in that string. The function should be case insensitive, meaning that both 'a' and 'A' should be counted. Write a function `count_a_letters(s: str) -> int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_a_letters('apple') == 1\", \"assert count_a_letters('banana') == 3\", \"assert count_a_letters('Aardvark') == 3\", \"assert count_a_letters('') == 0\", \"assert count_a_letters('hello world') == 0\", \"assert count_a_letters('aaaaaaa') == 7\", \"assert... | {
"split": "train",
"index": 80628,
"acecode_id": "bigcode_python_fns_30753",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of strings: `runs_log` and `runs_xtc`. Each string in these lists represents a 4-character run identifier. Your task is to implement a function that returns a list of run identifiers from `runs_xtc` that are not present in `runs_log`. The output list sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_new_runs(['0001', '0002', '0003'], ['0002', '0003', '0004', '0005']) == ['0004', '0005']\", \"assert find_new_runs(['0001'], ['0001', '0002', '0003']) == ['0002', '0003']\", \"assert find_new_runs([], ['0002', '0003', '0004']) == ['0002', '0003', '0004'... | {
"split": "train",
"index": 80629,
"acecode_id": "bigcode_python_fns_47964",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a duration in the format 'HH:MM:SS' or 'MM:SS', write a function that converts this human-readable duration into the total number of seconds. If the input string does not match the required format, the function should raise a ValueError. You may assu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_duration('01:30:00') == 5400\", \"assert parse_duration('00:45:30') == 2730\", \"assert parse_duration('00:15') == 15\", \"assert parse_duration('02:05') == 125\", \"assert parse_duration('00:00:05') == 5\", \"assert parse_duration('00:01') == 1\", \"a... | {
"split": "train",
"index": 80630,
"acecode_id": "bigcode_python_fns_27062",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You have a list of notification entries, each represented by a dictionary containing the keys 'id' and 'username'. Your task is to implement a function that removes a notification entry for a specific user based on the given username. The function should take in a list of notif... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dismiss_notifications([{'id': 1, 'username': 'alice'}, {'id': 2, 'username': 'bob'}, {'id': 3, 'username': 'alice'}], 'alice') == [{'id': 2, 'username': 'bob'}]\", \"assert dismiss_notifications([{'id': 1, 'username': 'alice'}], 'bob') == [{'id': 1, 'usernam... | {
"split": "train",
"index": 80631,
"acecode_id": "bigcode_python_fns_8552",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes two parameters: a message (`msg`) which can be either a string or a list of strings, and a message details string (`msg_details`). The function should return a tuple containing two elements: the first element should be a list o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_info_message_files('Hello World', 'This is a detail') == (['Hello World'], 'This is a detail')\", \"assert create_info_message_files(['Hi', 'There'], 'Greetings') == (['Hi', 'There'], 'Greetings')\", \"assert create_info_message_files('A very very lon... | {
"split": "train",
"index": 80632,
"acecode_id": "bigcode_python_fns_10513",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that schedules periodic tasks based on a given policy. The function should take in three parameters: an asset ID (a string), a user ID (a string), and a policy (an object with properties: repeat (a boolean) and repeat_freq (a string, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert schedule_task('asset123', 'user456', {'repeat': True, 'repeat_freq': 'DAILY'}) == 'Task scheduled for DAILY at 8:00 AM'\", \"assert schedule_task('asset123', 'user456', {'repeat': True, 'repeat_freq': 'WEEKLY'}) == 'Task scheduled for WEEKLY at 8:00 AM'\", \... | {
"split": "train",
"index": 80633,
"acecode_id": "bigcode_python_fns_16163",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of energy values and their corresponding transmission or fluorescence values along with an optional transmission reference. Write a function `extract_scan` that takes four parameters: a list of energy values, a list of mu values (either for transmission or ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_scan([1.0, 1.2, 1.0], [0.7, 0.8, 0.7], False, 0.1) == {'energy': [1.0, 1.2], 'mu': [0.7, 0.8]}\", \"assert extract_scan([3.0, 3.1, 3.0], [1.1, 1.2, 1.1], False, 0.05) == {'energy': [3.0, 3.1], 'mu': [1.1, 1.2]}\", \"assert extract_scan([4.0, 4.0, 4.0... | {
"split": "train",
"index": 80634,
"acecode_id": "bigcode_python_fns_27197",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that transcribes a DNA sequence into its corresponding RNA sequence. The transcription process involves replacing each nucleotide in the DNA sequence as follows: A becomes U, T becomes A, C becomes G, and G becomes C. The input to your fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transcribe_dna_to_rna('A T C G 123!') == 'UAGC'\", \"assert transcribe_dna_to_rna('A T C G') == 'UAGC'\", \"assert transcribe_dna_to_rna('GATTACA') == 'CUAAUGU'\", \"assert transcribe_dna_to_rna('1234!@#$%^&*()') == ''\", \"assert transcribe_dna_to_rna('') =... | {
"split": "train",
"index": 80635,
"acecode_id": "bigcode_python_fns_41867",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers and a specific integer, implement a function that counts the number of times the specific integer occurs in the array. Write a function `count_occurrences(arr: List[int], target: int) -> int` that takes in the array and the target integer, and returns... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_occurrences([1, 2, 3, 2, 1, 2], 2) == 3\", \"assert count_occurrences([1, 2, 3, 4, 5], 2) == 1\", \"assert count_occurrences([1, 1, 1, 1, 1], 1) == 5\", \"assert count_occurrences([5, 5, 5, 5, 5], 3) == 0\", \"assert count_occurrences([], 1) == 0\", \"... | {
"split": "train",
"index": 80636,
"acecode_id": "evol_3835",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers `nums` and a target integer `target`, implement a function `scan_by_key` that returns a new list where each element at index `i` is the sum of all the elements in `nums` from the start up to index `i` (inclusive) if the element is less than or equal to ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert scan_by_key([1, 2, 3, 4, 5], 3) == [1, 3, 6, 4, 5]\", \"assert scan_by_key([], 10) == []\", \"assert scan_by_key([1, 1, 1], 1) == [1, 2, 3]\", \"assert scan_by_key([1, 2, 3, 4, 5], 0) == [1, 2, 3, 4, 5]\", \"assert scan_by_key([100, 200, 300], 150) == [100, ... | {
"split": "train",
"index": 80637,
"acecode_id": "bigcode_python_fns_38263",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a dataset represented as a dictionary containing two lists. The first list contains dictionaries representing sales data, with each dictionary having 'id_provincia' (an integer representing the province ID) and 'ventas_totales' (a float representing total sales). ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_sales_by_province({'sales_data': [{'id_provincia': 1, 'ventas_totales': 100.0}, {'id_provincia': 2, 'ventas_totales': 150.0}, {'id_provincia': 1, 'ventas_totales': 200.0}], 'province_data': [{'id_provincia': 1, 'provincia': 'Province A'}, {'i... | {
"split": "train",
"index": 80638,
"acecode_id": "oss_15656",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the deletion of a file move setting based on a given setting ID. Your function should take an integer `id` as input and return a string indicating whether the deletion was successful or not. If the deletion is successfu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_setting(4) == 'Command failed.'\", \"assert delete_setting(6) == 'Command failed.'\", \"assert delete_setting(8) == 'Command failed.'\", \"assert delete_setting(11) == 'Command failed.'\", \"assert delete_setting(13) == 'Command failed.'\", \"assert d... | {
"split": "train",
"index": 80639,
"acecode_id": "bigcode_python_fns_39846",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the number of times a specified substring appears within a given string, maintaining case sensitivity. The function should take two parameters: the main string and the substring, and return an integer representing the count of the substring ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_substring('A quick brown fox jumps over the lazy dog.', 'dog') == 1\", \"assert count_substring('Hello World', 'hello') == 0\", \"assert count_substring('Python is great. Python is fun.', 'Python') == 2\", \"assert count_substring('abcabcabc', 'abc') =... | {
"split": "train",
"index": 80640,
"acecode_id": "evol_17819",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that accepts a SQL update query and a dictionary of parameters, and simulates the execution of this query. The function should return a success message if the update is 'executed' successfully, or an error message if any error occurs during the updat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_records('UPDATE my_table SET column = :value WHERE id = :id', {'value': 'new value', 'id': 1}) == 'Update executed successfully.'\", \"assert update_records('UPDATE my_table SET column = :value WHERE id = :id', {'value': 'new value', 'id': 2}) == 'Upd... | {
"split": "train",
"index": 80641,
"acecode_id": "evol_452",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates adding a cap type to a drawing builder. The function should take two parameters: a string `builder` representing the name of a drawing builder and a string `capType` representing the type of cap to be added. The function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_cap_type('Canvas', 'Round') == 'Adding cap type Round to Canvas'\", \"assert add_cap_type('Canvas', 'Square') == 'Adding cap type Square to Canvas'\", \"assert add_cap_type('Easel', 'Flat') == 'Adding cap type Flat to Easel'\", \"assert add_cap_type('Eas... | {
"split": "train",
"index": 80642,
"acecode_id": "bigcode_python_fns_12477",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `hypercube_volume(side_length: int) -> int` that calculates the volume of a hypercube in four-dimensional space given the length of its side. The volume of a hypercube is defined as the side length raised to the power of 4. The input will be a single integer re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hypercube_volume(1) == 1\", \"assert hypercube_volume(2) == 16\", \"assert hypercube_volume(3) == 81\", \"assert hypercube_volume(4) == 256\", \"assert hypercube_volume(5) == 625\", \"assert hypercube_volume(10) == 10000\", \"assert hypercube_volume(0) == 0\... | {
"split": "train",
"index": 80643,
"acecode_id": "evol_3524",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that parses a given dictionary containing project details and extracts specific information. The dictionary contains the project's homepage URL and author details. Your function should extract the homepage URL and the author's name... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_project_details({'url': 'https://example.com/project', 'author': 'Alice'}) == ('https://example.com/project', 'Alice')\", \"assert extract_project_details({'url': 'http://testsite.com', 'author': 'Bob'}) == ('http://testsite.com', 'Bob')\", \"assert ... | {
"split": "train",
"index": 80644,
"acecode_id": "oss_5787",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function to determine if two phrases contain the same unique words, ignoring any duplicates. Implement the following function: def compare_unique_words(phrase1: str, phrase2: str) -> bool: This function should return True if both phrases have the same set of unique wor... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_unique_words('apple banana orange', 'orange apple banana') == True\", \"assert compare_unique_words('apple banana', 'apple orange banana') == False\", \"assert compare_unique_words('apple', 'apple apple') == True\", \"assert compare_unique_words('ban... | {
"split": "train",
"index": 80645,
"acecode_id": "evol_6254",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `remove_even_numbers(lst)` that takes a list of integers as input and returns a new list containing only the odd integers from the original list. The function should handle a list of up to 10 million integers efficiently.\nPlease reason step by step, then write... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_even_numbers([1, 2, 3, 4, 5]) == [1, 3, 5]\", \"assert remove_even_numbers([2, 4, 6, 8]) == []\", \"assert remove_even_numbers([1, 3, 5, 7]) == [1, 3, 5, 7]\", \"assert remove_even_numbers([]) == []\", \"assert remove_even_numbers([0, 1, 2, 3, 4, 5]) ... | {
"split": "train",
"index": 80646,
"acecode_id": "evol_3953",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that sorts the integers in ascending order and returns the sorted list.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block."
}
] | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_numbers([3, 6, 5, 1, 4, 2]) == [1, 2, 3, 4, 5, 6]\", \"assert sort_numbers([10, 2, 8, 1, 5]) == [1, 2, 5, 8, 10]\", \"assert sort_numbers([4, 4, 4, 4]) == [4, 4, 4, 4]\", \"assert sort_numbers([0, -1, 2, -3, 1]) == [-3, -1, 0, 1, 2]\", \"assert sort_num... | {
"split": "train",
"index": 80647,
"acecode_id": "evol_11950",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_fixed_string` that creates a random string of a fixed length containing only lowercase letters and digits. The function should take an integer `length` as input and return a string of the specified length. The string should be generated using characte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_fixed_string(8)) == 8\", \"assert len(generate_fixed_string(5)) == 5\", \"assert len(generate_fixed_string(10)) == 10\", \"assert len(generate_fixed_string(1)) == 1\", \"assert len(generate_fixed_string(3)) == 3\", \"assert len(generate_fixed_st... | {
"split": "train",
"index": 80648,
"acecode_id": "bigcode_python_fns_29778",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, return the total number of unique subarrays. A subarray is defined as a contiguous portion of the array. For example, the array [1, 2, 1] contains the unique subarrays: [1], [2], [1, 2], [2, 1], [1, 2, 1], and [1, 1]. Your program should be able to h... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert num_of_subarrays([3, 1, 4, 2, 5]) == 15\", \"assert num_of_subarrays([1, 2, 1]) == 5\", \"assert num_of_subarrays([1, 1, 1]) == 3\", \"assert num_of_subarrays([1]) == 1\", \"assert num_of_subarrays([]) == 0\", \"assert num_of_subarrays([1, 2, 3, 4, 5]) == 15... | {
"split": "train",
"index": 80649,
"acecode_id": "evol_21707",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of incoming data packets received from a communication device. Each packet is represented as a string and can be of different types based on its prefix. Your goal is to create a function that processes these packets and returns a summary of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_packets(['CTR,command1', 'IFO,info1', 'CLR_RDV', 'CTR,command2']) == {'CTR': 2, 'IFO': 1, 'CLR_RDV': 1}\", \"assert process_packets(['PRM,MPC', 'IFO,info2', 'CLR_RDV']) == {'IFO': 1, 'CLR_RDV': 1}\", \"assert process_packets(['CTR,command3', 'CTR,com... | {
"split": "train",
"index": 80650,
"acecode_id": "bigcode_python_fns_12756",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings where each string consists of a metal name followed by its concentration level, separated by a space. Your task is to transform this list into a dictionary where each unique metal-concentration combination is a key, and the value is a correspondi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_metal_concentration(['Cu 10', 'Cd 20', 'Pb 30']) == {'Cu_10': 0, 'Cd_20': 1, 'Pb_30': 2}\", \"assert transform_metal_concentration(['Cu 10', 'Cu 20']) == {'Cu_10': 0, 'Cu_20': 0}\", \"assert transform_metal_concentration(['Sw 15', 'Cd 25', 'Cu 35']... | {
"split": "train",
"index": 80651,
"acecode_id": "bigcode_python_fns_26452",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that simulates the shutdown of a specific device in a pool of devices. The function should take two arguments: a list of devices (each represented by a dictionary containing the device's MAC address) and a string representing the MAC ad... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shutdown_device([{'mac': '00:1A:2B:3C:4D:5E'}, {'mac': '11:22:33:44:55:66'}], '00:1A:2B:3C:4D:5E') == 'Device with MAC 00:1A:2B:3C:4D:5E has been shut down.'\", \"assert shutdown_device([{'mac': '00:1A:2B:3C:4D:5E'}, {'mac': '11:22:33:44:55:66'}], '11:22:33:... | {
"split": "train",
"index": 80652,
"acecode_id": "bigcode_python_fns_9811",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a resistor, capacitor, or inductor code (RKM code), convert it to a string that includes a decimal point and an appropriate suffix representing the unit. The code may represent a numerical value followed by a unit suffix (like 'K' for kilo, 'M' for m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert from_rkm('4R7') == '4.7'\", \"assert from_rkm('4K7') == '4.7k'\", \"assert from_rkm('47K3') == '47.3k'\", \"assert from_rkm('4M7') == '4.7M'\", \"assert from_rkm('47M3') == '47.3M'\", \"assert from_rkm('4G7') == '4.7G'\", \"assert from_rkm('47G3') == '47.3G'... | {
"split": "train",
"index": 80653,
"acecode_id": "bigcode_python_fns_13069",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `any_type_matcher` that checks if a given input matches a specified type. The function should take two parameters: `input_value`, which can be of any data type, and `wanted_type`, which is a type. The function should return `True` if `input_valu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert any_type_matcher(5, int) == True\", \"assert any_type_matcher(5.0, int) == False\", \"assert any_type_matcher('hello', str) == True\", \"assert any_type_matcher('hello', int) == False\", \"assert any_type_matcher([1, 2, 3], list) == True\", \"assert any_type... | {
"split": "train",
"index": 80654,
"acecode_id": "bigcode_python_fns_30522",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists: `students` and `sandwiches`. Each element in the `students` list represents a student's preferred sandwich type, and each element in the `sandwiches` list represents the available sandwich types in the order they will be served. The lists are of the sam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert assign_sandwiches([1, 1, 2, 3], [1, 2, 3, 4]) == 1\", \"assert assign_sandwiches([1, 1, 1], [1, 2, 2]) == 2\", \"assert assign_sandwiches([1, 2, 1], [1, 1, 1]) == 1\", \"assert assign_sandwiches([1, 1, 2], [2, 3, 1]) == 2\", \"assert assign_sandwiches([1, 2,... | {
"split": "train",
"index": 80655,
"acecode_id": "oss_28821",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function called `process_settings` that accepts a dictionary representing settings. The dictionary includes the following fields: \n- 'input_folder': a string representing the path to the input folder. \n- 'document_count_limit': an integer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_settings({'input_folder': '/documents', 'document_count_limit': -1, 'reference': 'example'}) == {'input_folder': '/documents', 'document_count_limit': 9223372036854775807, 'reference': 'example'}\", \"assert process_settings({'input_folder': '/files'... | {
"split": "train",
"index": 80656,
"acecode_id": "oss_33380",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function `redistribute_arr(arr)` that rearranges the elements such that all prime numbers appear on the left side of the array and all non-prime numbers appear on the right side. The order of elements within the prime and non-prime groups... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert redistribute_arr([5, 4, 3, 2, 1]) == [5, 3, 2, 4, 1]\", \"assert redistribute_arr([1, 4, 6, 8, 9]) == [1, 4, 6, 8, 9]\", \"assert redistribute_arr([]) == []\", \"assert redistribute_arr([13, 29, 30, 31]) == [13, 29, 31, 30]\", \"assert redistribute_arr([4, 6... | {
"split": "train",
"index": 80657,
"acecode_id": "evol_808",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a string of text. Your task is to implement a function that adds line breaks to the string every ten characters. If the string is longer than 10 characters, you should add a line break after every ten characters, up to a maximum of four line breaks. The function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_line_breaks('abcdefghijabcdefghijabcdefghijabcdefghij') == 'abcdefghij-\\\\nabcdefghij-\\\\nabcdefghij-\\\\nabcdefghij'\", \"assert add_line_breaks('abcdefghijabcdefghij') == 'abcdefghij-\\\\nabcdefghij'\", \"assert add_line_breaks('1234567890') == '1234... | {
"split": "train",
"index": 80658,
"acecode_id": "bigcode_python_fns_3882",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Develop a Python recursive function that takes a tuple as input and returns a list of values contained in the tuple. The function should handle nested tuples and return all values in a flat list, preserving the order of appearance. For example, if the input is (6, 7, (8, 9, (10... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten_tuple((6, 7, (8, 9, (10, 11)), 12)) == [6, 7, 8, 9, 10, 11, 12]\", \"assert flatten_tuple((1, 2, 3)) == [1, 2, 3]\", \"assert flatten_tuple(((1, 2), (3, 4))) == [1, 2, 3, 4]\", \"assert flatten_tuple((5, (6, 7), (8, (9, 10)))) == [5, 6, 7, 8, 9, 10]\... | {
"split": "train",
"index": 80659,
"acecode_id": "evol_35082",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of historical values and an integer representing the number of future values to forecast. Your goal is to create a function `forecastValues` that uses a simple average of the last few historical values to predict the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert forecastValues([5.0], 1) == [5.0]\", \"assert forecastValues([0.0, 0.0, 0.0], 3) == [0.0, 0.0, 0.0]\", \"assert forecastValues([10.0, 10.0, 10.0, 10.0, 10.0], 5) == [10.0, 10.0, 10.0, 10.0, 10.0]\", \"assert forecastValues([1.0, 1.0, 1.0, 1.0, 1.0], 3) == [1... | {
"split": "train",
"index": 80660,
"acecode_id": "oss_3538",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the operations of a simple library management system. The function should be able to handle the following operations: adding a book, removing a book, checking out a book, and displaying the current list of available boo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert library_management([('add', 'Python Programming'), ('add', 'Data Structures and Algorithms'), ('display', None)]) == ['Python Programming', 'Data Structures and Algorithms']\", \"assert library_management([('add', 'Python Programming'), ('check_out', 'Python... | {
"split": "train",
"index": 80661,
"acecode_id": "oss_5875",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a name in a specific form based on certain parameters. The function `generate_name` takes the following parameters: `affix`, `type`, `suffix` (all strings), and two optional boolean parameters, `is_ablative` and `is_acc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_name('Mr.', 'Smith', 'Jr.') == 'Mr. Smith Jr.'\", \"assert generate_name('Dr.', 'Jones', 'III') == 'Dr. Jones III'\", \"assert generate_name('Ms.', 'Taylor', 'Sr.') == 'Ms. Taylor Sr.'\", \"assert generate_name('Lord', 'Voldemort', 'the Dark Lord') ... | {
"split": "train",
"index": 80662,
"acecode_id": "oss_31757",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates a specific result based on an agent's ID. The function `calculate_agent_result` takes an integer parameter `agent_id`. The function should compute the square of the `agent_id`, add an offset of 10 to the computed value... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_agent_result(0) == 10\", \"assert calculate_agent_result(1) == 11\", \"assert calculate_agent_result(2) == 14\", \"assert calculate_agent_result(3) == 19\", \"assert calculate_agent_result(4) == 26\", \"assert calculate_agent_result(5) == 35\", \"a... | {
"split": "train",
"index": 80663,
"acecode_id": "oss_31",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary containing information about various category options. Each category option is represented as a dictionary with keys 'id', 'code', 'shortName', and 'name'. Write a function that takes this dictionary as input and returns a list of dictionaries, where ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_category_options({'categoryOptions': [{'id': 1, 'code': 'A', 'shortName': 'Alpha', 'name': 'Alpha Category'}, {'id': 2, 'code': 'B', 'shortName': 'Beta', 'name': 'Beta Category'}]}) == [{'co_uid': 1, 'co_code': 'A', 'co_shortname': 'Alpha', 'co_nam... | {
"split": "train",
"index": 80664,
"acecode_id": "bigcode_python_fns_12623",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibonacci_and_gcd(n: int) -> Tuple[int, int]` that calculates the nth Fibonacci number and the greatest common divisor (GCD) between the nth Fibonacci number and the (n+1)th Fibonacci number. The function should validate the input, ensuring that `n` is a p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci_and_gcd(1) == (1, 1)\", \"assert fibonacci_and_gcd(2) == (1, 1)\", \"assert fibonacci_and_gcd(3) == (2, 1)\", \"assert fibonacci_and_gcd(4) == (3, 1)\", \"assert fibonacci_and_gcd(5) == (5, 1)\", \"assert fibonacci_and_gcd(6) == (8, 1)\", \"assert ... | {
"split": "train",
"index": 80665,
"acecode_id": "evol_27343",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement the Python function perfectSquarePairs. This function examines a list of numbers. It checks for pairs of sequential numbers within the list that are the same and tests if the square root of these paired numbers is an integer. If the list contains at least one valid pa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert perfectSquarePairs([4, 4, 1, 9]) == True\", \"assert perfectSquarePairs([1, 1, 2, 2]) == True\", \"assert perfectSquarePairs([5, 5, 6, 7]) == False\", \"assert perfectSquarePairs([8, 8, 8, 2]) == False\", \"assert perfectSquarePairs([0, 0]) == True\", \"asse... | {
"split": "train",
"index": 80666,
"acecode_id": "evol_5220",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given three positive integers: `n`, `index`, and `maxSum`. You want to construct an array `nums` (0-indexed) that satisfies the following conditions: `nums.length == n`, `nums[i]` is a positive integer where `0 <= i < n`, `abs(nums[i] - nums[i+1]) <= 1` for all `0 <= i ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxValue(3, 1, 7) == 3\", \"assert maxValue(7, 3, 20) == 4\", \"assert maxValue(8, 4, 24) == 4\", \"assert maxValue(1, 0, 1) == 1\", \"assert maxValue(8, 1, 23) == 4\", \"assert maxValue(3, 2, 9) == 4\"]}"
} | {
"split": "train",
"index": 80667,
"acecode_id": "evol_32448",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given an array `arr` of non-negative integers, implement a function `subarrayBitwiseORs(arr)` that returns a tuple containing three values: the number of distinct results from the bitwise OR operation on all possible contiguous subarrays of `arr`, the maximum result obtained fr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert subarrayBitwiseORs([0]) == (1, 0, 0)\", \"assert subarrayBitwiseORs([1, 1, 2]) == (3, 3, 1)\", \"assert subarrayBitwiseORs([1, 2, 4]) == (6, 7, 1)\", \"assert subarrayBitwiseORs([0, 0, 0]) == (1, 0, 0)\", \"assert subarrayBitwiseORs([2, 2, 2, 2]) == (1, 2, 2... | {
"split": "train",
"index": 80668,
"acecode_id": "evol_13851",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `compute_mode(data)` that returns the mode of the list. The mode is defined as the value that appears most frequently in the list. If there are multiple modes, return the smallest one. If the list is empty, return None.\nPlease rea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_mode([9, 5, 6, 9, 5, 3, 2, 5]) == 5\", \"assert compute_mode([1, 2, 3, 4, 5]) == 1\", \"assert compute_mode([5, 5, 5, 1, 1, 2]) == 5\", \"assert compute_mode([1, 1, 2, 2, 3, 3]) == 1\", \"assert compute_mode([8, 8, 6, 6, 6, 7]) == 6\", \"assert compu... | {
"split": "train",
"index": 80669,
"acecode_id": "evol_20085",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to calculate the sum of all even numbers in a given list. Implement a function called `sum_of_evens` that takes the following parameter: \n- `numbers`: A list of integers. \n\nThe function should return the sum of all even integers in the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 20, 30]) == 60\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([-2, -4, -6]) == -12\", \"assert sum_of_evens([0, 1, 2, 3]) == 2\", \"assert sum_of_evens([5, 7, 9, 11]) == 0... | {
"split": "train",
"index": 80670,
"acecode_id": "oss_13515",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `is_palindrome_with_vowels` that checks if a given string is a palindrome and contains all five English vowels: a, e, i, o, and u. The function should return True if both conditions are met, otherwise return False. The input string may include upperc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome_with_vowels('racecar') == False\", \"assert is_palindrome_with_vowels('No lemon, no melon') == False\", \"assert is_palindrome_with_vowels('A Toyota\\u2019s a Toyota') == False\", \"assert is_palindrome_with_vowels('12321') == False\", \"assert... | {
"split": "train",
"index": 80671,
"acecode_id": "evol_35995",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of a button click event in a graphical user interface. The function `simulate_button_click(action: str) -> str` should take a string parameter `action`, which can be one of three values: 'A', 'B', or 'C'. Based... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_button_click('B') == 'background color changed to white'\", \"assert simulate_button_click('C') == 'background color changed to light gray'\", \"assert simulate_button_click('D') == 'invalid action'\", \"assert simulate_button_click('B') == 'backgro... | {
"split": "train",
"index": 80672,
"acecode_id": "oss_36463",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a leading digit L and an integer n, define a function p(L, n) that returns the n-th smallest integer j such that the base 10 representation of 2^j starts with the digits of L. For example, p(12, 1) returns 7, and p(12, 2) returns 80. Your task is to implement the function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert p(12, 1) == 7\", \"assert p(12, 2) == 80\", \"assert p(1, 1) == 0\", \"assert p(2, 1) == 1\", \"assert p(4, 1) == 2\"]}"
} | {
"split": "train",
"index": 80673,
"acecode_id": "evol_35051",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `remove_element(data: List[List[List[int]]], position: List[int]) -> Union[List[List[List[int]]], str]` that removes an element from a three-dimensional array at the specified index given by `position`. If the index is out of bounds, the function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_element([[[1,2,3],[4,5,6]],[[7,8,9],[10,11,12]]], [0,1,2]) == [[[1,2,3],[4,5]],[[7,8,9],[10,11,12]]]\", \"assert remove_element([[[1,2,3],[4,5,6]],[[7,8,9],[10,11,12]]], [1,0,0]) == [[[1,2,3],[4,5,6]],[[8,9],[10,11,12]]]\", \"assert remove_element([[[... | {
"split": "train",
"index": 80674,
"acecode_id": "evol_10122",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of non-negative integers representing durations in seconds, write a function `convert_durations_to_time(durations: List[int]) -> List[str]` that converts each duration to a time string in the format 'HH:MM:SS'. The time string should be based on the total number of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_durations_to_time([3661]) == ['01:01:01']\", \"assert convert_durations_to_time([0]) == ['00:00:00']\", \"assert convert_durations_to_time([59]) == ['00:00:59']\", \"assert convert_durations_to_time([60]) == ['00:01:00']\", \"assert convert_durations... | {
"split": "train",
"index": 80675,
"acecode_id": "bigcode_python_fns_6124",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and uses a regular expression to extract all valid URLs from the input text. The function should be able to identify both ftp and http(s) URLs, while discarding any URLs that contain non-ASCII characters. The function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_urls('Check this site: https://example.com and ftp://example.org') == ['https://example.com', 'ftp://example.org']\", \"assert extract_urls('Visit our page at http://www.test-site.com for more information.') == ['http://www.test-site.com']\", \"asser... | {
"split": "train",
"index": 80676,
"acecode_id": "evol_17131",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the root of a binary tree, implement a function `levelOrder` that returns a list of lists, where each inner list contains the values of the nodes at each level of the tree in a level-order traversal. If the tree is empty, return an empty list.\nPlease reason step by step,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert levelOrder(None) == []\", \"assert levelOrder(TreeNode(1)) == [[1]]\", \"assert levelOrder(TreeNode(1, TreeNode(2), TreeNode(3))) == [[1], [2, 3]]\", \"assert levelOrder(TreeNode(1, TreeNode(2, TreeNode(4)), TreeNode(3))) == [[1], [2, 3], [4]]\", \"assert le... | {
"split": "train",
"index": 80677,
"acecode_id": "evol_33156",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with configuring a data processing module that receives input from a specific source and specifies an output file path. Implement a function called `configure_data_pipeline` that takes two parameters: `input_source` (a string representing the input tag for the da... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_data_pipeline('ecalPreshowerDigis', '/path/to/output/file.root') == {'input': 'ecalPreshowerDigis', 'output': '/path/to/output/file.root'}\", \"assert configure_data_pipeline('ecalPreshowerDigis', 'output/file.txt') == None\", \"assert configure_da... | {
"split": "train",
"index": 80678,
"acecode_id": "oss_5643",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of molecules, each represented by a list of tuples where each tuple contains the coordinates (x, y, z) of an atom and its corresponding element symbol, write a function `reconstruct_molecule` that returns a dictionary representation of the smallest molecule. The di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reconstruct_molecule([[ (0.0, 0.0, 0.0, 'H'), (1.0, 0.0, 0.0, 'O') ]]) == {'H': [(0.0, 0.0, 0.0)], 'O': [(1.0, 0.0, 0.0)]}\", \"assert reconstruct_molecule([[ (0.0, 0.0, 0.0, 'C'), (1.0, 1.0, 1.0, 'O') ], [ (2.0, 2.0, 2.0, 'C') ]]) == {'C': [(0.0, 0.0, 0.0),... | {
"split": "train",
"index": 80679,
"acecode_id": "bigcode_python_fns_41705",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple task processing function in Python. Your function should be named `process_task` and should take a single argument, `task_input`, which is a string. The function should print the message 'Processing task: <task_input>' where `<task_input>` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_task('12345') == 'Processing task: 12345'\", \"assert process_task('Hello World') == 'Processing task: Hello World'\", \"assert process_task('Test Case 1') == 'Processing task: Test Case 1'\", \"assert process_task('Python') == 'Processing task: Pyth... | {
"split": "train",
"index": 80680,
"acecode_id": "oss_27037",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of version strings that follow semantic versioning (e.g., '1.0.0', '1.0.1', '2.0.0'). Your task is to write a function `get_latest_version(versions: List[str]) -> str` that returns the latest version from the given list of versions. A version string is cons... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_latest_version(['1.0.0', '1.0.1', '1.0.2']) == '1.0.2'\", \"assert get_latest_version(['2.0.0', '1.0.0', '1.0.1']) == '2.0.0'\", \"assert get_latest_version(['1.2.3', '1.2.4', '1.2.3']) == '1.2.4'\", \"assert get_latest_version(['0.1.0', '0.1.1', '0.0.9'... | {
"split": "train",
"index": 80681,
"acecode_id": "bigcode_python_fns_49026",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_prime(n)` that determines if a given integer n is a prime number. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. The function should return True if n is prime and False othe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"assert is_prime(7) == True\", \"assert is_prime(8) == False\", \"assert is_prime(9) == False\", \"asser... | {
"split": "train",
"index": 80682,
"acecode_id": "evol_27060",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, classify each number into three categories: 'low', 'medium', and 'high'. Numbers in the lower third of the sorted list should be classified as 'low', numbers in the middle third as 'medium', and numbers in the upper third as 'high'. Implement a functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_numbers([1, 2, 3]) == [(1, 'low'), (2, 'medium'), (3, 'high')]\", \"assert classify_numbers([1, 2, 7, 8, 9, 10, 11]) == [(1, 'low'), (2, 'low'), (7, 'medium'), (8, 'medium'), (9, 'high'), (10, 'high'), (11, 'high')]\", \"assert classify_numbers([10,... | {
"split": "train",
"index": 80683,
"acecode_id": "evol_34099",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a lexicon represented as a dictionary where each key is a word and the associated value is a list of its synonyms. Write a function that takes this lexicon as input and returns a dictionary that maps each word to the number of synonyms it has. The output dictionar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_synonyms({'happy':['joyful', 'content', 'pleased'], 'sad':['unhappy', 'miserable', 'sorrowful']}) == {'happy': 3, 'sad': 3}\", \"assert compute_synonyms({'bright':['luminous', 'shining'], 'dark':['dim', 'gloomy', 'shadowy']}) == {'bright': 2, 'dark':... | {
"split": "train",
"index": 80684,
"acecode_id": "evol_4968",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers representing the breadths of rectangles, where the breadth is half of the length, write a function that returns the lengths of these rectangles. The area of each rectangle must be a perfect square value. The function should return a list of lengths co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rectangle_lengths([5, 10, 15]) == []\", \"assert rectangle_lengths([3, 7, 8, 11]) == []\", \"assert rectangle_lengths([11, 13]) == []\", \"assert rectangle_lengths([10, 12, 14]) == []\", \"assert rectangle_lengths([5, 6, 8]) == []\", \"assert rectangle_lengt... | {
"split": "train",
"index": 80685,
"acecode_id": "evol_23034",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing scores obtained by different users in a game. The task is to implement a function `find_top_scorers(scores: List[int], threshold: int) -> List[int]` that returns a list of user indices (0-based) of those users whose scores are great... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_top_scorers([100, 200, 150, 80], 150) == [1, 2]\", \"assert find_top_scorers([50, 60, 70, 80], 90) == []\", \"assert find_top_scorers([10, 20, 30, 40, 50, 60], 25) == [2, 3, 4, 5]\", \"assert find_top_scorers([5, 15, 25, 35], 15) == [1, 2, 3]\", \"asser... | {
"split": "train",
"index": 80686,
"acecode_id": "bigcode_python_fns_28174",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a user's login credentials. Given a dictionary of valid usernames and passwords, write a function `validate_login(credentials: Dict[str, str], username: str, password: str) -> bool` that checks if the provided username and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_login({'user1': 'pass1', 'user2': 'pass2'}, 'user1', 'pass1') == True\", \"assert validate_login({'user1': 'pass1', 'user2': 'pass2'}, 'user2', 'pass2') == True\", \"assert validate_login({'user1': 'pass1', 'user2': 'pass2'}, 'user1', 'wrongpass') =... | {
"split": "train",
"index": 80687,
"acecode_id": "bigcode_python_fns_20838",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates email addresses based on specific criteria. Your function should ensure that the email addresses adhere to the following constraints: \n1. The email address should be in a valid email format. \n2. The email address c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_email_field('john.doe@example.com') == True\", \"assert validate_email_field('') == True\", \"assert validate_email_field(None) == False\", \"assert validate_email_field('invalid_email') == False\", \"assert validate_email_field('test@domain.com') =... | {
"split": "train",
"index": 80688,
"acecode_id": "oss_4706",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that verifies if a given public key and private key pair is valid based on their matching criteria. The function should take a dictionary with two keys: 'certificate' and 'private_key'. The value of 'certificate' is a string representing ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_key_pair({'certificate': 'abc', 'private_key': 'abcdef'}) == 'ok'\", \"assert verify_key_pair({'certificate': 'def', 'private_key': 'abcdef'}) == 'ok'\", \"assert verify_key_pair({'certificate': '123', 'private_key': '123456'}) == 'ok'\", \"assert ver... | {
"split": "train",
"index": 80689,
"acecode_id": "bigcode_python_fns_32165",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `calculate_operations(attribute1: int, attribute2: int, attribute3: int) -> Tuple[int, int]` that takes three integers as input and returns a tuple containing the sum of the first two integers and the product of all three integers. The first element of the tupl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_operations(1, 2, 3) == (3, 6)\", \"assert calculate_operations(0, 0, 0) == (0, 0)\", \"assert calculate_operations(-1, -2, -3) == (-3, -6)\", \"assert calculate_operations(5, 10, 2) == (15, 100)\", \"assert calculate_operations(-4, 4, 4) == (0, -64... | {
"split": "train",
"index": 80690,
"acecode_id": "evol_1556",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array `nums` consisting of `n` positive integers. You can perform two operations on any element within the array: if the element is even, you can divide it by `2`, and if the element is odd, you can multiply it by `2`. The deviation of the array is defined as t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minimumDeviation([1,2,3,4]) == 1\", \"assert minimumDeviation([4,1,5,20,3]) == 3\", \"assert minimumDeviation([2,10,8]) == 3\", \"assert minimumDeviation([5,10,15]) == 5\", \"assert minimumDeviation([1,1,1]) == 0\", \"assert minimumDeviation([7,14,21]) == 7\... | {
"split": "train",
"index": 80691,
"acecode_id": "evol_2161",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs a linear search on a given list of integers and returns the index of the target value if found, or -1 if the target is not in the list. The function should be defined as follows: def linear_search(arr: List[int], target: int) -> int.\nPlease r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert linear_search([10, 20, 80, 30, 60], 80) == 2\", \"assert linear_search([10, 20, 80, 30, 60], 10) == 0\", \"assert linear_search([10, 20, 80, 30, 60], 60) == 4\", \"assert linear_search([10, 20, 80, 30, 60], 30) == 3\", \"assert linear_search([10, 20, 80, 30,... | {
"split": "train",
"index": 80692,
"acecode_id": "evol_16248",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the indexes of markers on a vertical axis, and two integers representing the top and bottom padding values, implement a function that filters out and returns a new list containing only the marker indexes that fall between the top and bottom... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_markers([1, 2, 3, 4, 5], 2, 5) == [3, 4]\", \"assert filter_markers([-3, -2, -1, 0, 1, 2], -2, 1) == [-1, 0]\", \"assert filter_markers([10, 20, 30, 40, 50], 15, 35) == [20, 30]\", \"assert filter_markers([5, 5, 5, 5, 6], 4, 7) == [5, 6]\", \"assert f... | {
"split": "train",
"index": 80693,
"acecode_id": "bigcode_python_fns_6717",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that computes the area and type of a rectangle (either 'Square' or 'Rectangle'), as well as the length of its diagonals and the angle between the diagonals. The function should validate if the provided lengths of the sides can form a valid rectangle. If the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rectangle_properties(4, 4, 4, 4, 5.66) == (16.00, 'Square', 5.66, 90)\", \"assert rectangle_properties(3, 6, 3, 6, 6.71) == (18.00, 'Rectangle', 6.71, 90)\", \"assert rectangle_properties(2, 2, 2, 2, 2.83) == (4.00, 'Square', 2.83, 90)\", \"assert rectangle_... | {
"split": "train",
"index": 80694,
"acecode_id": "evol_12067",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a command-line parser for creating Azure NetApp Files (ANF) accounts. The parser should handle command-line input arguments for the account name, tags, and active directories. Your task is to implement a function that parses the command-line input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parseANFCreateCommand(['--account-name', 'myanfaccount', '--tags', 'environment=dev', '--active-directories', 'ad1', 'ad2', 'ad3']) == {'account-name': 'myanfaccount', 'tags': ['environment=dev'], 'active-directories': ['ad1', 'ad2', 'ad3']}\", \"assert pars... | {
"split": "train",
"index": 80695,
"acecode_id": "oss_8189",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a nested member expression, represented as a tree structure, return its qualified name representation in the form 'foo.bar', 'foo.bar.baz', or similar. If the expression cannot be represented in this form, return None. You are given a structure where 'NameExpr' contains a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_member_expr_fullname(NameExpr('foo')) == 'foo'\", \"assert get_member_expr_fullname(MemberExpr(NameExpr('foo'), 'bar')) == 'foo.bar'\", \"assert get_member_expr_fullname(MemberExpr(MemberExpr(NameExpr('foo'), 'bar'), 'baz')) == 'foo.bar.baz'\", \"assert ... | {
"split": "train",
"index": 80696,
"acecode_id": "bigcode_python_fns_17722",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a basket size and a list of fruit ratios. Each basket must contain fruits in the specified ratios. Your task is to implement a function that calculates how many kilograms of each type of fruit are needed for the given basket size based on the provided ratios. If t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fruits_in_basket(75, [6, 4, 5]) == [30.0, 20.0, 25.0]\", \"assert fruits_in_basket(30, [1, 1, 1]) == [10.0, 10.0, 10.0]\", \"assert fruits_in_basket(12, [3, 2, 1]) == [6.0, 4.0, 2.0]\", \"assert fruits_in_basket(18, [1, 1, 1]) == [6.0, 6.0, 6.0]\", \"assert ... | {
"split": "train",
"index": 80697,
"acecode_id": "evol_20506",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining if two cells in a lattice structure are neighbors based on a specified distance metric. The lattice is represented as a grid of cells with given rows and columns. Your function should receive the following parameters: the number of rows (n_rows),... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_neighbors(3, 3, 'manhattan', 0, 0, 0, 1) == True\", \"assert are_neighbors(3, 3, 'manhattan', 0, 0, 1, 0) == True\", \"assert are_neighbors(3, 3, 'manhattan', 0, 0, 1, 1) == False\", \"assert are_neighbors(3, 3, 'euclidean', 0, 0, 0, 1) == True\", \"asse... | {
"split": "train",
"index": 80698,
"acecode_id": "oss_24958",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that retrieves the version of a specified software package and stores the result in a given list. Implement the `get_package_version` function, which takes two parameters: `package_name` (string): the name of the package to look up... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_package_version('numpy', []) == [('numpy', '1.21.0')]\", \"assert get_package_version('pandas', []) == [('pandas', '1.3.0')]\", \"assert get_package_version('nonexistent_package', []) == [('nonexistent_package', 'Not found')]\", \"assert get_package_vers... | {
"split": "train",
"index": 80699,
"acecode_id": "oss_20661",
"num_tests": 5
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.