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": "Implement a function `create_record(value: Optional[int]) -> bool` that simulates the behavior of a record field that does not accept `None` as a valid input. The function should take an integer `value` as input and return `True` if the value is successfully set (i.e., it is no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_record(5) == True\", \"assert create_record(0) == True\", \"assert create_record(-10) == True\", \"assert create_record(100) == True\", \"assert create_record(-1) == True\", \"assert create_record(50) == True\", \"assert create_record(999) == True\", ... | {
"split": "train",
"index": 2100,
"acecode_id": "bigcode_python_fns_47018",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a string that consists of words separated by spaces. Write a function `count_unique_words(s: str) -> int` that returns the count of unique words in the string. A word is defined as a sequence of characters that are not spaces. The comparison of words should be cas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_words('Hello world') == 2\", \"assert count_unique_words('Hello hello') == 1\", \"assert count_unique_words('One two three four five') == 5\", \"assert count_unique_words('word word word') == 1\", \"assert count_unique_words(' ') == 0\", \"ass... | {
"split": "train",
"index": 2101,
"acecode_id": "bigcode_python_fns_29828",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates user credentials given a username and password. The function should return 'Valid' if the username is 'admin' and the password is 'password123', and return 'Invalid' for any other combination of username and password. Imple... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_credentials('admin', 'password123') == 'Valid'\", \"assert validate_credentials('admin', 'wrongpassword') == 'Invalid'\", \"assert validate_credentials('user', 'password123') == 'Invalid'\", \"assert validate_credentials('admin', '') == 'Invalid'\",... | {
"split": "train",
"index": 2102,
"acecode_id": "bigcode_python_fns_37798",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns the sum of all prime numbers in the list. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. You need to implement the function `sum_of_primes(num_list: ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_primes([2, 3, 5, 7, 11]) == 28\", \"assert sum_of_primes([4, 6, 8, 9, 10]) == 0\", \"assert sum_of_primes([1, 2, 3, 4, 5]) == 10\", \"assert sum_of_primes([-1, -2, -3, -4]) == 0\", \"assert sum_of_primes([13, 17, 19]) == 49\", \"assert sum_of_primes([... | {
"split": "train",
"index": 2103,
"acecode_id": "evol_7254",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates if a given IP address is in the correct format and if each octet of the IP address is within the valid range (0-255). The function should take a single string input representing the IP address and return a boolean value... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_ip('192.168.0.1') == True\", \"assert is_valid_ip('0.0.0.0') == True\", \"assert is_valid_ip('255.255.255.255') == True\", \"assert is_valid_ip('10.0.0.1') == True\", \"assert is_valid_ip('172.16.254.1') == True\", \"assert is_valid_ip('192.168.1.25... | {
"split": "train",
"index": 2104,
"acecode_id": "oss_15203",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer n and a digit d (0 <= d <= 9), write a function `digitsCount(n, d)` that returns the total count of occurrences of the digit d in all numbers from 0 to n, inclusive. For example, if n is 13 and d is 1, the occurrences of digit 1 are in the numbers 1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert digitsCount(13, 1) == 6\", \"assert digitsCount(20, 1) == 12\", \"assert digitsCount(1000, 1) == 301\", \"assert digitsCount(9, 9) == 1\", \"assert digitsCount(99, 9) == 20\", \"assert digitsCount(100, 1) == 21\", \"assert digitsCount(999, 3) == 300\", \"ass... | {
"split": "train",
"index": 2105,
"acecode_id": "evol_28706",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a paired list of masses and their corresponding intensities, group the masses based on the differences between their m/z values. If the difference between consecutive m/z values is greater than a specified delta, a new group should be started. The function should return a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert group_masses([[100.0, 100.5, 101.0, 102.5], [10, 20, 30, 40]], 0.5) == [[[100.0, 100.5, 101.0], [10, 20, 30]], [[102.5], [40]]]\", \"assert group_masses([[200.0, 200.2, 201.0, 202.5], [5, 15, 25, 35]], 0.3) == [[[200.0, 200.2], [5, 15]], [[201.0], [25]], [[2... | {
"split": "train",
"index": 2106,
"acecode_id": "bigcode_python_fns_30055",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are working on a navigation system for a fleet of vehicles. Implement a function `output_json(vehicle_id_to_destination, vehicle_id_to_planned_route)` that takes two dictionaries as input: `vehicle_id_to_destination` and `vehicle_id_to_planned_route`. The `vehicle_id_to_des... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert output_json({'vehicle1': (37.7749, -122.4194)}, {'vehicle1': [(37.7749, -122.4194)]}) == '{\\\"vehicles\\\": [{\\\"id\\\": \\\"vehicle1\\\", \\\"destination\\\": {\\\"latitude\\\": 37.7749, \\\"longitude\\\": -122.4194}, \\\"planned_route\\\": [{\\\"latitude... | {
"split": "train",
"index": 2107,
"acecode_id": "oss_22308",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Create a function that calculates the sum of the squares of all prime numbers up to a given integer n, and then checks if this total sum is an odd number. The function should return True if the sum is odd, and False otherwise.\nPlease reason step by step, then write a self-cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_odd_prime_square_sum(1) == False\", \"assert is_odd_prime_square_sum(3) == True\", \"assert is_odd_prime_square_sum(4) == True\", \"assert is_odd_prime_square_sum(5) == False\", \"assert is_odd_prime_square_sum(7) == True\", \"assert is_odd_prime_square_s... | {
"split": "train",
"index": 2108,
"acecode_id": "evol_9680",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function that analyzes a given Python dictionary. The function should return a report containing three pieces of information: the total number of keys in the dictionary, a count of different data types present among the values, and the number of values that are cons... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert scrutinize_dict({'a': 1, 'b': 2.5, 'c': 'hello'}) == {'total_keys': 3, 'data_types_count': {'int': 1, 'float': 1, 'str': 1}, 'empty_values': 0}\", \"assert scrutinize_dict({'x': '', 'y': None, 'z': [3, 4]}) == {'total_keys': 3, 'data_types_count': {'str': 1,... | {
"split": "train",
"index": 2109,
"acecode_id": "evol_26346",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a user's ID and a collection's ID, write a function that returns a list of exploration IDs that the user has completed within the context of the provided collection. If the user has not completed any explorations in the collection, or if either the user or collection does... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_completed_exploration_ids('user1', 'collection1') == ['exploration1', 'exploration2']\", \"assert get_completed_exploration_ids('user2', 'collection1') == ['exploration3']\", \"assert get_completed_exploration_ids('user3', 'collection2') == []\", \"asser... | {
"split": "train",
"index": 2110,
"acecode_id": "bigcode_python_fns_31757",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that sets the 'consume' state of a music playback system. The function should take in a `state` parameter, which can either be 0 or 1. If the state is 1, the function should activate the consume mode, meaning that each song played wil... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_consume_state(1) == 'activated'\", \"assert set_consume_state(0) == 'deactivated'\", \"assert set_consume_state(1) == 'activated'\", \"assert set_consume_state(0) == 'deactivated'\", \"assert set_consume_state(1) == 'activated'\", \"assert set_consume_st... | {
"split": "train",
"index": 2111,
"acecode_id": "bigcode_python_fns_131",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary with an arbitrary number of records, implement a function that extracts the 'name' and 'age' of a specified entry. The entry will be provided as a key (e.g., 'first', 'second', etc.). Your function should return a dictionary containing only the 'name' and 'ag... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_info({'first':{'name':'Sam','age':32,'city':'Paris'}, 'second':{'name':'Anna','age':28,'city':'Tokyo'}, 'third':{'name':'Lucas','age':45,'city':'Berlin'}}, 'second') == {'name': 'Anna', 'age': 28}\", \"assert extract_info({'first':{'name':'John','age... | {
"split": "train",
"index": 2112,
"acecode_id": "evol_22692",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple message formatting system in Python. Your goal is to create a `Template` class that allows for formatting strings based on a template with placeholders. The `Template` class should have the following methods:\n- `__init__(self, template... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Template('{greeting}, {name}!').format(greeting='Hello', name='Alice') == 'Hello, Alice!'\", \"assert Template('Your order {order_id} is ready.').format(order_id='12345') == 'Your order 12345 is ready.'\", \"assert Template('Welcome to {location}.').format(l... | {
"split": "train",
"index": 2113,
"acecode_id": "oss_21383",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a floating-point number `x`, implement a function `ceil_special_cases(x)` that returns `x` if it is an integer. If `x` is not an integer, return the smallest integer greater than `x`. Your function should handle both positive and negative numbers. The input will be a sing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ceil_special_cases(3.0) == 3\", \"assert ceil_special_cases(3.5) == 4\", \"assert ceil_special_cases(-2.3) == -2\", \"assert ceil_special_cases(-2.0) == -2\", \"assert ceil_special_cases(0.0) == 0\", \"assert ceil_special_cases(4.2) == 5\", \"assert ceil_spe... | {
"split": "train",
"index": 2114,
"acecode_id": "bigcode_python_fns_6430",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `format_string(sequence: str) -> str` that accepts a sequence of alphanumeric characters as input, and reformats this string value such that the initial character is converted to uppercase. If the input string is not alphanumeric, the function should raise ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_string('hello') == 'Hello'\", \"assert format_string('world') == 'World'\", \"assert format_string('python123') == 'Python123'\", \"assert format_string('a1b2c3') == 'A1b2c3'\", \"assert format_string('123abc') == '123abc'\", \"assert format_string('s... | {
"split": "train",
"index": 2115,
"acecode_id": "evol_2114",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a given non-negative integer from decimal to binary. The function should take one parameter, an integer n (0 <= n <= 10^9), and return its binary representation as a string without leading zeros.\nPlease reason step by step, then write a self-... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decimal_to_binary(0) == '0'\", \"assert decimal_to_binary(1) == '1'\", \"assert decimal_to_binary(2) == '10'\", \"assert decimal_to_binary(3) == '11'\", \"assert decimal_to_binary(4) == '100'\", \"assert decimal_to_binary(5) == '101'\", \"assert decimal_to_b... | {
"split": "train",
"index": 2116,
"acecode_id": "evol_21630",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing the licensing information of software projects. You will receive a list of strings, where each string contains the name of a software project followed by its licensing information. Your goal is to determine which projects are distributed under the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_licenses(['ProjectA: GNU General Public License, version 3', 'ProjectB: MIT License', 'ProjectC: GNU General Public License, version 2']) == ['ProjectA: GNU General Public License, version 3', 'ProjectC: GNU General Public License, version 2']\", \"a... | {
"split": "train",
"index": 2117,
"acecode_id": "oss_3184",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple banking operation. Write a function `bank_operations(operations: List[Tuple[str, int]]) -> int` that takes a list of operations, where each operation is a tuple consisting of a string ('deposit' or 'withdraw') followed by an integer amoun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_operations([('deposit', 100), ('withdraw', 30)]) == 70\", \"assert bank_operations([('deposit', 200), ('withdraw', 50), ('withdraw', 100)]) == 50\", \"assert bank_operations([('withdraw', 10)]) == 0\", \"assert bank_operations([('deposit', 50), ('deposi... | {
"split": "train",
"index": 2118,
"acecode_id": "oss_18620",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a logging system. The function should take a 'stream' parameter, which can either be a string representing a log message or None. If the 'stream' is None, the function should print a specific message to indicate that no str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_message(None) == None\", \"assert log_message('Error: File not found') == 'Error: File not found'\", \"assert log_message('Warning: Low disk space') == 'Warning: Low disk space'\", \"assert log_message(None) == None\", \"assert log_message('Info: Update ... | {
"split": "train",
"index": 2119,
"acecode_id": "bigcode_python_fns_35615",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of integers as input and converts each integer to its binary string representation. The binary strings should be concatenated together, separated by commas, into a single output string. If the input contains any non-integer values, the functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_binary_string([42, 15]) == '101010,1111'\", \"assert convert_to_binary_string([1, 2, 3]) == '1,10,11'\", \"assert convert_to_binary_string([0, 255]) == '0,11111111'\", \"assert convert_to_binary_string([]) == ''\", \"assert convert_to_binary_strin... | {
"split": "train",
"index": 2120,
"acecode_id": "evol_28891",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates fetching meeting guide settings for a web application. Your function should return a dictionary containing the meeting guide settings in JSON format, a mapbox key, and a timezone string. The settings should be provided as a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_meeting_guide() != None\", \"assert 'meeting_guide_settings' in get_meeting_guide()\", \"assert 'mapbox_key' in get_meeting_guide()\", \"assert 'timezone' in get_meeting_guide()\", \"assert isinstance(get_meeting_guide()['meeting_guide_settings'], str)\"... | {
"split": "train",
"index": 2121,
"acecode_id": "bigcode_python_fns_3534",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that removes an environment by sending a DELETE request to a specified API endpoint. The function should take an application URL and the name of the environment's image as input and return a success message if the deletion is s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_environment('http://example.com', 'test_image') == 'Environment test_image removed successfully'\", \"assert remove_environment('http://example.com', 'prod_image') == 'Environment prod_image removed successfully'\", \"assert remove_environment('http:/... | {
"split": "train",
"index": 2122,
"acecode_id": "oss_31407",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `compound_interest` that calculates the compound interest based on the provided principal amount, interest rate, time period, and the number of times the interest is compounded per year. The function should have the following signature: `def compound_intere... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compound_interest(1000, 5, 2, 1) == 102.5\", \"assert compound_interest(500, 10, 1) == 50.0\", \"assert compound_interest(10000, 5, 0) == 0.0\", \"assert compound_interest(250, 0, 5) == 0.0\", \"assert compound_interest(3500, 5, 1, 1) == 175.0\"]}"
} | {
"split": "train",
"index": 2123,
"acecode_id": "evol_18399",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of software versions represented as strings. Your task is to implement a function that checks if the list contains at least one version. If the list is empty, the function should raise an exception called NotEnoughVersionsError. If the list contains at leas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_versions(['1.0', '1.1', '2.0']) == True\", \"assert check_versions(['1.0']) == True\", \"assert check_versions(['0.1', '0.2']) == True\", \"assert check_versions(['1.0.0', '1.0.1', '1.1.0']) == True\", \"assert check_versions(['2.0']) == True\", \"asse... | {
"split": "train",
"index": 2124,
"acecode_id": "bigcode_python_fns_33838",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of server UUIDs and a corresponding list of boolean values indicating whether each server is available for migration, write a function `migrate_servers(uuids: List[str], availability: List[bool]) -> List[str]` that returns a list of server UUIDs that are available ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert migrate_servers(['uuid1', 'uuid2', 'uuid3'], [True, True, True]) == ['uuid1', 'uuid2', 'uuid3']\", \"assert migrate_servers(['uuid1', 'uuid2', 'uuid3'], [False, False, False]) == []\", \"assert migrate_servers(['uuid1', 'uuid2', 'uuid3'], [True, False, True]... | {
"split": "train",
"index": 2125,
"acecode_id": "bigcode_python_fns_49029",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_blog_post(title: str, content: str, author: str, date: str, tags: List[str]) -> Dict[str, Any]` that creates a representation of a technology blog post. The function should return a dictionary containing the title, content, author, date, tags, and a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_blog_post('Understanding AI', 'This post discusses the basics of AI.', 'Alice Smith', '11/01/2023', ['AI', 'Technology']) == {'title': 'Understanding AI', 'content': 'This post discusses the basics of AI.', 'author': 'Alice Smith', 'date': '11/01/2023... | {
"split": "train",
"index": 2126,
"acecode_id": "evol_19130",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `rgb_to_hsv(rgb_tuple)` that converts an RGB color representation into its HSV representation. The input is a tuple of three integers representing the RGB values, each ranging from 0 to 255. The output should be a tuple containing three float values represe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rgb_to_hsv((255, 0, 0)) == (0.0, 1.0, 1.0)\", \"assert rgb_to_hsv((0, 255, 0)) == (120.0, 1.0, 1.0)\", \"assert rgb_to_hsv((0, 0, 255)) == (240.0, 1.0, 1.0)\", \"assert rgb_to_hsv((255, 255, 0)) == (60.0, 1.0, 1.0)\", \"assert rgb_to_hsv((0, 255, 255)) == (1... | {
"split": "train",
"index": 2127,
"acecode_id": "evol_14084",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "In a string `s` of lowercase letters, these letters form consecutive groups of the same character. A group is considered large if it has 3 or more characters. Write a function `largeGroupPositions(s: str) -> List[List[Union[int, str]]]` that returns the intervals of every large... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largeGroupPositions('abbxxxxzzy') == [[3, 6, 'x']]\", \"assert largeGroupPositions('abc') == []\", \"assert largeGroupPositions('abcdddeeeeaabbbcd') == [[3, 5, 'd'], [6, 9, 'e'], [12, 14, 'b']]\", \"assert largeGroupPositions('aaa') == [[0, 2, 'a']]\", \"ass... | {
"split": "train",
"index": 2128,
"acecode_id": "evol_27563",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining the winner of a game voting system based on player votes. You are given a list of player numbers and a list of votes that each player received. Your goal is to implement a function that takes in these two lists and returns the player number(s) wi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_winner([1, 2, 3, 4, 5], [1, 2, 3, 2, 4, 3, 2, 5, 4, 3, 5, 5, 5]) == [5]\", \"assert find_winner([1, 2, 3], [1, 1, 2, 3, 3]) == [1, 3]\", \"assert find_winner([1, 2], [1, 1, 2, 2]) == [1, 2]\", \"assert find_winner([1], [1]) == [1]\", \"assert find_winne... | {
"split": "train",
"index": 2129,
"acecode_id": "oss_9039",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the even integers from the input list. The output list should maintain the order of the even integers as they appear in the input list. Write a function `filter_even... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5, 6]) == [2, 4, 6]\", \"assert filter_even_numbers([7, 8, 9, 10]) == [8, 10]\", \"assert filter_even_numbers([1, 3, 5]) == []\", \"assert filter_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert filter_even_numbers([... | {
"split": "train",
"index": 2130,
"acecode_id": "oss_6981",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple attribute management system for a class. The class should allow you to define attributes with optional default values and secondary attributes that can influence their values. Implement a function `manage_attributes()` that takes a dict... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_attributes({'a': (None, None)}) == {'a': None}\", \"assert manage_attributes({'b': (10, None), 'c': (5, 'b')}) == {'b': 10, 'c': 5}\", \"assert manage_attributes({'x': (None, 'y'), 'y': (20, None)}) == {'x': None, 'y': 20}\", \"assert manage_attribute... | {
"split": "train",
"index": 2131,
"acecode_id": "bigcode_python_fns_32473",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers and a list of index ranges. The function should remove all elements from the list that are located in the specified ranges (inclusive) and return the modified list. You should not use built-in functions such as `del()` or list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert squeeze_numbers([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [(2,5), (7,9)]) == [0, 1, 6]\", \"assert squeeze_numbers([10, 20, 30, 40, 50], [(1, 3)]) == [10, 50]\", \"assert squeeze_numbers([1, 2, 3, 4, 5], [(0, 0)]) == [2, 3, 4, 5]\", \"assert squeeze_numbers([5, 6, 7, ... | {
"split": "train",
"index": 2132,
"acecode_id": "evol_26084",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple state machine. The function should accept an initial state and a list of commands. Each command can either be to update the state or to set a status. The function should return the final state and the status di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_state_machine('initial', [('update', 'updated'), ('set', 'key1', 'value1'), ('set', 'key2', 'value2')]) == ('updated', {'key1': 'value1', 'key2': 'value2'})\", \"assert simulate_state_machine('start', [('set', 'keyA', 'valueA'), ('update', 'middle')... | {
"split": "train",
"index": 2133,
"acecode_id": "oss_10918",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that extracts the version number from a given version string. The version string is formatted as 'SoftwareName Version X.Y.Z', where 'X', 'Y', and 'Z' are non-negative integers. Your function should return the version number in the format... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_version('XPP Version 1.2.3') == '1.2.3'\", \"assert extract_version('Software Version 10.0.0') == '10.0.0'\", \"assert extract_version('MyApp Version 0.1.2') == '0.1.2'\", \"assert extract_version('No version here') == 'Version not found'\", \"assert... | {
"split": "train",
"index": 2134,
"acecode_id": "bigcode_python_fns_4167",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Design a function that computes the geometric mean of all elements contained in a 3D array of float data types. The function should accept a 3D list as input and return the geometric mean as a float. For example, given the input [[[1.0, 2.0], [3.5, 2.2]], [[4.2, 5.4], [6.5, 3.7... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_geometric_mean([[[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]]]) == 1.0\", \"assert calculate_geometric_mean([[[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0], [1.0, 1.0]]]) == 1.0\", \"assert calculate_geometric_mean([[[2.0]]]) == 2.0\", \"assert calcula... | {
"split": "train",
"index": 2135,
"acecode_id": "evol_27933",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a function to convert a string of digits to the corresponding integer value without using built-in functions like int() or atoi(). Additionally, handle potential edge cases such as invalid characters in the input string, which should raise a ValueError.\nPlease reason ste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert string_to_int_correct('12345') == 12345\", \"assert string_to_int_correct('0') == 0\", \"assert string_to_int_correct('00123') == 123\", \"assert string_to_int_correct('9876543210') == 9876543210\", \"assert string_to_int_correct('00000') == 0\", \"assert st... | {
"split": "train",
"index": 2136,
"acecode_id": "evol_23451",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a fuzzing mechanism for primitive data types. The function should accept two parameters: a list of fuzz values and a boolean parameter to enable or disable fuzzing. Your goal is to implement a function `fuzz(value: Any,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fuzz(42, [10, 20, 30], True) == 10\", \"assert fuzz('hello', ['world'], True) == 'world'\", \"assert fuzz(42, [], True) == 42\", \"assert fuzz(42, [10, 20, 30], False) == 42\", \"assert fuzz('test', [], False) == 'test'\", \"assert fuzz(3.14, [1.0, 2.0], Tru... | {
"split": "train",
"index": 2137,
"acecode_id": "oss_34234",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `s`, write a function that inverts the positions of all the vowels present in the string, while leaving all other characters in their original places. The vowels to be considered are 'a', 'e', 'i', 'o', and 'u', and they can be in either uppercase or lowercase. I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverseVowels('hello') == 'holle'\", \"assert reverseVowels('leetcode') == 'leotcede'\", \"assert reverseVowels('aA') == 'Aa'\", \"assert reverseVowels('') == ''\", \"assert reverseVowels('') == ''\", \"assert reverseVowels('Uo') == 'oU'\", \"assert reverseV... | {
"split": "train",
"index": 2138,
"acecode_id": "evol_5728",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a session management system for a web API client. Your function should take an optional HTTP adapter as input and start a session using the requests library. If the HTTP adapter is provided, it should be mounted to the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pre_login() == True\", \"assert pre_login('custom_adapter') == True\", \"assert pre_login(None) == True\", \"assert pre_login('http_adapter') == True\", \"assert pre_login('https_adapter') == True\", \"assert pre_login('adapter_1') == True\", \"assert pre_lo... | {
"split": "train",
"index": 2139,
"acecode_id": "oss_434",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a singly linked list implementation in Python, represented by the `Node` class. Each `Node` contains a `data` field and a pointer to the `next` node in the list. Your task is to implement a function `print_linked_list` that takes the head of a linked list as an ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_linked_list(None) == ''\", \"assert print_linked_list(Node(1, None)) == '1'\", \"assert print_linked_list(Node(1, Node(2, None))) == '1 2'\", \"assert print_linked_list(Node(3, Node(4, Node(5, None)))) == '3 4 5'\", \"assert print_linked_list(Node(10, ... | {
"split": "train",
"index": 2140,
"acecode_id": "oss_10409",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with formatting a given number into a compact string representation using appropriate suffixes based on its magnitude. If the number is less than 1000, it should be formatted to two decimal places. If the number is 1000 or greater, it should be divided by the lar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_number(999, True) == '999.00'\", \"assert format_number(1500, True) == '1.5K'\", \"assert format_number(10000, True) == '10K'\", \"assert format_number(2500000, True) == '2.5M'\", \"assert format_number(1500000000, True) == '1.5G'\", \"assert format_n... | {
"split": "train",
"index": 2141,
"acecode_id": "bigcode_python_fns_8197",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the deletion of a registry key from a Windows operating system. The function should take a single argument, a string representing the registry key path, and return a confirmation message indicating whether the deletion ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_registry_key('HKLM\\\\SOFTWARE\\\\MyApp\\\\Settings') == 'Registry key deleted successfully.'\", \"assert delete_registry_key('HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\MyApp\\\\Settings') == 'Registry key not found.'\", \"assert delete_registry_key('HKU\\\\S... | {
"split": "train",
"index": 2142,
"acecode_id": "bigcode_python_fns_36504",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a data validation function for a financial application. The function should validate a given set of metadata against predefined valid values and ensure that the expiration timestamp and max cumulative amount are within acceptable ranges. Impleme... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_data({'valid-values': ['save_sub_account']}, 1627891200, None) == True\", \"assert validate_data({'valid-values': ['consent']}, 1627891200, None) == True\", \"assert validate_data({'valid-values': ['save_sub_account', 'consent']}, 1627891200, None) ... | {
"split": "train",
"index": 2143,
"acecode_id": "oss_32384",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries where each dictionary represents a user's media consumption behavior. Each dictionary contains the following keys: 'MMI1', 'MMI2', 'MMI3', 'MMI4', 'MMI_1_1', 'MMI_2_1', 'MMI_3_1', 'MMI_4_1', and 'TotalHours'. Your task is to calculate the we... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_weighted_averages([{'MMI1': 0.0, 'MMI2': 0.0, 'MMI3': 0.0, 'MMI4': 0.0, 'MMI_1_1': 0, 'MMI_2_1': 0, 'MMI_3_1': 0, 'MMI_4_1': 0, 'TotalHours': 1}]) == [{'MMI1': 0.0, 'MMI2': 0.0, 'MMI3': 0.0, 'MMI4': 0.0, 'MMI_1_1': 0, 'MMI_2_1': 0, 'MMI_3_1': 0, 'M... | {
"split": "train",
"index": 2144,
"acecode_id": "oss_24100",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts an array of integers using the Bubble Sort algorithm. The function should also validate the input to ensure it is a list and that all elements are integers. If the input is invalid, the function should raise an appropriate exception.\nPlease reas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([5, 3, 8, 1]) == [1, 3, 5, 8]\", \"assert bubble_sort([-1, -5, 0, 3]) == [-5, -1, 0, 3]\", \"assert bubble_sort([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert bubble_sort([10]) == [10]\", \"assert bubble_sort([]) == []\", \"assert bubble_sort([3... | {
"split": "train",
"index": 2145,
"acecode_id": "evol_12209",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of image URLs as a list of strings. Your task is to implement a function `download_images(urls: List[str]) -> List[str]` that saves each image from the provided URLs to a local directory and returns a list of filenames that were saved. The filenames should ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert download_images(['https://example.com/image1.png', 'https://example.com/image2.jpg']) == ['image1.png', 'image2.jpg']\", \"assert download_images(['https://example.com/photo.jpg']) == ['photo.jpg']\", \"assert download_images(['https://example.com/image.png'... | {
"split": "train",
"index": 2146,
"acecode_id": "bigcode_python_fns_32864",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of sentences, write a function that counts the total number of words across all sentences. Each sentence is a string, and words are defined as non-empty sequences of characters separated by whitespace. The input is a list of strings, and the output should be a sing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_total_words(['SingleSentence']) == 1\", \"assert count_total_words(['']) == 0\", \"assert count_total_words([' Leading spaces', 'Trailing spaces ', ' Multiple spaces between']) == 7\", \"assert count_total_words(['One', 'Two', 'Three', 'Four']) =... | {
"split": "train",
"index": 2147,
"acecode_id": "bigcode_python_fns_10876",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Django migration to rename a field in a model. Specifically, you need to write a migration file that renames the field 'con_id' to 'new_field_name' in the 'Choice' model of the 'polls' app. Your migration should ensure compatibility with Django's ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_migration() == \\\"from django.db import migrations, models\\\\n\\\\nclass Migration(migrations.Migration):\\\\n\\\\n dependencies = [\\\\n ('polls', '0016_choice_con_id'),\\\\n ]\\\\n\\\\n operations = [\\\\n migrations.Renam... | {
"split": "train",
"index": 2148,
"acecode_id": "oss_29972",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that contains a list of highlight colors in a specific format. The first color in the list defines the type of colors (either 'colorclass' or 'colorspec'), and the subsequent colors are the actual colors to be used. Your task is to process this string and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_highlight_colors('colorclass,table-primary,table-success') == {'type': 'colorclass', 'colors': ['table-primary', 'table-success']}\", \"assert process_highlight_colors('colorspec,#FF5733,#C70039') == {'type': 'colorspec', 'colors': ['#ff5733', '#c700... | {
"split": "train",
"index": 2149,
"acecode_id": "bigcode_python_fns_8538",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the heights of a group of people, write a function that calculates the average height of the group. The function should take in the list of heights and return a single floating point number representing the average height. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_height([160, 170, 180]) == 170.0\", \"assert average_height([150, 155, 160]) == 155.0\", \"assert average_height([180]) == 180.0\", \"assert average_height([]) == 0.0\", \"assert average_height([200, 210, 220, 230]) == 215.0\", \"assert average_heigh... | {
"split": "train",
"index": 2150,
"acecode_id": "bigcode_python_fns_3161",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with constructing a URL for accessing country ranking data on a specific website. Write a Python function `construct_alexa_url` that takes in two parameters: a country code and a page number. The parameters are defined as follows: \n1. `country_code` (string) - a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert construct_alexa_url('US', 1) == 'http://alexa.chinaz.com/Country/US_1.html'\", \"assert construct_alexa_url('CA', 2) == 'http://alexa.chinaz.com/Country/CA_2.html'\", \"assert construct_alexa_url('GB', 3) == 'http://alexa.chinaz.com/Country/GB_3.html'\", \"a... | {
"split": "train",
"index": 2151,
"acecode_id": "oss_12368",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function `arrange_elements(arr)` that determines if it is possible to sort the array in ascending order under the following conditions: 1. You can perform at most four swaps, and each swap must involve two unique elements. 2. After the ma... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert arrange_elements([]) == True\", \"assert arrange_elements([4, 6, 8, 10, 12]) == False\", \"assert arrange_elements([1, 2, 3, 4, 5, 6, 7]) == False\", \"assert arrange_elements([1, 4, 3, 2]) == False\", \"assert arrange_elements([12, 15, 3, 5]) == False\", \"... | {
"split": "train",
"index": 2152,
"acecode_id": "evol_983",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates basic banking operations for a simple bank account. The function should take an initial balance, a list of operations, and return the final balance after performing all operations. Each operation will be a tuple contain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert final_balance(100, [('deposit', 50), ('withdraw', 30)]) == 120\", \"assert final_balance(200, [('withdraw', 50), ('withdraw', 200)]) == 150\", \"assert final_balance(0, [('withdraw', 10)]) == 0\", \"assert final_balance(500, [('deposit', 100), ('withdraw', 5... | {
"split": "train",
"index": 2153,
"acecode_id": "oss_35786",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that sets configuration options for a hypothetical data processing library called 'Datalib'. The function should accept a dictionary of configuration options and apply each key-value pair as a configuration setting. Each key is a string r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_datalib_config({'option1': True, 'option2': 'value2'}) == {'option1': True, 'option2': 'value2'}\", \"assert set_datalib_config({'debug': False, 'timeout': 30}) == {'debug': False, 'timeout': 30}\", \"assert set_datalib_config({'max_rows': 1000}) == {'ma... | {
"split": "train",
"index": 2154,
"acecode_id": "bigcode_python_fns_19446",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a given directory path is a default directory for managed mode. The default directory for managed mode is defined as '/root/project'. Your function should take a string input representing a directory path and return Tru... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_default_directory('/root/project') == True\", \"assert is_default_directory('/home/user/project') == False\", \"assert is_default_directory('/root') == False\", \"assert is_default_directory('/root/project/') == False\", \"assert is_default_directory('roo... | {
"split": "train",
"index": 2155,
"acecode_id": "bigcode_python_fns_22627",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the Jaccard Index for two sets. The Jaccard Index is defined as the size of the intersection divided by the size of the union of the two sets. Write a function named `jaccard_index(set1, set2)` that takes two sets as input and returns the Ja... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert jaccard_index({1, 2, 3}, {4, 5, 6}) == 0.0\", \"assert jaccard_index({1, 2, 3}, {1, 2, 3}) == 1.0\", \"assert jaccard_index({1, 2}, {2, 3}) == 0.3333333333333333\", \"assert jaccard_index({1, 2, 3}, {}) == 0.0\", \"assert jaccard_index({1, 1, 2}, {1, 2, 3}) ... | {
"split": "train",
"index": 2156,
"acecode_id": "evol_27861",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `prime_composite_numbers(arr)` that returns a tuple containing the smallest positive prime number, the largest negative prime number, the largest positive composite number, and the smallest negative composite number from the list. If t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prime_composite_numbers([1, 0, -1, -2, -3]) == (None, -2, None, None)\", \"assert prime_composite_numbers([]) == (None, None, None, None)\", \"assert prime_composite_numbers([-1, -2, -3, -4]) == (None, -2, None, -4)\", \"assert prime_composite_numbers([2, 4,... | {
"split": "train",
"index": 2157,
"acecode_id": "evol_31192",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_substring(str_1: str, str_2: str, case_sense: bool) -> bool` that checks if `str_1` is a substring of `str_2`. The function should take into account the `case_sense` argument, which determines whether the check should be case sensitive. If `case_sense` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_substring('hello', 'HELLO world', False) == True\", \"assert is_substring('hello', 'HELLO world', True) == False\", \"assert is_substring('world', 'HELLO world', False) == True\", \"assert is_substring('WORLD', 'HELLO world', False) == True\", \"assert is... | {
"split": "train",
"index": 2158,
"acecode_id": "evol_24806",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of events represented as strings, write a function `filter_events(events: List[str], member_id: str) -> List[str]` that returns a list of events that contain the specified `member_id`. Each event is a string that may or may not include the `member_id`. If the `memb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_events(['event_1_member_123', 'event_2_member_456', 'event_3_member_123'], 'member_123') == ['event_1_member_123', 'event_3_member_123']\", \"assert filter_events(['event_1', 'event_2', 'event_3'], 'member_123') == []\", \"assert filter_events(['membe... | {
"split": "train",
"index": 2159,
"acecode_id": "bigcode_python_fns_10250",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_substring(str_1, str_2)` that accepts two strings as arguments. The function should return a tuple containing a boolean indicating whether `str_1` is a substring of `str_2`, and the starting index of the first occurrence of `str_1` in `str_2`. The sea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_substring('Hello', 'hello world') == (True, 0)\", \"assert find_substring('world', 'Hello world') == (True, 6)\", \"assert find_substring('python', 'I love Python programming') == (True, 7)\", \"assert find_substring('java', 'Java and javascript') == (T... | {
"split": "train",
"index": 2160,
"acecode_id": "evol_17378",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a non-negative integer, write a function `incrementString` that increments the integer by 1 and returns the result as a string. The function should not convert the string to an integer for the increment operation. The input string will have a length ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert incrementString('0') == '1'\", \"assert incrementString('9') == '10'\", \"assert incrementString('123') == '124'\", \"assert incrementString('999') == '1000'\", \"assert incrementString('1000') == '1001'\", \"assert incrementString('9999') == '10000'\", \"as... | {
"split": "train",
"index": 2161,
"acecode_id": "oss_30742",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the volume of a 3D box given the coordinates of its opposite corners in a single line input. The input will be a string containing six space-separated floating-point numbers, representing the x, y, and z coordinates of two opposite corners of the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_box_volume('1.0 2.0 3.0 4.0 5.0 6.0') == 27.0\", \"assert calculate_box_volume('0.0 0.0 0.0 1.0 1.0 1.0') == 1.0\", \"assert calculate_box_volume('1.5 2.5 3.5 4.5 5.5 6.5') == 27.0\", \"assert calculate_box_volume('2.0 3.0 4.0 5.0 6.0 7.0') == 27.0... | {
"split": "train",
"index": 2162,
"acecode_id": "oss_29464",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to parse a response from an API call and extract the application authentication token. The response is provided in the form of a dictionary, and it may or may not contain the key 'application_auth_token'. Your function should return t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_auth_token({'status': 'success', 'application_auth_token': 'abc123xyz'}) == 'abc123xyz'\", \"assert extract_auth_token({'status': 'error', 'message': 'Authentication failed'}) == ''\", \"assert extract_auth_token({'application_auth_token': 'token123'... | {
"split": "train",
"index": 2163,
"acecode_id": "oss_35045",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `text` that may contain alphanumeric characters and punctuation, implement a function `vowel_count(text: str) -> int` that returns the total number of vowel characters (both uppercase and lowercase) found in the string. Vowels are defined as 'a', 'e', 'i', 'o', '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert vowel_count('Hello World!') == 3\", \"assert vowel_count('Python Programming') == 4\", \"assert vowel_count('AEIOU') == 5\", \"assert vowel_count('') == 0\", \"assert vowel_count('12345') == 0\", \"assert vowel_count('C@t is f@st') == 1\", \"assert vowel_cou... | {
"split": "train",
"index": 2164,
"acecode_id": "evol_29587",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of user dictionaries and returns a JSON string representing the user list. Each user dictionary contains the following keys: 'id', 'name', and 'email'. Your function should ensure that the JSON output is formatted co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert export_users_to_json([]) == '[]'\", \"assert export_users_to_json([{'id': 1, 'name': 'Alice', 'email': 'alice@example.com'}]) == '[{\\\"id\\\": 1, \\\"name\\\": \\\"Alice\\\", \\\"email\\\": \\\"alice@example.com\\\"}]'\", \"assert export_users_to_json([{'id... | {
"split": "train",
"index": 2165,
"acecode_id": "bigcode_python_fns_40951",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a verification system for a web application. When a user attempts to access restricted features, they may be required to verify their account using a verification code sent to their email address. You need to implement a function `initiate_verif... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initiate_verification({'user_email': 'user1@example.com', 'is_verified': False}) == 'Verification code sent to user1@example.com.'\", \"assert initiate_verification({'user_email': 'user2@example.com', 'is_verified': True}) == 'User is already verified.'\", \... | {
"split": "train",
"index": 2166,
"acecode_id": "oss_4998",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks the validity of a file name based on specific criteria. The function should return 'Yes' if the file name is valid, and 'No' if it is not. A file name is considered valid if it meets the following conditions: 1) It contains only alphanumeric cha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert file_name_check('Example1.txt') == 'Yes'\", \"assert file_name_check('TestFile.pdf') == 'Yes'\", \"assert file_name_check('sample2File.exe') == 'Yes'\", \"assert file_name_check('MyFile123.dll') == 'Yes'\", \"assert file_name_check('validImage.jpeg') == 'Yes... | {
"split": "train",
"index": 2167,
"acecode_id": "evol_29205",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string that contains multiple hexadecimal color representations prefixed with '#', implement a function that parses this string and returns a list of tuples representing the RGB values for each color. The hexadecimal color format can be shorthand (like '#fff') or full (... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode_colors('#fff #000 #f00') == [(255, 255, 255), (0, 0, 0), (255, 0, 0)]\", \"assert decode_colors('') == []\", \"assert decode_colors('#xyz #fff') == [(255, 255, 255)]\", \"assert decode_colors('#123 #456 #789') == [(17, 34, 51), (68, 85, 102), (119, 13... | {
"split": "train",
"index": 2168,
"acecode_id": "evol_7641",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python package versioning system. Your goal is to implement a function that compares two version strings and determines which one is greater. The version strings follow the Semantic Versioning (SemVer) format, which consists of three non-negative ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_versions('1.2.3', '1.2.2') == 1\", \"assert compare_versions('1.2.3', '1.2.4') == -1\", \"assert compare_versions('1.2.3', '1.2.3') == 0\", \"assert compare_versions('1.0.0', '1.0.0+20130313144700') == 0\", \"assert compare_versions('1.0.0-alpha', '1... | {
"split": "train",
"index": 2169,
"acecode_id": "oss_21118",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if the length of a given string falls within a specified range. The function should take a string as input and return True if the length of the string is between the lower limit (inclusive) and upper limit (inclusive) of 5 and 15, respectively. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_string_length('hello') == True\", \"assert check_string_length('hi') == False\", \"assert check_string_length('world') == True\", \"assert check_string_length('a') == False\", \"assert check_string_length('this is a test string') == False\", \"assert c... | {
"split": "train",
"index": 2170,
"acecode_id": "evol_4667",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array of integers `stones` where `stones[i]` is the weight of the `i-th` stone. You are allowed to perform a series of operations on these stones. In each operation, you can select any two stones and smash them together. The outcome of this operation is as foll... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lastStoneWeightII([1,2]) == [1, 1]\", \"assert lastStoneWeightII([1]) == [1, 0]\", \"assert lastStoneWeightII([10]) == [10, 0]\", \"assert lastStoneWeightII([100, 1, 1]) == [98, 2]\", \"assert lastStoneWeightII([9, 8]) == [1, 1]\", \"assert lastStoneWeightII... | {
"split": "train",
"index": 2171,
"acecode_id": "evol_3",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the even integers from the original list, preserving the order of the elements. The function should be named `filter_even_numbers`. Please implement this function. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([0, 1, 2, 3, 4]) == [0, 2, 4]\", \"assert filter_even_numbers([-1, -2, -3, -4]) == [-2, -4]\", \"assert filter_even_numbers([7, 8, 9, 10]) == [8, 10]\", \"assert filter_even_numbe... | {
"split": "train",
"index": 2172,
"acecode_id": "oss_37641",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that takes two lists of tuples, each containing numeric values, and performs an element-wise exponentiation operation. The function should handle the following scenarios: if any value in the second tuple is negative, it should return an error message; if the t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert element_wise_exponentiation([(1, 2), (3, 4)], [(2, 3), (2, 2)]) == [(1**2, 2**3), (3**2, 4**2)]\", \"assert element_wise_exponentiation([(1, 2), (3, 4)], [(2, -1), (2, 2)]) == 'Exponent cannot be negative'\", \"assert element_wise_exponentiation([(1, 2)], [(... | {
"split": "train",
"index": 2173,
"acecode_id": "evol_5894",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of storm types represented as strings, determine if the storm is classified as purely 'SD' (Severe Drought) or 'SS' (Severe Storm) based on the following criteria: A storm is classified as purely 'SD' if it contains 'SD' and does not contain any of the following ty... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_storm(['SD', 'Clear', 'Sunny']) == True\", \"assert classify_storm(['SD', 'TD']) == False\", \"assert classify_storm(['SS', 'Rain', 'Wind']) == True\", \"assert classify_storm(['SS', 'TS']) == False\", \"assert classify_storm(['SD', 'TS', 'Clear']) ... | {
"split": "train",
"index": 2174,
"acecode_id": "bigcode_python_fns_46667",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list representing a vector, implement a function to normalize the vector. Normalization involves dividing each element of the vector by its magnitude (Euclidean norm). The magnitude of the vector is calculated as the square root of the sum of the squares of its elements... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_vector([3, 4]) == [0.6, 0.8]\", \"assert normalize_vector([0, 0]) == [0.0, 0.0]\", \"assert normalize_vector([1, 2, 2]) == [0.3333333333333333, 0.6666666666666666, 0.6666666666666666]\", \"assert normalize_vector([10, 0]) == [1.0, 0.0]\", \"assert ... | {
"split": "train",
"index": 2175,
"acecode_id": "oss_19313",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given three integers: `n_ref_reads`, `n_total_reads`, and `max_allowed_reads`. Your task is to implement a function that ensures that `n_total_reads` does not exceed `max_allowed_reads`. If `n_total_reads` is greater than `max_allowed_reads`, you need to rescale `n_ref_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rescale_read_counts(10, 50, 60) == (10, 50)\", \"assert rescale_read_counts(0, 100, 80) == (0, 80)\", \"assert rescale_read_counts(5, 25, 25) == (5, 25)\", \"assert rescale_read_counts(1, 1, 10) == (1, 1)\", \"assert rescale_read_counts(50, 200, 150) == (37,... | {
"split": "train",
"index": 2176,
"acecode_id": "bigcode_python_fns_48022",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function `repeat_sentence(text: str, num: int) -> str` that accepts a sentence and a number as input. The function should return the sentence with each word repeated the specified number of times in the same order. However, if a word is a palindrome, it should be repeat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert repeat_sentence('Hello hello world', 1) == 'Hello world'\", \"assert repeat_sentence('Python is awesome', 1) == 'Python is awesome'\", \"assert repeat_sentence('madam', 1) == 'madam madam'\", \"assert repeat_sentence('', 5) == ''\", \"assert repeat_sentence(... | {
"split": "train",
"index": 2177,
"acecode_id": "evol_14206",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing names of datastores in a data center. Write a function `get_datastore(datastore_names: List[str], datastore_name: str) -> Union[str, None]` that returns the name of the datastore if it exists in the list. If the datastore name does n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_datastore(['Datastore1', 'Datastore2', 'Datastore3'], 'Datastore2') == 'Datastore2'\", \"assert get_datastore(['Datastore1', 'Datastore2', 'Datastore3'], 'Datastore3') == 'Datastore3'\", \"assert get_datastore(['Datastore1', 'Datastore2', 'Datastore3'], ... | {
"split": "train",
"index": 2178,
"acecode_id": "bigcode_python_fns_28192",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a success response for setting an attribute of a light. The function should take in three parameters: an integer `entity_number` representing the light's identifier, a string `attr` representing the attribute name (e.g., 'o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_hue_success_response(1, 'on', True) == {'success': {'/lights/1/state/on': True}}\", \"assert create_hue_success_response(2, 'bri', 254) == {'success': {'/lights/2/state/bri': 254}}\", \"assert create_hue_success_response(3, 'hue', 10000) == {'success'... | {
"split": "train",
"index": 2179,
"acecode_id": "bigcode_python_fns_31027",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a utility function that generates a dictionary based on given command-line argument specifications. The function should accept the following parameters: 1. `folder_path`: A string representing the folder path, which can be an absolute or relative pa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_utility_dict('src', True, 'config.json') == {'folder_path': 'src', 'start_project': True, 'config_file': 'config.json', 'help': {'folder_path': 'The folder path; folder absolute or relative path.', 'start_project': 'Generate test case templates.', '... | {
"split": "train",
"index": 2180,
"acecode_id": "oss_8210",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer array, implement a function that separates the elements into two lists: one containing all even numbers and the other containing all odd numbers. The function should return a tuple of two lists, with the first list containing even numbers and the second list co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert separate_even_odd([1, 2, 3, 4, 5, 6]) == ([2, 4, 6], [1, 3, 5])\", \"assert separate_even_odd([0, 1, 2, 3, 4]) == ([0, 2, 4], [1, 3])\", \"assert separate_even_odd([10, 15, 20, 25, 30]) == ([10, 20, 30], [15, 25])\", \"assert separate_even_odd([7, 9, 11]) ==... | {
"split": "train",
"index": 2181,
"acecode_id": "evol_23185",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that initializes and runs a hypothetical data processing mapper based on various input parameters. The function should take the following parameters: a backbone string, a featureset string, a distance string, an onwhat string, a thres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_and_run_mapper('main', 'dataset1', 'euclidean', 'featureA', 0.5, 'mean', 'result', True, 'graph1', 'network1') == 'Mapper initialized and run with parameters: backbone=main, featureset=dataset1, distance=euclidean, onwhat=featureA, threshold=0.5, ... | {
"split": "train",
"index": 2182,
"acecode_id": "oss_27904",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of study names related to scientific simulations. Each study name consists of a string with the format 'prefix-version', where the prefix represents the study identifier and the version represents the study ve... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_study_identifiers(['studyA-1.0', 'studyB-2.0', 'studyA-2.0', 'studyC-1.0']) == ['studyA', 'studyB', 'studyC']\", \"assert extract_study_identifiers(['test-1', 'test-2', 'test-3']) == ['test']\", \"assert extract_study_identifiers(['studyA-1', 'studyB... | {
"split": "train",
"index": 2183,
"acecode_id": "oss_36632",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a list of software components and their corresponding version dependencies. Each dependency is represented as a tuple containing the name of the component and the specific version. Your objective is to implement a function that takes a list of these... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_dependencies([('posthog', '0086_team_session_recording_opt_in'), ('django', '3.2.5'), ('posthog', '0087_user_segmentation'), ('django', '3.2.6'), ('numpy', '1.21.0')]) == {'posthog': ['0086_team_session_recording_opt_in', '0087_user_segmentation'], 'dj... | {
"split": "train",
"index": 2184,
"acecode_id": "oss_28813",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a privilege-checking system for accessing private resources. Your function should take a user role and a resource type as input, and return a status code based on the user's access privileges. The function should behave... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_access('admin', 'private') == 200\", \"assert check_access('admin', 'public') == 200\", \"assert check_access('guest', 'private') == 401\", \"assert check_access('guest', 'public') == 403\", \"assert check_access('user', 'private') == 401\", \"assert c... | {
"split": "train",
"index": 2185,
"acecode_id": "bigcode_python_fns_466",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a story encoded using a simple cipher where each letter in the alphabet is shifted by a fixed number of positions. Your task is to implement a function `decrypt_story(ciphertext: str, shift: int) -> str` that takes the encoded story and a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decrypt_story('Uifsf jt b nfttbhf', 1) == 'There is a message'\", \"assert decrypt_story('Dpef', 1) == 'Code'\", \"assert decrypt_story('Gur dhvpx', 13) == 'The quick'\", \"assert decrypt_story('Zabc', 1) == 'Yzab'\", \"assert decrypt_story('A B C', 1) == 'Z... | {
"split": "train",
"index": 2186,
"acecode_id": "bigcode_python_fns_5186",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with updating the position of a sprite in a simple game inventory system. Write a function `update_dollars_position` that takes two parameters: the current x-coordinate of the dollars sprite and a new center x-coordinate. The function should return the updated x-... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_dollars_position(0.0, 5.0) == 5.0\", \"assert update_dollars_position(10.0, 10.0) == 10.0\", \"assert update_dollars_position(15.5, 20.5) == 20.5\", \"assert update_dollars_position(100.0, 90.0) == 90.0\", \"assert update_dollars_position(-5.0, 0.0) =... | {
"split": "train",
"index": 2187,
"acecode_id": "oss_5983",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a FASTA ID that contains locus information in the following format: 'genome:seqid:start-end'. Your task is to implement a function that parses this ID string and extracts the genome, sequence ID, and the start and end positions as integers. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_fasta_id('genome1:seqA:10-20') == ('genome1', 'seqA', 10, 20)\", \"assert parse_fasta_id('genome2:seqB:30-15') == ('genome2', 'seqB', 15, 30)\", \"assert parse_fasta_id('genome3:seqC:5-5') == ('genome3', 'seqC', 5, 5)\", \"assert parse_fasta_id('genome... | {
"split": "train",
"index": 2188,
"acecode_id": "bigcode_python_fns_43410",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that calculates and returns the standard deviation of the numbers in the list. The standard deviation is a measure of how spread out the numbers are in the dataset. The function should take the list of integers as input and return a fl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_std([1, 2, 3]) == 0.816496580927726\", \"assert calculate_std([4, 4, 4]) == 0.0\", \"assert calculate_std([1, 1, 1, 1]) == 0.0\", \"assert calculate_std([1, 2, 3, 4, 5]) == 1.4142135623730951\", \"assert calculate_std([1]) == 0.0\", \"assert calcul... | {
"split": "train",
"index": 2189,
"acecode_id": "bigcode_python_fns_293",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given two lists, `smh_data` and `ic_data`, where each list contains multiple elements representing pixel sizes and image data. Your task is to create a function that verifies if the pixel sizes and image data in both lists match certain criteria. Specifically, you need ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_data([(['image1', 'image2'], 0.5)], [(['image1', 'image2'], 0.5)]) == True\", \"assert verify_data([(['image1'], 0.5)], [(['image1'], 0.5)]) == True\", \"assert verify_data([(['image1', 'image2'], 0.5)], [(['image1', 'image3'], 0.5)]) == False\", \"as... | {
"split": "train",
"index": 2190,
"acecode_id": "bigcode_python_fns_4723",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that represents various factors related to a future trading system. The dictionary has a key '级别列表' which contains a list of frequency levels. Your task is to implement a function that checks for specific frequency levels in this list and returns a va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert future_bi_end_f30_base({'\\u7ea7\\u522b\\u5217\\u8868': ['F30', 'F5', 'F1']}) == Factors.Other\", \"assert future_bi_end_f30_base({'\\u7ea7\\u522b\\u5217\\u8868': ['F5']}) == Factors.Other\", \"assert future_bi_end_f30_base({'\\u7ea7\\u522b\\u5217\\u8868': [... | {
"split": "train",
"index": 2191,
"acecode_id": "bigcode_python_fns_33306",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary that maps elements to their corresponding orbitals, write a function that returns a list of strings representing the orbital projections in a specific format. The format for each element should be 'Element: Orbital(s)'. If an element has multiple orbitals, th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert orbital_projections({'Xe': 'p', 'Kr': 'p', 'Rn': 'p'}) == ['Xe: p', 'Kr: p', 'Rn: p']\", \"assert orbital_projections({'Ti': 'd', 'V': 'd', 'Cr': 'd'}) == ['Ti: d', 'V: d', 'Cr: d']\", \"assert orbital_projections({'Li': 's', 'Be': 's', 'B': 'p'}) == ['Li: s... | {
"split": "train",
"index": 2192,
"acecode_id": "bigcode_python_fns_13215",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks for duplicate entries in a list of tuples. Each tuple consists of an access code (an integer) and an operation (a string). The function should return True if there are any duplicate access codes in the list. Additionally, the function should tak... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert duplicate_detector([(1234, 'ADD'), (5678, 'ADD'), (9101, 'DELETE')]) == False\", \"assert duplicate_detector([(1234, 'ADD'), (5678, 'ADD'), (5678, 'DELETE'), (1234, 'ADD')], True) == True\", \"assert duplicate_detector([(1234, 'ADD'), (1234, 'DELETE')], True... | {
"split": "train",
"index": 2193,
"acecode_id": "evol_26381",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of irregular verbs in English along with their translations, past tense, and past participle forms. Write a function `validate_irregular_verbs(verbs)` that takes this list as input and returns a dictionary containing the number of correct and incorrect resp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_irregular_verbs([['hurt', ['machucar'], 'hurt', 'hurt']]) == {'correct': 1, 'incorrect': 0}\", \"assert validate_irregular_verbs([['keep', ['manter', 'preservar'], 'kept', 'kept']]) == {'correct': 1, 'incorrect': 0}\", \"assert validate_irregular_ve... | {
"split": "train",
"index": 2194,
"acecode_id": "oss_4624",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that calculates the Catalan number for a given non-negative integer or an iterable of non-negative integers. The function should handle incorrect inputs by raising suitable exceptions. If the input is an iterable, the function should return a list of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert catalan(0) == 1\", \"assert catalan(1) == 1\", \"assert catalan(2) == 2\", \"assert catalan(3) == 5\", \"assert catalan(4) == 14\", \"assert catalan(5) == 42\", \"assert catalan(6) == 132\", \"assert catalan(7) == 429\", \"assert catalan((4, 5, 6)) == [14, 4... | {
"split": "train",
"index": 2195,
"acecode_id": "evol_5591",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `caesar_encrypt(text: str, shift: int) -> str` that encrypts a given text using a Caesar cipher. The function should handle both uppercase and lowercase letters, shifting them by the specified integer `shift`. Characters that are not letters should remain u... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert caesar_encrypt('abc', 1) == 'bcd'\", \"assert caesar_encrypt('xyz', 2) == 'zab'\", \"assert caesar_encrypt('Hello, World!', 3) == 'Khoor, Zruog!'\", \"assert caesar_encrypt('Python3.8', 5) == 'Udymts3.8'\", \"assert caesar_encrypt('Test123!', 4) == 'Xiwx123!... | {
"split": "train",
"index": 2196,
"acecode_id": "evol_22622",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `check_version()` that verifies if a given version string matches the expected version of a software project. The function takes two parameters: `current_version` (a string) representing the current version of the software, and `expected_version... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_version('1.0.0', '1.0.0') == True\", \"assert check_version('1.0.1', '1.0.0') == False\", \"assert check_version('2.0.0', '2.0.0') == True\", \"assert check_version('2.1.0', '2.1.0') == True\", \"assert check_version('2.1.1', '2.1.0') == False\", \"ass... | {
"split": "train",
"index": 2197,
"acecode_id": "bigcode_python_fns_12167",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_max_sum_subarray(arr: List[int], k: int) -> int` that returns the maximum sum of any contiguous subarray of length `k`. If the length of the array is less than `k`, return 0. Your function should handle both positive and negative... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_sum_subarray([1, 2, 3, 4, 5], 3) == 12\", \"assert find_max_sum_subarray([2, -1, 3, 4, -2], 2) == 7\", \"assert find_max_sum_subarray([3, 2], 5) == 0\", \"assert find_max_sum_subarray([-1, -2, -3, -4], 2) == -3\", \"assert find_max_sum_subarray([5, ... | {
"split": "train",
"index": 2198,
"acecode_id": "bigcode_python_fns_32994",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that finds all possible paths in a given directed acyclic graph (DAG) from a specified start node to an end node. The graph is represented as an adjacency list, where each key-value pair represents a node and its adjacent nodes. Your ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_all_paths({'A': ['B', 'C'], 'B': ['D', 'E'], 'C': ['F'], 'D': ['E'], 'E': ['F'], 'F': []}, 'A', 'F') == [['A', 'B', 'D', 'E', 'F'], ['A', 'B', 'E', 'F'], ['A', 'C', 'F']]\", \"assert find_all_paths({'A': ['B'], 'B': ['C'], 'C': ['D'], 'D': []}, 'A', 'D'... | {
"split": "train",
"index": 2199,
"acecode_id": "oss_20606",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.