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 implementing a function that performs a simple transformation on a 2D list (matrix) of integers. The function should take an input matrix and return a new matrix where each element is the product of its corresponding element and the sum of its row. The sum o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_matrix([[1, 2], [3, 4]]) == [[3, 6], [21, 28]]\", \"assert transform_matrix([[0, 0], [0, 0]]) == [[0, 0], [0, 0]]\", \"assert transform_matrix([[1]]) == [[1]]\", \"assert transform_matrix([[1, 1], [1, 1], [1, 1]]) == [[2, 2], [2, 2], [2, 2]]\", \"a... | {
"split": "train",
"index": 84500,
"acecode_id": "oss_21594",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the tax owed based on a given income and tax rate. Write a function `calculate_tax(income: float, tax_rate: float) -> float` that takes two parameters: `income`, which is a non-negative float representing the total income, and `tax_rate`, which i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_tax(1000.0, 0.20) == 200.0\", \"assert calculate_tax(50000.0, 0.15) == 7500.0\", \"assert calculate_tax(0.0, 0.10) == 0.0\", \"assert calculate_tax(2500.0, 0.25) == 625.0\", \"assert calculate_tax(12000.5, 0.10) == 1200.05\", \"assert calculate_tax... | {
"split": "train",
"index": 84501,
"acecode_id": "oss_19755",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to remove unwanted words from a given list of text. The function should take in a list of text data and a list of unwanted words, and return the text data with the unwanted words removed. An unwanted word is defined as a word that app... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_unwanted_words([\\\"apple\\\", \\\"123\\\", \\\"banana\\\", \\\"456\\\", \\\"cherry\\\"], [\\\"123\\\", \\\"456\\\"]) == [\\\"apple\\\", \\\"banana\\\", \\\"cherry\\\"]\", \"assert remove_unwanted_words([\\\"hello\\\", \\\"world\\\", \\\"42\\\", \\\"t... | {
"split": "train",
"index": 84502,
"acecode_id": "oss_16496",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a scalar integer `x`, and two integers `m` and `M` which represent the minimum and maximum possible values in a range, implement a function `wrap(x, m, M)` that wraps `x` around the coordinate system defined by `m` and `M`. The function should ensure that the output value... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert wrap(360, -180, 180) == 0\", \"assert wrap(-190, -180, 180) == 170\", \"assert wrap(0, -180, 180) == 0\", \"assert wrap(-180, -180, 180) == -180\", \"assert wrap(-1, 0, 360) == 359\", \"assert wrap(720, 0, 360) == 0\", \"assert wrap(-100, -100, 100) == -100\... | {
"split": "train",
"index": 84503,
"acecode_id": "bigcode_python_fns_47778",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing image pixel values and a corresponding list of integers representing label values. Your task is to extract random patches from these images based on the indices of the labels. Each patch is defined by a specific shape. Implement a f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_patches([10, 20, 30, 40, 50], [0, 0, 0, 0, 0], 1, [1]) == ([], [])\", \"assert extract_patches([1, 2, 3, 4], [0, 0, 0, 0], 1, [1]) == ([], [])\", \"assert extract_patches([5, 5, 5, 5], [1, 1, 1, 1], 4, [1]) == ([5, 5, 5, 5], [1, 1, 1, 1])\", \"assert... | {
"split": "train",
"index": 84504,
"acecode_id": "bigcode_python_fns_14368",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with representing complex numbers in Python. A complex number consists of a real part and an imaginary part, expressed in the form `a + bi`, where `a` is the real part and `b` is the imaginary part. Your goal is to implement a function `complex_number_string(real... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert complex_number_string(3, 4) == '3 + 4i'\", \"assert complex_number_string(1, -2) == '1 - 2i'\", \"assert complex_number_string(0, 0) == '0 + 0i'\", \"assert complex_number_string(-5, 5) == '-5 + 5i'\", \"assert complex_number_string(-3, -4) == '-3 - 4i'\", \... | {
"split": "train",
"index": 84505,
"acecode_id": "oss_26600",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with modifying a dictionary that represents the configuration settings for a web application. The dictionary contains the following keys: 'INSTALLED_APPS', 'DATABASE_ENGINE', 'DATABASE_NAME', 'DATABASE_USER', 'DATABASE_PASSWORD', 'DATABASE_HOST', 'DATABASE_PORT',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cleanup_settings({'INSTALLED_APPS': [], 'DATABASE_ENGINE': '', 'DATABASE_NAME': 'mydb', 'DATABASE_USER': 'user', 'DATABASE_PASSWORD': 'pass', 'DATABASE_HOST': 'localhost', 'DATABASE_PORT': '5432', 'MIDDLEWARE_CLASSES': [], 'SESSION_ENGINE': 'file'}) == None\... | {
"split": "train",
"index": 84506,
"acecode_id": "bigcode_python_fns_21684",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D array `schematic` representing a grid, write a function `pad_to_sidelength(schematic: List[List[int]], sidelength: int) -> List[List[int]]` that adds padding to the grid so that both its width and height equal `sidelength`. If the original grid dimensions are larger ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pad_to_sidelength([[1, 2], [3, 4]], 4) == [[1, 2, 0, 0], [3, 4, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]\", \"assert pad_to_sidelength([[1]], 2) == [[1, 0], [0, 0]]\", \"assert pad_to_sidelength([[1, 2], [3, 4]], 2) == [[1, 2], [3, 4]]\", \"assert pad_to_sidelengt... | {
"split": "train",
"index": 84507,
"acecode_id": "bigcode_python_fns_31504",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of project names and their corresponding categories, implement a function `get_project_category_mapping(projects: List[str], categories: List[str]) -> Dict[str, str]` that returns a dictionary mapping each project name to its category. Each project name will be uni... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_project_category_mapping(['Project A', 'Project B', 'Project C'], ['Category 1', 'Category 2', 'Category 3']) == {'Project A': 'Category 1', 'Project B': 'Category 2', 'Project C': 'Category 3'}\", \"assert get_project_category_mapping(['Project X', 'Pro... | {
"split": "train",
"index": 84508,
"acecode_id": "bigcode_python_fns_22765",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that verifies if a given date string is in the correct format of 'yyyy/mm/dd'. The function should take a single string parameter representing the date and return a boolean value: 'True' if the date is in the correct format, and 'Fals... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_date('2023/01/31') == True\", \"assert check_date('2023/02/28') == True\", \"assert check_date('2020/02/29') == True\", \"assert check_date('2023/04/30') == True\", \"assert check_date('2023/12/01') == True\", \"assert check_date('2023/01/01') == True\... | {
"split": "train",
"index": 84509,
"acecode_id": "bigcode_python_fns_19781",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that performs a series of transformations on a list of integers. The function should take a list of integers as input and return a new list where each element is transformed according to the following rules: if the integer is even, it... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_numbers([1, 2, 3, 4]) == [3, 4, 9, 16]\", \"assert transform_numbers([0, 5, 10, 15]) == [0, 15, 100, 45]\", \"assert transform_numbers([]) == []\", \"assert transform_numbers([-1, -2, -3, -4]) == [-3, 4, -9, 16]\", \"assert transform_numbers([2, 4,... | {
"split": "train",
"index": 84510,
"acecode_id": "oss_31657",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that can insert an element at the nth position of a given list. Your function should take three arguments: a list of items, an element to insert, and a position index where to insert this element. If the position index is out of the range of the list ind... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert_element_at_given_position(['apple', 'banana', 'grapes', 'mango'], 'kiwi', 0) == ['kiwi', 'apple', 'banana', 'grapes', 'mango']\", \"assert insert_element_at_given_position(['apple', 'banana', 'grapes', 'mango'], 'orange', 4) == ['apple', 'banana', 'gr... | {
"split": "train",
"index": 84511,
"acecode_id": "evol_26968",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary `config` that contains various configuration settings for an application. You need to implement a function `create_application(config: dict) -> str` that simulates the creation of an application based on the provided configuration. The function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_application({'DATACENTER_ID': 1, 'WORKER_ID': 1, 'SEQUENCE': 0}) == 'Application created successfully'\", \"assert create_application({'DATACENTER_ID': 1, 'WORKER_ID': 1}) == 'Application creation failed: Missing configuration'\", \"assert create_appl... | {
"split": "train",
"index": 84512,
"acecode_id": "bigcode_python_fns_14638",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that evaluates if a mobile represented by a tuple can maintain balance. The mobile is considered balanced if it meets two conditions: it must be symmetric (the same items on both ends) and the sum of its components must not exceed a given total capacity. Implem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert does_it_balance((1, 2), 5) == False\", \"assert does_it_balance((3, 2, 3), 9) == True\", \"assert does_it_balance((3,), 5) == True\", \"assert does_it_balance((), 5) == True\", \"assert does_it_balance((1, 1), 2) == True\", \"assert does_it_balance((2, 3, 2)... | {
"split": "train",
"index": 84513,
"acecode_id": "evol_1568",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `current_price` that retrieves the current price of a given cryptocurrency symbol from a predefined list of prices. The function should take a string parameter `symbol` representing the cryptocurrency symbol (e.g., 'ETH', 'BTC', 'LTC') an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert current_price('ETH') == 2500\", \"assert current_price('BTC') == 60000\", \"assert current_price('LTC') == 150\", \"assert current_price('ETH') != 0\", \"assert current_price('BTC') != 0\", \"assert current_price('LTC') != 0\", \"assert current_price('ETH') ... | {
"split": "train",
"index": 84514,
"acecode_id": "bigcode_python_fns_14199",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the root of a binary tree, an integer distance, and an integer value, implement a function that returns the number of good leaf node pairs. A pair of two different leaf nodes is considered good if the length of the shortest path between them is less than or equal to dista... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert countPairs(TreeNode(1, None, TreeNode(2, None, TreeNode(4))), 3, 1) == 0\", \"assert countPairs(TreeNode(7, TreeNode(1, TreeNode(6), None), TreeNode(4, TreeNode(5), TreeNode(3))), 3, 2) == 0\", \"assert countPairs(TreeNode(100), 1, 100) == 0\", \"assert coun... | {
"split": "train",
"index": 84515,
"acecode_id": "evol_21475",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of classifiers and returns a dictionary containing the count of unique topics present in the classifiers list. Each classifier is a string representing a topic in the format 'Topic :: <specific topic>'. The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_topics(['Topic :: A', 'Topic :: B', 'Topic :: A']) == {'A': 2, 'B': 1}\", \"assert count_unique_topics(['Topic :: A', 'Topic :: A', 'Topic :: A']) == {'A': 3}\", \"assert count_unique_topics(['Topic :: A', 'Topic :: B']) == {'A': 1, 'B': 1}\", \... | {
"split": "train",
"index": 84516,
"acecode_id": "oss_27508",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks whether a given input is of type string. If the input is not a string, the function should raise a TypeError. Implement the function `check_string_type(value: Any) -> None` that takes a single parameter `value`. If `value` is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_string_type('hello') is None\", \"assert check_string_type('123') is None\", \"assert check_string_type('!@#') is None\", \"assert check_string_type('Python') is None\", \"assert check_string_type('LeetCode') is None\", \"assert check_string_type('') i... | {
"split": "train",
"index": 84517,
"acecode_id": "bigcode_python_fns_45098",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing cloud cover data from two climate models, 'CESM2' and 'NorESM2-LM'. Each model has data for two scenarios: 'abrupt-4xCO2' and 'piControl'. Your function should take a dictionary called `model_data`, where the keys are model names and the values ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_cloud_data({'CESM2': [0.3, 0.4, 'blue', '-', 2], 'NorESM2-LM': [0.5, 0.6, 'red', '--', 3]}) == {'CESM2_abrupt-4xCO2': 0.3, 'CESM2_piControl': 0.4, 'NorESM2-LM_abrupt-4xCO2': 0.5, 'NorESM2-LM_piControl': 0.6}\", \"assert process_cloud_data({'CESM2': [... | {
"split": "train",
"index": 84518,
"acecode_id": "oss_34907",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representation of a JSON object that contains details about an email attachment. Your task is to validate whether this JSON string is correctly formatted. Write a function `is_valid_json(json_string: str) -> bool` that takes in a string `json_string` and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_json('{\\\"name\\\": \\\"file.txt\\\", \\\"size\\\": 12345}') == True\", \"assert is_valid_json('{\\\"attachments\\\": [{\\\"fileName\\\": \\\"document.pdf\\\", \\\"fileSize\\\": 2048}]}') == True\", \"assert is_valid_json('{\\\"key\\\": \\\"value\\... | {
"split": "train",
"index": 84519,
"acecode_id": "bigcode_python_fns_26426",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function `check_consecutive` that takes in a list of integers. Your task is to determine if the list contains consecutive integers in an ascending order. The function should return `True` if the input list contains consecutive integers, and `False` otherwise. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_consecutive([]) == False\", \"assert check_consecutive([1]) == True\", \"assert check_consecutive([1, 2, 3]) == True\", \"assert check_consecutive([3, 2, 1]) == True\", \"assert check_consecutive([1, 2, 4]) == False\", \"assert check_consecutive([5, 6,... | {
"split": "train",
"index": 84520,
"acecode_id": "oss_34446",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a set of 2D coordinates representing a cell, and a distance, implement a function `inflate_cell(cell: Set[Tuple[int, int]], distance: int) -> Set[Tuple[int, int]]` that expands the current cell in all directions (up, down, left, right, and diagonally) by the specified dis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert inflate_cell({(0, 0)}, 0) == {(0, 0)}\", \"assert inflate_cell({(0, 0)}, 1) == {(0, 0), (0, 1), (0, -1), (1, 0), (-1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)}\", \"assert inflate_cell({(1, 1)}, 1) == {(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0), (2... | {
"split": "train",
"index": 84521,
"acecode_id": "bigcode_python_fns_18509",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a screen buffer. The function should allow you to set content at specific coordinates and retrieve the content at those coordinates, with optional clipping based on the buffer's boundaries. Implement the function `scree... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert screen_buffer(5, 5, [('set', 2, 2, 'X'), ('at', 2, 2, True)]) == ['X']\", \"assert screen_buffer(5, 5, [('set', 0, 0, 'A'), ('at', 0, 0, True)]) == ['A']\", \"assert screen_buffer(5, 5, [('set', 1, 1, 'B'), ('at', 1, 1, True)]) == ['B']\", \"assert screen_bu... | {
"split": "train",
"index": 84522,
"acecode_id": "oss_5276",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string that may contain a year in the format 'YYYY', where 'YYYY' is a four-digit year between 1900 and 2099, write a function that extracts the first valid year from the string. If there is no valid year in the string, return None. The input string may contain addition... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert year_parse('The year is 2021.') == 2021\", \"assert year_parse('In 1999, something happened.') == 1999\", \"assert year_parse('No year here!') == None\", \"assert year_parse('2020-01-01 was a new beginning.') == 2020\", \"assert year_parse('Year: 2000, Month... | {
"split": "train",
"index": 84523,
"acecode_id": "bigcode_python_fns_18764",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_password(length: int) -> str` that generates a random password of a specified length. The password must include at least one uppercase letter, one lowercase letter, one digit, and one special character. If the length is less than 4, the function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_password(4) != ''\", \"assert len(generate_password(5)) == 5\", \"assert any(c.islower() for c in generate_password(8))\", \"assert any(c.isupper() for c in generate_password(8))\", \"assert any(c.isdigit() for c in generate_password(8))\", \"assert... | {
"split": "train",
"index": 84524,
"acecode_id": "evol_6326",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `s` representing a Roman numeral. Your task is to write a function `roman_to_int(s)` that converts the given Roman numeral into an integer. The Roman numeral system uses seven different symbols: I, V, X, L, C, D, and M, which represent the values 1, 5, 10... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert roman_to_int('I') == 1\", \"assert roman_to_int('II') == 2\", \"assert roman_to_int('III') == 3\", \"assert roman_to_int('IV') == 4\", \"assert roman_to_int('V') == 5\", \"assert roman_to_int('VI') == 6\", \"assert roman_to_int('VII') == 7\", \"assert roman_... | {
"split": "train",
"index": 84525,
"acecode_id": "oss_573",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing an event object that contains a request and an intent with multiple slots. Each slot has a name and a corresponding value. Write a function `get_slot_value(event: Dict[str, Any], slot_name: str) -> Optional[str]` that takes this event dic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_slot_value({'request': {'intent': {'slots': {'SlotA': {'value': 'ValueA'}, 'SlotB': {'value': 'ValueB'}}}}}, 'SlotA') == 'ValueA'\", \"assert get_slot_value({'request': {'intent': {'slots': {'SlotA': {'value': 'ValueA'}, 'SlotB': {'value': 'ValueB'}}}}},... | {
"split": "train",
"index": 84526,
"acecode_id": "evol_13267",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that processes a list of integers and returns a new list containing only the unique elements from the original list, while preserving their original order. Implement a function called `unique_elements` that takes a list of integers as i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_elements([5, 5, 5, 5]) == [5]\", \"assert unique_elements([]) == []\", \"assert unique_elements([1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert unique_elements([1, 1, 2, 2, 3, 3]) == [1, ... | {
"split": "train",
"index": 84527,
"acecode_id": "oss_5695",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `max_subarray_sum(nums: List[int]) -> int` that returns the maximum sum of any contiguous subarray within the list. A subarray is defined as a contiguous portion of the array. The function should handle both positive and negative integ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([1, 2, 3, -2, 5]) == 9\", \"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([5, -1, 2, 3]) == 9\", \"assert max_subarray_sum([2, 3, -2, 4]) == 7\", \"assert max_subarray_sum([-2, -3, 4, -1, -2, 1, 5, -3]) == 7\",... | {
"split": "train",
"index": 84528,
"acecode_id": "bigcode_python_fns_10563",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that takes a positive integer n as input and returns the nth value in the Fibonacci sequence, where the sequence starts with Fibonacci(1) = 0 and Fibonacci(2) = 1. The Fibonacci sequence is defined as follows: Fibonacci(n) = Fibonacci(n-1) + Fibonacc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(1) == 0\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 1\", \"assert fibonacci(4) == 2\", \"assert fibonacci(5) == 3\", \"assert fibonacci(6) == 5\", \"assert fibonacci(7) == 8\", \"assert fibonacci(8) == 13\", \"assert fibonacci(9) == 2... | {
"split": "train",
"index": 84529,
"acecode_id": "evol_23871",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `are_anagrams(strings: List[str]) -> bool` that takes a list of strings and returns True if all the strings are anagrams of each other, and False otherwise. The function should ignore case sensitivity while checking for anagrams. If the list contains fewer than... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_anagrams(['listen', 'silent', 'enlist']) == True\", \"assert are_anagrams(['hello', 'world']) == False\", \"assert are_anagrams(['Dormitory', 'Dirty room']) == False\", \"assert are_anagrams(['triangle', 'integral']) == True\", \"assert are_anagrams(['a'... | {
"split": "train",
"index": 84530,
"acecode_id": "evol_3869",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple submission management system. Your goal is to create a function that allows users to submit content based on specific keywords and retrieve the submissions associated with those keywords. You need to implement a function that accepts a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert submission_manager(['add python First submission', 'add python Second submission', 'get python']) == [['First submission', 'Second submission']]\", \"assert submission_manager(['add java Hello World', 'get java']) == [['Hello World']]\", \"assert submission_... | {
"split": "train",
"index": 84531,
"acecode_id": "oss_8050",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with updating a configuration dictionary for a software application. The configuration dictionary has a key called 'ENV_TOKENS' which is itself another dictionary. You need to create a function called `update_configuration` that takes a single argument, `settings... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_configuration({'ENV_TOKENS': {}, 'CELERYBEAT_SCHEDULE': []}) == {'ENV_TOKENS': {'FIGURES': {}}, 'CELERYBEAT_SCHEDULE': ['figures.tasks']}\", \"assert update_configuration({'ENV_TOKENS': {'SOME_KEY': 'value'}, 'CELERYBEAT_SCHEDULE': ['task1']}) == {'EN... | {
"split": "train",
"index": 84532,
"acecode_id": "bigcode_python_fns_26936",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of job IDs, implement a function `cancel_jobs(job_ids)` that cancels the first job in the list. The function should return the ID of the canceled job. If the list is empty, return `None`. You can assume that the job IDs are unique integers.\nPlease reason step by s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cancel_jobs([]) == None\", \"assert cancel_jobs([1]) == 1\", \"assert cancel_jobs([1, 2, 3]) == 1\", \"assert cancel_jobs([10, 20, 30]) == 10\", \"assert cancel_jobs([5, 15, 25]) == 5\", \"assert cancel_jobs([0, -1, -2]) == 0\", \"assert cancel_jobs([99, 100... | {
"split": "train",
"index": 84533,
"acecode_id": "bigcode_python_fns_43176",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a given experiment configuration represented as a JSON string. This JSON string contains various parameters for running a scientific experiment. Your function should be named `process_experiment_config` and should take a si... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_experiment_config('{\\\"experiment_name\\\": \\\"Test1\\\", \\\"duration\\\": 120, \\\"temperature\\\": 25, \\\"pressure\\\": 1.0}') == {'name': 'Test1', 'duration': 120, 'temp': 25, 'press': 1.0}\", \"assert process_experiment_config('{\\\"experimen... | {
"split": "train",
"index": 84534,
"acecode_id": "oss_5877",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_max(words: List[str], case_sensitive: bool = False) -> str` that takes a list of distinct strings as input and returns the word with the highest number of unique characters. If there is a tie, return the word that is lexicographically first. The funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max(['a', 'b', 'c', 'd'], case_sensitive=False) == 'a'\", \"assert find_max(['abc', 'def', 'gh'], case_sensitive=False) == 'abc'\", \"assert find_max(['zebra', 'ant', 'cat'], case_sensitive=False) == 'zebra'\", \"assert find_max(['Unique', 'Characters',... | {
"split": "train",
"index": 84535,
"acecode_id": "evol_25903",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given an item `atv`, implement a function `should_include` that determines if the item should be included based on the following criteria: \n1. If `atv` is a string, it should be included if its length is greater than 5. \n2. If `atv` is a list, it should be included if it cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert should_include('hello') == False\", \"assert should_include('hello world') == True\", \"assert should_include([1, 2, 3]) == False\", \"assert should_include([1, 2, 3, 4]) == True\", \"assert should_include(5) == False\", \"assert should_include(15) == True\"... | {
"split": "train",
"index": 84536,
"acecode_id": "oss_18225",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a unique queue data structure in Python. The unique queue should only allow unique elements to be added to it, and it should maintain the order of insertion. Your task is to implement a function `unique_enqueue(elements: List[int]) -> List[int]`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_enqueue([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_enqueue([1, 2, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert unique_enqueue([1, 1, 1, 1, 1]) == [1]\", \"assert unique_enqueue([]) == []\", \"assert unique_enqueue([5, 2, 3, 5, 4, 2]) == [5, 2, 3,... | {
"split": "train",
"index": 84537,
"acecode_id": "oss_17130",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Semir has two options for breakfast: a light breakfast or a heavy breakfast. The probability that he chooses a light breakfast is given by `p_light_breakfast`, and the probability that he chooses a heavy breakfast is given by `p_heavy_breakfast`. If he has a light breakfast, th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_prob(1.0, 0.0, 0.02, 0.15) == 0.98\", \"assert calculate_prob(0.0, 1.0, 0.06, 0.15) == 0.85\", \"assert calculate_prob(0.5, 0.5, 0.0, 0.0) == 1.0\", \"assert calculate_prob(0.0, 1.0, 0.0, 0.0) == 1.0\", \"assert calculate_prob(0.5, 0.5, 0.15, 0.0) ... | {
"split": "train",
"index": 84538,
"acecode_id": "evol_4798",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple venue booking system for a specific date. The system allows you to book a certain number of seats at a venue given the user's name, the date, and the number of seats requested. The venue has a maximum capacity of 1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert venue_booking([('Alice', '2022-10-15', 5), ('Bob', '2022-10-15', 3)], []) == []\", \"assert venue_booking([('Charlie', '2022-10-16', 4)], []) == []\", \"assert venue_booking([('David', '2022-10-15', 2), ('Eve', '2022-10-15', 4)], []) == []\", \"assert venue_... | {
"split": "train",
"index": 84539,
"acecode_id": "oss_22520",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given string contains valid parentheses. A string is considered valid if every opening parenthesis '(' has a corresponding closing parenthesis ')' and they are properly nested. Write a function `is_valid_parentheses(s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_parentheses('()') == True\", \"assert is_valid_parentheses('(]') == False\", \"assert is_valid_parentheses('([)]') == False\", \"assert is_valid_parentheses('') == True\", \"assert is_valid_parentheses('((()))') == True\", \"assert is_valid_parenthe... | {
"split": "train",
"index": 84540,
"acecode_id": "bigcode_python_fns_45253",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Your task is to implement a function that checks if a list of integers can 'fly' based on three conditions: 1) the list must be palindromic, 2) the sum of its elements must not exceed a given weight, and 3) it must contain exactly a specified number of the smallest unique integ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert not will_it_fly([1, 2], 5, 2)\", \"assert not will_it_fly([3, 2, 3], 1, 2)\", \"assert will_it_fly([1, 2, 3, 2, 1], 10, 3)\", \"assert not will_it_fly([1, 1, 1, 1], 2, 1)\", \"assert not will_it_fly([1, 2, 3], 5, 2)\", \"assert not will_it_fly([1, 2, 3, 2], ... | {
"split": "train",
"index": 84541,
"acecode_id": "evol_35949",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of global ranks of processes along with their respective names (representing the computing nodes they belong to). Your task is to implement a function `get_rank_info(global_ranks: List[Tuple[int, str]]) -> List[Tuple[int, int, int, int, int]]` that calculat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_rank_info([(0, 'node1'), (1, 'node1'), (2, 'node2'), (3, 'node2')]) == [(0, 0, 2, 0, 2), (1, 1, 2, 0, 2), (2, 0, 2, 1, 2), (3, 1, 2, 1, 2)]\", \"assert get_rank_info([(0, 'nodeA'), (1, 'nodeB'), (2, 'nodeA')]) == [(0, 0, 2, 0, 2), (1, 0, 1, 1, 2), (2, 1,... | {
"split": "train",
"index": 84542,
"acecode_id": "bigcode_python_fns_27687",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that sets up the environment variables needed for a multi-node training system. The function will take in a dictionary representing the current environment variables and update it based on specific keys related to multi-node training. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_environment_variables({'AZ_BATCHAI_MPI_MASTER_NODE': '192.168.1.1'}) == {'AZ_BATCHAI_MPI_MASTER_NODE': '192.168.1.1', 'MASTER_ADDR': '192.168.1.1', 'MASTER_PORT': '6105'}\", \"assert set_environment_variables({'MASTER_IP': '192.168.1.2'}) == {'MASTER_IP'... | {
"split": "train",
"index": 84543,
"acecode_id": "bigcode_python_fns_4002",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary of parameters and a secret key. Your task is to implement a function that checks if the calculated signature from the provided parameters matches a given signature. The signature is generated using a hashing function. If the signature matches, return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_signature_valid({'paramA': 'valueA', 'paramB': 'valueB'}, 'generated_signature_2', 'secret_key_2') == False\", \"assert is_signature_valid({}, 'generated_signature_4', 'secret_key_4') == False\", \"assert is_signature_valid({'foo': 'bar'}, 'generated_sign... | {
"split": "train",
"index": 84544,
"acecode_id": "bigcode_python_fns_46422",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers `A`. Write a function `find_duplicate` to identify and return the first duplicate element in the list. A duplicate is defined as an element that appears more than once in the list. If there are no duplicates, return -1. The function must return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_duplicate([2, 3, 1, 0, 2, 5, 3]) == 2\", \"assert find_duplicate([1, 2, 3, 4, 5]) == -1\", \"assert find_duplicate([1, 1, 2, 2, 3]) == 1\", \"assert find_duplicate([5, 5, 6, 7, 8]) == 5\", \"assert find_duplicate([10, 20, 30, 40, 10]) == 10\", \"assert ... | {
"split": "train",
"index": 84545,
"acecode_id": "oss_29716",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a prediction aggregation algorithm. The algorithm takes in predictions from multiple models and computes the average prediction for each item. The predictions are stored in a list of dictionaries, where each dictionary represents an item and its... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert aggregate_predictions([{'item_id': 'A', 'prediction': 0.8}, {'item_id': 'B', 'prediction': 0.6}, {'item_id': 'A', 'prediction': 0.7}, {'item_id': 'C', 'prediction': 0.9}]) == [{'item_id': 'A', 'prediction': 0.75}, {'item_id': 'B', 'prediction': 0.6}, {'item_... | {
"split": "train",
"index": 84546,
"acecode_id": "oss_7381",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that performs certain operations and eventually returns a value. However, for some reason, you need to modify the function to return the value through an assignment to a variable instead of using a return statement. Write a function `rewrite_return(func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rewrite_return(lambda: 5) == 5\", \"assert rewrite_return(lambda: 'hello') == 'hello'\", \"assert rewrite_return(lambda: 3.14) == 3.14\", \"assert rewrite_return(lambda: True) == True\", \"assert rewrite_return(lambda: [1, 2, 3]) == [1, 2, 3]\", \"assert rew... | {
"split": "train",
"index": 84547,
"acecode_id": "bigcode_python_fns_8993",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer array 'arr', write a function that calculates the minimum and maximum sum of all odd-length subarrays, along with the corresponding subarrays that yield these sums. The function should return a tuple consisting of the minimum sum, maximum sum, a list of subarra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert odd_subarray_average([]) == (0, 0, [], [])\", \"assert odd_subarray_average([1]) == (1, 1, [[1]], [[1]])\", \"assert odd_subarray_average([0]) == (0, 0, [[0]], [[0]])\", \"assert odd_subarray_average([1, 3, 5, 7, 9]) == (1, 25, [[1]], [[1, 3, 5, 7, 9]])\", \... | {
"split": "train",
"index": 84548,
"acecode_id": "evol_28365",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a string of text, write a function that analyzes the frequency of words in the text and returns a dictionary containing the frequency of each word. A word is defined as a sequence of alphanumeric characters separated by spaces. Ignore punctuation and ensure that the compa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_frequency('Hello, world!') == {'hello': 1, 'world': 1}\", \"assert word_frequency('This is a test.') == {'this': 1, 'is': 1, 'a': 1, 'test': 1}\", \"assert word_frequency('Hello hello') == {'hello': 2}\", \"assert word_frequency('One two three. One two.... | {
"split": "train",
"index": 84549,
"acecode_id": "oss_574",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that retrieves all incomplete records from a list of employee dictionaries where the job role or department is not specified. Additionally, the function should filter out any entries with invalid dates of birth (in the format 'YYYY-MM-DD') or unrealistic age ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_incomplete_records([]) == []\", \"assert retrieve_incomplete_records([{'role': None, 'department': None, 'dob': '2000-01-01', 'age': 25}]) == [{'role': None, 'department': None, 'dob': '2000-01-01', 'age': 25}]\", \"assert retrieve_incomplete_record... | {
"split": "train",
"index": 84550,
"acecode_id": "evol_11062",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer n, write a function that calculates the nth Fibonacci number. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n >= 2. The function should raise a ValueError if n is less than 0. Implement the function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fib(0) == 0\", \"assert fib(1) == 1\", \"assert fib(2) == 1\", \"assert fib(3) == 2\", \"assert fib(4) == 3\", \"assert fib(5) == 5\", \"assert fib(6) == 8\", \"assert fib(7) == 13\", \"assert fib(8) == 21\", \"assert fib(9) == 34\", \"assert fib(10) == 55\"... | {
"split": "train",
"index": 84551,
"acecode_id": "bigcode_python_fns_26510",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and an integer n, determine if n is present in the list. Implement a function `is_present(nums: List[int], n: int) -> bool` that returns True if n is found in the list and False otherwise. The input list may contain duplicates, and the order of elements... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_present([1, 2, 3, 4, 5], 3) == True\", \"assert is_present([10, 20, 30, 40, 50], 25) == False\", \"assert is_present([1, 2, 3, 4, 5], 1) == True\", \"assert is_present([5, 5, 5, 5], 5) == True\", \"assert is_present([], 1) == False\", \"assert is_present(... | {
"split": "train",
"index": 84552,
"acecode_id": "bigcode_python_fns_41207",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines if a given command line argument list is valid based on predefined option groups and conditions. The function should take a list of command line arguments as input and return a boolean value indicating whether the argument... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_arguments(['-c', '-d', '-o']) == True\", \"assert is_valid_arguments(['-c', '-d', '-o', '-t', '-e']) == True\", \"assert is_valid_arguments(['-A', '-o', '-c', '-d']) == True\", \"assert is_valid_arguments(['-B', '-o', '-c', '-d', '-e']) == True\", \... | {
"split": "train",
"index": 84553,
"acecode_id": "bigcode_python_fns_32942",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of timestamps in string format representing dates and times, write a function `timestamp_features(timestamps: List[str]) -> Dict[str, List[int]]` that extracts various features from each timestamp. The features to extract are: the year, month, day of the month, day... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert timestamp_features(['2023-01-01 12:30:45', '2023-05-15 15:45:30']) == {'year': [2023, 2023], 'month': [1, 5], 'day_of_month': [1, 15], 'day_of_week': [6, 0], 'hour': [12, 15], 'minute': [30, 45]}\", \"assert timestamp_features(['2020-02-29 00:00:00', '2021-0... | {
"split": "train",
"index": 84554,
"acecode_id": "bigcode_python_fns_3817",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the removal of a specified utility from a given container. The function should take two parameters: 'utility_name' (a string representing the name of the utility to be removed) and 'container_name' (a string representing th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_utility('stress', 'my_container') == 'Utility stress removed from container my_container.'\", \"assert remove_utility('memory', 'my_container') == 'Utility memory not found in container my_container.'\", \"assert remove_utility('cpu', 'test_container'... | {
"split": "train",
"index": 84555,
"acecode_id": "bigcode_python_fns_48190",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a command pattern for a structural modeling tool that involves modifying a building model. Each command will modify the model by adding a node and potentially connecting it to line elements. Your goal is to implement a function `execute_command(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_command(['Node1', 'Node2'], 'add_node') == ['Node1', 'Node2', 'Node3']\", \"assert execute_command(['Node1', 'Node2'], 'add_node') == ['Node1', 'Node2', 'Node3']\", \"assert execute_command([], 'add_node') == ['Node1']\", \"assert execute_command(['N... | {
"split": "train",
"index": 84556,
"acecode_id": "evol_17512",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the relaxation of a given structure based on a specified operation. The function will take a structure represented as a list of parameters and a string operation indicating the type of relaxation to perform. The functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert relax_structure([1.0, 2.0, 3.0], 'converged') == ([1.0, 2.0, 3.0], True, 'converged')\", \"assert relax_structure([4.5, 5.5, 6.5], 'not_converged') == ([4.5, 5.5, 6.5], False, 'not_converged')\", \"assert relax_structure([0.1, 0.2, 0.3], 'converged') == ([0.... | {
"split": "train",
"index": 84557,
"acecode_id": "bigcode_python_fns_43209",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a boolean variable `fancyPlots` that indicates whether to use a fancy plotting style or not. Implement a function `set_figure_style(fancyPlots: bool) -> List[str]` that returns a list of colors based on the value of `fancyPlots`. If `fancyPlots` is True, return a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_figure_style(True) == ['#FF5733', '#33FF57', '#3357FF']\", \"assert set_figure_style(False) == ['#000000', '#FFFFFF', '#808080']\", \"assert set_figure_style(True) != set_figure_style(False)\", \"assert set_figure_style(True) == ['#FF5733', '#33FF57', '#... | {
"split": "train",
"index": 84558,
"acecode_id": "bigcode_python_fns_38455",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a warning message. The function takes in a string message and returns it prefixed with 'Warning: '. Your function should ensure that the output is formatted correctly, regardless of the input. For instance, if the input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_warning('Disk space low') == 'Warning: Disk space low'\", \"assert generate_warning('Memory usage high') == 'Warning: Memory usage high'\", \"assert generate_warning('CPU temperature high') == 'Warning: CPU temperature high'\", \"assert generate_war... | {
"split": "train",
"index": 84559,
"acecode_id": "bigcode_python_fns_4786",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function in Python that calculates the skewness of a list of numbers. The skewness is a measure of the asymmetry of the distribution of values in the list. You can use any method to calculate the skewness as long as the function takes a list of numbers as input. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_skewness([1, 2, 3, 4, 5]) == 0.0\", \"assert calculate_skewness([1, 2, 3, 4, 5, 6, 7, 8, 9]) == 0.0\", \"assert calculate_skewness([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == 0.0\", \"assert calculate_skewness([3, 3, 3, 3, 3, 3, 4]) > 0\", \"assert calcula... | {
"split": "train",
"index": 84560,
"acecode_id": "evol_18873",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Construct a function that determines whether two given phrases contain the same unique words, regardless of their order. Implement the function `compare_unique_words(phrase1: str, phrase2: str) -> bool:`. The function should return True if both phrases have identical unique wor... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_unique_words('cat dog mouse', 'mouse cat dog') == True\", \"assert compare_unique_words('hello world', 'world hello') == True\", \"assert compare_unique_words('one two three', 'four five six') == False\", \"assert compare_unique_words('apple', 'apple... | {
"split": "train",
"index": 84561,
"acecode_id": "evol_12794",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the behavior of a window in a graphical user interface (GUI) toolkit regarding its 'clickable' property. The function should take two arguments: an initial state of the 'clickable' property (a boolean) and a list of tog... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert window_clickable(False, ['toggle', 'check']) == [True]\", \"assert window_clickable(True, ['toggle', 'check']) == [False]\", \"assert window_clickable(False, ['check', 'toggle', 'check']) == [False, True]\", \"assert window_clickable(False, ['toggle', 'check... | {
"split": "train",
"index": 84562,
"acecode_id": "oss_22956",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a multidimensional array (list of lists) where the first dimension represents different groups, implement a function that flattens all other dimensions into a single dimension for each group. Your function should take a list of lists as input and return a new list of list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten_all_dimensions_but_first([[1, 2], [3, 4]]) == [[1, 2], [3, 4]]\", \"assert flatten_all_dimensions_but_first([[1, 2, 3], [4, 5]]) == [[1, 2, 3], [4, 5]]\", \"assert flatten_all_dimensions_but_first([[[1, 2], [3]], [[4], [5, 6]]]) == [[1, 2, 3], [4, 5,... | {
"split": "train",
"index": 84563,
"acecode_id": "bigcode_python_fns_32546",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates enabling an addon in a software system. The function `enable_addon(addon_module_name: str) -> str` takes a single string parameter representing the name of the addon to be enabled. The function should return a message indic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert enable_addon('add_mesh_extra_objects') == 'Addon enabled: add_mesh_extra_objects'\", \"assert enable_addon('add_mesh_basic_shapes') == 'Addon not found: add_mesh_basic_shapes'\", \"assert enable_addon('add_mesh_advanced_shapes') == 'Addon not found: add_mesh... | {
"split": "train",
"index": 84564,
"acecode_id": "bigcode_python_fns_24131",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of words, write a function `enumerate_words(words)` that takes in the list and enumerates the words by printing their index and the word itself in the following format: `index: word`. The function should not return anything. For example, given the input list `['app... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert enumerate_words(['apple', 'banana', 'cherry']) == None\", \"assert enumerate_words(['dog', 'cat', 'mouse']) == None\", \"assert enumerate_words(['sun', 'moon']) == None\", \"assert enumerate_words(['red', 'blue', 'green', 'yellow']) == None\", \"assert enume... | {
"split": "train",
"index": 84565,
"acecode_id": "oss_464",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a search term and simulates the behavior of a web service search. Your function `perform_search` should take a `searchterm` as input and perform the following steps: \n1. Decode the `searchterm` from 'utf8' encoding to ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert perform_search(b'valid_search_term') == 'valid_search_term'\", \"assert perform_search(b'invalid_search_\\\\xe9') == ''\", \"assert perform_search(b'valid_search_123') == 'valid_search_123'\", \"assert perform_search(b'') == ''\", \"assert perform_search(b's... | {
"split": "train",
"index": 84566,
"acecode_id": "oss_23499",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a sorting algorithm to sort a list of integers in ascending order. Write a function called `custom_sort` that takes a list of integers as input and returns the list sorted in ascending order. You are not allowed to use any built-in sorting funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_sort([5, 2, 9, 1, 5, 6]) == [1, 2, 5, 5, 6, 9]\", \"assert custom_sort([]) == []\", \"assert custom_sort([3]) == [3]\", \"assert custom_sort([3, 1]) == [1, 3]\", \"assert custom_sort([1, 1, 1]) == [1, 1, 1]\", \"assert custom_sort([5, 4, 3, 2, 1]) == ... | {
"split": "train",
"index": 84567,
"acecode_id": "oss_25596",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given four strings s1, s2, s3, and s4, write a function that computes the length of the longest common subsequence among these four strings. A common subsequence is a sequence that appears in the same relative order in all the strings, but not necessarily consecutively. The fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_common_subsequence('aaaa', 'aa', 'aaa', 'a') == 1\", \"assert longest_common_subsequence('abc', 'abc', 'abc', 'abc') == 3\", \"assert longest_common_subsequence('xyz', 'xyz', 'xyz', 'xyz') == 3\", \"assert longest_common_subsequence('a', 'b', 'c', 'd... | {
"split": "train",
"index": 84568,
"acecode_id": "evol_28489",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given an array of six unique integers, implement a function that returns the last three elements of the array. The function should take the array as its only parameter and return a new list containing the last three elements.\nPlease reason step by step, then write a self-conta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert last_3_elements([1, 2, 3, 4, 5, 6]) == [4, 5, 6]\", \"assert last_3_elements([10, 20, 30, 40, 50, 60]) == [40, 50, 60]\", \"assert last_3_elements([5, 15, 25, 35, 45, 55]) == [35, 45, 55]\", \"assert last_3_elements([7, 14, 21, 28, 35, 42]) == [28, 35, 42]\"... | {
"split": "train",
"index": 84569,
"acecode_id": "evol_1401",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary of parameters, write a function `format_url` that takes keyword arguments as input and returns a formatted URL string where each key-value pair in the dictionary is inserted into a predefined URL template. The URL template is defined as 'http://example.com/re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_url(key1='value1', key2='value2') == 'http://example.com/resource?key1=value1&key2=value2'\", \"assert format_url(param1='test', param2='123') == 'http://example.com/resource?param1=test¶m2=123'\", \"assert format_url(a='apple', b='banana', c='che... | {
"split": "train",
"index": 84570,
"acecode_id": "bigcode_python_fns_28788",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the y-intercept of the best-fit line for a simple linear regression model. Write a function named `calculate_y_intercept` that takes two lists of numbers as input: `x_points` and `y_points`. The function should calculate ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_y_intercept([1, 2, 3], [2, 3, 4]) == 1.0\", \"assert calculate_y_intercept([0, 1, 2], [0, 1, 2]) == 0.0\", \"assert calculate_y_intercept([-1, 0, 1], [-1, 0, 1]) == 0.0\", \"assert calculate_y_intercept([2, 4, 6], [1, 3, 5]) == -1.0\", \"assert cal... | {
"split": "train",
"index": 84571,
"acecode_id": "oss_34877",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to determine if a survey has been modified since the last time it was archived. You will receive a list of timestamps indicating when the survey was last updated and a timestamp indicating when the last archive was created. Your funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_survey_dirty([], None) == True\", \"assert check_survey_dirty([datetime(2023, 10, 1)], datetime(2023, 10, 2)) == False\", \"assert check_survey_dirty([datetime(2023, 10, 3)], datetime(2023, 10, 2)) == True\", \"assert check_survey_dirty([datetime(2023,... | {
"split": "train",
"index": 84572,
"acecode_id": "oss_18765",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `euclidean_distance` that calculates the Euclidean distance between two points in n-dimensional space. The function should take two lists of coordinates, `point1` and `point2`, as input. If the two points do not have the same number of dimensions, th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert euclidean_distance([1, 2], [4, 6]) == 5.0\", \"assert euclidean_distance([0, 0], [3, 4]) == 5.0\", \"assert euclidean_distance([1, 1, 1], [2, 2, 2]) == 1.7320508075688772\", \"assert euclidean_distance([1, 2, 3], [4, 5, 6]) == 5.196152422706632\", \"assert e... | {
"split": "train",
"index": 84573,
"acecode_id": "evol_30814",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `text_to_html(text: str) -> str` that converts a given multi-line text into its HTML equivalent by wrapping each non-empty line in paragraph (`<p>`) tags. The input string can contain multiple lines separated by newline characters. Ensure that any empty lin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert text_to_html('Line 1\\\\nLine 2') == '<p>Line 1</p><p>Line 2</p>'\", \"assert text_to_html('This is a test.') == '<p>This is a test.</p>'\", \"assert text_to_html('Line 1\\\\n\\\\nLine 2\\\\nLine 3') == '<p>Line 1</p><p>Line 2</p><p>Line 3</p>'\", \"assert t... | {
"split": "train",
"index": 84574,
"acecode_id": "evol_17705",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of Ticket objects, each containing a ticket number (a string), an id (a string), and a generation (an integer). Your task is to implement a function that simulates drawing a ticket from a heap of tickets. The function should return the ticket with the least... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert draw_with_replacement([Ticket('0.234', 'x', 2), Ticket('0.354', 'y', 1), Ticket('0.666', 'z', 2)]) == Ticket('0.234', 'x', 2)\", \"assert draw_with_replacement([Ticket('0.111', 'a', 1), Ticket('0.222', 'b', 1), Ticket('0.333', 'c', 1)]) == Ticket('0.111', 'a... | {
"split": "train",
"index": 84575,
"acecode_id": "bigcode_python_fns_15581",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary `outlierDict` containing brain region names as keys and their corresponding lower and upper outlier values as sub-dictionaries. Your task is to implement a function `find_outliers(data)` that takes a dictionary of brain region measurements as input an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_outliers({'Left-Amygdala': [1500, 1600, 1700], 'Right-Amygdala': [2100, 2200, 2300]}) == {'Right-Amygdala': [2100, 2200, 2300]}\", \"assert find_outliers({'Left-Amygdala': [1500, 1600, 1700, 1800], 'Right-Amygdala': [1900, 2000]}) == {}\", \"assert find... | {
"split": "train",
"index": 84576,
"acecode_id": "oss_22104",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing several vulnerabilities, where each vulnerability has a unique identifier (qid), a title, a category, and a severity level. Your task is to implement a function called `count_vulnerabilities` that counts the number of vulnerabilities that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_vulnerabilities({'vuln1': {'qid': 'QID1', 'title': 'Vuln 1', 'category': 'Network', 'severity': 5}, 'vuln2': {'qid': 'QID2', 'title': 'Vuln 2', 'category': 'Web', 'severity': 3}}, 4) == 1\", \"assert count_vulnerabilities({'vuln1': {'qid': 'QID1', 'tit... | {
"split": "train",
"index": 84577,
"acecode_id": "bigcode_python_fns_38739",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a weights file path for a machine learning model based on several input parameters. The function should take the following parameters: `name` (string), `mode` (string), `batch_size` (integer), `image_height` (integer), `ima... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_weights_path('model', 'train', 32, 224, 224, True, 'var1', 'cat_loss', True) == 'model_train_batch32_im224_224_shallow_var1_cat_loss_aug.hdf5'\", \"assert generate_weights_path('my_model', 'eval', 16, 256, 256, True, 'var3', 'cat_loss', True) == 'my... | {
"split": "train",
"index": 84578,
"acecode_id": "bigcode_python_fns_19548",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `multiply(num_1: int, num_2: int) -> int` that takes two distinct integers as input and returns their product. The integers will not be equal and will be within the range of -1000 to 1000.\nPlease reason step by step, then write a self-contained Python solu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply(10, 15) == 150\", \"assert multiply(-10, 5) == -50\", \"assert multiply(0, 10) == 0\", \"assert multiply(-1, -1) == 1\", \"assert multiply(1, -1) == -1\", \"assert multiply(100, 0) == 0\", \"assert multiply(25, 4) == 100\", \"assert multiply(7, 8) =... | {
"split": "train",
"index": 84579,
"acecode_id": "evol_35056",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries where each dictionary contains key-value pairs representing the attributes of various objects. Your task is to create a function that serializes this list of dictionaries into a single JSON string. The JSON string should have all the key-val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert serialize_to_json([{'a': 1}, {'b': 2}]) == '{\\\\n \\\"a\\\": 1,\\\\n \\\"b\\\": 2\\\\n}'\", \"assert serialize_to_json([{'a': 1}, {'a': 2}, {'c': 3}]) == '{\\\\n \\\"a\\\": 2,\\\\n \\\"c\\\": 3\\\\n}'\", \"assert serialize_to_json([{'name': 'Ali... | {
"split": "train",
"index": 84580,
"acecode_id": "bigcode_python_fns_16103",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing an Access Control List (ACL) system for a Python function. The ACL system should allow or deny access to specific resources based on the permissions granted to different user groups. You are given an ACL that specifies permissions for a group ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert acl_allows('user1', 'resource1', MODE_READ) == True\", \"assert acl_allows('user1', 'resource1', MODE_WRITE) == True\", \"assert acl_allows('user1', 'resource1', MODE_EXECUTE) == True\", \"assert acl_allows('user1', 'te_st', MODE_EXECUTE) == False\", \"asser... | {
"split": "train",
"index": 84581,
"acecode_id": "oss_7471",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibonacci(n: int) -> int` that returns the nth number in the Fibonacci sequence. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n > 1. Note that the Fibonacci sequence starts from index 0.\nPlease reason st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2... | {
"split": "train",
"index": 84582,
"acecode_id": "evol_35084",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates the version of a given module. The function should take the module name and expected version as input and return whether the module's version matches the expected version. Write a function called `validate_module_ver... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_module_version('example_module', (1, 1)) == False\", \"assert validate_module_version('example_module', (2, 0)) == False\", \"assert validate_module_version('example_module', (3, 5)) == False\", \"assert validate_module_version('example_module', (0,... | {
"split": "train",
"index": 84583,
"acecode_id": "oss_2965",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes a list of integers and returns a new list containing only the unique integers from the original list, in the order they first appeared. Your function should not use any built-in set or dictionary data structures to track unique ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 3, 1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert unique_integers([5, 5, 5, 5, 5]) == [5]\", \"assert unique_integers([]) == []\", \"assert unique_integers([10, 20, 10, 30, 40, 20]) == [10, 20, 30, 40]\", \"assert unique_integers([1, 2, 2, 1... | {
"split": "train",
"index": 84584,
"acecode_id": "oss_25497",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the discounted price of a product based on its original price and a specified discount percentage. Write a function `calculate_discounted_price(price: float, discount_percentage: float) -> float` that takes in two parameters: the original price o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_discounted_price(1000, 10) == 900.0\", \"assert calculate_discounted_price(100, 20) == 80.0\", \"assert calculate_discounted_price(250, 0) == 250.0\", \"assert calculate_discounted_price(500, 50) == 250.0\", \"assert calculate_discounted_price(200,... | {
"split": "train",
"index": 84585,
"acecode_id": "oss_6083",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing the inventory of a grocery store. Implement a function `update_inventory(current_inventory: Dict[str, int], updates: List[Tuple[str, int]]) -> Dict[str, int]` that takes in a dictionary representing the current inventory of items and a list of updat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_inventory({'Apple': 10, 'Orange': 20, 'Banana': 5, 'Grapes': 15}, [('Apple', 5), ('Orange', -5)]) == {'Apple': 15, 'Orange': 15, 'Banana': 5, 'Grapes': 15}\", \"assert update_inventory({'Apple': 10, 'Orange': 20, 'Banana': 5, 'Grapes': 15}, [('Banana'... | {
"split": "train",
"index": 84586,
"acecode_id": "evol_19780",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integer values representing the heights of buildings in a city skyline. Your task is to implement a function that calculates the maximum height of buildings that can be seen from the left side. The buildings are represented in a list where each element i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_visible_height([3, 0, 2, 5, 4]) == 5\", \"assert max_visible_height([1, 3, 2, 5, 4]) == 5\", \"assert max_visible_height([5, 4, 3, 2, 1]) == 5\", \"assert max_visible_height([1, 2, 3, 4, 5]) == 5\", \"assert max_visible_height([0]) == 0\", \"assert max_v... | {
"split": "train",
"index": 84587,
"acecode_id": "bigcode_python_fns_1109",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a sequence of operations. Each operation is represented by an integer in the list. Your task is to implement a function that processes these operations by incrementing a counter for each positive integer in the list and decrementing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert final_counter([1, -1, 2]) == 2\", \"assert final_counter([0, 0, 0]) == 0\", \"assert final_counter([-1, 1, -1, 1]) == 0\", \"assert final_counter([5, -2, -2, 3]) == 4\", \"assert final_counter([]) == 0\", \"assert final_counter([10, -5, 10, -10]) == 5\", \"a... | {
"split": "train",
"index": 84588,
"acecode_id": "oss_32626",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and a target integer. Your task is to determine if any two distinct integers in the list sum up to the target integer. If such a pair exists, return True; otherwise, return False. Implement a function `two_sum(nums: List[int], target: int) -> bo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert two_sum([1, 2, 3, 4, 5], 9) == True\", \"assert two_sum([1, 2, 3, 4, 5], 10) == False\", \"assert two_sum([0, -1, 2, -3, 1], -2) == True\", \"assert two_sum([1, 2, 3, 4, 5], 8) == True\", \"assert two_sum([4, 5, 1, 2], 6) == True\", \"assert two_sum([], 1) =... | {
"split": "train",
"index": 84589,
"acecode_id": "bigcode_python_fns_23350",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, write a function that filters out all strings that are shorter than a specified minimum length. The function should return a new list containing only the strings that meet or exceed this minimum length. The input parameters are the list of strings and t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_strings(['apple', 'banana', 'pear', 'kiwi'], 5) == ['apple', 'banana']\", \"assert filter_strings(['hello', 'world', 'foo', 'bar'], 4) == ['hello', 'world']\", \"assert filter_strings(['a', 'ab', 'abc'], 2) == ['ab', 'abc']\", \"assert filter_strings(... | {
"split": "train",
"index": 84590,
"acecode_id": "bigcode_python_fns_6384",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with extracting the 'label' field from a given JSON object. Implement a function `extract_label(response_json)` that takes a dictionary `response_json` as input and returns the value of the 'label' key. If the 'label' key does not exist in the dictionary, return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_label({'label': 'EXAMPLE_ONTOLOGY'}) == 'EXAMPLE_ONTOLOGY'\", \"assert extract_label({'label': 'SPECIMEN_123'}) == 'SPECIMEN_123'\", \"assert extract_label({'other_field': 'value'}) == 'Label not found in metadata'\", \"assert extract_label({'label':... | {
"split": "train",
"index": 84591,
"acecode_id": "oss_25445",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function `solution(n)` that takes an integer `n` as input and returns the sum of all positive integers less than `n` that are multiples of 3 or 5. Implement the function to achieve this. For example, if `n` is 10, the function should return the sum of 3, 5, 6, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solution(0) == 0\", \"assert solution(1) == 0\", \"assert solution(2) == 0\", \"assert solution(3) == 0\", \"assert solution(4) == 3\", \"assert solution(5) == 3\", \"assert solution(6) == 8\", \"assert solution(9) == 14\", \"assert solution(10) == 23\", \"a... | {
"split": "train",
"index": 84592,
"acecode_id": "oss_32619",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `max_frequency(data: List[int]) -> int` that returns the maximum frequency of any element in the given list of integers. The function should handle both positive and negative integers, as well as zero. If the input list is empty, the function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_frequency([1, 4, 2, 6, 2, 1, 2, 9]) == 3\", \"assert max_frequency([1, 1, 1, 1]) == 4\", \"assert max_frequency([3, 3, 4, 4, 4]) == 3\", \"assert max_frequency([-1, -1, -2, -2, -2]) == 3\", \"assert max_frequency([0, 0, 1, 1, 0]) == 3\", \"assert max_fre... | {
"split": "train",
"index": 84593,
"acecode_id": "evol_12835",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the sizes of covers in pixels. Your task is to determine if all the given sizes meet two criteria: they must be greater than a defined minimum content length (MIN_CONTENT_LENGTH), and there should be no duplicate sizes. Write a func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_cover_sizes([2, 3, 4]) == True\", \"assert is_valid_cover_sizes([1, 2, 1]) == False\", \"assert is_valid_cover_sizes([5, 6, 7, 8]) == True\", \"assert is_valid_cover_sizes([0, 2, 3]) == False\", \"assert is_valid_cover_sizes([10, 10, 12]) == False\"... | {
"split": "train",
"index": 84594,
"acecode_id": "bigcode_python_fns_43238",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `primes_in_array(array: List[int]) -> List[bool]` that accepts a list of integers and returns a list of booleans. Each boolean in the output list should indicate whether the corresponding integer in the input list is a prime number (true) or not (false). Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert primes_in_array([-1, 0, 1, 2, 3]) == [False, False, False, True, True]\", \"assert primes_in_array([4, 5, 6, 7, 8]) == [False, True, False, True, False]\", \"assert primes_in_array([11, 13, 15, 17, 19]) == [True, True, False, True, True]\", \"assert primes_i... | {
"split": "train",
"index": 84595,
"acecode_id": "evol_18059",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers and inverts the elements of the list in place. The function should modify the input list without creating a new list. You may assume that the input list will contain at least one element.\nPlease reason step by step, then write... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert invert_list([1]) == [1]\", \"assert invert_list([1, 2]) == [2, 1]\", \"assert invert_list([1, 2, 3]) == [3, 2, 1]\", \"assert invert_list([1, 2, 3, 4]) == [4, 3, 2, 1]\", \"assert invert_list([0, -1, -2]) == [-2, -1, 0]\", \"assert invert_list([10, 20, 30, 4... | {
"split": "train",
"index": 84596,
"acecode_id": "evol_33163",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function called `hefty_numbers(seq)` that takes a non-empty list of positive integers and returns a list of numbers that satisfy the following conditions: 1. The frequency of the number in the list exceeds double the number itself. 2. The frequency of the number is a F... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hefty_numbers([7, 7, 7, 7, 7, 7, 7, 7, 8]) == []\", \"assert hefty_numbers([2, 2, 2, 2]) == []\", \"assert hefty_numbers([1, 2, 3]) == []\", \"assert hefty_numbers([6, 6, 6, 6, 6, 6, 6]) == []\", \"assert hefty_numbers([9, 9, 9, 9, 9, 9]) == []\", \"assert h... | {
"split": "train",
"index": 84597,
"acecode_id": "evol_34493",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a configuration management system for a plugin-based authentication module in a Python application. Your goal is to implement a function `get_auth_config` that retrieves the authentication configuration settings for a given user. The configurati... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_auth_config() == {'username': 'admin', 'password': 'secretpassword'}\", \"assert isinstance(get_auth_config(), dict)\", \"assert 'username' in get_auth_config()\", \"assert 'password' in get_auth_config()\", \"assert get_auth_config()['username'] == 'adm... | {
"split": "train",
"index": 84598,
"acecode_id": "oss_34378",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a class called 'Employee' that has a method to adjust skill ratings. The 'Employee' class should have attributes for 'name', 'age', and 'skills', where 'skills' is a dictionary containing skill names as keys and their corresponding ratings (1-5) as ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Employee('Alice', 30, {'communication': 3, 'teamwork': 4}).adjust_skill_rating('communication', 2) == {'communication': 5, 'teamwork': 4}\", \"assert Employee('Bob', 40, {'coding': 5, 'design': 3}).adjust_skill_rating('design', 2) == {'coding': 5, 'design': ... | {
"split": "train",
"index": 84599,
"acecode_id": "evol_4400",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.