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 an integer n, and you need to generate a dataset consisting of n samples and 4 features. Each feature is a floating-point number generated randomly between 0 and 1. The output should be a list of dictionaries where each dictionary represents a single sample with k...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_data(5)) == 5\", \"assert len(generate_data(10)) == 10\", \"assert all(0 <= sample['x1'] <= 1 for sample in generate_data(100))\", \"assert all(0 <= sample['x2'] <= 1 for sample in generate_data(100))\", \"assert all(0 <= sample['x3'] <= 1 for s...
{ "split": "train", "index": 77600, "acecode_id": "bigcode_python_fns_26065", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of consecutive mountains. Your task is to implement a function that determines the maximum height difference between any two mountains, where the first mountain is to the left of the second mountain. The function should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_height_difference([1, 3, 5, 2, 9, 7]) == 8\", \"assert max_height_difference([5, 3, 2, 1]) == 0\", \"assert max_height_difference([1, 2]) == 1\", \"assert max_height_difference([2, 1]) == 0\", \"assert max_height_difference([7, 1, 5, 3, 6, 4]) == 5\", \"...
{ "split": "train", "index": 77601, "acecode_id": "bigcode_python_fns_48724", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer 'n', implement a function that returns a list containing the Fibonacci sequence up to the 'n'-th term (inclusive). The Fibonacci sequence is defined as follows: the first two terms are 0 and 1, and each subsequent term is the sum of the two preceding on...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci_sequence(0) == [0]\", \"assert fibonacci_sequence(1) == [0, 1]\", \"assert fibonacci_sequence(2) == [0, 1, 1]\", \"assert fibonacci_sequence(3) == [0, 1, 1, 2]\", \"assert fibonacci_sequence(4) == [0, 1, 1, 2, 3]\", \"assert fibonacci_sequence(5) =...
{ "split": "train", "index": 77602, "acecode_id": "evol_9871", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a Python function that identifies the appropriate leftmost insertion point for a specific value in a sorted list, ensuring that the overall order remains sorted. The function should be capable of handling various data types including integers, floats, strings, tuples, a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_insertion_point([1, 3, 5, 7], 4) == 2\", \"assert find_insertion_point([3, 2, 1], 4) == 0\", \"assert find_insertion_point([1.1, 2.2, 3.3], 2.5) == 2\", \"assert find_insertion_point(['x', 'y', 'z'], 'a') == 0\", \"assert find_insertion_point([], 'test'...
{ "split": "train", "index": 77603, "acecode_id": "evol_31666", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of a game. Write a function `calculate_average_score(scores: List[int]) -> float` that takes in a list of integers `scores` and returns the average score, rounded to two decimal places, after excluding the highest and low...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_score([1, 2, 3, 4, 5]) == 3.00\", \"assert calculate_average_score([10, 10, 10, 10]) == 10.00\", \"assert calculate_average_score([5, 5, 5, 5, 5]) == 5.00\", \"assert calculate_average_score([-1, -2, -3, -4, -5]) == -3.00\", \"assert calcul...
{ "split": "train", "index": 77604, "acecode_id": "oss_23782", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that sets a group selector based on the provided input parameters. The function should take two arguments: a group identifier (group_id) which is an integer representing the ID of the group, and a selector value (selector) which is also a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_group_selector(1, 2) == 3\", \"assert set_group_selector(10, 20) == 30\", \"assert set_group_selector(0, 0) == 0\", \"assert set_group_selector(-1, -1) == -2\", \"assert set_group_selector(100, 200) == 300\", \"assert set_group_selector(-50, 50) == 0\", ...
{ "split": "train", "index": 77605, "acecode_id": "bigcode_python_fns_1585", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that receives a nested dictionary where the keys are categories (like 'students', 'teachers') and the values are dictionaries that map names to their occurrence frequencies. The function should return the category and the name with the lowest frequency. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lowest_frequency({'students': {'Jon': 3, 'Arya': 1, 'Tyrion': 1, 'Cersei': 1}, 'teachers': {'Sam': 4, 'Ellen': 1, 'George': 3}}) == ('teachers', 'Ellen')\", \"assert lowest_frequency({'students': {'Alice': 2, 'Bob': 1}, 'teachers': {'Charlie': 1}}) == ('teac...
{ "split": "train", "index": 77606, "acecode_id": "evol_12851", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns a list of all the prime numbers found in that list. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Your function should take a list of int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_primes([2, 3, 4, 5, 6, 7, 8, 9, 10]) == [2, 3, 5, 7]\", \"assert extract_primes([11, 12, 13, 14, 15]) == [11, 13]\", \"assert extract_primes([1, 4, 6, 8]) == []\", \"assert extract_primes([17, 18, 19, 20]) == [17, 19]\", \"assert extract_primes([23, ...
{ "split": "train", "index": 77607, "acecode_id": "evol_11081", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary where each key is a feature name and the corresponding value is a list of tuples, with each tuple containing a bin label and its associated NWOE value, implement a function that calculates the average NWOE for each feature and returns a new dictionary with th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_nwoe({'feature1': [('bin1', 10), ('bin2', 20)], 'feature2': [('bin1', 30), ('bin2', 40)]}) == {'feature1': 15.0, 'feature2': 35.0}\", \"assert average_nwoe({'featureA': [('bin1', 5)], 'featureB': [('bin1', 15), ('bin2', 25)]}) == {'featureA': 5.0, 'f...
{ "split": "train", "index": 77608, "acecode_id": "bigcode_python_fns_37659", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a custom menu based on a list of items provided. The function should take a list of strings as input, where each string represents a menu item. The function should return a formatted string that represents the custom menu, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_custom_menu(['Salad', 'Pizza', 'Pasta']) == '* Salad\\\\n* Pizza\\\\n* Pasta'\", \"assert generate_custom_menu(['Apple', 'Banana', 'Cherry']) == '* Apple\\\\n* Banana\\\\n* Cherry'\", \"assert generate_custom_menu(['Coffee', 'Tea']) == '* Coffee\\\\...
{ "split": "train", "index": 77609, "acecode_id": "bigcode_python_fns_16001", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of images categorized by their class names in a dataset. Your task is to split the images into two subsets based on the specified sizes: one for training and one for validation. You need to implement a function `split_images` that takes the following parame...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_images({'class1': ['img1.jpg', 'img2.jpg', 'img3.jpg'], 'class2': ['img4.jpg']}, [0.6, 0.4], False) == {'train': {'class1': ['img1.jpg', 'img2.jpg'], 'class2': ['img4.jpg']}, 'val': {'class1': ['img3.jpg'], 'class2': []}}\", \"assert split_images({'cla...
{ "split": "train", "index": 77610, "acecode_id": "bigcode_python_fns_41287", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Create a function that takes a list of phrases describing a person's character and returns a dictionary where each phrase is a key, and its length is the value. Ensure that your implementation uses at least five different programming concepts such as loops, conditionals, and st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert character_length(['Generous', 'Punctual', 'Reliable']) == {'Generous': 8, 'Punctual': 8, 'Reliable': 8}\", \"assert character_length(['Sincere']) == {'Sincere': 7}\", \"assert character_length(['Bold', 'Innovative']) == {'Bold': 4, 'Innovative': 10}\", \"ass...
{ "split": "train", "index": 77611, "acecode_id": "evol_25601", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `setup_kde_options` that configures options for kernel density estimation based on given parameters. The function should take the following parameters: `fxyz` (a boolean indicating if a file is provided), `design_matrix` (a list of li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert setup_kde_options(False, [[1, 2], [3, 4]], True, False, None, 'output.xyz', 'output.txt') == {'prefix': 'ASAP-kde', 'savexyz': 'output.xyz', 'savetxt': 'output.txt', 'use_atomic_descriptors': True, 'only_use_species': False}\", \"assert setup_kde_options(Tru...
{ "split": "train", "index": 77612, "acecode_id": "bigcode_python_fns_19411", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a journey for a car based on a list of driving instructions. Each instruction contains the driver name and the number of miles driven. The function should take the initial mileage, a list of valid drivers, and the driving i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_journey(100.0, ['Alice', 'Bob'], [{'driver': 'Alice', 'miles': 10.0}, {'driver': 'Bob', 'miles': 20.5}]) == ['Mileage after Alice: 110.0', 'Mileage after Bob: 130.5']\", \"assert simulate_journey(0.0, ['John', 'Doe'], [{'driver': 'John', 'miles': 15...
{ "split": "train", "index": 77613, "acecode_id": "evol_25193", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of floats representing latitude and longitude: `lat` and `lon`, your task is to create a transformation that applies an affine transformation based on the first two elements of each list. The transformation consists of a translation followed by a scaling operati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_from_latlon([0.0, 1.0], [0.0, 1.0]) == (0.0, 0.0, 1.0, 1.0)\", \"assert transform_from_latlon([10.0, 20.0], [30.0, 40.0]) == (30.0, 10.0, 10.0, 10.0)\", \"assert transform_from_latlon([-10.0, -20.0], [30.0, 40.0]) == (30.0, -10.0, 10.0, -10.0)\", \...
{ "split": "train", "index": 77614, "acecode_id": "bigcode_python_fns_23216", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of lemma and short definition pairs. The function should take a list of strings where each string contains a lemma and its corresponding short definition, separated by a tab character. Your task is to implemen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_lemma_definitions(['lemma3\\tdefinition3']) == ['created lattice_node lemma3 definition3', 'created lemma_node']\", \"assert process_lemma_definitions(['lemma4\\t']) == ['created lattice_node lemma4 unglossed', 'created lemma_node']\", \"assert proce...
{ "split": "train", "index": 77615, "acecode_id": "oss_27068", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of stock prices for a specific stock over a period of time, represented as a list of dictionaries. Each dictionary contains the date and the corresponding stock price. Your task is to implement a function `normalize_stock_prices(prices: List[Dict[str, float...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_stock_prices([], 'minmax') == []\", \"assert normalize_stock_prices([], 'zscore') == []\", \"assert normalize_stock_prices([{'date': '2023-01-01', 'price': 100}, {'date': '2023-01-02', 'price': 200}], 'minmax') == [{'date': '2023-01-01', 'price': 0...
{ "split": "train", "index": 77616, "acecode_id": "bigcode_python_fns_48707", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of device names that represent the available temperature sensors in a folder. Each device name starts with '28-' followed by a unique identifier. Write a function that takes a list of device names as input and returns the first device name that starts with ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert guess_temperature_sensor(['28-123', '28-456', '28-789']) == '28-123'\", \"assert guess_temperature_sensor(['29-000', '29-001', '29-002']) == 'No temperature sensors found'\", \"assert guess_temperature_sensor(['28-abc', '28-def', '28-ghi']) == '28-abc'\", \"...
{ "split": "train", "index": 77617, "acecode_id": "bigcode_python_fns_6111", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function `get_black_pixel()` that returns a dictionary representing a black pixel in RGB format. The RGB values for black are (0, 0, 0). Your function should return a dictionary with keys 'R', 'G', and 'B', corresponding to the red, green, and blue compo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_black_pixel() == {'R': 0, 'G': 0, 'B': 0}\", \"assert get_black_pixel() == {'R': 0, 'G': 0, 'B': 0}\", \"assert get_black_pixel() == {'R': 0, 'G': 0, 'B': 0}\", \"assert get_black_pixel() == {'R': 0, 'G': 0, 'B': 0}\", \"assert get_black_pixel() == {'R':...
{ "split": "train", "index": 77618, "acecode_id": "bigcode_python_fns_1854", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to validate product labels for an inventory management system. The function should check if a given product label meets the following criteria: it must be a string with a maximum length of 10 characters. The label can be empty or None...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_label(None) == True\", \"assert is_valid_label('') == True\", \"assert is_valid_label('valid') == True\", \"assert is_valid_label('1234567890') == True\", \"assert is_valid_label('short') == True\", \"assert is_valid_label('') == True\", \"assert is...
{ "split": "train", "index": 77619, "acecode_id": "oss_33181", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an encoded string, return its decoded string based on the encoding rule: `k[encoded_string]`, where `encoded_string` inside the square brackets is repeated exactly `k` times. The encoded string can contain nested encoded strings up to 3 levels deep. You may assume that th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decode_string('3[a]2[bc]') == 'aaabcbc'\", \"assert decode_string('3[a2[c]]') == 'accaccacc'\", \"assert decode_string('2[abc]3[cd]ef') == 'abcabccdcdcdef'\", \"assert decode_string('abc3[cd]xyz') == 'abccdcdcdxyz'\", \"assert decode_string('10[a]') == 'aaaa...
{ "split": "train", "index": 77620, "acecode_id": "evol_22205", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to parse commit messages and extract specific information from them. The commit messages follow a specific format and contain various details such as author name, email, service name, tag, and environment. Your task is to write a func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_commit_message('Author: Jane Smith <jane.smith@example.com>\\\\nService: my-service\\\\nTag: abcdef1234\\\\nEnvironment: production') == {'author_name': 'Jane Smith', 'author_email': 'jane.smith@example.com', 'service_name': 'my-service', 'tag': 'abcde...
{ "split": "train", "index": 77621, "acecode_id": "oss_1418", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a boolean value `operand`, write a function `logic_not(operand: bool) -> bool` that returns the logical negation of the operand. The output should be `True` if the input is `False`, and `False` if the input is `True`.\nPlease reason step by step, then write a self-contain...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert logic_not(True) == False\", \"assert logic_not(False) == True\", \"assert logic_not(True) == False\", \"assert logic_not(False) == True\", \"assert logic_not(True) == False\", \"assert logic_not(False) == True\", \"assert logic_not(True) == False\", \"assert...
{ "split": "train", "index": 77622, "acecode_id": "bigcode_python_fns_361", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `below_zero(operations: List[Union[Tuple[int, str], int]], case_insensitive: bool = False) -> bool` that analyzes a list of operations on a bank account starting with a balance of zero. The list can include integers, strings representing integers, or tuples...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert below_zero([(2, '3'), 5]) == False\", \"assert below_zero([(2, '5'), 3]) == False\", \"assert below_zero([1, (4, '1'), -6]) == True\", \"assert below_zero([1, 2, (3, '2'), -10]) == True\", \"assert below_zero([(3, '2'), 1, -8]) == True\", \"assert below_zero...
{ "split": "train", "index": 77623, "acecode_id": "evol_11142", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to validate and categorize abuse reports on a social media platform. The function should take a list of abuse report dictionaries and return a list of categorized abuse types based on given criteria. Each report dictionary will contain th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_abuse_reports([{'abuse_type': 'Abuse', 'description': 'Hate speech', 'date': '2023-01-01T12:00:00Z', 'to_vit': 'post1', 'user': 'user1'}]) == ['Abuse']\", \"assert categorize_abuse_reports([{'abuse_type': 'Inappropriate', 'description': 'Nudity', ...
{ "split": "train", "index": 77624, "acecode_id": "oss_14386", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given an array of integers, write a function `last_true_index(arr: List[int], convert: bool = True, check: bool = True) -> Optional[int]` that returns the index of the last positive integer in the array. If `convert` is set to True, treat all non-positive integers as false and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert last_true_index([0, -1, -2, 3, 4, 5]) == 5\", \"assert last_true_index([-1, -2, -3, -4]) == None\", \"assert last_true_index([1, 2, 3, 0, 0, 0]) == 2\", \"assert last_true_index([0, 0, 0, 0]) == None\", \"assert last_true_index([1, 2, 3, 4, 5]) == 4\", \"ass...
{ "split": "train", "index": 77625, "acecode_id": "bigcode_python_fns_45684", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the training configurations for a machine learning model. Your task is to create a function that shuffles the list of integers and returns the shuffled list. The function should not modify the original list. Write a function `shuffl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shuffle_configs([1, 2, 3, 4, 5]) != [1, 2, 3, 4, 5]\", \"assert len(shuffle_configs([10, 20, 30, 40, 50])) == 5\", \"assert set(shuffle_configs([1, 2, 3, 4, 5])) == {1, 2, 3, 4, 5}\", \"assert shuffle_configs([1]) == [1]\", \"assert shuffle_configs([]) == []...
{ "split": "train", "index": 77626, "acecode_id": "bigcode_python_fns_30185", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing an HXL attribute, convert it to BCP47 format. The input string will contain components separated by '+' with specific patterns: the main language code followed by optional modifiers. The primary modifications to be applied are: 1) Replace '+i_' with ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_hxl_to_bcp47('es+is_example') == 'es-Example'\", \"assert convert_hxl_to_bcp47('ar+is_\\u0645\\u062b\\u0627\\u0644') == 'ar-\\u0645\\u062b\\u0627\\u0644'\", \"assert convert_hxl_to_bcp47('hi+ix_\\u0935\\u093f\\u0936\\u0947\\u0937') == 'hi-x-\\u0935\\...
{ "split": "train", "index": 77627, "acecode_id": "bigcode_python_fns_1467", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes user settings to generate a populated template path. Given user settings containing a template directory and a user-defined output directory, your function should take a template name as input and return the path where the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_template_path(Settings('app/templates', 'user/populated'), 'template1.txt') == 'user/populated/template1.txt'\", \"assert generate_template_path(Settings('app/templates', 'user/populated'), 'template2.html') == 'user/populated/template2.html'\", \"a...
{ "split": "train", "index": 77628, "acecode_id": "oss_9015", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_count_in_range(text: str, a: int = 5, b: int = 15) -> bool` that determines if the number of characters in the given text string `text` falls within the inclusive range defined by the lower threshold `a` and upper threshold `b`. The function should retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_count_in_range('Hello', 5, 15) == True\", \"assert is_count_in_range('Hello, World!', 5, 15) == True\", \"assert is_count_in_range('', 5, 15) == False\", \"assert is_count_in_range('Hi', 5, 15) == False\", \"assert is_count_in_range('This is a test string...
{ "split": "train", "index": 77629, "acecode_id": "evol_1348", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a command for managing storage volumes. Write a function `start_volume_rebalance(volume: str) -> str` that takes in a single parameter `volume`, which is a string representing the name of a storage volume. The function should return a string that re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert start_volume_rebalance('my_volume') == 'volume rebalance my_volume start'\", \"assert start_volume_rebalance('data_storage') == 'volume rebalance data_storage start'\", \"assert start_volume_rebalance('backup_volume_1') == 'volume rebalance backup_volume_1 s...
{ "split": "train", "index": 77630, "acecode_id": "bigcode_python_fns_44255", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given the head of a singly linked list and the root of a binary tree, determine if the linked list is represented as a path in the binary tree. A path in the binary tree is defined as any sequence of nodes starting from the root and moving downward to any leaf node, where each ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert isSubPath(ListNode(1), TreeNode(1)) == True\", \"assert isSubPath(ListNode(1, ListNode(2)), TreeNode(1, TreeNode(2))) == True\", \"assert isSubPath(ListNode(1, ListNode(2)), TreeNode(1, TreeNode(3))) == False\", \"assert isSubPath(ListNode(1, ListNode(2, Lis...
{ "split": "train", "index": 77631, "acecode_id": "evol_6811", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that represents an XML element and a dictionary of attributes with their corresponding values. Your task is to write a function `update_xml_element(xml_string: str, attributes: dict) -> str` that updates the attributes of the XML element with the values p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_xml_element('<element></element>', {'attr1': 'value1'}) == '<element attr1=\\\"value1\\\"></element>'\", \"assert update_xml_element('<element attr1=\\\"value1\\\"></element>', {'attr1': 'new_value1'}) == '<element attr1=\\\"new_value1\\\"></element>'...
{ "split": "train", "index": 77632, "acecode_id": "bigcode_python_fns_12486", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function that determines the maximal total value that can be acquired from traversing exactly k cells of an N x N grid - N being at least 2. Each move can only be up, down, left, or right, without crossing the outlines of the grid. The cells of the grid hold unique nu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert optimizedTraversal([[1, 2], [3, 4]], 2) == [4, 3]\", \"assert optimizedTraversal([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 2) == [9, 8]\", \"assert optimizedTraversal([[1, 3], [2, 4]], 2) == [4, 3]\", \"assert optimizedTraversal([[5, 1], [2, 3]], 1) == [5]\", \"ass...
{ "split": "train", "index": 77633, "acecode_id": "evol_8810", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `greeting(name: str, role: str) -> str` that takes two string parameters, `name` and `role`, and returns a greeting message in the format: \"Hello, my name is {name} and I am a {role}.\" If either `name` or `role` is not a string or is an empty string, rais...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert greeting('Alice', 'Manager') == 'Hello, my name is Alice and I am a Manager.'\", \"assert greeting('Bob', 'Developer') == 'Hello, my name is Bob and I am a Developer.'\", \"assert greeting('Charlie', 'Designer') == 'Hello, my name is Charlie and I am a Desig...
{ "split": "train", "index": 77634, "acecode_id": "evol_23904", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple in-memory database for a library system. The library can hold a list of books, where each book is represented by a dictionary containing the title, author, and publication year. Your function should accept a li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_books([{'title': 'Book A', 'author': 'Author A', 'year': 1999}, {'title': 'Book B', 'author': 'Author B', 'year': 2001}]) == [{'title': 'Book B', 'author': 'Author B', 'year': 2001}]\", \"assert filter_books([{'title': 'Book C', 'author': 'Author C', ...
{ "split": "train", "index": 77635, "acecode_id": "bigcode_python_fns_19774", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the sum of all prime numbers within a given range. A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. Given two integers, `start` and `end`, your function should retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_primes(10, 20) == 60\", \"assert sum_of_primes(1, 10) == 17\", \"assert sum_of_primes(0, 0) == 0\", \"assert sum_of_primes(5, 5) == 5\", \"assert sum_of_primes(14, 16) == 0\", \"assert sum_of_primes(2, 10) == 17\", \"assert sum_of_primes(15, 15) == 0\...
{ "split": "train", "index": 77636, "acecode_id": "oss_34425", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a function that converts a given angle from gradians to degrees. The function should take a single parameter, gradians, which is a float representing the angle in gradians, and return the corresponding angle in degrees as a float. The conversion formula is: degrees = grad...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert gradians_to_degrees(0) == 0.0\", \"assert gradians_to_degrees(100) == 90.0\", \"assert gradians_to_degrees(200) == 180.0\", \"assert gradians_to_degrees(400) == 360.0\", \"assert gradians_to_degrees(50) == 45.0\", \"assert gradians_to_degrees(1) == 0.9\", \"...
{ "split": "train", "index": 77637, "acecode_id": "evol_1058", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a dictionary as input and converts it into a JSON-formatted string. Your function should ensure that the keys of the dictionary are sorted in alphabetical order and that the output string is properly indented with 2 spaces ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dict_to_json({'b': 1, 'a': 2}) == '{\\\\n \\\"a\\\": 2,\\\\n \\\"b\\\": 1\\\\n}'\", \"assert dict_to_json({'key1': 'value1', 'key2': 'value2'}) == '{\\\\n \\\"key1\\\": \\\"value1\\\",\\\\n \\\"key2\\\": \\\"value2\\\"\\\\n}'\", \"assert dict_to_json({'n...
{ "split": "train", "index": 77638, "acecode_id": "bigcode_python_fns_45126", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that accepts a user's details and returns a dictionary containing their username, a menu generated for the user, and a page title. The function should take in two parameters: `user_details`, which is a dictionary containing the user's inf...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_user_profile({'username': 'john_doe'}, lambda user: ['Home', 'Profile', 'Settings']) == {'user_name': 'john_doe', 'menu': ['Home', 'Profile', 'Settings'], 'page_title': 'Profile'}\", \"assert generate_user_profile({'username': 'alice'}, lambda user:...
{ "split": "train", "index": 77639, "acecode_id": "bigcode_python_fns_46784", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates an incremental learning process for a machine learning model. The function should take two arguments: a list of tuples where each tuple contains an input feature and its corresponding output value, and a list of previou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_learning_rates([(1, 2), (2, 3), (3, 4)], [0.95]) == [0.001, 0.001, 0.001]\", \"assert calculate_learning_rates([(1, 2), (2, 3), (3, 4)], [0.75]) == [0.01, 0.01, 0.01]\", \"assert calculate_learning_rates([(1, 2), (2, 3), (3, 4)], [0.65]) == [0.1, 0...
{ "split": "train", "index": 77640, "acecode_id": "evol_3283", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of file names and their corresponding attributes, including size and last modified date. Write a function `filter_files(files: List[Tuple[str, int, str]], size_threshold: int, last_modified_date: str) -> List[str]` that returns a list of file names that are...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_files([('fileA.txt', 50, '2023-02-01'), ('fileB.txt', 150, '2023-02-05'), ('fileC.txt', 200, '2023-01-20')], 100, '2023-01-01') == ['fileB.txt', 'fileC.txt']\", \"assert filter_files([('doc.txt', 300, '2023-03-01'), ('image.png', 250, '2023-03-05'), (...
{ "split": "train", "index": 77641, "acecode_id": "bigcode_python_fns_1458", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers and returns a new list containing the same integers sorted in ascending order. You must implement your sorting algorithm without using any built-in sort functions.\nPlease reason step by step, then write a self-contained Python...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_list([5, 3, 8, 1, 2]) == [1, 2, 3, 5, 8]\", \"assert sort_list([10, 7, 8, 9, 1, 5]) == [1, 5, 7, 8, 9, 10]\", \"assert sort_list([-1, 0, 3, 10]) == [-1, 0, 3, 10]\", \"assert sort_list([]) == []\", \"assert sort_list([2, 1]) == [1, 2]\", \"assert sort_l...
{ "split": "train", "index": 77642, "acecode_id": "evol_36000", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `check_congruity(string1: str, string2: str) -> bool` that evaluates whether both input strings consist only of lowercase alphabetical characters. The function should return True if both strings match the criteria of containing only lowercase letters (a-z) and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_congruity('example', 'test') == True\", \"assert check_congruity('Hello', 'world') == False\", \"assert check_congruity('abc', 'def') == True\", \"assert check_congruity('123', 'abc') == False\", \"assert check_congruity('hello', 'WORLD') == False\", \...
{ "split": "train", "index": 77643, "acecode_id": "evol_2885", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to manage a sequence of images for an explosion animation in a game. The function should be called `manage_explosion_animation`. This function takes two parameters: a list of image file names and an integer representing the frame rate for...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_explosion_animation(['explosion0.png', 'explosion1.png', 'explosion2.png', 'explosion3.png', 'explosion4.png', 'explosion5.png', 'explosion6.png', 'explosion7.png', 'explosion8.png'], 100) == ['explosion0_scaled.png', 'explosion1_scaled.png', 'explosi...
{ "split": "train", "index": 77644, "acecode_id": "oss_22610", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of model checkpoint file names in a directory. Each checkpoint file is represented as a string. Your task is to implement a function `validate_checkpoints(checkpoint_files: List[str]) -> List[str]` that returns a list of file names that are valid checkpoint...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_checkpoints(['model1.pth', 'model2.pt', 'model3.txt', 'model1.pth', 'model4.pt']) == ['model1.pth', 'model2.pt', 'model4.pt']\", \"assert validate_checkpoints(['checkpoint1.pth', 'checkpoint2.pth', 'checkpoint3.pth']) == ['checkpoint1.pth', 'checkpo...
{ "split": "train", "index": 77645, "acecode_id": "bigcode_python_fns_25221", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of URIs and performs certain actions based on their presence in different lists. The function should skip URIs that are present in a list of completed URIs and ignore URIs that are present in a list of ignored...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_uris(['uri1', 'uri2'], ['uri3'], ['uri1', 'uri2', 'uri3', 'uri4']) == ['uri4']\", \"assert process_uris([], [], ['uri1', 'uri2', 'uri3']) == ['uri1', 'uri2', 'uri3']\", \"assert process_uris(['uri1'], ['uri2'], ['uri1', 'uri2', 'uri3']) == ['uri3']\"...
{ "split": "train", "index": 77646, "acecode_id": "oss_27437", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that generates a random string consisting of alphanumeric and special characters. The generated string must satisfy the following constraints: \n- The length of the generated string must be between 10 and 15 characters inclusive. \n- Include at least 2 uppe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_random_string()) in range(10, 16)\", \"assert sum(1 for c in generate_random_string() if c.isupper()) >= 2\", \"assert sum(1 for c in generate_random_string() if c.islower()) >= 2\", \"assert sum(1 for c in generate_random_string() if c.isdigit(...
{ "split": "train", "index": 77647, "acecode_id": "evol_6298", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a data dictionary for an image and its associated sentence. The function should take in four parameters: a source string representing the dataset of the sentence, an image ID string, a sentence ID integer, and the sentence ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_data('dataset1', 'img001', 1, 'This is a test sentence.') == {'uid': 'img001-dataset1-1', 'img_id': 'img001', 'img_path': 'dataset1/img001.jpg', 'sent': 'This is a test sentence.'}\", \"assert create_data('dataset2', 'img002', 2, 'Another example sent...
{ "split": "train", "index": 77648, "acecode_id": "bigcode_python_fns_13092", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dataset represented as a dictionary that contains user permissions for different databases. Each database can have multiple user roles, and each role has a certain level of access (either 'rw' for read-write or 'ro' for read-only). Write a function `get_user_per...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_user_permissions({'db1': {'admin': 'rw', 'user': 'rw', 'viewer': 'ro'}}, 'db1') == {'admin': 'rw', 'user': 'rw', 'viewer': 'ro'}\", \"assert get_user_permissions({'db1': {'admin': 'rw', 'user': 'ro'}}, 'db1') == {'admin': 'rw', 'user': 'ro', 'viewer': 'n...
{ "split": "train", "index": 77649, "acecode_id": "bigcode_python_fns_32212", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_axolotl(species: str, limb_count: int, skin_color: str) -> dict` that takes three parameters: a string representing the species, an integer representing the limb count, and a string representing the skin color of an axolotl. The function should retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_axolotl('Ambystoma mexicanum', 4, 'Black') == {'species': 'Ambystoma mexicanum', 'limb_count': 4, 'skin_color': 'Black'}\", \"assert create_axolotl('Axolotl', 4, 'Albino') == {'species': 'Axolotl', 'limb_count': 4, 'skin_color': 'Albino'}\", \"assert ...
{ "split": "train", "index": 77650, "acecode_id": "evol_12881", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string 'word' which may contain glosses represented by a plus sign (+). Your task is to implement a function that processes this string and removes the glosses, effectively replacing any occurrence of a plus sign with an empty string. The resulting string should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_glosses('example+gloss') == 'examplegloss'\", \"assert remove_glosses('test+case+string') == 'testcasestring'\", \"assert remove_glosses('no+gloss+here') == 'noglosshere'\", \"assert remove_glosses('word') == 'word'\", \"assert remove_glosses('plus+si...
{ "split": "train", "index": 77651, "acecode_id": "bigcode_python_fns_31146", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a list of floating-point numbers as input and returns a new list containing the same numbers sorted in descending order.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code bloc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_descending([7.1, 3.2, 5.5, 9.8, 11.0, 10.7]) == [11.0, 10.7, 9.8, 7.1, 5.5, 3.2]\", \"assert sort_descending([1.1, 2.2, 3.3]) == [3.3, 2.2, 1.1]\", \"assert sort_descending([0.0, -1.1, -2.2]) == [0.0, -1.1, -2.2]\", \"assert sort_descending([-3.3, -2.2,...
{ "split": "train", "index": 77652, "acecode_id": "evol_595", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integers, startnum and endnum, find all perfect squares between startnum and endnum (inclusive) where the sum of the digits of each perfect square is also a perfect square. A perfect square is a number that can be expressed as the square of an integer. The sum of the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_special_numbers(0, 0) == [0]\", \"assert find_special_numbers(0, 1) == [0, 1]\", \"assert find_special_numbers(1, 1) == [1]\", \"assert find_special_numbers(2, 2) == []\", \"assert find_special_numbers(50, 60) == []\", \"assert find_special_numbers(70, ...
{ "split": "train", "index": 77653, "acecode_id": "evol_10963", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a custom function that takes a 2D list (matrix) of integers and returns a new 2D list (matrix) where each element is replaced by the sign of the original element. If the original element is positive, it should be replaced by 1; if it is negative...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_sign_matrix([[1, -2, 0], [0, 5, -6]]) == [[1, -1, 0], [0, 1, -1]]\", \"assert binary_sign_matrix([[0, 0], [0, 0]]) == [[0, 0], [0, 0]]\", \"assert binary_sign_matrix([[-1, 2, -3], [4, -5, 6]]) == [[-1, 1, -1], [1, -1, 1]]\", \"assert binary_sign_matri...
{ "split": "train", "index": 77654, "acecode_id": "oss_29191", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a distinct integer n and a range defined by two parameters lower_limit and upper_limit, implement a function that returns a list of all multiples of n that exist within the inclusive range from lower_limit to upper_limit. The boundaries lower_limit and upper_limit are inc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_multiples(3, 1, 10) == [3, 6, 9]\", \"assert find_multiples(5, 10, 30) == [10, 15, 20, 25, 30]\", \"assert find_multiples(2, 2, 8) == [2, 4, 6, 8]\", \"assert find_multiples(10, 5, 50) == [10, 20, 30, 40, 50]\", \"assert find_multiples(1, -5, 5) == [-5,...
{ "split": "train", "index": 77655, "acecode_id": "evol_8877", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple function that accepts a list of integers and returns a new list containing only the even integers from the input list. Your function should preserve the order of the original integers. If there are no even integers in the input list, return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([1, 3, 5]) == []\", \"assert filter_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert filter_even_numbers([])...
{ "split": "train", "index": 77656, "acecode_id": "oss_10426", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a Python function that takes a nested list as input and returns a tuple containing the length of the longest sublist and the index of that sublist. If there are multiple sublists with the longest length, return the index of the first one found. The function signature sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_sublist([[1, 2, 3], [4, 5, 6, 7], [8], [9, 10]]) == (4, 1)\", \"assert longest_sublist([[1], [], [2, 3, 4], [5, 6]]) == (3, 2)\", \"assert longest_sublist([[], [], []]) == (0, 0)\", \"assert longest_sublist([[1, 2], [3], [4, 5, 6, 7], [8, 9]]) == (4,...
{ "split": "train", "index": 77657, "acecode_id": "evol_24501", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings, each representing a word, implement a function that returns the longest common prefix among all the strings. If there is no common prefix, the function should return an empty string. Create a function `longestCommonPrefix(words: List[str]) -> str` where...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longestCommonPrefix(['flower', 'flow', 'flight']) == 'fl'\", \"assert longestCommonPrefix(['dog', 'racecar', 'car']) == ''\", \"assert longestCommonPrefix(['throne', 'throne']) == 'throne'\", \"assert longestCommonPrefix(['a']) == 'a'\", \"assert longestComm...
{ "split": "train", "index": 77658, "acecode_id": "oss_20233", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that calculates the number of active peers for a given upstream server in a streaming service. The function should take in a dictionary representing the current status of the streaming service. This dictionary contains an 'upstream...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_active_peers({'upstreams': {'server1': {'peers': ['peer1', 'peer2', 'peer3']}}}, 'server1') == 3\", \"assert count_active_peers({'upstreams': {'server2': {'peers': []}}}, 'server2') == 0\", \"assert count_active_peers({'upstreams': {'server3': {'peers'...
{ "split": "train", "index": 77659, "acecode_id": "oss_21163", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to decode specific energy sums from a given integer buffer. The buffer contains encoded energy sums, and your goal is to extract and decode these values using a defined encoding scheme. The encoding involves bitwise operations and mas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decode_energy_sums(0xFFFF0000) == {'trace_length': 65535, 'trace_out_of_range': 0}\", \"assert decode_energy_sums(0x0000FFFF) == {'trace_length': 0, 'trace_out_of_range': 65535}\", \"assert decode_energy_sums(0x12345678) == {'trace_length': 4660, 'trace_out_...
{ "split": "train", "index": 77660, "acecode_id": "oss_33985", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers as input and returns a new list containing only the unique elements from the input list, preserving the order of their first appearance. Implement a function named `get_unique_elements(arr: List[int]) -> List...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_elements([1, 2, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert get_unique_elements([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert get_unique_elements([]) == []\", \"assert get_unique_elements([5, 5, 5, 5]) == [5]\", \"assert get_unique_elements([10, 20, 10, ...
{ "split": "train", "index": 77661, "acecode_id": "oss_2435", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the output tracking of a photovoltaic (PV) system. Write a function `pv_output_tracking(system_id: int, time_period: int) -> List[int]` that takes a PV system ID and a time period as inputs, and returns a list of simulated output values for the PV...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pv_output_tracking(1, 0) == []\", \"assert pv_output_tracking(2, 1) == [50]\", \"assert pv_output_tracking(3, 2) == [50, 49]\", \"assert pv_output_tracking(4, 3) == [50, 49, 48]\", \"assert pv_output_tracking(6, 10) == [50, 49, 48, 47, 46, 45, 44, 43, 42, 41...
{ "split": "train", "index": 77662, "acecode_id": "oss_34859", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that calculates the cube of a given integer. Your function should take a single integer as input and return the cube of that number. The cube of a number is defined as the number multiplied by itself twice. For example, the cub...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cube(0) == 0\", \"assert cube(1) == 1\", \"assert cube(-1) == -1\", \"assert cube(2) == 8\", \"assert cube(-2) == -8\", \"assert cube(3) == 27\", \"assert cube(-3) == -27\", \"assert cube(4) == 64\", \"assert cube(-4) == -64\", \"assert cube(5) == 125\", \"a...
{ "split": "train", "index": 77663, "acecode_id": "oss_23493", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `quicksort(lst)` that takes a list of integers and returns a new list containing the elements sorted in ascending order using the quicksort algorithm. The sorting should be stable, meaning that equal elements retain their original relative order in the outp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert quicksort([-2, 0, 7, 1, -8]) == [-8, -2, 0, 1, 7]\", \"assert quicksort([3, 1, 2, 3, 4]) == [1, 2, 3, 3, 4]\", \"assert quicksort([5, 5, 5]) == [5, 5, 5]\", \"assert quicksort([1]) == [1]\", \"assert quicksort([]) == []\", \"assert quicksort([10, 20, 10]) ==...
{ "split": "train", "index": 77664, "acecode_id": "evol_6072", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of cell dimensions represented as tuples, where each tuple contains two integers representing the length and width of a rectangular cell. Write a function `compute_cell_areas(dimensions: List[Tuple[int, int]]) -> List[int]` that computes and returns the are...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_cell_areas([(2, 3), (4, 5)]) == [6, 20]\", \"assert compute_cell_areas([(1, 1), (2, 2), (3, 3)]) == [1, 4, 9]\", \"assert compute_cell_areas([(10, 10)]) == [100]\", \"assert compute_cell_areas([(2, 5), (3, 7)]) == [10, 21]\", \"assert compute_cell_ar...
{ "split": "train", "index": 77665, "acecode_id": "bigcode_python_fns_18596", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with transforming a list of values into a specific dictionary format. Write a function `parse_bluegenelog` that takes a list `parsed_bluegenelog` containing exactly 10 elements. The function should return a new dictionary with the following key-value pairs: 'sock...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_bluegenelog([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == {'sock': 1, 'number': 2, 'timestamp': 3, 'core1': 4, 'timestamp_bgl': 5, 'core2': 6, 'source': 7, 'service': 8, 'level': 9, 'message': 10}\", \"assert parse_bluegenelog(['a', 'b', 'c', 'd', 'e', 'f', 'g',...
{ "split": "train", "index": 77666, "acecode_id": "oss_28998", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of arguments representing a function call. Your task is to create a function that extracts specific arguments based on certain rules. The function should take a list of arguments and two boolean flags: `include_buffers` and `remove_constants`. The function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_arguments([1, 2, 3], False, False) == [1, 2, 3]\", \"assert extract_arguments([1, 2, 3], True, False) == [1, 2, 3]\", \"assert extract_arguments([1, 2, 3], False, True) == [2, 3]\", \"assert extract_arguments([], False, False) == []\", \"assert extra...
{ "split": "train", "index": 77667, "acecode_id": "bigcode_python_fns_27055", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates file paths and their corresponding content based on protocol and role information. The function should take a dictionary as input that contains two keys: 'protocol' and 'role'. The 'protocol' value is a string represent...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_files({'protocol': 'HTTP', 'role': 'client'}) == [('HTTP/EFSM.ts', '// Placeholder content for EFSM.ts'), ('HTTP/client.ts', '// Placeholder content for client.ts')]\", \"assert generate_files({'protocol': 'FTP', 'role': 'server'}) == [('FTP/EFSM.ts...
{ "split": "train", "index": 77668, "acecode_id": "oss_36167", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integers K and n, write a function that generates a list of n integers, where each integer is randomly selected from the range [0, K-1]. The generated integers should be uniformly distributed, meaning that each integer in the range should have an equal probability of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_k_array(3, 5) != [0, 0, 0, 0, 0]\", \"assert len(generate_k_array(2, 10)) == 10\", \"assert all(0 <= x < 2 for x in generate_k_array(2, 10))\", \"assert len(set(generate_k_array(3, 10))) <= 10\", \"assert generate_k_array(1, 5) == [0, 0, 0, 0, 0]\",...
{ "split": "train", "index": 77669, "acecode_id": "bigcode_python_fns_28465", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a 3D array of shape (n, m, p) representing a collection of logits, implement a function that splits the array into chunks of size 8 along the second dimension (m) and returns a flattened list of results after decoding each chunk. The decoding process is simulated by summi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert batch_decode([[[1, 2], [3, 4], [5, 6]], [[7, 8], [9, 10], [11, 12]]], False, 1) == [21, 57]\", \"assert batch_decode([[[1, 1], [1, 1], [1, 1]], [[1, 1], [1, 1], [1, 1]]], True, 10) == [6, 6]\", \"assert batch_decode([[[0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0]...
{ "split": "train", "index": 77670, "acecode_id": "bigcode_python_fns_17085", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that creates a user from a given email and password. The function should take the email and password as input parameters and optionally an alias. The function should check if the email is valid (it should contain an '@' symbol and a d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_user('test@example.com', 'password123', 'testuser') is not None\", \"assert create_user('invalid-email', 'password123') is None\", \"assert create_user('user@domain.com', 'mypassword') is not None\", \"assert create_user('user@domain', 'mypassword') i...
{ "split": "train", "index": 77671, "acecode_id": "oss_18557", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing image pixel values. Your task is to implement a function that calculates the average pixel value of the image. The average should be calculated by summing all the pixel values and dividing by the number of pixels. If the list is emp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_pixel_value([255, 128, 64]) == 149.0\", \"assert average_pixel_value([0, 0, 0]) == 0.0\", \"assert average_pixel_value([100, 200, 300]) == 200.0\", \"assert average_pixel_value([10]) == 10.0\", \"assert average_pixel_value([]) == 0.0\", \"assert aver...
{ "split": "train", "index": 77672, "acecode_id": "bigcode_python_fns_46086", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that receives two equal-length, non-empty lists of integers. The function should determine if it is possible to swap elements between the two lists in such a way that the counts of even and odd numbers in both lists become equal. If such swaps can be made, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert exchange([1, 2, 3, 4], [1, 5, 3, 4]) == 'IMPOSSIBLE'\", \"assert exchange([10, 12, 14], [1, 3, 5]) == 'IMPOSSIBLE'\", \"assert exchange([1, 1, 1, 2], [2, 2, 2, 3]) == 'IMPOSSIBLE'\", \"assert exchange([8, 10, 12], [3, 5, 7]) == 'IMPOSSIBLE'\", \"assert excha...
{ "split": "train", "index": 77673, "acecode_id": "evol_28307", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of tokens/ids, write a function that converts this sequence into a list of sentences. A sentence is defined as a sublist of tokens/ids that ends with a specified end symbol. You may also provide a list of symbols that should be excluded from the final result. Your ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_sequence_to_sentences(['Hello', 'world', '.', 'This', 'is', 'a', 'test', '.']) == [['Hello', 'world'], ['This', 'is', 'a', 'test']]\", \"assert convert_sequence_to_sentences(['!', 'Hello', 'world', '.', 'This', '!', 'is', 'a', 'test', '.'], excl_symb...
{ "split": "train", "index": 77674, "acecode_id": "bigcode_python_fns_28023", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates receiving messages from a communication system. The function should take a string as input, representing a message, and return the decoded message as a string. The decoding process involves converting the input message to u...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert receive_and_decode_message('hello') == 'OLLEH'\", \"assert receive_and_decode_message('world') == 'DLROW'\", \"assert receive_and_decode_message('Python') == 'NOHTYP'\", \"assert receive_and_decode_message('') == ''\", \"assert receive_and_decode_message('Le...
{ "split": "train", "index": 77675, "acecode_id": "oss_4051", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given an array of integers and a list of keys, write a function `remove_keys_from_array(array: List[int], keys: List[int]) -> List[int]` that removes all occurrences of each key from the array. The function should return the modified array. If a key appears multiple times in th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_keys_from_array([1, 2, 3, 4, 3, 5], [3]) == [1, 2, 4, 5]\", \"assert remove_keys_from_array([1, 2, 3, 4, 5], []) == [1, 2, 3, 4, 5]\", \"assert remove_keys_from_array([1, 1, 1, 1], [1]) == []\", \"assert remove_keys_from_array([], [1]) == []\", \"asse...
{ "split": "train", "index": 77676, "acecode_id": "bigcode_python_fns_45489", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines the type of adapter based on the type of workflow client provided. The function should take a string input representing the type of the workflow client and return the corresponding adapter type as a string. The possible wo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_adapter_type('DataFlowKernel') == 'ParslAdapter'\", \"assert get_adapter_type('Client') == 'DaskAdapter'\", \"assert get_adapter_type('OtherType') == 'Unknown Adapter'\", \"assert get_adapter_type('DataFlowKernel') == 'ParslAdapter'\", \"assert get_adapt...
{ "split": "train", "index": 77677, "acecode_id": "bigcode_python_fns_33148", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a string representing a file path and a string representing an environment path, which consists of multiple paths separated by a semicolon. Implement a function `env_path_contains(path_to_look_for: str, env_path: str) -> bool` that checks if the specified `path_to...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert env_path_contains('C:\\\\Program Files\\\\MyApp', 'C:\\\\Program Files\\\\MyApp;C:\\\\Windows;C:\\\\System32') == True\", \"assert env_path_contains('C:\\\\InvalidPath', 'C:\\\\Program Files\\\\MyApp;C:\\\\Windows;C:\\\\System32') == False\", \"assert env_pa...
{ "split": "train", "index": 77678, "acecode_id": "bigcode_python_fns_38457", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You need to implement a function that takes a list of integers and returns a new list containing only the unique elements in the order they first appeared in the input list. If the input list is empty, return an empty list. Implement the function `unique_elements(nums: List[int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 3, 2, 1]) == [1, 2, 3]\", \"assert unique_elements([4, 5, 5, 4, 6, 7]) == [4, 5, 6, 7]\", \"assert unique_elements([]) == []\", \"assert unique_elements([10, 20, 10, 30, 20, 40]) == [10, 20, 30, 40]\", \"assert unique_elements([1, 1, 1...
{ "split": "train", "index": 77679, "acecode_id": "oss_16615", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of transaction names and a dictionary containing various data, including the 'strand' key, which is a list of strings representing the strands of these transactions. Your task is to implement a function that checks if all the strands in the given data are t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_same_strand(['tx1', 'tx2'], {'strand': ['+', '+', '+']}) == True\", \"assert verify_same_strand(['tx1'], {'strand': ['-']}) == True\", \"assert verify_same_strand(['tx1', 'tx2'], {'strand': ['+', '-']}) == False\", \"assert verify_same_strand(['tx1', ...
{ "split": "train", "index": 77680, "acecode_id": "bigcode_python_fns_2644", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a two-dimensional array, flattens it, and returns a list of every distinct integer sorted in ascending order of their frequencies. If two numbers have the same frequency, the smaller number should come first in the sorted list. The function should be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flatten_and_print([[10], [20], [10, 20]]) == [10, 20]\", \"assert flatten_and_print([]) == []\", \"assert flatten_and_print([[5, 5, 5], [5, 5]]) == [5]\", \"assert flatten_and_print([[1, 1, 2], [3, 3, 3], [2, 2]]) == [1, 2, 3]\", \"assert flatten_and_print([...
{ "split": "train", "index": 77681, "acecode_id": "evol_33499", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `handle_login_error` that simulates the behavior of a login system when an authentication error occurs. The function should take two parameters: `flow_id` (a string representing the unique identifier of a login flow) and `error_code` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_login_error('flow123', 'login_failed') == {'type': 'RESULT_TYPE_ABORT', 'flow_id': 'flow123', 'handler': 'DOMAIN', 'reason': 'login_failed', 'description_placeholders': None}\", \"assert handle_login_error('flow456', 'invalid_credentials') == {}\", \"...
{ "split": "train", "index": 77682, "acecode_id": "bigcode_python_fns_35755", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary where the key is a student's name and the value is a tuple of float values representing the student's height, weight, age, and GPA. You also have a tuple of minimum acceptable values for height, weight, age, and GPA. Construct a function that filters ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_arrange_students({'Alice': (1.60, 60, 20, 3.7), 'Bob': (1.90, 100, 30, 2.8)}, (1.50, 50, 18, 2.5)) == {'Alice': (1.60, 60, 20, 3.7), 'Bob': (1.90, 100, 30, 2.8)}\", \"assert filter_arrange_students({}, (1.70, 75, 22, 3.0)) == {}\", \"assert filter_arr...
{ "split": "train", "index": 77683, "acecode_id": "evol_8719", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `run_experiment` that simulates running an experiment in a local environment. The function should accept a string `experiment_name`, which represents the name of the experiment to run, and a list of command-line arguments `argv`, whic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert run_experiment('goal_conditioned_classifier_rl', []) == 'Experiment executed successfully'\", \"assert run_experiment('goal_conditioned_classifier_rl', ['--option1']) == 'Experiment executed successfully'\", \"assert run_experiment('goal_conditioned_classifi...
{ "split": "train", "index": 77684, "acecode_id": "bigcode_python_fns_14475", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `categorize_numbers(numbers)` that takes a list of integers and categorizes them into prime numbers, composite numbers, and invalid inputs. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. A...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_numbers([10, 11, 12, 13, 14, 15]) == ([11, 13], [10, 12, 14, 15], [])\", \"assert categorize_numbers([2, 3, 5, 7, 11]) == ([2, 3, 5, 7, 11], [], [])\", \"assert categorize_numbers([4, 6, 8, 9, 10]) == ([], [4, 6, 8, 9, 10], [])\", \"assert categor...
{ "split": "train", "index": 77685, "acecode_id": "evol_23063", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of constant arrays and a function expression that takes these arrays as input. Your task is to implement a function that evaluates the expression using the provided arrays. The function should take in two parameters: a list of constant arrays (which are lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_expression([[1, 2], [3, 4]], lambda x, y: sum(x) + sum(y)) == 10\", \"assert evaluate_expression([[0], [5]], lambda x, y: x[0] * y[0]) == 0\", \"assert evaluate_expression([[10, 20]], lambda x: x[0] + x[1]) == 30\", \"assert evaluate_expression([[1]...
{ "split": "train", "index": 77686, "acecode_id": "bigcode_python_fns_29929", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `extract_ipv4_addresses` that takes a string `text` as input and returns a list of all valid IPv4 addresses found within that text. An IPv4 address is defined as four decimal numbers (each ranging from 0 to 255) separated by dots. Ensure that each address i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_ipv4_addresses('Here are some IPs: 192.168.1.1, 10.0.0.256, and 172.16.0.5.') == ['192.168.1.1', '172.16.0.5']\", \"assert extract_ipv4_addresses('No IPs here.') == []\", \"assert extract_ipv4_addresses('The IP 0.0.0.0 and 255.255.255.255 are valid.'...
{ "split": "train", "index": 77687, "acecode_id": "evol_34164", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of migration operations for a database schema and applies them sequentially. Each operation in the list is represented as a dictionary with a type and corresponding attributes. The function should return a string sum...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert apply_migrations([]) == 'Updated database schema after applying the given operations.'\", \"assert apply_migrations([{ 'type': 'AlterModelOptions', 'name': 'goods', 'options': {'ordering': ('status', 'index')} }]) == 'Updated database schema after applying t...
{ "split": "train", "index": 77688, "acecode_id": "oss_28169", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that removes a network device from a system if it exists. Your function should accept a string representing the name of the network device. If the device exists, it should return a success message indicating the device was removed. If...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_network_device('eth0') == 'Net device removed: eth0'\", \"assert remove_network_device('wlan0') == 'Net device removed: wlan0'\", \"assert remove_network_device('eth1') == 'Failed removing net device: eth1'\", \"assert remove_network_device('dummy0') ...
{ "split": "train", "index": 77689, "acecode_id": "bigcode_python_fns_46262", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple application launcher. The function `launch_app(config: dict, in_metadata: dict, out_metadata: str) -> str` takes in three parameters: a configuration dictionary `config`, an input metadata dictionary `in_metada...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert launch_app({'setting': 'value'}, {'input': 'data'}, 'output_metadata.txt') == 'Execution finished; see output_metadata.txt'\", \"assert launch_app({'mode': 'test'}, {'input': 'test_data'}, 'result_metadata.json') == 'Execution finished; see result_metadata.j...
{ "split": "train", "index": 77690, "acecode_id": "bigcode_python_fns_6274", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function to calculate and return the standard deviation of a list of numbers using recursion. Do not use numpy or any other external libraries. The function should take a list of floats or integers and return a float representing the standard deviation.\nPlease reas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert standard_deviation([5, 5, 5, 5]) == 0.0\", \"assert standard_deviation([1]) == 0.0\", \"assert standard_deviation([4, 4, 4, 4, 4, 4]) == 0.0\", \"assert standard_deviation([0, 0, 0, 0]) == 0.0\", \"assert standard_deviation([1.5, 1.5, 1.5]) == 0.0\"]}" }
{ "split": "train", "index": 77691, "acecode_id": "evol_28863", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a quaternion represented as a tuple of four elements (w, x, y, z), where 'w' is the real part and 'x', 'y', 'z' are the imaginary parts, implement a function `quaternion_conjugate(q)` that returns the conjugate of the quaternion. The conjugate of a quaternion is obtained ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert quaternion_conjugate((1, 2, 3, 4)) == (1, -2, -3, -4)\", \"assert quaternion_conjugate((0, 0, 0, 0)) == (0, 0, 0, 0)\", \"assert quaternion_conjugate((5, -1, 2, 3)) == (5, 1, -2, -3)\", \"assert quaternion_conjugate((2.5, 1.5, -3.5, 2.0)) == (2.5, -1.5, 3.5,...
{ "split": "train", "index": 77692, "acecode_id": "bigcode_python_fns_5242", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a custom encoding and decoding mechanism for data. Your goal is to create a function `custom_encode_decode(coder_urn: str, data: str) -> Tuple[str, str]` that takes a coder identifier and data as input and returns a tuple containing the encoded ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_encode_decode('urn:example:coder', 'hello') == ('encoded_hello', 'hello')\", \"assert custom_encode_decode('urn:example:coder', 'test') == ('encoded_test', 'test')\", \"assert custom_encode_decode('urn:example:coder', '12345') == ('encoded_12345', '12...
{ "split": "train", "index": 77693, "acecode_id": "oss_436", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with parsing specific NMEA sentences related to marine sensor data for depth and water temperature. Write a function `parse_nmea_sentences(nmea_sentences: List[str]) -> Dict[str, Union[float, None]]` that takes a list of NMEA sentences as input and returns a dict...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_nmea_sentences(['$IIDBT,,f,3.5,M,,F', '$IIMTW,25.5,C']) == {'depth': 3.5, 'water_temperature': 25.5}\", \"assert parse_nmea_sentences(['$IIMTW,27.8,C']) == {'depth': None, 'water_temperature': 27.8}\", \"assert parse_nmea_sentences(['$IIDBT,,f,0.0,M,,F...
{ "split": "train", "index": 77694, "acecode_id": "oss_26561", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function that calculates the cumulative count of vowels from a given array of paragraphs. However, the function should only consider paragraphs that meet the following criteria: they must not start with a consonant, must not end with a vowel, must contain at least 10 s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_vowels(['This is not a valid paragraph. It starts with a consonant.']) == 0\", \"assert count_vowels(['This paragraph ends with a vowel.']) == 0\", \"assert count_vowels(['Too few sentences.']) == 0\", \"assert count_vowels(['This is a great paragraph!...
{ "split": "train", "index": 77695, "acecode_id": "evol_24156", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a directed graph represented by an adjacency list, where each node is a switch and the edges represent direct paths between them with their respective distances. Your task is to implement a function `calc_shortest_paths(adjacency: Dict[str, Dict[str, int]]) -> Dic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calc_shortest_paths({'A': {'B': 1, 'C': 4}, 'B': {'C': 2}, 'C': {}}) == {'A': {'A': 0, 'B': 1, 'C': 3}, 'B': {'A': float('inf'), 'B': 0, 'C': 2}, 'C': {'A': float('inf'), 'B': float('inf'), 'C': 0}}\", \"assert calc_shortest_paths({'A': {'B': 1, 'C': 5}, 'B'...
{ "split": "train", "index": 77696, "acecode_id": "bigcode_python_fns_6035", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function `create_luxury_sport_car(color: str, model: str, year: int) -> Dict[str, Union[str, int]]` that creates a representation of a luxury sport car. The function should take in three parameters: color (a string), model (a string), and year (an integer). The func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_luxury_sport_car('Red', 'Ferrari', 2022) == {'color': 'Red', 'model': 'Ferrari', 'year': 2022}\", \"assert create_luxury_sport_car('Blue', 'Lamborghini', 2021) == {'color': 'Blue', 'model': 'Lamborghini', 'year': 2021}\", \"assert create_luxury_sport_...
{ "split": "train", "index": 77697, "acecode_id": "evol_13641", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `OrbitDirection` and `QDOrbitDirection`, along with a list of floats `QDLat`, implement a function that identifies the corresponding 'OrbitSection' for each entry in the lists based on the following rules: 1. If `OrbitDirection[i]` is 1 and `QDOrbit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert append_orbit_section([1, -1, 1, -1], [1, -1, 1, -1], [60, 70, -60, -70]) == [1, 2, 4, 3]\", \"assert append_orbit_section([-1, 1], [-1, 1], [-60, 60]) == [3, 1]\", \"assert append_orbit_section([0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]) == [0, 0, 0, 0]\", \"a...
{ "split": "train", "index": 77698, "acecode_id": "bigcode_python_fns_46982", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a class called CheckFile which is supposed to represent a file checker. You need to implement a function called `is_instance_of_checkfile` that takes an instance of any class and checks if it is an instance of the CheckFile class. The function should return True i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_instance_of_checkfile(CheckFile()) == True\", \"assert is_instance_of_checkfile(object()) == False\", \"assert is_instance_of_checkfile(CheckFile) == False\", \"assert is_instance_of_checkfile(None) == False\", \"assert is_instance_of_checkfile(123) == Fa...
{ "split": "train", "index": 77699, "acecode_id": "bigcode_python_fns_48708", "num_tests": 16 }