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": "Given a string `text`, a secret `key`, and an optional `charset`, implement a function `cipher(text: str, key: str, charset: str) -> str` that encrypts the `text` using the Vigenere cipher method. The Vigenere cipher encrypts alphabetic text by using a simple form of polyalphab...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cipher('hello', 'key') == 'rijvs'\", \"assert cipher('a', 'b') == 'b'\", \"assert cipher('aaaaa', 'b') == 'bbbbb'\", \"assert cipher('', 'key') == ''\", \"assert cipher('12345', 'key') == '12345'\"]}" }
{ "split": "train", "index": 68000, "acecode_id": "bigcode_python_fns_6146", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a list of event data represented as dictionaries, where each event contains the following keys: 'RA', 'DEC', 'ENERGY', 'ZENITH_ANGLE', 'THETA', and 'TIME'. Your task is to implement a function that extracts events based on a radial cut defined by a center point an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rad_extract([{'RA': 10, 'DEC': 20, 'ENERGY': 100, 'ZENITH_ANGLE': 50, 'THETA': 30, 'TIME': 1}], (10, 20), 5, ['RA', 'DEC']) == [{'RA': 10, 'DEC': 20}]\", \"assert rad_extract([{'RA': 10, 'DEC': 20, 'ENERGY': 100, 'ZENITH_ANGLE': 50, 'THETA': 30, 'TIME': 1}],...
{ "split": "train", "index": 68001, "acecode_id": "bigcode_python_fns_36328", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of integers and a threshold value. Your task is to implement a function that filters the list by removing all integers that are less than the threshold. The function should return a new list containing only the integers that are greater than or equal to the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_by_threshold([1, 2, 3, 4], 3) == [3, 4]\", \"assert filter_by_threshold([5, 10, 15], 20) == []\", \"assert filter_by_threshold([-1, 0, 1, 2], 0) == [0, 1, 2]\", \"assert filter_by_threshold([100, 200, 300], 150) == [200, 300]\", \"assert filter_by_thr...
{ "split": "train", "index": 68002, "acecode_id": "bigcode_python_fns_46388", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that updates user information based on the provided keyword arguments. The function should take an existing user item and a set of keyword arguments, and return a dictionary containing the updated user information. If a keyword argume...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_user_info({'id': 1, 'username': 'user1', 'email': 'user1@example.com', 'date_joined': '2022-01-01'}, username='new_user') == {'id': 1, 'username': 'new_user', 'email': 'user1@example.com', 'date_joined': '2022-01-01'}\", \"assert update_user_info({'id...
{ "split": "train", "index": 68003, "acecode_id": "oss_35354", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a header dictionary that contains the keys 'privOffset', 'privLength', and 'length', write a function that checks if the 'privOffset' value is greater than the sum of 'length' and a constant value (4). If it is, return (None, 'ERROR'). If it is not, return (None, 'OK'). I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_private_data_offset({'privOffset': 10, 'privLength': 1, 'length': 5}) == (None, 'ERROR')\", \"assert validate_private_data_offset({'privOffset': 15, 'privLength': 1, 'length': 10}) == (None, 'ERROR')\", \"assert validate_private_data_offset({'privOf...
{ "split": "train", "index": 68004, "acecode_id": "bigcode_python_fns_34561", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `find(lst)` that returns the smallest integer from the list that appears at most half as many times as its value. If no such integer exists, return -1.\nPlease reason step by step, then write a self-contained Python solution. Give your...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find([9, 8, 7, 6, 5, 5]) == 5\", \"assert find([1, 1, 1, 2, 3]) == 2\", \"assert find([10, 10, 5, 5, 2]) == 2\", \"assert find([8, 8, 7, 6, 6]) == 6\", \"assert find([]) == -1\"]}" }
{ "split": "train", "index": 68005, "acecode_id": "evol_15870", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Create a function `create_sports_car(make: str, model: str, year: int) -> dict` that takes in the make, model, and year of a sports car and returns a dictionary representation of the sports car with the keys 'make', 'model', and 'year'.\nPlease reason step by step, then write a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_sports_car('Aston Martin', 'V8 Vantage', 2022) == {'make': 'Aston Martin', 'model': 'V8 Vantage', 'year': 2022}\", \"assert create_sports_car('Ferrari', '488 Spider', 2019) == {'make': 'Ferrari', 'model': '488 Spider', 'year': 2019}\", \"assert create...
{ "split": "train", "index": 68006, "acecode_id": "evol_25270", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary where each key is a word and the value is a list of definitions for that word, implement a function `count_definitions(dictionary)` that counts the number of definitions for each word in the dictionary. The function should return a new dictionary with words a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_definitions({'apple':['a fruit', 'a technology company'], 'orange':['a fruit', 'a color']}) == {'apple': 2, 'orange': 2}\", \"assert count_definitions({'banana':['a fruit'], 'grape':['a fruit', 'a color', 'a type of wine']}) == {'banana': 1, 'grape': 3...
{ "split": "train", "index": 68007, "acecode_id": "evol_35", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string of contiguous characters as input and returns a dictionary where each distinct word in the string is a key, and its corresponding value is the number of times that word appears in the string. The words are separated by spaces.\nPlease re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert word_freq('This is a test string') == {'This': 1, 'is': 1, 'a': 1, 'test': 1, 'string': 1}\", \"assert word_freq('Hello world Hello') == {'Hello': 2, 'world': 1}\", \"assert word_freq('Python Python Python') == {'Python': 3}\", \"assert word_freq('A quick br...
{ "split": "train", "index": 68008, "acecode_id": "evol_19943", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the initial setup of a game state when a new game is created. Given a dictionary `starting_resources` where the keys are resource names (strings) and the values are the quantities of those resources (integers), and a dictionary `starting_positions...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_game_state({}, {}) == []\", \"assert initialize_game_state({'Gold': 100, 'Wood': 50}, {}) == ['Resource: Gold, Quantity: 100', 'Resource: Wood, Quantity: 50']\", \"assert initialize_game_state({}, {'Player1': [(0, 0), (1, 1)]}) == ['Player: Player...
{ "split": "train", "index": 68009, "acecode_id": "bigcode_python_fns_18197", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that checks if a given string consists solely of consonants. The function should return True if the string contains only consonants (including uppercase and lowercase letters) and False if it contains any vowels (a, e, i, o, u) or non-alphabetic characters....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert contains_only_consonants('bcdfghjklmnpqrstvwxyz') == True\", \"assert contains_only_consonants('BCDFGHJKLMNPQRSTVWXYZ') == True\", \"assert contains_only_consonants('hello') == False\", \"assert contains_only_consonants('HELLO') == False\", \"assert contains...
{ "split": "train", "index": 68010, "acecode_id": "evol_31051", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates and retrieves choices for difficulty levels and non-player character (NPC) types in a role-playing game. The function should accept two parameters: a difficulty choice and an NPC choice. The valid difficulty choices are...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_game_choices('beginner', 'warrior') == ('beginner', 'warrior')\", \"assert get_game_choices('intermediate', 'mage') == ('intermediate', 'mage')\", \"assert get_game_choices('advanced', 'rogue') == ('advanced', 'rogue')\", \"assert get_game_choices('exper...
{ "split": "train", "index": 68011, "acecode_id": "oss_23835", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the discovery of nearby Bluetooth devices. The function should take a list of Bluetooth devices represented as tuples containing the device name and address. The function should return a list of names of devices that match ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_devices([('DeviceA', '00:11:22:33:44:55'), ('DeviceB', '00:11:22:33:44:56'), ('DeviceC', '00:11:22:33:44:57')], 'Device') == ['DeviceA', 'DeviceB', 'DeviceC']\", \"assert filter_devices([('HomePod', '11:22:33:44:55:66'), ('Echo', '11:22:33:44:55:77'),...
{ "split": "train", "index": 68012, "acecode_id": "oss_36867", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a bi-dimensional matrix represented as a nested list, write a function that flattens this matrix into a single-dimensional list. For example, if the input is [[1, 2], [3, 4], [5, 6]], the output should be [1, 2, 3, 4, 5, 6].\nPlease reason step by step, then write a self-...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flatten([[1, 2], [3, 4], [5, 6]]) == [1, 2, 3, 4, 5, 6]\", \"assert flatten([[1], [2], [3]]) == [1, 2, 3]\", \"assert flatten([[1, 2], [], [3, 4]]) == [1, 2, 3, 4]\", \"assert flatten([[], [], []]) == []\", \"assert flatten([[1, 2, 3], [4, 5], [6]]) == [1, 2...
{ "split": "train", "index": 68013, "acecode_id": "evol_28312", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a non-negative integer n, implement a function called `factorial_string(n)` that calculates the factorial of n and returns it as a string. You must handle large numbers by utilizing string manipulation instead of using built-in large integer support. The input n will be i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial_string(0) == '1'\", \"assert factorial_string(1) == '1'\", \"assert factorial_string(2) == '2'\", \"assert factorial_string(3) == '6'\", \"assert factorial_string(4) == '24'\", \"assert factorial_string(5) == '120'\", \"assert factorial_string(6) =...
{ "split": "train", "index": 68014, "acecode_id": "evol_13009", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats a compilation specification dictionary for a machine learning model. The function should take a dictionary as input, which contains various keys related to compilation settings, including an 'inputs' key that specifies the in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_compile_spec({'inputs': [{'min': (1, 3, 224, 224), 'opt': (1, 3, 512, 512), 'max': (1, 3, 1024, 1024), 'dtype': 'int32', 'format': 'channel_last'}], 'device': {'device_type': 'cuda', 'gpu_id': 0}, 'enabled_precisions': {'half'}}) == {'inputs': [{'min'...
{ "split": "train", "index": 68015, "acecode_id": "bigcode_python_fns_46582", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a servo motor's functionality. Implement a function `set_servo_angle` that accepts three parameters: `min_angle` (integer), `max_angle` (integer), and `angle` (integer). The function should set the angle of the servo motor to the specified `angle`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_servo_angle(0, 180, 90) == 90\", \"assert set_servo_angle(0, 180, 200) == 'Invalid angle'\", \"assert set_servo_angle(0, 180, -10) == 'Invalid angle'\", \"assert set_servo_angle(10, 150, 100) == 100\", \"assert set_servo_angle(10, 150, 10) == 10\", \"ass...
{ "split": "train", "index": 68016, "acecode_id": "oss_13875", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `sort_even_indices(l: list) -> list` that returns a new list where the elements at even indices are sorted in ascending order, while the elements at odd indices remain unchanged. The function should maintain the length of the origi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_even_indices([1, 2, 3]) == [1, 2, 3]\", \"assert sort_even_indices([]) == []\", \"assert sort_even_indices([4]) == [4]\", \"assert sort_even_indices([4, 5]) == [4, 5]\", \"assert sort_even_indices([4, 5, 6]) == [4, 5, 6]\", \"assert sort_even_indices([7...
{ "split": "train", "index": 68017, "acecode_id": "evol_10275", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a string `text` that contains multiple pages separated by a specific character '\\x0c'. Each page may contain paragraphs separated by two newlines '\\n\\n'. Your task is to implement a function `split_text_to_pages(text: str) -> List[List[str]]` that splits the in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_text_to_pages('First page.\\\\x0cSecond page.\\\\n\\\\nThird page.') == [['First page.'], ['Second page.', 'Third page.']]\", \"assert split_text_to_pages('First.\\\\n\\\\n\\\\n\\\\nSecond.\\\\x0cThird.\\\\n\\\\nFourth.') == [['First.', 'Second.'], ['T...
{ "split": "train", "index": 68018, "acecode_id": "bigcode_python_fns_21143", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Write a function `add_two_numbers(num1: int, num2: int) -> int` that takes two integers as input and returns their sum. The function should also handle any exceptions that may occur during addition. If an exception occurs, return None instead of the sum.\nPlease reason step by ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_two_numbers(1, 2) == 3\", \"assert add_two_numbers(-1, 1) == 0\", \"assert add_two_numbers(0, 0) == 0\", \"assert add_two_numbers(-5, -5) == -10\", \"assert add_two_numbers(100, 200) == 300\", \"assert add_two_numbers(123456789, 987654321) == 1111111110\...
{ "split": "train", "index": 68019, "acecode_id": "evol_4717", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that validates a given phone number based on certain criteria. The phone number is represented as a string and must adhere to the following rules: 1. The phone number must consist of only digits (0-9) and may contain optional hyphe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_phone_number('1234567890') == True\", \"assert validate_phone_number('123-456-7890') == True\", \"assert validate_phone_number('123-456-78901234') == False\", \"assert validate_phone_number('(123 456-7890') == False\", \"assert validate_phone_number...
{ "split": "train", "index": 68020, "acecode_id": "oss_1240", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string that may contain a year formatted as a four-digit number (from 1900 to 2099), write a function that extracts the year from the string. If the year is found, return it as an integer. If the year is not found, raise a RuntimeError. Your function should only extract...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_year('The year was 2020') == 2020\", \"assert parse_year('We are in 1999') == 1999\", \"assert parse_year('Data from 2001 and 2022') == 2001\", \"assert parse_year('Year 2023 is here') == 2023\", \"assert parse_year('Year: 2021') == 2021\", \"assert pa...
{ "split": "train", "index": 68021, "acecode_id": "bigcode_python_fns_4644", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of data instances, where each instance is represented as a dictionary containing a key 'tokens' that maps to a list of strings. Your task is to implement a function that counts the occurrences of different lengths of token sequences across all instances. Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_token_lengths([{'tokens': []}, {'tokens': ['x', 'y']}, {'tokens': ['z']}]) == {0: 1, 2: 1, 1: 1}\", \"assert count_token_lengths([{'tokens': ['hello', 'world']}, {'tokens': ['foo', 'bar', 'baz']}]) == {2: 1, 3: 1}\", \"assert count_token_lengths([{'tok...
{ "split": "train", "index": 68022, "acecode_id": "oss_29337", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of commands represented as strings. Each command can contain a command name and an action to be performed. Your task is to implement a function `initialize_runtime_commands(commands: List[str]) -> List[str]` that takes a list of commands and returns a list ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_runtime_commands(['fgToggleSmoothShaded import fg_tools.ui.toggle_smooth_shaded()']) == ['Command: fgToggleSmoothShaded, Action: import fg_tools.ui.toggle_smooth_shaded()']\", \"assert initialize_runtime_commands(['fgToggleWireframe import fg_tool...
{ "split": "train", "index": 68023, "acecode_id": "bigcode_python_fns_16438", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function `assess_transition` that simulates the transition of a finite state machine based on a set of conditions derived from a user's input and system state. The function accepts the following parameters: `link_state` (a boolean indicating if the instructor is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert assess_transition(False, 'QUESTION', 1, 'correct', {}) == 'END'\", \"assert assess_transition(True, 'QUESTION', 2, 'correct', {}) == 'TITLE'\", \"assert assess_transition(True, 'QUESTION', 2, 'incorrect', {}) == 'TITLE'\", \"assert assess_transition(True, 'O...
{ "split": "train", "index": 68024, "acecode_id": "bigcode_python_fns_30597", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given two lists, `latitudes` and `longitudes`, which represent the latitude and longitude coordinates of points on a map, implement a function `get_coordinates_summary(latitudes: List[float], longitudes: List[float]) -> Dict[str, Union[float, float]]` that returns a summary of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_coordinates_summary([10.0, 20.0, 30.0], [5.0, 15.0, 25.0]) == {'min_latitude': 10.0, 'max_latitude': 30.0, 'min_longitude': 5.0, 'max_longitude': 25.0}\", \"assert get_coordinates_summary([-10.0, -20.0, -30.0], [-5.0, -15.0, -25.0]) == {'min_latitude': -...
{ "split": "train", "index": 68025, "acecode_id": "bigcode_python_fns_19948", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a string that represents a screen display, where each line of the string corresponds to a row on the screen. Your task is to convert this string into a list of lists, where each inner list represents a row of characters from the string. The rows are separated by n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_screen('a\\\\nb\\\\nc') == [['a'], ['b'], ['c']]\", \"assert convert_screen('abc\\\\ndef') == [['a', 'b', 'c'], ['d', 'e', 'f']]\", \"assert convert_screen('hello\\\\nworld') == [['h', 'e', 'l', 'l', 'o'], ['w', 'o', 'r', 'l', 'd']]\", \"assert conve...
{ "split": "train", "index": 68026, "acecode_id": "bigcode_python_fns_11514", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes an integer 'delta' and returns a new function. This new function should take a single integer 'number' as input and return the sum of 'number' and 'delta'. Additionally, implement another part of the function that takes a list ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_data(10)[0](0) == 10\", \"assert process_data(10)[0](5) == 15\", \"assert process_data(10)[0](10) == 20\", \"assert process_data(0)[0](0) == 0\", \"assert process_data(0)[0](1) == 1\", \"assert process_data(1)[0](1) == 2\", \"assert process_data(100)...
{ "split": "train", "index": 68027, "acecode_id": "bigcode_python_fns_7356", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats a person's name based on their first, middle, and last names. Write a function `format_name` that takes in three strings: `first_name`, `middle_name`, and `last_name`. The function should return a tuple containing two element...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_name('John', 'Michael', 'Doe') == ('John Michael Doe', 'Doe, J. M.')\", \"assert format_name('Alice', 'Wonder', 'Land') == ('Alice Wonder Land', 'Land, A. W.')\", \"assert format_name('Mary', 'Jane', 'Watson') == ('Mary Jane Watson', 'Watson, M. J.')\...
{ "split": "train", "index": 68028, "acecode_id": "oss_22881", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing a list of vehicles represented by custom VIMS (Vehicle Information Management System) objects. Each VIMS object contains information about a vehicle, including its make, model, year, and mileage. Your task is to implement a function that calculate...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_mileage([]) == 0\", \"assert calculate_average_mileage([VIMS('Toyota', 'Camry', 2020, 15000)]) == 15000.0\", \"assert calculate_average_mileage([VIMS('Honda', 'Accord', 2019, 20000), VIMS('Ford', 'Focus', 2018, 25000)]) == 22500.0\", \"asse...
{ "split": "train", "index": 68029, "acecode_id": "oss_19125", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `get_unique_random_numbers` that returns a list of exactly 7 non-repeating random integers between 1 and 20, inclusive. The output should not contain any duplicate numbers.\nPlease reason step by step, then write a self-contained Python solution. Giv...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_random_numbers() != get_unique_random_numbers()\", \"assert len(get_unique_random_numbers()) == 7\", \"assert all(1 <= num <= 20 for num in get_unique_random_numbers())\", \"assert len(set(get_unique_random_numbers())) == 7\", \"assert all(get_uni...
{ "split": "train", "index": 68030, "acecode_id": "evol_13940", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string of comma-separated numbers. Your task is to implement a function that reads this string, converts the numbers into a list of floating-point numbers, and returns this list. The input string may contain spaces around the numbers, which should be ignored. If...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert read_floats_from_string('1.1, 2.2, 200, -1.7') == [1.1, 2.2, 200.0, -1.7]\", \"assert read_floats_from_string(' 3.0, 4.5, 6.7 ') == [3.0, 4.5, 6.7]\", \"assert read_floats_from_string('0.1, 0.2, 0.3') == [0.1, 0.2, 0.3]\", \"assert read_floats_from_strin...
{ "split": "train", "index": 68031, "acecode_id": "bigcode_python_fns_39544", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a password validation function. The function `validate_password` takes a password as input and checks if it adheres to the following rules: 1. It must be at least 8 characters long. 2. It must contain at least one uppercase letter, one lowercase...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_password('Password1!') == True\", \"assert validate_password('weak') == False\", \"assert validate_password('NoDigit!') == False\", \"assert validate_password('NoSpecialCharacter1') == False\", \"assert validate_password('Short1!') == False\", \"ass...
{ "split": "train", "index": 68032, "acecode_id": "oss_16385", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `set_integer_value(key: str, value: Optional[int]) -> str` that simulates setting a global integer value in a hypothetical API. The function takes in a `key` which is a string identifier and a `value` which is an integer or None. If t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_integer_value('testKey', 10) == '10'\", \"assert set_integer_value('testKey', None) == 'Deleted'\", \"assert set_integer_value('testKey', 0) == '0'\", \"assert set_integer_value('anotherKey', 42) == '42'\", \"assert set_integer_value('', 5) == 'Invalid K...
{ "split": "train", "index": 68033, "acecode_id": "bigcode_python_fns_38286", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a directed graph represented as an adjacency list, where each node represents a metabolite and each directed edge represents a connection from one metabolite to another. Write a function `set_degree_as_weight(graph: Dict[int, List[int]]) -> Dict[Tuple[int, int], i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_degree_as_weight({1: [2, 3], 2: [3], 3: []}) == {(1, 2): 1, (1, 3): 0, (2, 3): 0}\", \"assert set_degree_as_weight({0: [1, 2], 1: [2], 2: []}) == {(0, 1): 1, (0, 2): 0, (1, 2): 0}\", \"assert set_degree_as_weight({1: [2], 2: [3], 3: [1]}) == {(1, 2): 1, ...
{ "split": "train", "index": 68034, "acecode_id": "bigcode_python_fns_31951", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of pairs representing connections between locations in a maze. Each location is identified by a unique letter and you need to determine if it is possible to visit all the locations starting from a given location while ensuring that you visit each location e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_visit_all_locations([('A', 'B'), ('A', 'C'), ('A', 'D'), ('B', 'C'), ('D', 'C')], 'A') == True\", \"assert can_visit_all_locations([('A', 'B'), ('B', 'C'), ('C', 'D'), ('D', 'E')], 'A') == True\", \"assert can_visit_all_locations([('A', 'B'), ('B', 'C'),...
{ "split": "train", "index": 68035, "acecode_id": "bigcode_python_fns_19169", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the cards in a player's hand in a game of blackjack. Your task is to implement a function `calculate_score(arr)` that computes the total score of the hand according to the following rules:\n\n1. If the hand contains exactly two card...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_score([10, 11]) == 0\", \"assert calculate_score([2, 3, 4]) == 9\", \"assert calculate_score([10, 10]) == 20\", \"assert calculate_score([9, 10, 11]) == 20\", \"assert calculate_score([2, 2, 2]) == 6\", \"assert calculate_score([10, 5, 11]) == 16\"...
{ "split": "train", "index": 68036, "acecode_id": "bigcode_python_fns_24174", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a keyring management system for storing and retrieving sensitive information (like passwords). The function `manage_keyring` will take two parameters: a list of tuples and an operation type. Each tuple contains a key (strin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_keyring([('user1', 'password1')], 'add') == None\", \"assert manage_keyring([('user1', 'password1')], 'get') == 'Key not found'\", \"assert manage_keyring([('user1', 'password1'), ('user2', 'password2')], 'add') == None\", \"assert manage_keyring([('u...
{ "split": "train", "index": 68037, "acecode_id": "bigcode_python_fns_4748", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a python function called `calculate_cube_properties` that takes a positive number `side` as input, representing the length of a side of a cube. The function should return a dictionary with the following keys and their corresponding values: 'volume', 'surface_area', and 'd...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_cube_properties(1) == {'volume': 1, 'surface_area': 6, 'diagonal': 1.7320508075688772}\", \"assert calculate_cube_properties(2) == {'volume': 8, 'surface_area': 24, 'diagonal': 3.4641016151377544}\", \"assert calculate_cube_properties(3) == {'volum...
{ "split": "train", "index": 68038, "acecode_id": "evol_34642", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a string `work_url` representing a URL. Your task is to extract the work id from the URL. The work id is defined as the last segment of the URL, which is separated by '/' characters. Implement a function `extract_work_id(work_url: str) -> str` that takes the URL a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_work_id('https://example.com/work/12345') == '12345'\", \"assert extract_work_id('https://example.com/work/') == ''\", \"assert extract_work_id('work/67890') == '67890'\", \"assert extract_work_id('/') == ''\", \"assert extract_work_id('http://mywebs...
{ "split": "train", "index": 68039, "acecode_id": "bigcode_python_fns_6030", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function in Python that takes two arrays and a number. The function should return a new array: the first array sorted in ascending order by the frequency of each value in the second array. If a value is not present in the second array, sort it in ascending order by ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_by_frequency_and_value([], [1, 2, 3], 1) == []\", \"assert sort_by_frequency_and_value([1], [], 1) == [1]\", \"assert sort_by_frequency_and_value([8, 8, 8], [8, 8], 3) == [8, 8, 8]\", \"assert sort_by_frequency_and_value([5], [9, 10, 11], 1) == [5]\", \...
{ "split": "train", "index": 68040, "acecode_id": "evol_15589", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given two lists of numerical values, `y_sim` representing simulated values and `y_obs` representing observed values, write a function `coef_determ(y_sim: List[float], y_obs: List[float]) -> float` that calculates the coefficient of determination (R-squared value). The coefficie...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert coef_determ([1, 2, 3], [1, 2, 3]) == 1.0\", \"assert coef_determ([1, 2, 3], [1, 1, 1]) == 0.0\", \"assert coef_determ([-1, -2, -3], [-1, -2, -3]) == 1.0\", \"assert coef_determ([10, 20, 30], [10, 20, 30]) == 1.0\", \"assert coef_determ([2, 3, 4], [2, 3, 4]) ...
{ "split": "train", "index": 68041, "acecode_id": "bigcode_python_fns_7041", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function called `format_string` that takes a string as input and replaces all occurrences of specific characters with alternative characters. The characters to replace are: replace '&' with 'and', replace '@' with 'at', and replace '#' with 'numbe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_string('Hello & World @ 2023 #1') == 'Hello and World at 2023 number1'\", \"assert format_string('Python & Java') == 'Python and Java'\", \"assert format_string('No special characters here.') == 'No special characters here.'\", \"assert format_string(...
{ "split": "train", "index": 68042, "acecode_id": "bigcode_python_fns_31309", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the setup of a climate control system for a sauna. The function should take a temperature setting as input and return a string indicating whether the sauna is ready, too hot, or too cold based on the provided temperatur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert setup_sauna_climate(65) == 'Too cold'\", \"assert setup_sauna_climate(70) == 'Sauna is ready'\", \"assert setup_sauna_climate(75) == 'Sauna is ready'\", \"assert setup_sauna_climate(85) == 'Sauna is ready'\", \"assert setup_sauna_climate(90) == 'Sauna is rea...
{ "split": "train", "index": 68043, "acecode_id": "bigcode_python_fns_46573", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a parser function for improper dihedral parameters used in molecular dynamics simulations. You are given a database `db` represented as a dictionary, where each key is an entry name associated with an improper dihedral, and the value is a dictio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_improper_dihedral({'dipole-cone-1': {'style': 'dipole/cone', 'params': '200 120 60'}}, 'dipole-cone-1') == ('dipole/cone', [200, 120, 60])\", \"assert parse_improper_dihedral({'dipole-cone-1': {'style': 'dipole/cone', 'params': '200 120 60'}}, 'non-exi...
{ "split": "train", "index": 68044, "acecode_id": "oss_31577", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `quick_sort_alphanumeric(data: List[str]) -> List[str]` that takes a list of alphanumeric strings and sorts them in lexicographic order using the Quick Sort algorithm. The function should return the sorted list.\nPlease reason step by step, then write a sel...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert quick_sort_alphanumeric(['b', 'd', 'a', 'c', 'f', 'e', '1', '3', '2']) == ['1', '2', '3', 'a', 'b', 'c', 'd', 'e', 'f']\", \"assert quick_sort_alphanumeric(['apple', 'banana', 'cherry', 'date']) == ['apple', 'banana', 'cherry', 'date']\", \"assert quick_sort...
{ "split": "train", "index": 68045, "acecode_id": "evol_31738", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_max_count(my_list)` that takes a list of integers as input. The function should return a tuple containing the maximum value from the list and the number of times this maximum value appears in the list. If the list is empty, the function should return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_count([25, 1, 8, 25, 10, 6, 25]) == (25, 3)\", \"assert find_max_count([3, 1, 2, 3, 3]) == (3, 3)\", \"assert find_max_count([-1, -2, -3, -1]) == (-1, 2)\", \"assert find_max_count([1]) == (1, 1)\", \"assert find_max_count([10, 10, 10, 10]) == (10, ...
{ "split": "train", "index": 68046, "acecode_id": "evol_13694", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the total number of elements in a multi-dimensional dataset represented as a list of lists. The function should return the total number of elements present in the dataset. Implement the function `calculate_total_elemen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_elements([[1, 2, 3], [4, 5]]) == 5\", \"assert calculate_total_elements([[1, 2], [3, 4], [5, 6]]) == 6\", \"assert calculate_total_elements([[], [], []]) == 0\", \"assert calculate_total_elements([[1], [2], [3], [4], [5]]) == 5\", \"assert ca...
{ "split": "train", "index": 68047, "acecode_id": "oss_16784", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a binary tree represented as a list of tuples, where each tuple consists of a node's value and a list of its children, implement a function that merges genes from different strains into species. Each strain is represented by a string, and each gene is represented by a str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert getMergers([(1, [2, 3]), (2, []), (3, [])], {'strain1': 'speciesA', 'strain2': 'speciesA'}, {}) == []\", \"assert getMergers([(1, [2]), (2, [3]), (3, [])], {'strain1': 'speciesA', 'strain2': 'speciesB', 'strain3': 'speciesB'}, {}) == []\", \"assert getMerger...
{ "split": "train", "index": 68048, "acecode_id": "bigcode_python_fns_21004", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a string that represents a system name, implement a function `is_windows_system(system_name: str) -> bool` that determines if the given system name corresponds to a Windows operating system. The function should return True if the system name is 'Windows', regardless of ca...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_windows_system('Windows') == True\", \"assert is_windows_system('windows') == True\", \"assert is_windows_system('WINDOWS') == True\", \"assert is_windows_system('Linux') == False\", \"assert is_windows_system('macOS') == False\", \"assert is_windows_syst...
{ "split": "train", "index": 68049, "acecode_id": "bigcode_python_fns_16431", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a two-dimensional array `X`, write a function that traverses through every element of the array and returns a one-dimensional list containing all the elements. The order of the elements in the resulting list does not matter.\nPlease reason step by step, then write a self-...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert f([[1, 2], [3, 4]]) == [1, 2, 3, 4]\", \"assert f([[5]]) == [5]\", \"assert f([[1, 2, 3], [4, 5, 6]]) == [1, 2, 3, 4, 5, 6]\", \"assert f([[10, 20], [30, 40], [50, 60]]) == [10, 20, 30, 40, 50, 60]\", \"assert f([[7, 8, 9], [10, 11, 12]]) == [7, 8, 9, 10, 11...
{ "split": "train", "index": 68050, "acecode_id": "evol_21406", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the growth of a snake in a simple game. The snake's body is represented as a list of blocks, where each block has x and y coordinates. Given the initial position of the snake's head and its current direction, implement a function `add_body_block(i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_body_block(0, 0, (1, 0)) == {'x': -1, 'y': 0}\", \"assert add_body_block(1, 1, (0, 1)) == {'x': 1, 'y': 0}\", \"assert add_body_block(5, 5, (-1, 0)) == {'x': 6, 'y': 5}\", \"assert add_body_block(10, 10, (0, -1)) == {'x': 10, 'y': 11}\", \"assert add_bod...
{ "split": "train", "index": 68051, "acecode_id": "oss_12497", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `lcm_of_primes(limit: int) -> int` that calculates the least common multiple (LCM) of all prime numbers up to a specified limit. The function should return the LCM of all prime numbers in the range from 2 to the given limit, inclusive. If there are no prime...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lcm_of_primes(1) == 1\", \"assert lcm_of_primes(2) == 2\", \"assert lcm_of_primes(3) == 6\", \"assert lcm_of_primes(4) == 6\", \"assert lcm_of_primes(5) == 30\", \"assert lcm_of_primes(6) == 30\", \"assert lcm_of_primes(7) == 210\", \"assert lcm_of_primes(8)...
{ "split": "train", "index": 68052, "acecode_id": "evol_16737", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list `head_medica` containing a single string element. The string consists of comma-separated medical class codes, where each code is in the format 'Class-{number}-{code}'. Your task is to write a function `count_medical_codes` that counts the occurrences of eac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_medical_codes(['Class-0-593_70,Class-1-079_99,Class-2-786_09']) == {'593_70': 1, '079_99': 1, '786_09': 1}\", \"assert count_medical_codes(['Class-0-593_70,Class-1-593_70']) == {'593_70': 2}\", \"assert count_medical_codes(['Class-0-123_45,Class-1-123_...
{ "split": "train", "index": 68053, "acecode_id": "oss_17082", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of dictionaries, each representing a field with a 'label' and a 'value'. Your function should return a list of strings formatted as '<label> : <value>' for each field. Write a function named 'format_fields' that implemen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_fields([{'label': 'Name', 'value': 'Alice'}, {'label': 'Age', 'value': 30}]) == ['Name : Alice', 'Age : 30']\", \"assert format_fields([{'label': 'Email', 'value': 'alice@example.com'}, {'label': 'Country', 'value': 'Wonderland'}]) == ['Email : alice@...
{ "split": "train", "index": 68054, "acecode_id": "evol_8499", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a value and two children, implement a function that creates a binary tree node and returns it. The node should have a value and pointers to its left and right children, which can be set to None if they do not exist.\nPlease reason step by step, then write a self-contained...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert TreeNode('Root').value == 'Root'\", \"assert TreeNode('Left child').left == None\", \"assert TreeNode('Right child').right == None\", \"assert TreeNode('Node', TreeNode('Left')).left.value == 'Left'\", \"assert TreeNode('Node', None, TreeNode('Right')).right...
{ "split": "train", "index": 68055, "acecode_id": "evol_9279", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that searches for a specific pattern within a given memory range defined by a starting address and size. Write a function `search_memory` that takes the following parameters: \n- `memory_start`: An integer representing the starting ad...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_memory(0, 100, b'abc', 1) == 10\", \"assert search_memory(0, 100, b'abc', 5) == 10\", \"assert search_memory(0, 100, b'abc', 10) == 10\", \"assert search_memory(0, 100, b'abc', 2) == 10\", \"assert search_memory(0, 50, b'abc', 1) == 10\", \"assert sea...
{ "split": "train", "index": 68056, "acecode_id": "oss_23745", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that sorts the list in ascending order using the merge sort algorithm. The function should take a single parameter, `arr`, which is a list of integers, and return a new list that contains the sorted integers.\nPlease reason step by...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_sort([2, 5, 4, 3, 9]) == [2, 3, 4, 5, 9]\", \"assert merge_sort([10, 7, 8, 9, 1, 5]) == [1, 5, 7, 8, 9, 10]\", \"assert merge_sort([3, 2, 1]) == [1, 2, 3]\", \"assert merge_sort([1]) == [1]\", \"assert merge_sort([]) == []\", \"assert merge_sort([5, 4,...
{ "split": "train", "index": 68057, "acecode_id": "evol_24435", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function that simulates saving a machine learning model to a file. Your task is to implement a function `save_model(model: str, model_file: str) -> str` that takes a model name as a string and a file name as a string. The function should return a success message...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert save_model('my_model', 'model.pkl') == 'Model export success: model.pkl'\", \"assert save_model('decision_tree', 'tree_model.pkl') == 'Model export success: tree_model.pkl'\", \"assert save_model('linear_regression', 'linear_model.joblib') == 'Model export s...
{ "split": "train", "index": 68058, "acecode_id": "bigcode_python_fns_40098", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a country or region code (e.g., 'zh_CN', 'jp_JP', etc.), implement a function `get_default_font(country_code: str) -> List[str]` that returns a list of default sans-serif fonts based on the provided country code. The font preferences should be as fol...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_default_font('zh_CN') == ['Microsoft YaHei', 'Source Han Sans CN', 'Noto Sans CJK']\", \"assert get_default_font('zh_TW') == ['Microsoft JhengHei', 'Source Han Sans TW', 'Noto Sans CJK']\", \"assert get_default_font('jp_JP') == ['Meiryo', 'Source Han JP'...
{ "split": "train", "index": 68059, "acecode_id": "bigcode_python_fns_42410", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string of text as input and retrieves all distinct telephone numbers found within the text. The function should support both domestic and international formats, including country codes. Return a list of the extracted telephone numbers, ensuring...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_phone_numbers('Call us at +1 800 123 4567 or 800 123 456.') == ['+18001234567', '800123456']\", \"assert find_phone_numbers('Reach me at +91-800-000-0000 or +1-202-555-0191.') == ['+918000000000', '+12025550191']\", \"assert find_phone_numbers('Dial +1-...
{ "split": "train", "index": 68060, "acecode_id": "evol_10095", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the deletion of a relationship based on an identifier. The function will take an integer parameter `rel_id`, which represents the ID of a comment relationship to be deleted. Your function should return a string message ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_relationship(1) == 'Relationship 1 deleted.'\", \"assert delete_relationship(42) == 'Relationship 42 deleted.'\", \"assert delete_relationship(0) == 'Relationship 0 deleted.'\", \"assert delete_relationship(100) == 'Relationship 100 deleted.'\", \"ass...
{ "split": "train", "index": 68061, "acecode_id": "bigcode_python_fns_6251", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a filename, return the complete path to the file located in a directory named 'ffxml'. The directory 'ffxml' is located at the root of the project. The function should concatenate the given filename with the directory path and return the full path as a string. Implement a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_file_path('example.txt') == 'ffxml/example.txt'\", \"assert get_file_path('data.csv') == 'ffxml/data.csv'\", \"assert get_file_path('config.json') == 'ffxml/config.json'\", \"assert get_file_path('image.png') == 'ffxml/image.png'\", \"assert get_file_pat...
{ "split": "train", "index": 68062, "acecode_id": "bigcode_python_fns_42648", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program that simulates a simple game using a 5x5 grid. The game involves a player navigating through the grid to reach a goal while avoiding obstacles. The player's position and the goal position are represented by specific indices on the grid (fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_game((0, 0), (4, 4), [(1, 1), (2, 2), (3, 3)]) == 'Game in progress'\", \"assert simulate_game((2, 0), (4, 4), [(2, 1), (3, 2), (1, 3)]) == 'Game in progress'\", \"assert simulate_game((1, 0), (4, 4), [(2, 1), (3, 2), (1, 3)]) == 'Game in progress'\...
{ "split": "train", "index": 68063, "acecode_id": "oss_13718", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to write a function that determines the maximum sum of any contiguous subarray within the list. A contiguous subarray is defined as a sequence of elements in the array that are next to each other. Implement the function `max_subarr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_subarray_sum([1, 2, 3, 4, 5]) == 15\", \"assert max_subarray_sum([-2, -3, -1]) == -1\", \"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([1, -2, 3, 4]) == 7\", \"assert max_subarray_sum([2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6\"...
{ "split": "train", "index": 68064, "acecode_id": "bigcode_python_fns_22367", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Write a function that returns a new list containing only the unique elements from the original list, in the order they first appeared. Do not use any external libraries. The function should take a single argument, which is the list of integers,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 2, 3, 4, 3, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_elements([5, 5, 5, 5]) == [5]\", \"assert unique_elements([]) == []\", \"assert unique_elements([1, 1, 1, 2, 2, 2, 3]) == [1, 2, 3]\", \"assert unique_elements([10, 20, 30, 10, 20, ...
{ "split": "train", "index": 68065, "acecode_id": "bigcode_python_fns_4468", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string and a list of characters, implement a function that returns a dictionary containing the count of each character from the list that appears in the string. The string can contain all ASCII characters and can be as long as 1,000,000 characters. Your solution should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_characters(['l', 'o', 'r'], 'Hello World') == {'l': 3, 'o': 2, 'r': 1}\", \"assert count_characters(['a', 'e', 'i', 'o', 'u'], 'The quick brown fox jumps over the lazy dog') == {'a': 1, 'e': 3, 'i': 1, 'o': 4, 'u': 2}\", \"assert count_characters(['H',...
{ "split": "train", "index": 68066, "acecode_id": "evol_36031", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to format vertex and normal data for 3D models. Your function should take in two parameters: `verts`, a 2D list containing vertex coordinates where each vertex is represented as a list of three floats (x, y, z), and `norms`, a 2D list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_vertex_data([[1.0, 2.0, 3.0]], [[0.1, 0.2, 0.3]]) == '1.0 2.0 3.0 0.1 0.2 0.3\\\\n'\", \"assert format_vertex_data([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], [[0.1, 0.2, 0.3], [0.4, 0.5, 0.6]]) == '1.0 2.0 3.0 0.1 0.2 0.3\\\\n4.0 5.0 6.0 0.4 0.5 0.6\\\\n'\",...
{ "split": "train", "index": 68067, "acecode_id": "oss_18004", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of a cancel button in a graphical user interface (GUI). The function should take a single argument, `event`, which represents a user action. When the user presses the Escape key, the function should set a globa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_cancel_event('Escape') == 'Cancel action triggered.'\", \"assert handle_cancel_event('Enter') == 'No action taken.'\", \"assert handle_cancel_event('Space') == 'No action taken.'\", \"assert handle_cancel_event('ArrowUp') == 'No action taken.'\", \"as...
{ "split": "train", "index": 68068, "acecode_id": "bigcode_python_fns_9284", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `enqueue_and_get_mean(queue: List[int], value: int) -> float` that simulates adding an integer to a queue represented as a list and returns the updated mean of the queue elements after the insertion. The queue is empty initially. If the queue becomes empty ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert enqueue_and_get_mean([], 5) == 5.0\", \"assert enqueue_and_get_mean([5], 10) == 7.5\", \"assert enqueue_and_get_mean([5, 10], 7) == 7.333333333333333\", \"assert enqueue_and_get_mean([5, 10, 7], 3) == 6.25\", \"assert enqueue_and_get_mean([5, 10, 7, 3], 8) =...
{ "split": "train", "index": 68069, "acecode_id": "evol_15440", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a string as input, representing the name of a logger, and returns a dictionary that simulates the state of that logger. The dictionary should contain two keys: 'level' which should be set to 'DEBUG', and 'propagate' which shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert disable_logger('my_logger') == {'level': 'DEBUG', 'propagate': False}\", \"assert disable_logger('error_logger') == {'level': 'DEBUG', 'propagate': False}\", \"assert disable_logger('access_logger') == {'level': 'DEBUG', 'propagate': False}\", \"assert disab...
{ "split": "train", "index": 68070, "acecode_id": "bigcode_python_fns_3080", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of floating-point numbers representing reduced potentials, implement a function `compute_timeseries(potentials: List[float]) -> List[float]` that returns a new list where each element is the square of the corresponding element in the input list. The output list sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_timeseries([]) == []\", \"assert compute_timeseries([0.0]) == [0.0]\", \"assert compute_timeseries([-1.0]) == [1.0]\", \"assert compute_timeseries([-2.5, 0.0, 2.5]) == [6.25, 0.0, 6.25]\", \"assert compute_timeseries([1.0, -1.0, 2.0]) == [1.0, 1.0, 4...
{ "split": "train", "index": 68071, "acecode_id": "bigcode_python_fns_32542", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that converts any input into its string representation. The function should take a single parameter of any data type and return its string format. The input can be an integer, float, list, dictionary, or any other data type that can be co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_string(123) == '123'\", \"assert convert_to_string(45.67) == '45.67'\", \"assert convert_to_string([1, 2, 3]) == '[1, 2, 3]'\", \"assert convert_to_string({'a': 1, 'b': 2}) == \\\"{'a': 1, 'b': 2}\\\"\", \"assert convert_to_string('Hello, World!')...
{ "split": "train", "index": 68072, "acecode_id": "bigcode_python_fns_37332", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating an HTML anchor tag from a given text and URL. Write a function `create_anchor_tag(text: str, url: str) -> str` that takes two strings as input: `text`, which is the anchor text, and `url`, which is the hyperlink. The function should return a string ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_anchor_tag('Google', 'http://www.google.com') == \\\"<a href='http://www.google.com'>Google</a>\\\"\", \"assert create_anchor_tag('OpenAI', 'https://www.openai.com') == \\\"<a href='https://www.openai.com'>OpenAI</a>\\\"\", \"assert create_anchor_tag(...
{ "split": "train", "index": 68073, "acecode_id": "bigcode_python_fns_38996", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are required to implement a function that takes a list of integers as input and returns a list containing the squares of those integers in ascending order. The input list may contain both positive and negative integers. Your function should handle the case where the input l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sorted_squares([]) == []\", \"assert sorted_squares([-2, -1, 0, 1, 2]) == [0, 1, 1, 4, 4]\", \"assert sorted_squares([-3, -2, -1]) == [1, 4, 9]\", \"assert sorted_squares([3, 2, 1]) == [1, 4, 9]\", \"assert sorted_squares([-5, -4, -3, -2, -1]) == [1, 4, 9, 1...
{ "split": "train", "index": 68074, "acecode_id": "oss_21648", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the addition of a user to a group in a system. The function should take three parameters: a list of existing users in the group, a new user to be added, and the name of the group. The function should return `True` if the us...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_user_to_group(['alice', 'bob'], 'charlie', 'staff') == True\", \"assert add_user_to_group(['alice', 'bob'], 'alice', 'staff') == False\", \"assert add_user_to_group([], 'dave', 'admins') == True\", \"assert add_user_to_group(['eve'], 'frank', 'managers')...
{ "split": "train", "index": 68075, "acecode_id": "bigcode_python_fns_47140", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines whether a new heap size is greater than an existing heap size. Write a function `check_heap_size` that takes the existing heap size as an argument and a new heap size as a second argument. The function should return a bool...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_heap_size(1024, 2048) == True\", \"assert check_heap_size(512, 1024) == True\", \"assert check_heap_size(2048, 2048) == False\", \"assert check_heap_size(100, 50) == False\", \"assert check_heap_size(0, 1) == True\", \"assert check_heap_size(999, 1000)...
{ "split": "train", "index": 68076, "acecode_id": "oss_14831", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `search_media(search_queries: List[str], media: List[Dict[str, Any]], ignore_likes: bool) -> List[List[Dict[str, Any]]]`. The function takes three parameters: a list of search queries (strings) and a list of media items (dictionaries)...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_media(['fun'], [{'comments': 'This is a fun video', 'likes': 10, 'tags': ['video', 'fun']}], True) == [[{'comments': 'This is a fun video', 'likes': 10, 'tags': ['video', 'fun']}]]\", \"assert search_media(['video'], [{'comments': 'This is a fun video...
{ "split": "train", "index": 68077, "acecode_id": "bigcode_python_fns_19690", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `reverse_parameters(*args)` that accepts any number of parameters and returns a list of these parameters in reversed order. If no parameters are provided, the function should return an empty list.\nPlease reason step by step, then write a self-contained Pyt...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_parameters(1, 2, 3) == [3, 2, 1]\", \"assert reverse_parameters('a', 'b', 'c') == ['c', 'b', 'a']\", \"assert reverse_parameters(10, 20, 30, 40) == [40, 30, 20, 10]\", \"assert reverse_parameters() == []\", \"assert reverse_parameters('hello', 5) == ...
{ "split": "train", "index": 68078, "acecode_id": "evol_29935", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `calculate_energy` that computes the energy of the signal represented by the list. The energy is defined as the sum of the squares of the integers in the list. The function should take a single parameter, a list of integers, and return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_energy([1, 2, 3]) == 14\", \"assert calculate_energy([-1, -2, -3]) == 14\", \"assert calculate_energy([0, 0, 0]) == 0\", \"assert calculate_energy([5]) == 25\", \"assert calculate_energy([1, -1]) == 2\", \"assert calculate_energy([2, 2, 2]) == 12\"...
{ "split": "train", "index": 68079, "acecode_id": "bigcode_python_fns_36182", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of integers as input and returns the sum of all even numbers in the list. If there are no even numbers, return 0. The function should handle negative numbers and zero as valid integers. Define the function `sum_of_ev...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4]) == 6\", \"assert sum_of_evens([0, 1, 2]) == 2\", \"assert sum_of_evens([-2, -1, 0, 1]) == -2\", \"assert sum_of_evens([1, 3, 5]) == 0\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([2, 4, 6, 8]) == 20\", \"assert sum_of...
{ "split": "train", "index": 68080, "acecode_id": "oss_11207", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a nested data structure that may consist of dictionaries and lists, implement a function `get_property(obj, components)` that retrieves a specific property from the object based on the provided list of components. The components can be keys for dictionaries or indices for...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_property({'a': [{'b': 1}, {'c': 2}]}, ['a', 0, 'b']) == 1\", \"assert get_property({'a': [{'b': 1}, {'c': 2}]}, ['a', 1, 'c']) == 2\", \"assert get_property({'a': [{'b': 1}, {'c': 2}]}, ['a', 2]) == None\", \"assert get_property({'a': [{'b': 1}, {'c': 2}...
{ "split": "train", "index": 68081, "acecode_id": "bigcode_python_fns_40639", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that initializes the attributes of an Airflow Network Distribution Component Coil. The function should set the validation level to error and initialize the following attributes: `coil_name` with the string 'object-list|Coil Name', `coil_o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_coil() == {'coil_name': 'object-list|Coil Name', 'coil_object_type': 'Coil:Cooling:DX:SingleSpeed', 'air_path_length': 0.0001}\", \"assert initialize_coil()['coil_name'] == 'object-list|Coil Name'\", \"assert initialize_coil()['coil_object_type'] ...
{ "split": "train", "index": 68082, "acecode_id": "oss_12012", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given string is a valid receipt identifier. A valid receipt identifier must meet the following criteria: it must start with the prefix 'REC-', followed by exactly 6 numeric digits. Implement a function `is_valid_receipt_i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_receipt_identifier('REC-123456') == True\", \"assert is_valid_receipt_identifier('REC-000001') == True\", \"assert is_valid_receipt_identifier('REC-123abc') == False\", \"assert is_valid_receipt_identifier('REC-123') == False\", \"assert is_valid_re...
{ "split": "train", "index": 68083, "acecode_id": "bigcode_python_fns_11778", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries where each dictionary contains four keys ('a', 'b', 'c', 'd') with numeric values or non-numeric strings, implement a function `sort_and_handle_exceptions(data)` that converts non-numeric values to None, sorts the dictionaries by the values of each ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_and_handle_exceptions([{'a': 1, 'b': 'x', 'c': 'y', 'd': 4}, {'a': 3, 'b': 5, 'c': 6, 'd': 2}, {'a': 2, 'b': 8, 'c': 1, 'd': 3}]) == [{'a': 1, 'b': None, 'c': None, 'd': 4}, {'a': 2, 'b': 8, 'c': 1, 'd': 3}, {'a': 3, 'b': 5, 'c': 6, 'd': 2}]\", \"assert...
{ "split": "train", "index": 68084, "acecode_id": "evol_3873", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a string representing the content of a Python setup configuration file. Your task is to write a function `extract_package_info` that extracts the package name, version, and author from this configuration string. The extracted information should be returned as a di...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_package_info('setup(name=\\\"runa\\\", version=\\\"0.2.10\\\", author=\\\"John Doe\\\")') == {'name': 'runa', 'version': '0.2.10', 'author': 'John Doe'}\", \"assert extract_package_info('setup(name=\\\"example-package\\\", version=\\\"1.0.0\\\", auth...
{ "split": "train", "index": 68085, "acecode_id": "oss_32441", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple messaging system for a chat bot. Implement a function `send_message(chat_id: int, message: str) -> str` that simulates sending a message to a specific chat. The function should take two inputs: an integer `chat_id` representing the unique i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_message(1, 'Hello!') == 'Message sent to chat 1: Hello!'\", \"assert send_message(2, 'Welcome to the chat!') == 'Message sent to chat 2: Welcome to the chat!'\", \"assert send_message(3, 'This is a test message.') == 'Message sent to chat 3: This is a t...
{ "split": "train", "index": 68086, "acecode_id": "bigcode_python_fns_8138", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that modifies the content of a text file by inserting a specified line at the beginning of the file. The function should take three parameters: the content to insert, the initial content of the file as a string, and the location where the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert insert_line_at_start('X', 'A\\\\nB\\\\nC') == 'X\\\\nA\\\\nB\\\\nC'\", \"assert insert_line_at_start('Hello', 'World\\\\n!') == 'Hello\\\\nWorld\\\\n!'\", \"assert insert_line_at_start('1', '2\\\\n3\\\\n4') == '1\\\\n2\\\\n3\\\\n4'\", \"assert insert_line_at...
{ "split": "train", "index": 68087, "acecode_id": "bigcode_python_fns_13875", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `remove_last_element(lst)` that takes a list as input and removes the last element from the list. The function should return the updated list after the last element has been removed.\nPlease reason step by step, then write a self-contained Python solution. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_last_element(['a', 'b', 'c', 'd']) == ['a', 'b', 'c']\", \"assert remove_last_element(['1', '2', '3']) == ['1', '2']\", \"assert remove_last_element(['apple', 'banana', 'cherry']) == ['apple', 'banana']\", \"assert remove_last_element([True, False, Tr...
{ "split": "train", "index": 68088, "acecode_id": "evol_28296", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the creation of database tables for a healthcare data analysis project. Write a function `create_tables` that takes two parameters: `hpo_id`, a string representing the ID of the healthcare provider organization, and `drop_existing`, a boolean that...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_tables('HPO123', False) == ['patients', 'observations', 'conditions', 'procedures', 'drugs']\", \"assert create_tables('HPO456', True) == ['patients (dropped)', 'observations (dropped)', 'conditions (dropped)', 'procedures (dropped)', 'drugs (dropped)...
{ "split": "train", "index": 68089, "acecode_id": "bigcode_python_fns_12662", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers and returns a new list with the elements shuffled in a random order. The original list should remain unchanged. You may assume the list has at least one element.\nPlease reason step by step, then write a self-contained Python s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shuffle_list([1]) == [1]\", \"assert shuffle_list([1, 2]) != [1, 2]\", \"assert sorted(shuffle_list([1, 2, 3])) == [1, 2, 3]\", \"assert shuffle_list(['a', 'b', 'c']) != ['a', 'b', 'c']\", \"assert shuffle_list([0, 0, 0]) == [0, 0, 0]\", \"assert shuffle_lis...
{ "split": "train", "index": 68090, "acecode_id": "evol_7987", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `get_favorite_number(name: str) -> int` that takes a string `name` as input. The function should convert the string `name` to an integer and return the result of adding 10 to it. Assume that the input string will always be a valid integer representation.\nP...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_favorite_number('5') == 15\", \"assert get_favorite_number('10') == 20\", \"assert get_favorite_number('0') == 10\", \"assert get_favorite_number('-5') == 5\", \"assert get_favorite_number('100') == 110\", \"assert get_favorite_number('1234') == 1244\", ...
{ "split": "train", "index": 68091, "acecode_id": "evol_18225", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that generates a random floating-point number within a specified range, inclusive of both minimum and maximum values. The function should take two parameters, `min_value` and `max_value`, where `min_value` is guaranteed to be less than or equal to `max_valu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert 5 <= generate_stochastic(5, 20) <= 20\", \"assert 10 <= generate_stochastic(10, 15) <= 15\", \"assert -5 <= generate_stochastic(-5, 5) <= 5\", \"assert 0 <= generate_stochastic(0, 1) <= 1\", \"assert 1 <= generate_stochastic(1, 1) <= 1\", \"assert 50 <= gene...
{ "split": "train", "index": 68092, "acecode_id": "evol_9908", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates a list of DNS record entries. Each DNS record is represented as a dictionary with two keys: 'name' (a string representing the domain name) and 'type' (a string indicating the DNS record type, such as 'A', 'CNAME', 'MX', etc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_dns_records([{'name': 'example.com', 'type': 'A'}, {'name': 'www.example.com', 'type': 'CNAME'}]) == True\", \"assert validate_dns_records([{'name': 'example.com', 'type': 'A'}, {'name': 'mail.example.com', 'type': 'MX'}]) == True\", \"assert valida...
{ "split": "train", "index": 68093, "acecode_id": "oss_13717", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `sum_of_evens` that returns the sum of all even numbers in the list. If there are no even numbers, return 0. The input list can contain both positive and negative integers. \n\nFunction Signature: `def sum_of_evens(nums: List[int]) -> ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([0, 2, 4, -6]) == 0\", \"assert sum_of_evens([-1, -2, -3, -4]) == -6\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([10, 20, 30, 40]) == 100\", \"assert sum_of_evens([1, 2, 3, ...
{ "split": "train", "index": 68094, "acecode_id": "bigcode_python_fns_28393", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `find_most_frequent_element(nearest_neighbours)` that takes a list of integers called `nearest_neighbours` as input. Your function should return the most frequently occurring integer in the list. If there are multiple integers that oc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_most_frequent_element([1, 2, 3, 2, 2, 3, 4, 4, 4, 4]) in [2, 4]\", \"assert find_most_frequent_element([1, 1, 2, 2, 3, 3, 1]) == 1\", \"assert find_most_frequent_element([5, 5, 5, 1, 1, 2]) == 5\", \"assert find_most_frequent_element([]) == None\", \"as...
{ "split": "train", "index": 68095, "acecode_id": "oss_7985", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function that processes a list of dictionaries representing user actions on an e-commerce platform. Each dictionary contains the following keys: 'action', 'user_id', and 'timestamp'. The function should aggregate the actions by user and return a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert aggregate_user_actions([{'action': 'click', 'user_id': 'user1', 'timestamp': 1}, {'action': 'purchase', 'user_id': 'user1', 'timestamp': 2}, {'action': 'click', 'user_id': 'user2', 'timestamp': 3}]) == [{'user_id': 'user1', 'total_actions': 2, 'last_action_t...
{ "split": "train", "index": 68096, "acecode_id": "evol_14557", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a SQL query string, implement a function that extracts the names of all the tables referenced in the query. The tables are identified by the keywords 'FROM' and 'JOIN'. The function should return a set of unique table names mentioned in the query. If no tables are found, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_tables('SELECT * FROM users JOIN orders ON users.id = orders.user_id') == {'users', 'orders'}\", \"assert extract_tables('SELECT name FROM employees') == {'employees'}\", \"assert extract_tables('SELECT * FROM products') == {'products'}\", \"assert e...
{ "split": "train", "index": 68097, "acecode_id": "bigcode_python_fns_45412", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `class_weighting` that takes a list of class counts and returns a list of weights for each class based on the inverse frequency of the classes. The weight for each class should be calculated as the total number of samples divided by the count of samples in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert class_weighting([0, 0, 0]) == [0, 0, 0]\", \"assert class_weighting([0, 1, 2]) == [0, 3.0, 1.5]\", \"assert class_weighting([5]) == [1.0]\", \"assert class_weighting([0, 10, 20]) == [0, 3.0, 1.5]\", \"assert class_weighting([1, 1, 1, 0]) == [3.0, 3.0, 3.0, 0...
{ "split": "train", "index": 68098, "acecode_id": "evol_15295", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of company tickers as input and returns a list of those tickers that belong to the technology sector. The function should filter out any tickers that do not belong to the technology sector. The input will be a list of st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_tech_tickers(['AAPL', 'MSFT', 'GOOGL', 'AMZN', 'FB', 'TSLA']) == ['AAPL', 'MSFT', 'GOOGL', 'AMZN', 'FB', 'TSLA']\", \"assert filter_tech_tickers(['AAPL', 'NFLX', 'TSLA', 'AMZN']) == ['AAPL', 'TSLA', 'AMZN']\", \"assert filter_tech_tickers(['AMZN', 'IB...
{ "split": "train", "index": 68099, "acecode_id": "bigcode_python_fns_11764", "num_tests": 16 }