data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are tasked with creating a function that removes a specified node from a given directed graph represented as an adjacency list. The function should take two parameters: an adjacency list, which is a dictionary where the keys are node names and the values are lists of adjace...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_node({'A': ['B', 'C'], 'B': ['A'], 'C': ['A']}, 'B') == {'A': ['C'], 'C': ['A']}\", \"assert remove_node({'A': ['B', 'C'], 'B': ['A'], 'C': ['A']}, 'D') == {'A': ['B', 'C'], 'B': ['A'], 'C': ['A']}\", \"assert remove_node({'A': ['B'], 'B': []}, 'A') =...
{ "split": "train", "index": 75800, "acecode_id": "bigcode_python_fns_33955", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with transforming a list of tweets into a format suitable for display. Each tweet is represented as a dictionary containing a 'handle' (the username of the person who tweeted) and 'text' (the content of the tweet). Your goal is to modify the 'handle' and 'text' f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_tweets([]) == []\", \"assert format_tweets([{'handle': 'user1', 'text': 'Hello World!'}]) == [{'handle': '<a href=\\\"http://twitter.com/user1\\\">user1</a>', 'text': 'Hello World!'}]\", \"assert format_tweets([{'handle': 'user3', 'text': 'No links he...
{ "split": "train", "index": 75801, "acecode_id": "bigcode_python_fns_21105", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a given string representing a color in hexadecimal format. Your function should take a string as input, which may have a '#' character at the beginning. Your goal is to return the hexadecimal color code without the '#' char...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_hex_color('#ff00ff') == 'ff00ff'\", \"assert format_hex_color('ff00ff') == 'ff00ff'\", \"assert format_hex_color('#123456') == '123456'\", \"assert format_hex_color('123456') == '123456'\", \"assert format_hex_color('#abcdef') == 'abcdef'\", \"assert ...
{ "split": "train", "index": 75802, "acecode_id": "bigcode_python_fns_13325", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings where each string is in the format 'name_date', implement a function `decompose_names(dates)` that splits each string into a tuple of (`name`, `date`). The `name` is the part before the last underscore ('_') and the `date` is the part after the last unde...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decompose_names(['Alice_2023-03-15', 'Bob_2023-03-16']) == [('Alice', '2023-03-15'), ('Bob', '2023-03-16')]\", \"assert decompose_names(['Charlie_2023-03-17']) == [('Charlie', '2023-03-17')]\", \"assert decompose_names(['David_2023-03-18', 'Eve_ 2023-03-19']...
{ "split": "train", "index": 75803, "acecode_id": "bigcode_python_fns_8558", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a Bitcoin script. Your task is to implement a function `is_p2wpkh_output(cscript: List[int]) -> bool` that checks if the output script is of the form: `OP_0 <pubkey hash>`. The script is considered valid if it meets the following cr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_p2wpkh_output([0] + [1]*21) == True\", \"assert is_p2wpkh_output([1] + [1]*21) == False\", \"assert is_p2wpkh_output([0] + [2]*21) == True\", \"assert is_p2wpkh_output([0]) == False\", \"assert is_p2wpkh_output([0] + [1]*20) == False\", \"assert is_p2wpkh...
{ "split": "train", "index": 75804, "acecode_id": "bigcode_python_fns_35962", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `char_freq_map(s: str) -> dict` that takes a string `s` as input and returns a dictionary containing the frequency of each unique character in the string. The keys of the dictionary should be the characters themselves if they are alphanumeric, and the Unico...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert char_freq_map('12345') == {'1': 1, '2': 1, '3': 1, '4': 1, '5': 1}\", \"assert char_freq_map('') == {}\", \"assert char_freq_map('abcABC') == {'a': 2, 'b': 2, 'c': 2}\", \"assert char_freq_map('Test!#123') == {'t': 2, 'e': 1, 's': 1, '1': 1, '2': 1, '3': 1, ...
{ "split": "train", "index": 75805, "acecode_id": "evol_24536", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a dictionary of message arguments and returns specific values based on the presence of certain keys and their corresponding values. You are given a dictionary `dMsg` with a key `args` that is itself a dictionary. You al...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_message_args({'args': {'host': 'localhost'}}, type('obj', (object,), {'hostArgName': 'host'})) == ('NO', 'localhost', None, None)\", \"assert process_message_args({'args': {'host': '127.0.0.1'}}, type('obj', (object,), {'hostArgName': 'host'})) == ('...
{ "split": "train", "index": 75806, "acecode_id": "oss_5854", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `decode_and_compare(encoded_strings: List[str], sequence: str) -> List[bool]` that takes a list of Base64 encoded strings and a sequence of characters. The function should decode each string and return a list of boolean values indicating whether each decode...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decode_and_compare(['QmFzZTY0RW5jb2RlZFN0cmluZw==', 'RGV2ZWxvcGFQcm9ncmFtbWluZ1Rlc3Q='], 'Test') == [False, True]\", \"assert decode_and_compare(['QmFzZTY0RW5jb2RlZFN0cmluZw==', 'U29tZSBzdHJpbmc='], 'Base64') == [True, False]\", \"assert decode_and_compare([...
{ "split": "train", "index": 75807, "acecode_id": "evol_19061", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that converts a temperature from Fahrenheit to Kelvin. The function should take a single floating-point number as input representing the temperature in Fahrenheit and return the temperature in Kelvin rounded to two decimal places. If the input is not a vali...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fahrenheit_to_kelvin(32) == 273.15\", \"assert fahrenheit_to_kelvin(100) == 310.93\", \"assert fahrenheit_to_kelvin(-40) == 233.15\", \"assert fahrenheit_to_kelvin(212) == 373.15\", \"assert fahrenheit_to_kelvin(0) == 255.37\", \"assert fahrenheit_to_kelvin(...
{ "split": "train", "index": 75808, "acecode_id": "evol_32602", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `triangle_properties(a: int, b: int, c: int) -> Tuple[str, str]` that takes three integers representing the lengths of the sides of a triangle. The function should return a tuple containing two strings: the first string should indicate the type of triangle ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert triangle_properties(3, 3, 3) == ('Equilateral', 'Acute')\", \"assert triangle_properties(3, 4, 5) == ('Scalene', 'Right')\", \"assert triangle_properties(10, 10, 10) == ('Equilateral', 'Acute')\", \"assert triangle_properties(6, 8, 10) == ('Scalene', 'Right'...
{ "split": "train", "index": 75809, "acecode_id": "evol_15520", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `is_prime_number(num: int) -> bool` that takes an integer as input and returns True if the number is a prime number, and False otherwise. A prime number is defined as a number greater than 1 that has no divisors other than 1 and itself.\nPlease reason step ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_prime_number(2) == True\", \"assert is_prime_number(3) == True\", \"assert is_prime_number(4) == False\", \"assert is_prime_number(5) == True\", \"assert is_prime_number(6) == False\", \"assert is_prime_number(7) == True\", \"assert is_prime_number(8) == ...
{ "split": "train", "index": 75810, "acecode_id": "evol_11910", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates sending user data to a remote service. The function should accept a request object and a details dictionary containing user information. The request object contains a `COOKIES` attribute which includes a unique identifier c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_user_data({\\\"COOKIES\\\": {\\\"hubspotutk\\\": \\\"somefakedata\\\"}}, {\\\"email\\\": \\\"test@test.com\\\"}, {\\\"HUBSPOT_PORTAL_ID\\\": None, \\\"HUBSPOT_CREATE_USER_FORM_ID\\\": None}) == {}\", \"assert send_user_data({\\\"COOKIES\\\": {\\\"hubspo...
{ "split": "train", "index": 75811, "acecode_id": "bigcode_python_fns_24150", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an input object, write a function `is_sequence(input)` that determines if the object is a sequence. A sequence is defined as any object that supports indexing and iteration, except for strings. The function should return `True` if the input is a sequence (like a list, tup...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_sequence([]) == True\", \"assert is_sequence(()) == True\", \"assert is_sequence('hello') == False\", \"assert is_sequence(123) == False\", \"assert is_sequence(None) == False\", \"assert is_sequence('') == False\", \"assert is_sequence(range(5)) == True\...
{ "split": "train", "index": 75812, "acecode_id": "bigcode_python_fns_11298", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that calculates the square of a given integer and moves a point in a 2D space. Your function should take two parameters: an integer `num` and a list of three floating-point numbers `[x, y, offset_x, offset_y]` where `x` and `y` represent t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_square_and_move_point(5, [3.0, 4.0, 2.0, 3.0]) == (25, [5.0, 7.0])\", \"assert calculate_square_and_move_point(0, [0.0, 0.0, 1.0, 1.0]) == (0, [1.0, 1.0])\", \"assert calculate_square_and_move_point(3, [1.0, 1.0, -1.0, -1.0]) == (9, [0.0, 0.0])\", ...
{ "split": "train", "index": 75813, "acecode_id": "oss_13037", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a binary image represented as a 2D array of 0s and 1s. Your task is to implement a function `process_image(binary_image: List[List[int]], iterations: int, operation: str) -> List[List[int]]`, where `binary_image` is the input 2D array, `iterations` is the number o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_image([[1, 0], [0, 1]], 1, 'erode') == [[0, 0], [0, 0]]\", \"assert process_image([[0, 0], [0, 0]], 1, 'erode') == [[0, 0], [0, 0]]\", \"assert process_image([[1, 0], [1, 1]], 1, 'erode') == [[0, 0], [0, 0]]\", \"assert process_image([[1, 1], [0, 1]]...
{ "split": "train", "index": 75814, "acecode_id": "oss_2465", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a directed graph represented as an adjacency list where each edge has associated metadata. Each edge is represented as a tuple (u, v) where u is the starting node and v is the ending node, and the metadata is a dictionary containing various keys. Your task is to i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_graph_metadata({(1, 2): {'CITATION': {'author': 'Alice', 'title': 'Graph Theory', 'year': 2020}}}) == None\", \"assert clean_graph_metadata({(1, 2): {'CITATION': {'author': 'Alice', 'title': 'Graph Theory', 'publisher': 'XYZ Press'}}}) == None\", \"ass...
{ "split": "train", "index": 75815, "acecode_id": "bigcode_python_fns_13653", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the configuration of a software service. Write a function named `configure_service` that takes no parameters and performs the following actions: it sets a flag named 'service.installed' to True and clears a flag named 'service.configured' to False...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert configure_service() == {'service.installed': True, 'service.configured': False}\", \"assert configure_service() == {'service.installed': True, 'service.configured': False}\", \"assert configure_service() == {'service.installed': True, 'service.configured': F...
{ "split": "train", "index": 75816, "acecode_id": "bigcode_python_fns_2797", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of daily stock prices, develop a function that calculates the maximum possible profit from multiple buying and selling operations. A stock must be bought before it can be sold, and after a stock is sold, another stock cannot be bought on the same day. Additionally,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert stock_portfolio([1, 2, 3, 4, 5]) == (4, [((1, 5), 4)])\", \"assert stock_portfolio([5, 4, 3, 2, 1]) == (0, [])\", \"assert stock_portfolio([30, 40, 50, 40, 30]) == (20, [((30, 50), 20)])\", \"assert stock_portfolio([1, 2]) == (1, [((1, 2), 1)])\", \"assert s...
{ "split": "train", "index": 75817, "acecode_id": "evol_18353", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a model that represents a memory system with a specific number of items encoded into it. The model has an attribute `item_count` that specifies the number of items and a method `activations(vector)` that returns a list of activation values for each item based on a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retrieve_items({'item_count': 3, 'activations': lambda x: [0.7, 0.1, 0.2]}, [0]) == [0]\", \"assert retrieve_items({'item_count': 4, 'activations': lambda x: [0.4, 0.4, 0.4, 0.4]}, [0]) == []\", \"assert retrieve_items({'item_count': 2, 'activations': lambda...
{ "split": "train", "index": 75818, "acecode_id": "bigcode_python_fns_8135", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a rotation axis ('X', 'Y', or 'Z'), the sine and cosine of an angle theta, and a translation vector represented as a 3-tuple (x, y, z), implement a function `build_rotation_translation_matrix(axis: str, s: float, c: float, t: Tuple[float, float, float]) -> List[List[float...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_rotation_translation_matrix('Z', 0.0, 1.0, (1, 1, 1)) == [[1.0, 0.0, 0.0, 1.0], [0.0, 1.0, 0.0, 1.0], [0.0, 0.0, 1.0, 1.0], [0.0, 0.0, 0.0, 1.0]]\", \"assert build_rotation_translation_matrix('Y', 0.0, 1.0, (1, 1, 1)) == [[1.0, 0.0, 0.0, 1.0], [0.0, 1....
{ "split": "train", "index": 75819, "acecode_id": "bigcode_python_fns_20828", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries where each dictionary contains a person's name and age, implement a function that adds two new keys to each dictionary: 'age_group' and 'working_status'. The 'age_group' should have values based on the following criteria: 'young' if age is less than...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_people([{'name': 'John', 'age': 25}, {'name': 'Mark', 'age': 45}, {'name': 'Isabelle', 'age': 75}]) == [{'name': 'John', 'age': 25, 'age_group': 'young', 'working_status': 'employed'}, {'name': 'Mark', 'age': 45, 'age_group': 'adult', 'working_sta...
{ "split": "train", "index": 75820, "acecode_id": "evol_1694", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes notifications for account-related events. The function `send_notifications` is responsible for deciding whether to send a notification based on the type of notification and the provided parameters. Your function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_notifications('account', 'user123', 'param1_value', 'param2_value', True) == 'Notification sent with param1 and param2'\", \"assert send_notifications('account', 'user123', None, None, False) == 'No notification sent'\", \"assert send_notifications('acc...
{ "split": "train", "index": 75821, "acecode_id": "oss_29434", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that manages a configuration setting for a web application. Specifically, you need to implement a function called `get_debug_mode` that returns the value of a configuration variable called `DEBUG`. The function should return `True`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_debug_mode('true') == True\", \"assert get_debug_mode('True') == True\", \"assert get_debug_mode('TRUE') == True\", \"assert get_debug_mode('false') == False\", \"assert get_debug_mode('False') == False\", \"assert get_debug_mode('FALSE') == False\", \"a...
{ "split": "train", "index": 75822, "acecode_id": "oss_5810", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing a quantum data set represented as a list of complex numbers. Your objective is to implement a function `analyze_quantum_data(data: List[complex]) -> Dict[str, float]` that calculates and returns a dictionary containing the following statistics: the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_quantum_data([2+3j]) == {'mean': 3.605551275463989, 'max': 3.605551275463989, 'min': 3.605551275463989}\", \"assert analyze_quantum_data([-1-1j, 1+1j]) == {'mean': 1.4142135623730951, 'max': 1.4142135623730951, 'min': 1.4142135623730951}\", \"assert ...
{ "split": "train", "index": 75823, "acecode_id": "oss_15558", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Create a function `introduce_employee(name: str, age: int) -> str` that takes an employee's name and age as input and returns a string introducing the employee in the format: \"My name is {name} and I am {age} years old.\".\nPlease reason step by step, then write a self-contain...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert introduce_employee('Alice', 25) == 'My name is Alice and I am 25 years old.'\", \"assert introduce_employee('Bob', 30) == 'My name is Bob and I am 30 years old.'\", \"assert introduce_employee('Charlie', 35) == 'My name is Charlie and I am 35 years old.'\", ...
{ "split": "train", "index": 75824, "acecode_id": "evol_18561", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a logging system for a distributed database management system. You need to create a function that simulates the logging of events for a MariaDB cluster. The function should take a list of events where each event is represented by a dictionary co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_events([{'action': 'start', 'ipv4': '10.0.0.1'}, {'action': 'error', 'ipv4': '10.0.0.2', 'error_message': 'Timeout error'}]) == ['Node 10.0.0.1 started', 'Error on node 10.0.0.2: Timeout error']\", \"assert log_events([{'action': 'start', 'ipv4': '192.16...
{ "split": "train", "index": 75825, "acecode_id": "oss_11557", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a sample tag based on a user's name and an optional tag name. The function should take in a string representing the user's name and an optional string for the tag name, defaulting to 'Main course' if not provided. The funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_sample_tag('Alice') == {'user': 'Alice', 'name': 'Main course'}\", \"assert create_sample_tag('Bob') == {'user': 'Bob', 'name': 'Main course'}\", \"assert create_sample_tag('Charlie', 'Dessert') == {'user': 'Charlie', 'name': 'Dessert'}\", \"assert cr...
{ "split": "train", "index": 75826, "acecode_id": "bigcode_python_fns_47916", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing names of models in a project. Your task is to implement a function that takes this list as input and returns a new list containing only the names of models that start with the letter 'A'. The function should be case-insensitive, mean...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_models_starting_with_a(['Alpha', 'beta', 'Anaconda', 'gamma', 'app']) == ['Alpha', 'Anaconda', 'app']\", \"assert filter_models_starting_with_a(['apple', 'banana', 'avocado', 'cherry']) == ['apple', 'avocado']\", \"assert filter_models_starting_with_a...
{ "split": "train", "index": 75827, "acecode_id": "bigcode_python_fns_16835", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the factorial of a given non-negative integer using recursion. The factorial of a non-negative integer n is denoted as n! and is the product of all positive integers less than or equal to n. Implement a Python function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_factorial(0) == 1\", \"assert calculate_factorial(1) == 1\", \"assert calculate_factorial(2) == 2\", \"assert calculate_factorial(3) == 6\", \"assert calculate_factorial(4) == 24\", \"assert calculate_factorial(5) == 120\", \"assert calculate_facto...
{ "split": "train", "index": 75828, "acecode_id": "oss_20305", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string 's', write a function that reverses the string and returns the reversed result. The input string can contain any printable ASCII characters, including spaces and punctuation. The function should not use any built-in string reversal functions or methods. Implement...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_string('hello') == 'olleh'\", \"assert reverse_string('world') == 'dlrow'\", \"assert reverse_string('') == ''\", \"assert reverse_string('a') == 'a'\", \"assert reverse_string('ab') == 'ba'\", \"assert reverse_string('abcdef') == 'fedcba'\", \"asser...
{ "split": "train", "index": 75829, "acecode_id": "bigcode_python_fns_36934", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to convert a given integer into its Roman numeral representation. Roman numerals are represented by seven different symbols: I, V, X, L, C, D, and M, which correspond to the decimal values 1, 5, 10, 50, 100, 500, and 1000, respectivel...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert int_to_roman(1) == 'I'\", \"assert int_to_roman(2) == 'II'\", \"assert int_to_roman(3) == 'III'\", \"assert int_to_roman(4) == 'IV'\", \"assert int_to_roman(5) == 'V'\", \"assert int_to_roman(6) == 'VI'\", \"assert int_to_roman(9) == 'IX'\", \"assert int_to_...
{ "split": "train", "index": 75830, "acecode_id": "oss_23470", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program to parse and analyze a series of movement commands for a robotic system. The movement commands are represented as strings in the format 'component:action', where 'component' is the specific part of the robot (e.g., left_leg, left_foot) and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_movement_commands(['left_leg:crz', 'left_leg:ctx']) == {'left_leg': {'crz': 1, 'ctx': 1}}\", \"assert parse_movement_commands(['left_leg:crz', 'left_leg:crz']) == {'left_leg': {'crz': 2}}\", \"assert parse_movement_commands(['left_foot:crx', 'left_foot...
{ "split": "train", "index": 75831, "acecode_id": "oss_22072", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing datasets and model configurations for a machine learning project. Write a function `manage_project` that takes in two dictionaries: `DATASETS` and `MODEL`. The function should perform the following operations: \n1. Return a list of names of all data...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_project({'TRAIN': ('lm_real_glue_train',), 'TRAIN2': ('lm_pbr_glue_train',), 'TRAIN2_RATIO': 0.0, 'TEST': ('lm_real_glue_test',)}, {'WEIGHTS': 'path/to/model.pth'}) == (['TRAIN', 'TRAIN2', 'TRAIN2_RATIO', 'TEST'], True, 'path/to/model.pth')\", \"asser...
{ "split": "train", "index": 75832, "acecode_id": "oss_35654", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string of alphanumeric characters and returns a list of indexes for each decimal digit (from '0' to '9') that is surrounded by prime numbers on both its left and right sides. Digits at the start or end of any numeric sequence should be ignored....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert digits_between_primes('abc123') == []\", \"assert digits_between_primes('3a5b7c') == []\", \"assert digits_between_primes('0abc1def2ghi3') == []\", \"assert digits_between_primes('10 1 2 3 4') == []\", \"assert digits_between_primes('abcdefg') == []\"]}" }
{ "split": "train", "index": 75833, "acecode_id": "evol_10383", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a given URL is valid. A valid URL must start with 'http://' or 'https://', followed by a domain name that includes at least one dot (.) and ends with a valid top-level domain (TLD) such as '.com', '.org', or '.net'. Imp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_url('http://example.com') == True\", \"assert is_valid_url('https://example.org') == True\", \"assert is_valid_url('http://example.net') == True\", \"assert is_valid_url('http://subdomain.example.com') == True\", \"assert is_valid_url('https://www.e...
{ "split": "train", "index": 75834, "acecode_id": "bigcode_python_fns_32677", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of a series of buildings. Your task is to implement a function that determines whether the heights of the buildings can be arranged in such a way that the extreme values (the tallest and the shortest buildings) are at th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_arrange_extreme_values([1, 2, 3]) == True\", \"assert can_arrange_extreme_values([5]) == True\", \"assert can_arrange_extreme_values([]) == True\", \"assert can_arrange_extreme_values([2, 2, 2]) == True\", \"assert can_arrange_extreme_values([10, 20, 30,...
{ "split": "train", "index": 75835, "acecode_id": "bigcode_python_fns_48295", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a string of text and a corresponding list of labels, where each label corresponds to a character in the text. Your task is to convert this input into structured features for a machine learning model. Specifically, you need to implement a function that takes the fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_features('hello', ['A', 'A', 'B', 'B', 'A'], {'A': 1, 'B': 2}) == {'input_ids': [104, 101, 108, 108, 111], 'label_ids': [1, 1, 2, 2, 1], 'seq_length': 5}\", \"assert convert_to_features('world', ['C', 'C', 'C', 'D', 'C'], {'C': 3, 'D': 4}) == {'in...
{ "split": "train", "index": 75836, "acecode_id": "bigcode_python_fns_4534", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program to preprocess movie reviews for sentiment analysis. Your goal is to implement a function that takes a raw movie review as input and returns a cleaned version of the review. The cleaning process involves removing any non-alphabetic characte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_clean_review('The movie was fantastic! Great acting and storyline.') == 'the movie was fantastic great acting and storyline'\", \"assert get_clean_review('I loved it!') == 'i loved it'\", \"assert get_clean_review('What a terrible movie...') == 'what a t...
{ "split": "train", "index": 75837, "acecode_id": "oss_14218", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function that evaluates a complex arithmetic expression given as a string. The expression will contain integers, addition, subtraction, multiplication, and division operators. Your function should return the result of the expression as a float.\nPlease reason step by s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_expression('5 * 5 - 10 + 2') == 17.0\", \"assert evaluate_expression('8 / 4 + 2 * 3') == 8.0\", \"assert evaluate_expression('15 / 3 * 2 + 1') == 11.0\", \"assert evaluate_expression('1 + 1 + 1 + 1 + 1') == 5.0\", \"assert evaluate_expression('2 * (...
{ "split": "train", "index": 75838, "acecode_id": "evol_18587", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a greedy algorithm to optimize a target function based on a given fine vector and an order parameter. Your goal is to design and implement a function `greedy_algorithm(fine_vector: List[int], order: int, target_function: Callable[[List[int]], in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert greedy_algorithm([1, 2, 3], 1, lambda x: sum(x)) == 6\", \"assert greedy_algorithm([1, 2, 3], 2, lambda x: sum(x)) == 6\", \"assert greedy_algorithm([5, 3, 1, 4, 2], 1, lambda x: sum(x)) == 15\", \"assert greedy_algorithm([5, 3, 1, 4, 2], 2, lambda x: sum(x)...
{ "split": "train", "index": 75839, "acecode_id": "oss_19873", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing precipitation data based on certain conditions. Write a function called `process_precipitation_data` that takes in the following parameters: a list of precipitation values (as floats) for different time intervals, a date object representing the va...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_precipitation_data([0.0, 0.05, 0.1], datetime(2014, 5, 21), 1.0, 1.0, (0.0, 0.0, 5.0, 5.0)) == 0.1\", \"assert process_precipitation_data([], datetime(2014, 5, 21), 1.0, 1.0, (0.0, 0.0, 5.0, 5.0)) == 0.0\", \"assert process_precipitation_data([0.0, 0...
{ "split": "train", "index": 75840, "acecode_id": "bigcode_python_fns_11279", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple banking transaction system. The function should take a list of transactions and return the final balance and the total number of transactions performed. Each transaction is represented as a tuple where the first el...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_bank_transactions([('deposit', 1000), ('withdraw', 500), ('deposit', 200)]) == (700, 3)\", \"assert simulate_bank_transactions([('deposit', 150), ('deposit', 50), ('withdraw', 100)]) == (100, 3)\", \"assert simulate_bank_transactions([('withdraw', 1...
{ "split": "train", "index": 75841, "acecode_id": "oss_4802", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a list of integers and returns the product of all its elements.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block." } ]
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert product_list_elements([1, 2, 3, 4]) == 24\", \"assert product_list_elements([0, 1, 2, 3]) == 0\", \"assert product_list_elements([-1, 1, 2]) == -2\", \"assert product_list_elements([5, 5, 5]) == 125\", \"assert product_list_elements([10, 2]) == 20\", \"asser...
{ "split": "train", "index": 75842, "acecode_id": "evol_1360", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array, implement a function that determines whether the number of elements in the array is a prime number or a composite number. The function should return 'Prime' if the length is prime and 'Composite' if the length is composite. Note that lengths of 0 and 1 are consi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert array_prime_or_composite([]) == 'Composite'\", \"assert array_prime_or_composite([1]) == 'Composite'\", \"assert array_prime_or_composite([1, 2]) == 'Prime'\", \"assert array_prime_or_composite([1, 2, 3, 4]) == 'Composite'\", \"assert array_prime_or_composit...
{ "split": "train", "index": 75843, "acecode_id": "evol_4984", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `categorizeNumbers` that takes three parameters: `small` (a positive integer), `large` (a positive integer), and `var` (a positive float). The function should return an integer based on the following conditions: \n- If `small` is grea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorizeNumbers(10, 20, 0.1) == -1\", \"assert categorizeNumbers(5, 10, 0.05) == -1\", \"assert categorizeNumbers(8, 32, 0.4) == -1\", \"assert categorizeNumbers(1, 2, 0.1) == -1\", \"assert categorizeNumbers(50, 100, 0.1) == -1\", \"assert categorizeNumbe...
{ "split": "train", "index": 75844, "acecode_id": "oss_3202", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function `is_subset(s1: set, s2: set) -> bool` that checks if the first set `s1` is a subset of the second set `s2`, without using any built-in set functions. The function should return `True` if `s1` is a subset of `s2`, and `False` otherwise.\nPlease reason step b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_subset({1, 2, 3}, {1, 2, 3, 4, 5}) == True\", \"assert is_subset({1, 4}, {1, 2, 3, 4, 5}) == True\", \"assert is_subset({2, 3}, {1, 2, 3}) == True\", \"assert is_subset({5}, {1, 2, 3, 4}) == False\", \"assert is_subset({}, {1, 2, 3}) == True\", \"assert i...
{ "split": "train", "index": 75845, "acecode_id": "evol_32080", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of image scale names by first registering them, then packaging them, and finally returning the list of packaged image scales. You need to implement a function called `process_image_scales` that takes in a list of ima...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_image_scales(['small', 'medium', 'large']) == ['small_package', 'medium_package', 'large_package']\", \"assert process_image_scales(['thumbnail', 'banner']) == ['thumbnail_package', 'banner_package']\", \"assert process_image_scales(['icon']) == ['ic...
{ "split": "train", "index": 75846, "acecode_id": "oss_24289", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function named `bubble_sort` that takes a list of integers as input and returns a new list containing the same integers sorted in ascending order using the bubble sort algorithm. Do not use any built-in sorting functions. The function should handle lists of varying ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bubble_sort([3, 5, 1, 9, 7, 2]) == [1, 2, 3, 5, 7, 9]\", \"assert bubble_sort([10, 7, 8, 9, 1, 5]) == [1, 5, 7, 8, 9, 10]\", \"assert bubble_sort([]) == []\", \"assert bubble_sort([1]) == [1]\", \"assert bubble_sort([5, 5, 5]) == [5, 5, 5]\", \"assert bubble...
{ "split": "train", "index": 75847, "acecode_id": "evol_6502", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with extracting URL mappings from a list of URL patterns in a web application. Each URL pattern is associated with a specific view class and may include additional parameters. Your job is to create a function `extract_url_mapping(urlpatterns)` that takes a list o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_url_mapping([['signup/', 'UserSignupView.as_view()']]) == {'signup/': ('UserSignupView.as_view()',)}\", \"assert extract_url_mapping([['login/', 'auth_views.LoginView.as_view()', 'template_name=authentication/login.html']]) == {'login/': ('auth_views...
{ "split": "train", "index": 75848, "acecode_id": "oss_209", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string representation of an integer and converts it into a strictly positive integer. The function should raise a ValueError if the converted integer is less than or equal to zero. If the integer equals -1, the function should return -1. Additi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_positive_integer('5') == 5\", \"assert convert_to_positive_integer('10', strict=True) == 10\", \"assert convert_to_positive_integer('-1') == -1\", \"assert convert_to_positive_integer('3', cutoff=5) == 3\", \"assert convert_to_positive_integer('8'...
{ "split": "train", "index": 75849, "acecode_id": "bigcode_python_fns_28066", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of numerical values and two constants: a scale factor and an offset. Your task is to implement a Python function that takes in a list of numbers, scales each number by the scale factor, adds the offset to each scaled number, and returns the modified list. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_data([1, 2, 3], 2.0, 5.0) == ([7.0, 9.0, 11.0], {'scale_factor': 2.0, 'offset': 5.0})\", \"assert process_data([0, 0, 0], 1.0, 10.0) == ([10.0, 10.0, 10.0], {'scale_factor': 1.0, 'offset': 10.0})\", \"assert process_data([10], 0.5, 2.0) == ([7.0], {'...
{ "split": "train", "index": 75850, "acecode_id": "oss_26473", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that computes the factorial of a given non-negative integer using recursion. The function should take a single parameter, n, which is the non-negative integer for which you want to compute the factorial. Return the factorial of n.\nPlease reason step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(...
{ "split": "train", "index": 75851, "acecode_id": "evol_23147", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of tuples where each tuple contains a name (string) and a score (integer), implement a function `organize_scores(data: List[Tuple[str, int]]) -> List[Tuple[str, int]]` that organizes the list by scores in descending order. In case of ties, order the tied scores alp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert organize_scores([('John', 70), ('Jane', 80), ('Dave', 65), ('Sam', 70)]) == [('Jane', 80), ('John', 70), ('Sam', 70), ('Dave', 65)]\", \"assert organize_scores([('Alice', 90), ('Bob', 90), ('Charlie', 85)]) == [('Alice', 90), ('Bob', 90), ('Charlie', 85)]\",...
{ "split": "train", "index": 75852, "acecode_id": "evol_14064", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function 'within_range' that determines if every number in the provided list is within the specified inclusive range defined by lower_limit and upper_limit. The function should return True if all numbers fall within the range, and False otherwise. You may assume tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert within_range([1, 2, 3, 4, 5], 1, 5) == True\", \"assert within_range([0, 2, 4, 6], 0, 6) == True\", \"assert within_range([-1, 0, 1], -1, 1) == True\", \"assert within_range([10, 20, 30], 5, 25) == False\", \"assert within_range([5, 5, 5], 5, 5) == True\", \...
{ "split": "train", "index": 75853, "acecode_id": "evol_31256", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a variable number of keyword arguments representing different types of waypoints for a navigation system. Each keyword argument should represent a waypoint type with a default value of 'none' if no specific type is provided...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_waypoints() == {'waypoints': 'none', 'none': 'none', 'default': 'none'}\", \"assert manage_waypoints(a=1) == {'a': 1, 'waypoints': 'none', 'none': 'none', 'default': 'none'}\", \"assert manage_waypoints(x='test', y=3.14) == {'x': 'test', 'y': 3.14, 'w...
{ "split": "train", "index": 75854, "acecode_id": "oss_29651", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci(n)` that generates a Fibonacci sequence up to n elements. The first two elements of the Fibonacci sequence are 0 and 1, and each subsequent element is the sum of the two preceding ones. The function should return a list containing the first n ele...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(0) == []\", \"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\",...
{ "split": "train", "index": 75855, "acecode_id": "evol_6870", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `mean` that calculates the mean of a list of numbers. The function should take a single argument, `numbers`, which is a list of integers or floats. If the list is empty or not a list, or if it contains non-numeric values, the f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert mean([10, 20, 30, 40]) == 25.0\", \"assert mean([-10, 0, 10]) == 0.0\", \"assert mean([1.5, 2.5, 3.5]) == 2.5\", \"assert mean([1]) == 1.0\", \"assert mean([100, 200]) == 150.0\", \"assert mean([0, 0, 0]) == 0.0\", \"assert mean([3, 6, 9]) == 6.0\", \"assert...
{ "split": "train", "index": 75856, "acecode_id": "evol_1675", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the heights of several columns, implement a function to calculate the amount of water that can be trapped between the columns after raining. The water trapped above each column is determined by the height of the shorter of the tallest colum...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert trap_water([0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1]) == 6\", \"assert trap_water([4, 2, 0, 3, 2, 5]) == 9\", \"assert trap_water([1, 0, 2]) == 1\", \"assert trap_water([0, 0, 0]) == 0\", \"assert trap_water([1, 1, 1]) == 0\", \"assert trap_water([2, 1, 2]) == 1\...
{ "split": "train", "index": 75857, "acecode_id": "bigcode_python_fns_35133", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that calculates the average embedding vector for a given list of words based on provided word embeddings. The function should take a list of tuples representing word embeddings, where each tuple contains a word and its correspondin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_embedding([('cat', [1.0, 2.0]), ('dog', [2.0, 3.0]), ('fish', [3.0, 4.0])], ['cat', 'dog']) == [1.5, 2.5]\", \"assert calculate_average_embedding([('apple', [0.1, 0.2]), ('banana', [0.3, 0.4]), ('cherry', [0.5, 0.6])], ['banana', 'cherry'])...
{ "split": "train", "index": 75858, "acecode_id": "oss_13757", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a function `check_divisibility_and_positive` that takes a single parameter `n`. The function should determine if `n` is a positive integer and if it is divisible by 4. If `n` is a positive integer and divisible by 4, return 'Positive and Divisible by 4'. If `n` is a posit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_divisibility_and_positive(16) == 'Positive and Divisible by 4'\", \"assert check_divisibility_and_positive(20) == 'Positive and Divisible by 4'\", \"assert check_divisibility_and_positive(8) == 'Positive and Divisible by 4'\", \"assert check_divisibili...
{ "split": "train", "index": 75859, "acecode_id": "evol_6452", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that calculates the area of a rectangle given its length and width. The function should take two parameters: `length` and `width`, both of which are positive integers. The function should return the area of the rectangle.\nPlease reason step by step, the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rectangle_area(5, 10) == 50\", \"assert rectangle_area(1, 1) == 1\", \"assert rectangle_area(2, 3) == 6\", \"assert rectangle_area(7, 8) == 56\", \"assert rectangle_area(15, 4) == 60\", \"assert rectangle_area(9, 6) == 54\", \"assert rectangle_area(12, 10) =...
{ "split": "train", "index": 75860, "acecode_id": "evol_3906", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given three integers xSize, ySize, and zSize representing the dimensions of a 3D grid. Your task is to implement a function that generates a specified number of unique random positions within this grid. Each position is represented as a tuple of three integers (x, y, z)...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_random_positions(1, 1, 1, 1)) == 1\", \"assert generate_random_positions(0, 0, 0, 1) == []\", \"assert len(generate_random_positions(4, 4, 4, 64)) == 64\", \"assert len(generate_random_positions(10, 10, 10, 1000)) == 1000\", \"assert len(generat...
{ "split": "train", "index": 75861, "acecode_id": "bigcode_python_fns_3291", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of bars in a histogram. Your task is to write a function `max_area(heights)` that calculates the largest rectangle that can be formed in the histogram. The rectangle must be formed using the height of the bars and the wi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_area([1, 1, 1, 1]) == 4\", \"assert max_area([]) == 0\", \"assert max_area([1, 2, 3, 4, 5]) == 9\", \"assert max_area([5, 4, 3, 2, 1]) == 9\", \"assert max_area([2, 4]) == 4\", \"assert max_area([0, 2, 0, 3]...
{ "split": "train", "index": 75862, "acecode_id": "bigcode_python_fns_15016", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a sentence that consists of words and punctuation. Your task is to convert each word in the sentence to its corresponding integer index based on a predefined vocabulary list. The vocabulary list is constant and is defined as follows: ['hello', 'world', 'this', 'is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert map_sentence_to_indices('unknown word') == [-1, -1]\", \"assert map_sentence_to_indices('a quick brown fox') == [4, -1, -1, -1]\", \"assert map_sentence_to_indices('') == []\", \"assert map_sentence_to_indices('test test test') == [5, 5, 5]\", \"assert map_s...
{ "split": "train", "index": 75863, "acecode_id": "bigcode_python_fns_10880", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a string `value`, write a function `trimAlphaNum(value)` that removes all alphanumeric characters from the beginning and end of the string. The function should return the modified string. Alphanumeric characters are defined as any character that is a letter (a-z, A-Z) or ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert trimAlphaNum(u'AND 1>(2+3)-- foobar') == u' 1>(2+3)-- '\", \"assert trimAlphaNum(u'abc123!@#xyz') == u'!@#'\", \"assert trimAlphaNum(u'1234567890') == u''\", \"assert trimAlphaNum(u'!!@#$%^&*()') == u'!!@#$%^&*()'\", \"assert trimAlphaNum(u'xyzabc ') == u...
{ "split": "train", "index": 75864, "acecode_id": "bigcode_python_fns_24390", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string as input and returns the string with all its characters converted to lowercase. The function should handle empty strings and strings that are already in lowercase without any issues.\nPlease reason step by step, then write a self-contain...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_lowercase('Hello, World!') == 'hello, world!'\", \"assert convert_to_lowercase('PYTHON') == 'python'\", \"assert convert_to_lowercase('123 ABC') == '123 abc'\", \"assert convert_to_lowercase('') == ''\", \"assert convert_to_lowercase('Already lowe...
{ "split": "train", "index": 75865, "acecode_id": "evol_30536", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a string as input and removes all vowels (both uppercase and lowercase) from it. The function should return the modified string without vowels.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a sin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_vowels('Hello, World!') == 'Hll, Wrld!'\", \"assert remove_vowels('Python Programming') == 'Pythn Prgrmmng'\", \"assert remove_vowels('AEIOUaeiou') == ''\", \"assert remove_vowels('No Vowels Here!') == 'N Vwls Hr!'\", \"assert remove_vowels('') == ''\...
{ "split": "train", "index": 75866, "acecode_id": "evol_13767", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that accepts a list of user objects and returns a list of usernames from those user objects. Each user object is a dictionary containing at least a 'username' key. Implement the function `get_usernames(users: List[Dict[str, str]]) -> List...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_usernames([{'username': 'alice'}, {'username': 'bob'}, {'username': 'charlie'}]) == ['alice', 'bob', 'charlie']\", \"assert get_usernames([{'username': 'user1'}, {'username': 'user2'}]) == ['user1', 'user2']\", \"assert get_usernames([]) == []\", \"asser...
{ "split": "train", "index": 75867, "acecode_id": "bigcode_python_fns_34669", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a packet handling system for an online multiplayer game server. In this system, packets are identified by unique packet IDs, and the server must be able to register handlers for specific packet IDs to process incoming packets. Your goal is to im...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_packets([(1, 'data1'), (2, 'data2'), (1, 'data3')]) == {1: ['data1', 'data3'], 2: ['data2']}\", \"assert handle_packets([(3, 'dataA'), (3, 'dataB'), (4, 'dataC'), (5, 'dataD')]) == {3: ['dataA', 'dataB'], 4: ['dataC'], 5: ['dataD']}\", \"assert handle...
{ "split": "train", "index": 75868, "acecode_id": "oss_7957", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_password(num_chars: int, prev_password: Optional[str] = None) -> str` that generates a strong password. The password must consist of a mix of symbols, numbers, uppercase letters, and lowercase letters. If a previous password is provided, the new pas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_password(10) != create_password(10)\", \"assert len(create_password(12)) == 12\", \"assert len(create_password(5)) == 5\", \"assert len(create_password(15, 'Password!1')) == 20\", \"assert create_password(8) != create_password(8)\", \"assert create_pa...
{ "split": "train", "index": 75869, "acecode_id": "evol_10704", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with building a cloud configuration generator. Write a function `generate_cloud_config` that takes in the following parameters: `project` (string), `container` (string), `tag` (string), `async_` (boolean), `package` (string), `target` (string), `bazel_version` (s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_cloud_config('my-project', 'my-container', 'v1.0', True, 'my-package', '//my:target', '4.2.0', '/path/to/toolchains', 'my-bucket', 'my-tarball') == 'gcloud builds submit . --config=/path/to/toolchains/container/cloudbuild.yaml --substitutions _PROJE...
{ "split": "train", "index": 75870, "acecode_id": "bigcode_python_fns_49140", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of words and returns a new list that contains only the unique words sorted in alphabetical order. Write a function `unique_sorted_words(words: List[str]) -> List[str]` that takes a list of strings `words` and outputs...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_sorted_words(['apple', 'banana', 'apple', 'orange']) == ['apple', 'banana', 'orange']\", \"assert unique_sorted_words(['grape', 'kiwi', 'grape', 'kiwi', 'pear']) == ['grape', 'kiwi', 'pear']\", \"assert unique_sorted_words([]) == []\", \"assert unique...
{ "split": "train", "index": 75871, "acecode_id": "bigcode_python_fns_4453", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function which outputs a list of tuples, each containing a prefix of the input string and the length of that prefix, in ascending order. The function should look like this: \n\nfrom typing import List, Tuple\n\ndef all_prefixes_with_lengths(string: str) -> List[Tuple[s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert all_prefixes_with_lengths('') == []\", \"assert all_prefixes_with_lengths('a') == [('a', 1)]\", \"assert all_prefixes_with_lengths('ab') == [('a', 1), ('ab', 2)]\", \"assert all_prefixes_with_lengths('abc') == [('a', 1), ('ab', 2), ('abc', 3)]\", \"assert al...
{ "split": "train", "index": 75872, "acecode_id": "evol_5227", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the pixel values of a grayscale image, where each pixel value is in the range of 0 to 255. Implement a function `normalize_image(pixels: List[int]) -> List[float]` that normalizes the pixel values to a range of 0.0 to 1.0. The funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_image([0, 128, 255]) == [0.0, 0.5019607843137255, 1.0]\", \"assert normalize_image([255, 255, 255]) == [1.0, 1.0, 1.0]\", \"assert normalize_image([0, 0, 0]) == [0.0, 0.0, 0.0]\", \"assert normalize_image([64, 128, 192]) == [0.25098039215686274, 0....
{ "split": "train", "index": 75873, "acecode_id": "bigcode_python_fns_18083", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `sigmoid(x: float) -> float` that computes the sigmoid function for a given input `x`. The sigmoid function is defined as: \n\n sigmoid(x) = 1 / (1 + exp(-x)) \n\nwhere `exp` is the exponential function. Your function should return the computed sigmoid v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(sigmoid(0) - 0.5) < 1e-9\", \"assert abs(sigmoid(1) - 0.7310585786300049) < 1e-9\", \"assert abs(sigmoid(-1) - 0.2689414213699951) < 1e-9\", \"assert abs(sigmoid(10) - 0.9999546021312976) < 1e-9\", \"assert abs(sigmoid(-10) - 0.0000453978687024) < 1e-9\"...
{ "split": "train", "index": 75874, "acecode_id": "bigcode_python_fns_40617", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program that processes a list of strings, where each string represents a record with multiple columns of data separated by spaces. Your program needs to search for a specific pattern within the strings and extract relevant information based on the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_data(['Name Age Gender', 'Alice 30 Female', 'Bob 25 Male'], 'Age Gender') == ['Age', 'Gender']\", \"assert extract_data(['ID Name Age', '1 John 28', '2 Jane 22'], 'Name Age') == ['Name', 'Age']\", \"assert extract_data(['Product Price Quantity', 'App...
{ "split": "train", "index": 75875, "acecode_id": "oss_30983", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a block type (e.g. 'html', 'vertical'). Implement a function `is_block_type_support_children(block_type: str) -> bool` that returns True if the block type supports child blocks and False otherwise. For this problem, consider the following blo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_block_type_support_children('html') == True\", \"assert is_block_type_support_children('vertical') == True\", \"assert is_block_type_support_children('horizontal') == False\", \"assert is_block_type_support_children('text') == False\", \"assert is_block_t...
{ "split": "train", "index": 75876, "acecode_id": "bigcode_python_fns_34067", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the creation of a parent profile in a user profile system. The function should take the username of a user, the parent's name, and the parent's age as parameters, and return a dictionary representing the parent profile. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_parent_profile('john_doe', 'Jane Doe', 45) == {'user': 'john_doe', 'parent_name': 'Jane Doe', 'parent_age': 45}\", \"assert create_parent_profile('mary_jane', 'Mary Jane', 30) == {'user': 'mary_jane', 'parent_name': 'Mary Jane', 'parent_age': 30}\", \...
{ "split": "train", "index": 75877, "acecode_id": "oss_22143", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a given filename's MD5 hash matches a precomputed MD5 hash stored in a dictionary. Your goal is to write a Python function that takes in a dictionary of precomputed MD5 hashes and a filename as input and returns whether...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_file_md5({'file1.txt': 'd41d8cd98f00b204e9800998ecf8427e', 'file2.txt': '098f6bcd4621d373cade4e832627b4f6'}, 'file3.txt') == False\", \"assert check_file_md5({'fileA.txt': 'e2fc714c4727ee9395f324cd2e7f331f', 'fileB.txt': '5d41402abc4b2a76b9719d911017c5...
{ "split": "train", "index": 75878, "acecode_id": "oss_37418", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function `tripfib(n: float)` that computes the n-th element of the TripFib sequence, where the first three elements are defined as tripfib(0) == 0, tripfib(1) == 0, tripfib(2) == 1, and for n >= 3, tripfib(n) = tripfib(n-1) + tripfib(n-2) + tripfib(n-3). The input n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert tripfib(0) == 0\", \"assert tripfib(1) == 0\", \"assert tripfib(2) == 1\", \"assert tripfib(3) == 1\", \"assert tripfib(4) == 2\", \"assert tripfib(5) == 4\", \"assert tripfib(6) == 7\", \"assert tripfib(7) == 13\", \"assert tripfib(8) == 24\", \"assert trip...
{ "split": "train", "index": 75879, "acecode_id": "evol_28235", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integers `mn` and `mx`, implement a function `xrange(mn: int, mx: int)` that returns a list of all integers from `mn` to `mx` inclusive. If only one argument `mn` is provided, the function should return a list of integers from `0` to `mn` inclusive. The function shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert xrange(5) == [0, 1, 2, 3, 4, 5]\", \"assert xrange(3, 7) == [3, 4, 5, 6, 7]\", \"assert xrange(0) == [0]\", \"assert xrange(1) == [0, 1]\", \"assert xrange(10, 15) == [10, 11, 12, 13, 14, 15]\", \"assert xrange(0, 0) == [0]\", \"assert xrange(1, 1) == [1]\",...
{ "split": "train", "index": 75880, "acecode_id": "bigcode_python_fns_38690", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given two sets of strings: `all_csq` which contains a collection of consequence strings, and `mane_csq` which contains a subset of these consequences that are considered important (MANE). Your task is to implement a function that processes these sets and returns a singl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert color_csq({'A', 'B', 'C'}, {'A'}) == '**A**, <B>, <C>'\", \"assert color_csq({'pencil', 'pen', 'eraser'}, {'pen'}) == '<pencil>, **pen**, <eraser>'\", \"assert color_csq({'apple', 'orange', 'grape'}, {'orange'}) == '<apple>, **orange**, <grape>'\", \"assert ...
{ "split": "train", "index": 75881, "acecode_id": "bigcode_python_fns_44090", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Write a function `generate_PID` that produces a Personal Identification Number (PID) composed of exactly 8 characters, including 6 unique characters and 2 of those characters repeated. The characters should be a combination of uppercase letters, lowercase letters, and digits. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_PID() != generate_PID()\", \"assert len(generate_PID()) == 8\", \"assert sum(c.isupper() for c in generate_PID()) >= 0\", \"assert sum(c.islower() for c in generate_PID()) >= 0\", \"assert sum(c.isdigit() for c in generate_PID()) >= 0\", \"assert le...
{ "split": "train", "index": 75882, "acecode_id": "evol_8435", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to manage SNMP sensor data. Implement a function `add_sensors` that takes two parameters: a list of dictionaries where each dictionary contains the details of a sensor (host, port, community, baseOID, name, and unit) and a boolean `error_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_sensors([{'host': 'example.com', 'port': 161, 'community': 'public', 'baseOID': '1.3.6.1.2.1.1', 'name': 'Sensor1', 'unit': 'Celsius'}], False) == ['Sensor Sensor1 added at example.com:161']\", \"assert add_sensors([{'host': 'example.com', 'port': 161, '...
{ "split": "train", "index": 75883, "acecode_id": "oss_6770", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a string consisting of alphabetic symbols, write a function that removes all consecutive duplicate characters from the string. The function should return a new string that contains only the first occurrence of each group of consecutive characters. For example, if the inpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_repeated_chars('AAABBBCCC') == 'ABC'\", \"assert remove_repeated_chars('AABBCC') == 'ABC'\", \"assert remove_repeated_chars('A') == 'A'\", \"assert remove_repeated_chars('') == ''\", \"assert remove_repeated_chars('AABCCDAA') == 'ABCDA'\", \"assert re...
{ "split": "train", "index": 75884, "acecode_id": "evol_34537", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with finding the maximum value of a given objective function using a greedy approach. Write a function `find_maximum_value(objective_function: Callable[[int], int]) -> int` that takes a callable `objective_function` as an argument. The function should evaluate th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_maximum_value(lambda x: -x**2 + 10*x) == 25\", \"assert find_maximum_value(lambda x: x) == 99\", \"assert find_maximum_value(lambda x: 100 - x) == 100\", \"assert find_maximum_value(lambda x: x * (100 - x)) == 2500\", \"assert find_maximum_value(lambda ...
{ "split": "train", "index": 75885, "acecode_id": "oss_22629", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a logging system for an application. Implement a function called `remove_log_handler` that takes a list of log handlers and an integer `index`. The function should remove the log handler at the specified index from the list and return the updated li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_log_handler(['handler1', 'handler2', 'handler3'], 1) == ['handler1', 'handler3']\", \"assert remove_log_handler(['handler1', 'handler2'], 0) == ['handler2']\", \"assert remove_log_handler(['handler1', 'handler2', 'handler3'], 3) == ['handler1', 'handl...
{ "split": "train", "index": 75886, "acecode_id": "bigcode_python_fns_26487", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a rate limiter for a feature in a software application. The rate limiter should enforce limits on how many times a user can interact with a feature within specified time frames. Specifically, you need to implement a function `allow_usage(domain:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert allow_usage('my_domain', 5000, 2000, [(13000, 1), (50000, 600)]) == True\", \"assert allow_usage('my_domain', 60000, 1000, [(13000, 1), (50000, 600)]) == False\", \"assert allow_usage('my_domain', 1, 300, [(13000, 1), (50000, 600)]) == True\", \"assert allow...
{ "split": "train", "index": 75887, "acecode_id": "bigcode_python_fns_48385", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of log lines represented as strings. Write a function `filter_log_lines(log_lines: List[str], keyword: str) -> List[str]` that filters the log lines and returns a list containing only the log lines that contain the specified keyword. The log lines are case-...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_log_lines(['Error occurred in module A', 'Warning: low memory', 'Error: file not found'], 'Error') == ['Error occurred in module A', 'Error: file not found']\", \"assert filter_log_lines(['System rebooted', 'User logged in', 'System shutdown'], 'Error...
{ "split": "train", "index": 75888, "acecode_id": "bigcode_python_fns_27719", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a rendering system for a particle simulation. Each particle type has an associated rendering order determined by its 'pass' number. The rendering order is as follows: Pass 1: Render background elements, Pass 2: Render bond particles, Pass 3: Ren...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert render_particles([('background', 1), ('bond', 2), ('other', 3), ('special_effect', 4), ('blob', 5)]) == ['background', 'bond', 'other', 'special_effect', 'blob']\", \"assert render_particles([('bond', 2), ('other', 3), ('bond', 2), ('background', 1)]) == ['b...
{ "split": "train", "index": 75889, "acecode_id": "oss_20164", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a 'marktlokations_id', write a function that validates whether the ID is valid based on the following criteria: 1) The ID must not be empty. 2) The ID must match a specific pattern (for the sake of this problem, assume the pattern is defined as a str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_marktlokations_id('ABCDEFGHIJ0') == False\", \"assert is_valid_marktlokations_id('1234567899') == False\", \"assert is_valid_marktlokations_id('') == False\", \"assert is_valid_marktlokations_id('ABCDEFGHIJ2') == False\", \"assert is_valid_marktloka...
{ "split": "train", "index": 75890, "acecode_id": "bigcode_python_fns_19300", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates loading a pre-trained XGBoost model from a file and making predictions on a new dataset. You will receive a string, `name`, and a 2D list of numerical data, `data`, representing features for which predictions are requir...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_and_predict_model('model1', [[1.0, 2.0], [3.0, 4.0]]) == [3.0, 7.0]\", \"assert load_and_predict_model('model2', [[0.5, 0.5], [1.5, 1.5]]) == [1.0, 3.0]\", \"assert load_and_predict_model('model3', [[10.0, 20.0], [30.0, 40.0]]) == [30.0, 70.0]\", \"asse...
{ "split": "train", "index": 75891, "acecode_id": "oss_20881", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of GCP instance nodes represented as strings. Your task is to implement a function that removes any instance nodes from the list that are marked as outdated. An outdated instance is defined as any string that contains the substring 'outdated'. The function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cleanup_gcp_instances(['instance1', 'outdated_instance', 'instance2']) == ['instance1', 'instance2']\", \"assert cleanup_gcp_instances(['inst_outdated', 'instance3', 'instance4', 'instance5']) == ['instance3', 'instance4', 'instance5']\", \"assert cleanup_gc...
{ "split": "train", "index": 75892, "acecode_id": "bigcode_python_fns_15746", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `calculate(num1, num2)` that takes two integers as input and returns a tuple containing three values: the sum of the squares of the two integers, the square of their sum, and the absolute difference between these two results. The function should not handle ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate(3, 4) == (25, 49, 24)\", \"assert calculate(0, 0) == (0, 0, 0)\", \"assert calculate(-3, -4) == (25, 49, 24)\", \"assert calculate(-1, 1) == (2, 0, 2)\", \"assert calculate(5, 5) == (50, 100, 50)\", \"assert calculate(10, 2) == (104, 144, 40)\", \"...
{ "split": "train", "index": 75893, "acecode_id": "evol_32229", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `process_data(input_data)` that processes a list of integers by applying a specific transformation. The transformation consists of multiplying each integer in the list by 2 and then adding 3 to the result. Your function should take a list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_data([1, 2, 3]) == [5, 7, 9]\", \"assert process_data([0]) == [3]\", \"assert process_data([]) == []\", \"assert process_data([10, 20, 30]) == [23, 43, 63]\", \"assert process_data([5]) == [13]\", \"assert process_data([-10]) == [-17]\", \"assert pro...
{ "split": "train", "index": 75894, "acecode_id": "oss_35363", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that raises a given numerical value to a specified integer exponent p, without using the exponentiation operator (**). The function should handle negative exponents by returning the reciprocal of the positive exponentiation result. If the exponent is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert exponentiate(2, 3) == 8\", \"assert exponentiate(5, 0) == 1\", \"assert exponentiate(3, 2) == 9\", \"assert exponentiate(10, -1) == 0.1\", \"assert exponentiate(4, -2) == 0.0625\", \"assert exponentiate(-2, 3) == -8\", \"assert exponentiate(-3, 2) == 9\", \"...
{ "split": "train", "index": 75895, "acecode_id": "evol_5829", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that analyzes a list of package dependencies and identifies any potential conflicts. A conflicting dependency occurs when two packages require the same dependency name but this dependency is associated with different package names....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_dependency_conflicts([]) == []\", \"assert check_dependency_conflicts([{'name': 'pkg1', 'version': '1.0.0', 'install_requires': ['libA']}]) == []\", \"assert check_dependency_conflicts([{'name': 'pkg1', 'version': '1.0.0', 'install_requires': ['libA']}...
{ "split": "train", "index": 75896, "acecode_id": "oss_233", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a variable 'v', implement a function 'make_list' that converts 'v' into a list if it is not already a list. If 'v' is a single scalar value, it should be wrapped in a list. If 'v' is a list, it should be returned unchanged. The function should handle integer, string, and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_list([1, 2, 3]) == [1, 2, 3]\", \"assert make_list([1]) == [1]\", \"assert make_list(1) == [1]\", \"assert make_list('hello') == ['hello']\", \"assert make_list(3.14) == [3.14]\", \"assert make_list([]) == []\", \"assert make_list(['a', 'b', 'c']) == ['...
{ "split": "train", "index": 75897, "acecode_id": "bigcode_python_fns_13866", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `generate_alphanumeric_set()` that generates a random string of seven alphanumeric characters. The string must contain at least three uppercase letters and at least two non-sequential numbers. The function should return this string.\nPlease reason step by step,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert any(char.isupper() for char in generate_alphanumeric_set())\", \"assert sum(1 for char in generate_alphanumeric_set() if char.isdigit()) >= 2\", \"assert len(generate_alphanumeric_set()) == 7\", \"assert all(char.isalnum() for char in generate_alphanumeric_s...
{ "split": "train", "index": 75898, "acecode_id": "evol_12040", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates user input for a form that collects a user's name, email, and state. The function should take three parameters: 'name' (string), 'email' (string), and 'state' (string). The function should validate the following rules: 1. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_form('John Doe', 'john.doe@example.com', 'New York') == True\", \"assert validate_form('Jane Smith', 'jane.smith@example.com', 'California') == True\", \"assert validate_form('Alice Johnson', 'alice.johnson@example.com', 'Texas') == True\", \"assert...
{ "split": "train", "index": 75899, "acecode_id": "oss_1937", "num_tests": 16 }