data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary represents information about a station. Each dictionary contains a 'station_id', 'network_id', and an 'extra' field, which is also a dictionary. Your task is to implement a function `isolate_and_merge_station(stations:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isolate_and_merge_station([{'station_id': 'YYY', 'network_id': 'XX', 'extra': {'something': {'namespace': 'https://example.com', 'value': 'test'}}}], 'XX', 'YYY') == [{'station_id': 'YYY', 'network_id': 'XX', 'extra': {'something': {'namespace': 'https://exa... | {
"split": "train",
"index": 61000,
"acecode_id": "bigcode_python_fns_27880",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that generates the first N numbers in the Fibonacci sequence given an integer N, where 1 ≤ N ≤ 50. The function should then return the series in reverse order as a list. Additionally, the function should handle potential errors, such as non-integer inputs and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_fibonacci(1) == [0]\", \"assert generate_fibonacci(2) == [1, 0]\", \"assert generate_fibonacci(3) == [1, 1, 0]\", \"assert generate_fibonacci(4) == [2, 1, 1, 0]\", \"assert generate_fibonacci(5) == [3, 2, 1, 1, 0]\", \"assert generate_fibonacci(6) =... | {
"split": "train",
"index": 61001,
"acecode_id": "evol_1554",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a JSON string representation of a person. The function should take two parameters, `name` (a string) and `age` (an integer), and return a JSON string in the format: '{\"name\": \"<name>\", \"age\": <age>}' where <name> and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_json_string('Alice', 25) == '{\\\"name\\\": \\\"Alice\\\", \\\"age\\\": 25}'\", \"assert generate_json_string('Bob', 30) == '{\\\"name\\\": \\\"Bob\\\", \\\"age\\\": 30}'\", \"assert generate_json_string('Charlie', 22) == '{\\\"name\\\": \\\"Charlie... | {
"split": "train",
"index": 61002,
"acecode_id": "bigcode_python_fns_2958",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a sentiment analysis program to evaluate a series of text snippets and determine if they indicate signs of depression. Your function should take in two parameters: a list of dictionaries, where each dictionary contains a sentiment score for a text s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_depression([{'compound': -0.1}, {'compound': 0.0}], [1, 1]) == 'Seasonal affective disorder (SAD). This type of depression emerges as days get shorter in the fall and winter...'\", \"assert detect_depression([{'compound': 0.1}, {'compound': 0.0}], [1,... | {
"split": "train",
"index": 61003,
"acecode_id": "oss_14977",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of experimental records, where each record consists of an experiment name and the time taken for that experiment. Your task is to implement a function `calculate_average_time(records: List[Tuple[str, int]]) -> Dict[str, float]` that calculates the average t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_time([('Experiment 1', 10), ('Experiment 1', 15), ('Experiment 2', 20), ('Experiment 2', 25), ('Experiment 2', 30)]) == {'Experiment 1': 12.50, 'Experiment 2': 25.00}\", \"assert calculate_average_time([('Experiment A', 5), ('Experiment A',... | {
"split": "train",
"index": 61004,
"acecode_id": "oss_33694",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `register_agents(operations: List[Tuple[str, str]]) -> List[str]` that manages the registration of agents with unique IDs. The function should support the following operational commands: 'register' for registering an agent and 'make_a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_agents([('register', 'agent1'), ('register', 'agent2'), ('make_agent', 'agent1')]) == ['Registered', 'Registered', 'agent1']\", \"assert register_agents([('register', 'agent1'), ('register', 'agent1')]) == ['Registered', 'Cannot re-register ID']\", ... | {
"split": "train",
"index": 61005,
"acecode_id": "oss_5541",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a one-dimensional array (tensor) of integers and a desired shape (a tuple of integers), implement a function `broadcast_to(tensor: List[int], shape: Tuple[int]) -> List[List[int]]` that broadcasts the tensor to the new shape according to broadcasting rules. The function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert broadcast_to([1, 2, 3], (3, 3)) == [[1, 2, 3], [1, 2, 3], [1, 2, 3]]\", \"assert broadcast_to([1], (3, 3)) == [[1, 1, 1], [1, 1, 1], [1, 1, 1]]\", \"assert broadcast_to([1, 2], (2, 2)) == [[1, 2], [1, 2]]\", \"assert broadcast_to([4, 5], (4, 2)) == [[4, 5], ... | {
"split": "train",
"index": 61006,
"acecode_id": "bigcode_python_fns_12117",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the Levenshtein Distance between two strings. The Levenshtein Distance is the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one string into the other. For example, the distance between ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert levenshtein_distance('kitten', 'sitting') == 3\", \"assert levenshtein_distance('flaw', 'lawn') == 2\", \"assert levenshtein_distance('intention', 'execution') == 5\", \"assert levenshtein_distance('horse', 'ros') == 3\", \"assert levenshtein_distance('', 'a... | {
"split": "train",
"index": 61007,
"acecode_id": "evol_12795",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks the equality of two job configurations for data processing tasks. Each job configuration consists of a command argument, an SQL script, and a set of properties represented as a dictionary. Your function should take two job con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_job_configs_equal({'command_args': 'arg1', 'sql_script': 'SELECT * FROM table', 'properties': {'key1': 'value1'}}, {'command_args': 'arg1', 'sql_script': 'SELECT * FROM table', 'properties': {'key1': 'value1'}}) == True\", \"assert are_job_configs_equal(... | {
"split": "train",
"index": 61008,
"acecode_id": "oss_12009",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a class named Person that represents a person with a name and an age. The class should have an initializer that sets the name and age attributes. Implement a method to compare two Person instances based on their age, such that one Person is considered less than another i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert str(Person('Alice', 30)) == 'Name: Alice, Age: 30'\", \"assert str(Person('Bob', 25)) == 'Name: Bob, Age: 25'\", \"assert str(Person('Charlie', 40)) == 'Name: Charlie, Age: 40'\", \"assert str(Person('Frank', 22)) == 'Name: Frank, Age: 22'\", \"assert str(Pe... | {
"split": "train",
"index": 61009,
"acecode_id": "evol_30911",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of items, each with a weight and a value, and a maximum weight capacity. Your task is to implement a function that determines the maximum value that can be obtained by selecting items without exceeding the weight capacity. Use dynamic programming and memoiz... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert knapSack(50, [10, 20, 30], [60, 100, 120]) == 220\", \"assert knapSack(0, [1, 2, 3], [10, 20, 30]) == 0\", \"assert knapSack(10, [], []) == 0\", \"assert knapSack(6, [1, 3, 4, 5], [1, 4, 5, 7]) == 8\", \"assert knapSack(20, [5, 10, 15], [10, 40, 30]) == 50\"... | {
"split": "train",
"index": 61010,
"acecode_id": "evol_28282",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns a new list where each element at index i is the product of all the numbers in the original list except the one at index i. You must not use division, and your solution should have linear time complexity.\nPlease reason ste... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_list([1, 2, 3, 4, 5]) == [120, 60, 40, 30, 24]\", \"assert product_list([2, 3, 4]) == [12, 8, 6]\", \"assert product_list([1, 1, 1, 1]) == [1, 1, 1, 1]\", \"assert product_list([5]) == [1]\", \"assert product_list([0, 1, 2]) == [2, 0, 0]\", \"assert ... | {
"split": "train",
"index": 61011,
"acecode_id": "evol_17143",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `anagram_check(string1: str, string2: str) -> bool` that verifies if two input strings are anagrams of each other. The function should ignore case distinctions and any special characters or spaces in the strings. The comparison should focus solely on the alphab... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert anagram_check('Eat!', 'tEa.') == True\", \"assert anagram_check('Listen', 'Silent') == True\", \"assert anagram_check('Hello!', 'Olelh') == True\", \"assert anagram_check('Astronomer', 'Moon starer') == True\", \"assert anagram_check('The Morse Code', 'Here ... | {
"split": "train",
"index": 61012,
"acecode_id": "evol_1048",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that simulates the creation of a city. The function should take two parameters: a string `name` representing the name of the city and an integer `population` representing the population of the city. The function should return the population of t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_city('NYC', 500000) == 500000\", \"assert create_city('Los Angeles', 4000000) == 4000000\", \"assert create_city('Chicago', 2700000) == 2700000\", \"assert create_city('Houston', 2300000) == 2300000\", \"assert create_city('Phoenix', 1700000) == 17000... | {
"split": "train",
"index": 61013,
"acecode_id": "oss_34581",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the movement of a ball in a 2D space where it can bounce off walls. Given the initial position of the ball, its speed (in both x and y directions), and the dimensions of the rectangular boundary, write a function that returns the new position of t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_new_position((100, 100), (10, 15), 1, (0, 0, 400, 300)) == (110, 115)\", \"assert calculate_new_position((200, 200), (30, -50), 1, (0, 0, 400, 300)) == (230, 150)\", \"assert calculate_new_position((400, 150), (10, 0), 1, (0, 0, 400, 300)) == (390,... | {
"split": "train",
"index": 61014,
"acecode_id": "oss_15106",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `fan_out(num: int, inputs: List[Any]) -> List[List[Any]]` that simulates a fan-out layer in a neural network. The function takes an integer `num` and a list of `inputs`. The function should return a new list where each element of the `inp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fan_out(3, [1, 2]) == [[1, 1, 1], [2, 2, 2]]\", \"assert fan_out(2, ['a', 'b']) == [['a', 'a'], ['b', 'b']]\", \"assert fan_out(1, [True, False]) == [[True], [False]]\", \"assert fan_out(0, [1, 2]) == [[], []]\", \"assert fan_out(4, [3.5]) == [[3.5, 3.5, 3.5... | {
"split": "train",
"index": 61015,
"acecode_id": "bigcode_python_fns_40220",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You have an infinite number of stacks arranged in a row and numbered (left to right) from 0, each of the stacks has the same maximum `capacity`. Implement a function `push_and_pop(capacity: int, operations: List[Tuple[str, int]]) -> List[int]`, where `operations` is a list of o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert push_and_pop(2, [('push', 1), ('push', 2), ('pop', 0)]) == [2]\", \"assert push_and_pop(1, [('push', 1), ('pop', 0)]) == [1]\", \"assert push_and_pop(3, [('push', 1), ('push', 2), ('pop', 0), ('pop', 0)]) == [2, 1]\", \"assert push_and_pop(2, [('push', 1), (... | {
"split": "train",
"index": 61016,
"acecode_id": "evol_33662",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given an array of distinct strings, write a function `cumulative_character_count(arr)` that calculates the total count of alphanumeric characters (letters and digits) across all strings in the array. The function should ignore punctuation, whitespace, and special characters, an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cumulative_character_count(['123', '456', '789']) == 9\", \"assert cumulative_character_count(['', ' ', '!!!']) == 0\", \"assert cumulative_character_count(['SingleWord']) == 10\", \"assert cumulative_character_count(['A', 'B', 'C']) == 3\", \"assert cumulat... | {
"split": "train",
"index": 61017,
"acecode_id": "evol_30205",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given three dictionaries, each containing five key-value pairs representing contact information. Your task is to merge these dictionaries into a single dictionary without losing any data. Additionally, write a function that searches for a key in the merged dictionary an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_key('phone2') == '0987654321'\", \"assert search_key('phone1') == '1234567890'\", \"assert search_key('non_existent_key') == 'Key not found in contact'\", \"assert search_key('random_key') == 'Key not found in contact'\", \"assert search_key('name4') ... | {
"split": "train",
"index": 61018,
"acecode_id": "evol_8022",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function that reverses the string without using any built-in functions for reversing or modifying strings. The function should return the reversed string.\nPlease reason step by step, then write a self-contained Python solution. Give your final progr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_string('hello') == 'olleh'\", \"assert reverse_string('Python') == 'nohtyP'\", \"assert reverse_string('12345') == '54321'\", \"assert reverse_string('') == ''\", \"assert reverse_string('a') == 'a'\", \"assert reverse_string('racecar') == 'racecar'\... | {
"split": "train",
"index": 61019,
"acecode_id": "evol_11522",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function `analyze_text` that takes a string input and counts the number of uppercase letters, lowercase letters, digits, and special symbols present in the string. The function should return a tuple containing four integers: the count of uppercase letters, lowercase l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_text('') == (0, 0, 0, 0)\", \"assert analyze_text('1234567890') == (0, 0, 10, 0)\", \"assert analyze_text('!@#$%^&*()') == (0, 0, 0, 10)\", \"assert analyze_text('A1B2C3!@#') == (3, 0, 3, 3)\", \"assert analyze_text('1234!@#$5678') == (0, 0, 8, 4)\"]... | {
"split": "train",
"index": 61020,
"acecode_id": "evol_18142",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a temperature sensor that provides temperature readings in Celsius with two decimal places, and a modem that can send temperature data to a server. Your goal is to implement a function that simulates the temperature sensor and the modem's data sen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_temperature_data('01') != simulate_temperature_data('01')\", \"assert len(simulate_temperature_data('01')) == 5\", \"assert all(0 <= int(data[2:], 16) / 100 <= 100 for data in simulate_temperature_data('01'))\", \"assert simulate_temperature_data('0... | {
"split": "train",
"index": 61021,
"acecode_id": "oss_12011",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with converting a list of identifiers into a format that complies with a specified schema. Implement a function `convert_identifiers(identifiers_list: List[str]) -> List[Dict[str, str]]` that takes in a list of strings called `identifiers_list`. For each identifi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_identifiers(['id1', 'id2', 'id3']) == [{'notation': 'id1'}, {'notation': 'id2'}, {'notation': 'id3'}]\", \"assert convert_identifiers([]) == []\", \"assert convert_identifiers(['a', 'b']) == [{'notation': 'a'}, {'notation': 'b'}]\", \"assert convert_... | {
"split": "train",
"index": 61022,
"acecode_id": "bigcode_python_fns_26342",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that accepts a string representing a question and a string representing an answer. The function should return a dictionary with two keys: 'question' and 'answer'. The value for 'question' should be the input string for the question... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_question_answer_dict('What is your name?', 'My name is AI.') == {'question': 'What is your name?', 'answer': 'My name is AI.'}\", \"assert create_question_answer_dict('What is the capital of France?', 'Paris') == {'question': 'What is the capital of F... | {
"split": "train",
"index": 61023,
"acecode_id": "oss_3692",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes in a string representing a person's name and returns a greeting message. If the name is provided, the function should return a personalized greeting message. If the name is not provided, the function should return a gene... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert greet_person('Alice') == 'Hello, Alice! Welcome back.'\", \"assert greet_person('Bob') == 'Hello, Bob! Welcome back.'\", \"assert greet_person('Charlie') == 'Hello, Charlie! Welcome back.'\", \"assert greet_person('') == 'Hello, there! Welcome back.'\", \"as... | {
"split": "train",
"index": 61024,
"acecode_id": "oss_30272",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a two-dimensional list of integers that is either sorted in non-increasing or non-decreasing order along both axes (horizontal and vertical). Your task is to find the smallest positive integer that is not present in the list. If the list contains only negative int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_smallest_pos_int([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == 10\", \"assert find_smallest_pos_int([[1, 1, 1], [1, 1, 1], [1, 1, 1]]) == 2\", \"assert find_smallest_pos_int([[0, 0, 0], [-1, -2, -3], [-4, -5, -6]]) == 1\", \"assert find_smallest_pos_int([[2, 3,... | {
"split": "train",
"index": 61025,
"acecode_id": "evol_24710",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an unordered list of integers, write a function that finds the kth smallest element in the list. The function should take three parameters: a list of integers, an integer k (where k > 0), and an integer n representing the length of the list. The function should return the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert kth_smallest([-1, -2, -3, -4, -5], 5, 5) == -1\", \"assert kth_smallest([9, 5, 3, 7, 6, 4], 6, 6) == 9\", \"assert kth_smallest([1, 1, 1, 1, 1], 5, 3) == 1\", \"assert kth_smallest([1, 3, 2, 5, 4], 5, 5) == 5\", \"assert kth_smallest([0, 0, 0, 0, 0], 5, 1) =... | {
"split": "train",
"index": 61026,
"acecode_id": "evol_16221",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a decorator function named `cache_result` that caches the return value of any function it decorates. The caching mechanism should satisfy the following requirements: 1. It should work for functions with any number of positional and keyword arguments. 2. It should supp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cache_result(lambda x: x)(1) == 1\", \"assert cache_result(lambda x: x)(2) == 2\", \"assert cache_result(lambda x: x)(3) == 3\", \"assert cache_result(lambda x, y: x + y)(1, 2) == 3\", \"assert cache_result(lambda x, y: x + y)(2, 3) == 5\", \"assert cache_re... | {
"split": "train",
"index": 61027,
"acecode_id": "oss_11369",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `name`, return a string that greets the person with the format 'Hello {name}!', where {name} is the input string. Your task is to implement the function `greet(name: str) -> str` that takes a single parameter `name` and returns the greeting string.\nPlease reason... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert greet('Alice') == 'Hello Alice!'\", \"assert greet('Bob') == 'Hello Bob!'\", \"assert greet('Charlie') == 'Hello Charlie!'\", \"assert greet('David') == 'Hello David!'\", \"assert greet('Eve') == 'Hello Eve!'\", \"assert greet('Frank') == 'Hello Frank!'\", \... | {
"split": "train",
"index": 61028,
"acecode_id": "bigcode_python_fns_43383",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `transform_and_duplicate` that takes two parameters: a list of integers `numbers` and an integer `transformation_factor`. The function should return a new list where each element is the result of multiplying the corresponding element i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_and_duplicate([1, 2, 3], 2) == [2, 4, 6]\", \"assert transform_and_duplicate([0, -1, -2], 3) == [0, -3, -6]\", \"assert transform_and_duplicate([5], 5) == [25]\", \"assert transform_and_duplicate([], 10) == []\", \"assert transform_and_duplicate([1... | {
"split": "train",
"index": 61029,
"acecode_id": "bigcode_python_fns_35358",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function called `object_hash` that takes in three parameters: a string `data`, a bytes object `fmt`, and an optional string `repo`. Your function should determine the type of object based on the `fmt` parameter and return a string representati... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert object_hash('example data', b'commit') == 'Created a commit object'\", \"assert object_hash('example data', b'tree') == 'Created a tree object'\", \"assert object_hash('example data', b'tag') == 'Created a tag object'\", \"assert object_hash('example data', ... | {
"split": "train",
"index": 61030,
"acecode_id": "bigcode_python_fns_30505",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_max_value(array)` that takes a list of integers `array` and returns the maximum value in the list. If the list is empty, return None.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```pyth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_value([3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]) == 9\", \"assert find_max_value([-1, -2, -3, -4, -5]) == -1\", \"assert find_max_value([0, 0, 0, 0, 0]) == 0\", \"assert find_max_value([10]) == 10\", \"assert find_max_value([]) == None\", \"assert find_max_... | {
"split": "train",
"index": 61031,
"acecode_id": "evol_660",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks whether a given string is a palindrome. A palindrome is a word, phrase, number, or other sequences of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization). Your function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('hello') == False\", \"assert is_palindrome('') == True\", \"assert is_palindrome('Was it a car or a cat I saw?') == True\", \"asse... | {
"split": "train",
"index": 61032,
"acecode_id": "oss_28246",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file names representing JSON files that need to be converted to Parquet format. Each file name is a string and ends with '.json'. Your task is to implement a function that takes a list of file names as input and returns a list of corresponding Parquet fi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_json_to_parquet(['data1.json', 'data2.json', 'data3.json']) == ['data1.parquet', 'data2.parquet', 'data3.parquet']\", \"assert convert_json_to_parquet(['file1.json']) == ['file1.parquet']\", \"assert convert_json_to_parquet([]) == []\", \"assert conv... | {
"split": "train",
"index": 61033,
"acecode_id": "bigcode_python_fns_7493",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `is_credit_card_valid(card_num: str) -> bool` that validates credit card numbers using the Luhn algorithm. The Luhn algorithm works as follows: From the rightmost digit (excluding the check digit) and moving left, double the value of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_credit_card_valid('4556737586899855') == True\", \"assert is_credit_card_valid('1234567812345670') == True\", \"assert is_credit_card_valid('1234567812345678') == False\", \"assert is_credit_card_valid('79927398713') == True\", \"assert is_credit_card_val... | {
"split": "train",
"index": 61034,
"acecode_id": "oss_12116",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple API response. The function, `generate_response`, should return a dictionary with a single key-value pair. The key should be 'message' and the value should be a string 'ok'. This function does not take any parameter... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_response() == {'message': 'ok'}\", \"assert generate_response() is not None\", \"assert 'message' in generate_response()\", \"assert generate_response()['message'] == 'ok'\", \"assert isinstance(generate_response(), dict)\", \"assert len(generate_re... | {
"split": "train",
"index": 61035,
"acecode_id": "bigcode_python_fns_9054",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that takes an employee ID and a performance score as input parameters and returns a string that contains the details of the employee in the format 'Employee ID: {employee_id}, Performance Score: {performance_score}'.\nPlease reason step by step, then write a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert employee_details(1, 85) == 'Employee ID: 1, Performance Score: 85'\", \"assert employee_details(2, 90) == 'Employee ID: 2, Performance Score: 90'\", \"assert employee_details(3, 78) == 'Employee ID: 3, Performance Score: 78'\", \"assert employee_details(4, 9... | {
"split": "train",
"index": 61036,
"acecode_id": "evol_14511",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of numbers, implement a function that computes the dot product of the two lists using vector multiplication. You must not use any in-built libraries for the multiplication. Both lists will always be of equal length and may contain negative numbers as well as dec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_vectors([1, 2, 3], [4, 5, 6]) == 32.0\", \"assert multiply_vectors([0, 0, 0], [0, 0, 0]) == 0.0\", \"assert multiply_vectors([-1, -2, -3], [4, 5, 6]) == -32.0\", \"assert multiply_vectors([1, 1, 1], [1, 1, 1]) == 3.0\", \"assert multiply_vectors([-1... | {
"split": "train",
"index": 61037,
"acecode_id": "evol_15115",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing data loaded from a source. Your task is to implement a function that extracts relevant information from this data and then transforms it to uppercase. The function should perform two steps: first, extract the phrase 'data' from the loaded str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data('Loaded data from source') == 'DATA'\", \"assert process_data('No relevant information here') == 'DATA NOT FOUND'\", \"assert process_data('Just some random text') == 'DATA NOT FOUND'\", \"assert process_data('data is important') == 'DATA'\", \"... | {
"split": "train",
"index": 61038,
"acecode_id": "oss_6215",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list of integers, implement a function `spiral(matrix)` that returns the elements of the matrix in a clockwise spiral order. The input will be a non-empty 2D list where each inner list has the same length.\nPlease reason step by step, then write a self-contained Pyth... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert spiral([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [1, 2, 3, 6, 9, 8, 7, 4, 5]\", \"assert spiral([[1]]) == [1]\", \"assert spiral([[1, 2], [3, 4]]) == [1, 2, 4, 3]\", \"assert spiral([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]]) == [1, 2, 3, 4, 8, 12, 11, 10, 9,... | {
"split": "train",
"index": 61039,
"acecode_id": "evol_18400",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates adding a new cryptocurrency token to a database represented as a dictionary. The function, `add_token`, should take four parameters: a string `token` representing the name of the cryptocurrency token, a string `_method` rep... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_token('Bitcoin', 'mining', 'btc', 45000.0) == {'method': 'mining', 'id': 'btc', 'price': 45000.0}\", \"assert add_token('Ethereum', 'staking', 'eth', 3000.0) == {'method': 'staking', 'id': 'eth', 'price': 3000.0}\", \"assert add_token('Litecoin', 'mining... | {
"split": "train",
"index": 61040,
"acecode_id": "bigcode_python_fns_2982",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing configuration details for charts in a Helm repository. Each dictionary must contain the following mandatory keys: 'chart_name', 'helm_repo_name', 'name_space', 'values_file', 'private_image', and 'extra_executes'. The keys 'char... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_charts_configuration([{'chart_name': 'my-chart', 'helm_repo_name': 'my-repo', 'name_space': 'default', 'values_file': 'values.yaml', 'private_image': True, 'extra_executes': []}]) == True\", \"assert is_valid_charts_configuration([{'chart_name': 'my... | {
"split": "train",
"index": 61041,
"acecode_id": "bigcode_python_fns_28325",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the SHA-256 hash of a given string and compares it with a provided hash value to determine if the string has been tampered with. Your goal is to create a Python function `check_string_integrity(input_string: str, expec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_string_integrity('world', '7c211e45b09621f8e6e735a4e1a1a2d6b9f3f2e7f0f3e4c7d7d3e5a057a6c9c3') == False\", \"assert check_string_integrity('Python', 'd9c8f0a7cbe6e4c0d15b0f5c4dfe8c07a343f3a6b4cb8f3f0f0cc4bfbf7f7e2e0') == False\", \"assert check_string_i... | {
"split": "train",
"index": 61042,
"acecode_id": "oss_2548",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a custom form in a Python web application. Your goal is to implement a function called `create_custom_form` that returns a form class with a specific field configuration. The form should include a single field named `body` which is a character field... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_custom_form().__name__ == 'CustomForm'\", \"assert create_custom_form()().fields['body'].widget.__class__.__name__ == 'Textarea'\", \"assert 'body' in create_custom_form()().fields\", \"assert len(create_custom_form()().fields) == 1\", \"assert 'place... | {
"split": "train",
"index": 61043,
"acecode_id": "oss_37462",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a dictionary of key-value pairs and a key-value pair to add or update. Your function should create a deep copy of the input dictionary and modify the copy by adding or updating the specified key-value pair. The original diction... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert deep_copy_and_modify_dict({'a': 1, 'b': 2}, 'c', 3) == {'a': 1, 'b': 2, 'c': 3}\", \"assert deep_copy_and_modify_dict({}, 'a', 1) == {'a': 1}\", \"assert deep_copy_and_modify_dict({'x': 5}, 'x', 10) == {'x': 10}\", \"assert deep_copy_and_modify_dict({'name':... | {
"split": "train",
"index": 61044,
"acecode_id": "oss_3847",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array of unsigned 8-bit integers. Your task is to implement a function that takes this array as input and returns a new array that contains the same integers, but with each integer incremented by 1. The function should maintain the same data type and shape as t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert increment_array([1, 2, 3]) == [2, 3, 4]\", \"assert increment_array([0, 0, 0]) == [1, 1, 1]\", \"assert increment_array([255]) == [0]\", \"assert increment_array([254, 255]) == [255, 0]\", \"assert increment_array([100, 150, 200]) == [101, 151, 201]\", \"ass... | {
"split": "train",
"index": 61045,
"acecode_id": "bigcode_python_fns_32422",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks the integrity of a dictionary after performing a roundtrip serialization and deserialization. The function should take in a dictionary representing example metadata and verify that the original data is the same as the data... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_serialisation_roundtrip({'key1': 'value1', 'key2': 'value2'}) == True\", \"assert validate_serialisation_roundtrip({'name': 'Alice', 'age': 30}) == True\", \"assert validate_serialisation_roundtrip({'x': 10, 'y': 20}) == True\", \"assert validate_se... | {
"split": "train",
"index": 61046,
"acecode_id": "oss_252",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the movement of a bullet in a 2D game. The bullet starts at a specific vertical position and moves upwards on the screen with each update. Your task is to implement a function that simulates the bullet's movement, given its initial vertical positi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_bullet_movement(10.0, 5) == 5.0\", \"assert simulate_bullet_movement(20.5, 3) == 17.5\", \"assert simulate_bullet_movement(0.0, 0) == 0.0\", \"assert simulate_bullet_movement(15.5, 15) == 0.5\", \"assert simulate_bullet_movement(5.0, 10) == -5.0\", ... | {
"split": "train",
"index": 61047,
"acecode_id": "oss_25772",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers and a target sum, write a function that determines if there are two distinct elements in the array that sum up to the target sum. The function should return True if such a pair exists, and False otherwise.\nPlease reason step by step, then write a sel... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_sum([1, 2, 3, 4], 6) == True\", \"assert check_sum([1, 2, 3, 4], 5) == True\", \"assert check_sum([1, 2, 3, 4], 7) == True\", \"assert check_sum([1, 2, 3, 4], 8) == False\", \"assert check_sum([5, 1, 2, 3], 6) == True\", \"assert check_sum([5, 1, 2, 3]... | {
"split": "train",
"index": 61048,
"acecode_id": "evol_39",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the release of all Pokémon for a Pokémon Trainer. The function `release_all_pokemon(party: List[str], confirm: str) -> List[str]` takes two parameters: a list of Pokémon names representing the trainer's party and a string t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert release_all_pokemon(['Pikachu', 'Charmander', 'Bulbasaur'], 'yes') == ['Pikachu', 'Charmander', 'Bulbasaur']\", \"assert release_all_pokemon(['Squirtle', 'Eevee'], 'no') == []\", \"assert release_all_pokemon(['Mewtwo'], 'YES') == ['Mewtwo']\", \"assert relea... | {
"split": "train",
"index": 61049,
"acecode_id": "oss_23166",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of distinct integers, implement a function that returns a random permutation of the array. The function should not modify the input array and must produce a new array containing the same integers in a randomized order.\nPlease reason step by step, then write a se... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert random_permutation([1, 2, 3, 4, 5]) != [1, 2, 3, 4, 5]\", \"assert sorted(random_permutation([1, 2, 3, 4, 5])) == [1, 2, 3, 4, 5]\", \"assert len(random_permutation([10, 20, 30])) == 3\", \"assert random_permutation([1]) == [1]\", \"assert random_permutation... | {
"split": "train",
"index": 61050,
"acecode_id": "evol_11853",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates converting an RGB color to grayscale. The grayscale value is computed using the formula: Gray = 0.299 * Red + 0.587 * Green + 0.114 * Blue. Your function should take three parameters representing the Red, Green, and Blue co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_grayscale(255, 0, 0) == 76\", \"assert convert_to_grayscale(0, 255, 0) == 150\", \"assert convert_to_grayscale(0, 0, 255) == 29\", \"assert convert_to_grayscale(255, 255, 255) == 255\", \"assert convert_to_grayscale(0, 0, 0) == 0\", \"assert conve... | {
"split": "train",
"index": 61051,
"acecode_id": "oss_13456",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `convert_to_grade(score: int) -> Tuple[str, str]` that takes an integer score between 0 and 100 (inclusive) and returns a tuple containing the corresponding alphabetic grade and a descriptor. The grading system is as follows: scores 90 and above receive an ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_grade(95) == ('A', 'Excellent')\", \"assert convert_to_grade(85) == ('B', 'Good')\", \"assert convert_to_grade(75) == ('C', 'Average')\", \"assert convert_to_grade(65) == ('D', 'Poor')\", \"assert convert_to_grade(55) == ('E', 'Fail')\", \"assert ... | {
"split": "train",
"index": 61052,
"acecode_id": "evol_36186",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function decorator that logs the name of the function being called. Your task is to complete the implementation of the `log_function_call` decorator so that it prints the name of the function being called when the decorated function is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_function_call(lambda: None) is not None\", \"assert log_function_call(lambda x: x)(5) is None\", \"assert log_function_call(lambda: None)() is None\", \"assert log_function_call(lambda x, y: x + y)(3, 4) is None\", \"assert log_function_call(lambda: 'tes... | {
"split": "train",
"index": 61053,
"acecode_id": "oss_17303",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Dockerfile for a given base image and installing a specified package within it. Write a function `create_dockerfile` that takes the following parameters: a string `image_name` representing the name of the image to be created, a string `install_pac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_dockerfile('my_image', 'httpd', 'my_namespace') == 'FROM quay.io/ocsci/fedora:latest\\\\n RUN yum install -y httpd\\\\n CMD tail -f /dev/null'\", \"assert create_dockerfile('web_server', 'nginx', 'production') == 'FROM quay.io/ocsci/fedora:latest\\\\n... | {
"split": "train",
"index": 61054,
"acecode_id": "bigcode_python_fns_9115",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `detect_and_transform_lanes` that performs lane detection and perspective transformation on an undistorted image. The function takes in three parameters: an undistorted image (as a 2D list of pixel values), a polygon of interest (as a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_and_transform_lanes([[0, 0], [0, 0]], [(0, 0), (1, 1), (1, 0)], 0) == [[0, 0], [0, 0]]\", \"assert detect_and_transform_lanes([[255, 255], [255, 255]], [(0, 0), (1, 1), (1, 0)], 100) == [[255, 255], [255, 255]]\", \"assert detect_and_transform_lanes([... | {
"split": "train",
"index": 61055,
"acecode_id": "oss_26307",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of U.S. states and a list of guessed states as input. The function should return a list of states that were correctly guessed. A state is considered correctly guessed if it appears in both the list of U.S. states and the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert correct_guesses(['California', 'Texas', 'New York'], ['california', 'florida']) == ['California']\", \"assert correct_guesses(['Florida', 'Ohio', 'Nevada'], ['nevada', 'ohio']) == ['Nevada', 'Ohio']\", \"assert correct_guesses(['Maine', 'Oregon', 'Vermont'],... | {
"split": "train",
"index": 61056,
"acecode_id": "oss_24945",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of sets, where each set contains strings representing annotation labels. Your task is to implement a function that takes this list and a string prefix, and returns a new list of sets where each label in the input sets is prefixed with the provided string fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_prefix_to_annotations([{ 'GO:0010008', 'GO:0070062' }, { 'GO:0006351' }], 'h') == [{'h@GO:0010008', 'h@GO:0070062'}, {'h@GO:0006351'}]\", \"assert add_prefix_to_annotations([{ 'A', 'B' }, { 'C' }], 'test') == [{'test@A', 'test@B'}, {'test@C'}]\", \"asser... | {
"split": "train",
"index": 61057,
"acecode_id": "bigcode_python_fns_23729",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings and a list of numbers, implement a function that generates a new list where each string is repeated according to the corresponding number in the number list. If the number is negative, it should be ignored. If the lengths of the two lists do not match, r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert repeat_strings(['Test', '123', 'ABC'], [2, 0, 1]) == ['Test', 'Test', 'ABC']\", \"assert repeat_strings(['A', 'B', 'C'], [-1, -2, -3]) == []\", \"assert repeat_strings(['Hello', 'World'], [3, 2]) == ['Hello', 'Hello', 'Hello', 'World', 'World']\", \"assert r... | {
"split": "train",
"index": 61058,
"acecode_id": "evol_12889",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes a list of string filenames and returns the episode ID of the latest checkpoint, if any. The filenames follow the format 'checkpoint_<episode_id>.pkl'. The episode ID is always an integer that appears after 'checkpoint_' and befo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_latest_checkpoint(['checkpoint_1.pkl', 'checkpoint_2.pkl', 'checkpoint_3.pkl']) == 3\", \"assert get_latest_checkpoint(['checkpoint_10.pkl', 'checkpoint_2.pkl', 'checkpoint_5.pkl']) == 10\", \"assert get_latest_checkpoint(['checkpoint_5.pkl']) == 5\", \"... | {
"split": "train",
"index": 61059,
"acecode_id": "bigcode_python_fns_27938",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that calculates the sum of all odd numbers in a given array and returns this sum along with the count of odd numbers. Additionally, categorize these odd numbers into separate bins based on their range (1-10, 11-20, etc.) and return a dictionary outlining the co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert oddNumberStats([2, 4, 6, 8]) == (0, 0, {'1-10': 0, '11-20': 0, '21-30': 0, '31-40': 0, '41-50': 0, '51-60': 0, '61-70': 0, '71-80': 0, '81-90': 0, '91-100': 0})\", \"assert oddNumberStats([11, 15, 23, 42]) == (49, 3, {'1-10': 0, '11-20': 2, '21-30': 1, '31-4... | {
"split": "train",
"index": 61060,
"acecode_id": "evol_279",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_unique_number_present(num_list: List[int], target: int) -> bool` that determines if a distinct whole number `target` is present within a unidimensional array `num_list` of discrete numerical values. The function should return `True` if `target` is found... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_unique_number_present([1, 2, 3, 4], 2) == True\", \"assert is_unique_number_present([1, 2, 3, 4], 5) == False\", \"assert is_unique_number_present([], 1) == False\", \"assert is_unique_number_present([0, -1, -2, -3], -1) == True\", \"assert is_unique_numb... | {
"split": "train",
"index": 61061,
"acecode_id": "evol_27209",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `extract_license_info(content: str) -> dict` that takes a string representing the content of a file and returns a dictionary containing the copyright notice and the license URL if present. The copyright notice should be in the format '# Copyright <year> <name>.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_license_info('No copyright information here.') == {'copyright_notice': '', 'license_url': ''}\", \"assert extract_license_info('# Licensed under the MIT License. # http://mit-license.org') == {'copyright_notice': '', 'license_url': 'http://mit-licens... | {
"split": "train",
"index": 61062,
"acecode_id": "oss_35392",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `outer()` that contains two nested functions, `middle()` and `inner()`. The `inner()` function should increment a variable `x`, which is defined in the `outer()` function, by 1. Your goal is to ensure that `inner()` can access and mod... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert outer() == None\", \"assert outer() == None\", \"assert outer() == None\", \"assert outer() == None\", \"assert outer() == None\", \"assert outer() == None\", \"assert outer() == None\", \"assert outer() == None\", \"assert outer() == None\", \"assert outer(... | {
"split": "train",
"index": 61063,
"acecode_id": "evol_800",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two strings, find their longest common subsequence (LCS). If multiple LCSs exist, return the lexicographically smallest one. If no subsequence exists, return '-1'. Implement a function called `longest_common_subsequence(x: str, y: str) -> str` that takes two strings as in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_common_subsequence('AAAA', 'AA') == 'AA'\", \"assert longest_common_subsequence('ABC', 'DEF') == '-1'\", \"assert longest_common_subsequence('A', 'A') == 'A'\", \"assert longest_common_subsequence('A', 'B') == '-1'\", \"assert longest_common_subseque... | {
"split": "train",
"index": 61064,
"acecode_id": "evol_18837",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `enhanced_multiply(lst)` that calculates the product of all odd numbers at even indices in the list, only if the next number in the list is a prime number. Additionally, the function should count how many of those odd numbers are p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert enhanced_multiply([1, 2, 3, 4, 5]) == (1, 0)\", \"assert enhanced_multiply([2, 3, 4, 5, 6]) == (1, 0)\", \"assert enhanced_multiply([1, 1, 1, 1, 1]) == (1, 0)\", \"assert enhanced_multiply([2, 4, 6, 8]) == (1, 0)\", \"assert enhanced_multiply([9, 4, 2, 6, 8]... | {
"split": "train",
"index": 61065,
"acecode_id": "evol_20033",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `install_packages(env_path: str, packages: List[str]) -> List[str]` that simulates the installation of a list of packages in a specified virtual environment. The function should accept the path to the virtual environment and a list of package names as input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert install_packages('myenv', ['package1', 'package2', 'package3']) == []\", \"assert install_packages('myenv', ['package1', 'error_package', 'package3']) == ['error_package']\", \"assert install_packages('myenv', ['error_package1', 'error_package2']) == ['error... | {
"split": "train",
"index": 61066,
"acecode_id": "evol_8950",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `sort_third(l: list)` that returns a new list where the elements at indices that are multiples of three (i.e., 0, 3, 6, ...) are sorted in descending order, while the elements at all other indices remain unchanged. The output list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_third([1, 2, 3]) == [1, 2, 3]\", \"assert sort_third([8, 7, 4, 1, 3, 6, 5]) == [8, 7, 4, 5, 3, 6, 1]\", \"assert sort_third([]) == []\", \"assert sort_third([7]) == [7]\", \"assert sort_third([7, 8]) == [7, 8]\", \"assert sort_third([7, 8, 9]) == [7, 8,... | {
"split": "train",
"index": 61067,
"acecode_id": "evol_19042",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of package requirements and generates a modified list of requirements for those browsing the Python Package Index (PyPI). The input list contains package requirements in the format specified in a `requirements... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_requirements_for_pypi(['requests>=2.20.0', 'numpy==1.18.1', 'matplotlib[array]>=3.1.2']) == ['requests (>= 2.20.0)', 'numpy (== 1.18.1)', 'matplotlib (>= 3.1.2)']\", \"assert format_requirements_for_pypi(['flask==1.1.2', 'scikit-learn>=0.22.1']) == ['... | {
"split": "train",
"index": 61068,
"acecode_id": "oss_3644",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks whether two floating-point numbers are approximately equal. Two numbers are considered approximately equal if their absolute difference is less than a specified tolerance value. Implement the function `are_floats_equal(num... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_floats_equal(0.1, 0.1, 0.01) == True\", \"assert are_floats_equal(0.1, 0.1000001, 0.0001) == True\", \"assert are_floats_equal(0.1, 0.2, 0.1) == False\", \"assert are_floats_equal(1.5, 1.5001, 0.001) == True\", \"assert are_floats_equal(-0.5, -0.500001, ... | {
"split": "train",
"index": 61069,
"acecode_id": "bigcode_python_fns_4373",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a custom error handling function in a web application. Your goal is to implement a function named `handle_404_error` that takes a string input representing a URL path and returns a user-friendly message indicating that the requested page was not fou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_404_error('/home') == '404 Not Found: The page at /home does not exist.'\", \"assert handle_404_error('/about') == '404 Not Found: The page at /about does not exist.'\", \"assert handle_404_error('/contact') == '404 Not Found: The page at /contact doe... | {
"split": "train",
"index": 61070,
"acecode_id": "oss_16476",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `locate_k(tuples, k)` that checks the provided list of tuples for the presence of the integer 'k'. If 'k' is found in any of the tuples, the function should return a list of indices where 'k' is located. If 'k' is not found in any tuple, the function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert locate_k([(1, 2), (3, 4), (5, 6)], 3) == [1]\", \"assert locate_k([(1, 2), (3, 4), (5, 6)], 7) == \\\"The integer '7' was not found in any tuple.\\\"\", \"assert locate_k([(1, 2), (3, 4), (5, 6)], 1) == [0]\", \"assert locate_k([(1, 2), (2, 2), (2, 2)], 2) =... | {
"split": "train",
"index": 61071,
"acecode_id": "evol_34413",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of command line arguments, write a function that separates the preparser arguments from the main parser arguments. The preparser arguments are defined as those starting with a hyphen ('-'). If the argument is found in a predefined set of preparser options or flags,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert separate_args(['--help', 'file.txt']) == (['--help'], ['file.txt'])\", \"assert separate_args(['--version', '-v', 'config.json']) == (['--version', '-v'], ['config.json'])\", \"assert separate_args(['-d', 'input.txt', '--config', 'output.txt']) == (['-d', '-... | {
"split": "train",
"index": 61072,
"acecode_id": "bigcode_python_fns_4864",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a two-dimensional matrix of integers, write a function that transforms the matrix into a one-dimensional list by concatenating all the elements in row-major order. The function should be defined as `def flatten(matrix: List[List[int]]) -> List[int]:`.\nPlease reason step ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]\", \"assert flatten([[1], [2], [3]]) == [1, 2, 3]\", \"assert flatten([[1, 2], [3, 4]]) == [1, 2, 3, 4]\", \"assert flatten([[]]) == []\", \"assert flatten([[... | {
"split": "train",
"index": 61073,
"acecode_id": "evol_34843",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that reads a configuration from a given string. The function should accept a string containing YAML formatted data and return the value associated with the key 'elrados'. If the key does not exist, the function should return an empty ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert read_config_from_string('elrados: {host: localhost, port: 8080}') == {'host': 'localhost', 'port': 8080}\", \"assert read_config_from_string('elrados: {}') == {}\", \"assert read_config_from_string('database: {user: admin}') == {}\", \"assert read_config_fro... | {
"split": "train",
"index": 61074,
"acecode_id": "bigcode_python_fns_40184",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of bounding boxes represented by their coordinates in the format [x1, y1, x2, y2], where (x1, y1) is the top-left corner and (x2, y2) is the bottom-right corner, and a single bounding box in the same format, write a function that calculates the Jaccard overlap for ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert jaccard_overlap([[0, 0, 1, 1], [1, 1, 2, 2]], [2, 2, 3, 3]) == [0.0, 0.0]\", \"assert jaccard_overlap([[0, 0, 1, 1]], [0, 0, 1, 1]) == [1.0]\", \"assert jaccard_overlap([[1, 1, 4, 4]], [1, 1, 4, 4]) == [1.0]\", \"assert jaccard_overlap([[0, 0, 5, 5]], [0, 0,... | {
"split": "train",
"index": 61075,
"acecode_id": "bigcode_python_fns_21551",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that analyzes a list of integers and returns a dictionary containing the frequency of each integer in the list. The input will be a list of integers, and the output should be a dictionary where the keys are the unique integers from the in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_frequencies([1, 2, 2, 3, 1]) == {1: 2, 2: 2, 3: 1}\", \"assert count_frequencies([5, 5, 5, 5]) == {5: 4}\", \"assert count_frequencies([]) == {}\", \"assert count_frequencies([1]) == {1: 1}\", \"assert count_frequencies([-1, -1, 0, 0, 0, 1]) == {-1: 2,... | {
"split": "train",
"index": 61076,
"acecode_id": "bigcode_python_fns_14105",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the scores of a game. The game has a rule that a player can only score if the previous two scores are both even. If the player's score is even, it is added to the total score; otherwise, it is ignored. Write a function `calculate_to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_score([1, 2, 3]) == 0\", \"assert calculate_total_score([2, 4, 6]) == 6\", \"assert calculate_total_score([]) == 0\", \"assert calculate_total_score([2]) == 0\", \"assert calculate_total_score([2, 4]) == 0\", \"assert calculate_total_score([1... | {
"split": "train",
"index": 61077,
"acecode_id": "oss_6103",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of lists, where each sublist contains distinct integers, return the cartesian product of all the lists. The cartesian product should be represented as a list of tuples, where each tuple contains one element from each of the input lists in the order they appear. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cartesian_product([[1, 2], [3, 4]]) == [(1, 3), (1, 4), (2, 3), (2, 4)]\", \"assert cartesian_product([[1], [2], [3]]) == [(1, 2, 3)]\", \"assert cartesian_product([[0, 1], [10, 20], [30, 40]]) == [(0, 10, 30), (0, 10, 40), (0, 20, 30), (0, 20, 40), (1, 10, ... | {
"split": "train",
"index": 61078,
"acecode_id": "bigcode_python_fns_24312",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates loading a user from a request based on SSL client verification. Your function should take a dictionary representing the request environment and perform the following checks: If the value associated with the key 'SSL_CLIENT_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert load_ssl_user({'SSL_CLIENT_VERIFY': 'SUCCESS', 'SSL_CLIENT_S_DN': 'user1'}) == 'user1'\", \"assert load_ssl_user({'SSL_CLIENT_VERIFY': 'SUCCESS', 'SSL_CLIENT_S_DN': 'existing_user'}) == 'User already exists.'\", \"assert load_ssl_user({'SSL_CLIENT_VERIFY': '... | {
"split": "train",
"index": 61079,
"acecode_id": "bigcode_python_fns_16825",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the daily stock prices of a company. Your task is to write a function `max_profit` to find the maximum profit that can be obtained by buying and selling the stock at most once. If it is not possible to make any profit, return 0. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_profit([7, 1, 5, 3, 6, 4]) == 5\", \"assert max_profit([7, 6, 4, 3, 1]) == 0\", \"assert max_profit([1, 2, 3, 4, 5]) == 4\", \"assert max_profit([5, 4, 3, 2, 1]) == 0\", \"assert max_profit([3, 2, 6, 5, 0, 3]) == 4\", \"assert max_profit([1]) == 0\", \"a... | {
"split": "train",
"index": 61080,
"acecode_id": "oss_9737",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a sequence of integers and returns a new list where each element is the sum of the current element and the previous element in the input list, except for the first element which remains unchanged. If the input list is e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert residual_sum_sequence([]) == []\", \"assert residual_sum_sequence([1]) == [1]\", \"assert residual_sum_sequence([1, 2]) == [1, 3]\", \"assert residual_sum_sequence([5, 10, 15]) == [5, 15, 25]\", \"assert residual_sum_sequence([-1, -2, -3]) == [-1, -3, -5]\",... | {
"split": "train",
"index": 61081,
"acecode_id": "oss_5012",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `text`, you are allowed to swap two non-adjacent characters in the string. Your task is to find the length of the longest substring that can be formed with repeated characters after performing at most one such swap. If no swap is needed, return the length of the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxRepOpt1('ababa') == 3\", \"assert maxRepOpt1('aaabaaa') == 6\", \"assert maxRepOpt1('aaaaa') == 5\", \"assert maxRepOpt1('abcdef') == 1\", \"assert maxRepOpt1('abcabcabc') == 3\", \"assert maxRepOpt1('a') == 1\", \"assert maxRepOpt1('aa') == 2\", \"assert... | {
"split": "train",
"index": 61082,
"acecode_id": "evol_24974",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `validate_url` that takes four parameters: `protocol`, `subdomain`, `primary_domain`, and `resource_path`. This function should validate the constructed URL based on the following criteria: 1) The protocol must be 'https'. 2) The subdomain can only contain ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_url('https', 'mypage', 'google.com', 'search') == 'URL is valid'\", \"assert validate_url('https', 'my-page', 'example.org', 'home/index') == 'URL is valid'\", \"assert validate_url('https', 'sub-domain', 'top-level.com', 'dir1/dir2') == 'URL is val... | {
"split": "train",
"index": 61083,
"acecode_id": "evol_16102",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers `molecule` and `query`, your task is to find all the unique subsequences in `molecule` that match the subsequence defined by `query`. A subsequence is considered matching if all the elements of `query` appear in the same order in the `molecule`, but ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_subsequences([1, 2, 3, 4], [5]) == []\", \"assert find_subsequences([], [1]) == []\", \"assert find_subsequences([1, 2, 3], [1, 3]) == [[0, 2]]\", \"assert find_subsequences([1, 2, 3, 4], [2, 3]) == [[1, 2]]\", \"assert find_subsequences([1, 2, 3], [4, ... | {
"split": "train",
"index": 61084,
"acecode_id": "bigcode_python_fns_47394",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given two strings, write a function to calculate the total number of common characters present in both strings, considering the frequency of each character in both strings. For example, if a character appears twice in one string and three times in another, it should be counted ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert common_chars('abc', 'def') == 0\", \"assert common_chars('aabbcc', 'abc') == 3\", \"assert common_chars('', 'nonempty') == 0\", \"assert common_chars('same', 'same') == 4\", \"assert common_chars('abcd', 'abdc') == 4\", \"assert common_chars('hello', 'hello'... | {
"split": "train",
"index": 61085,
"acecode_id": "evol_5030",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of a series of bars. Your task is to write a function called `max_area` that calculates the maximum area of a rectangle that can be formed using the heights of these bars. The rectangle can be formed by choosing two bars... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_area([1,8,6,2,5,4,8,3,7]) == 49\", \"assert max_area([1,1]) == 1\", \"assert max_area([4,3,2,1,4]) == 16\", \"assert max_area([1,2,1]) == 2\", \"assert max_area([2,1,5,6,2,3]) == 10\", \"assert max_area([1,2,3,4,5]) == 6\", \"assert max_area([5,4,3,2,1])... | {
"split": "train",
"index": 61086,
"acecode_id": "oss_14575",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of ingress Autonomous System Numbers (ASNs), an IP address, an origin ASN, an IP prefix, a country code, a number of bytes, and a number of packets. Your task is to create a function that updates a dictionary with unique ingress ASNs as keys. Each key shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_ip_analysis(['1234'], '10.10.10.1', 23456, '10.0.0.0/8', 'US', 1000, 10, {}) == {frozenset(['1234']): {('10.10.10.1', 23456, '10.0.0.0/8', 'US'): [1, 1000, 10]}}\", \"assert update_ip_analysis(['1234'], '10.10.10.1', 23456, '10.0.0.0/8', 'US', 500, 5,... | {
"split": "train",
"index": 61087,
"acecode_id": "bigcode_python_fns_17418",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given an array where the numbers at even indexes are in ascending order and the numbers at odd indexes are in descending order, implement a function that performs a binary search to find the index of a target number. If the target number is found, return its index; otherwise, r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_search_special([-3, 10, 0, 9, 5, 0, 7, -1], 0) == 2\", \"assert binary_search_special([-3, 10, 0, 9, 5, 0, 7, -1], 1) == -1\", \"assert binary_search_special([-3, 10, 0, 9, 5, 0, 7, -1], 8) == -1\", \"assert binary_search_special([-3, 10, 0, 9, 5, 0, ... | {
"split": "train",
"index": 61088,
"acecode_id": "evol_3013",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Write a function `is_five_alpha(nomenclature: str) -> bool` that checks if the provided string `nomenclature` consists of exactly 5 alphabetic characters. The function should return `True` if the string has exactly 5 alphabetic characters, and `False` otherwise.\nPlease reason ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_five_alpha('apple') == True\", \"assert is_five_alpha('12345') == False\", \"assert is_five_alpha('abcde') == True\", \"assert is_five_alpha('abcd') == False\", \"assert is_five_alpha('abcdef') == False\", \"assert is_five_alpha('abc1e') == False\", \"ass... | {
"split": "train",
"index": 61089,
"acecode_id": "evol_18397",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_user_info(username: str, birthdate: str, email: str) -> str` that accepts three strings: `username`, `birthdate`, and `email`. The function should return a formatted string that contains the user's information in the following format: 'Username: {us... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_user_info('john_doe', '01/01/2000', 'john_doe@example.com') == 'Username: john_doe, Birthdate: 01/01/2000, Email: john_doe@example.com'\", \"assert create_user_info('jane_doe', '02/02/2002', 'jane_doe@example.com') == 'Username: jane_doe, Birthdate: 0... | {
"split": "train",
"index": 61090,
"acecode_id": "evol_79",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that parses a string representing Ansible playbook variables and returns a dictionary containing the variable names and their default values. You are given a string `variable_string` representing Ansible playbook variables in the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_ansible_variables('../../../common/defaults/main.yml name=common_defaults') == {'common_defaults': 'value_from_yaml'}\", \"assert parse_ansible_variables('../../../path/to/yaml.yml name=my_variable') == {'my_variable': 'value_from_yaml'}\", \"assert pa... | {
"split": "train",
"index": 61091,
"acecode_id": "oss_5094",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a type represented as a string, implement a function `ptr_ty(type_str: str) -> str` that returns a string representing a pointer to that type. The pointer type should be formatted as `type_str*`. For example, if the input is `int`, the output should be `int*`. If the inpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ptr_ty('int') == 'int*'\", \"assert ptr_ty('float') == 'float*'\", \"assert ptr_ty('double') == 'double*'\", \"assert ptr_ty('char') == 'char*'\", \"assert ptr_ty('void') == 'void*'\", \"assert ptr_ty('bool') == 'bool*'\", \"assert ptr_ty('struct') == 'struc... | {
"split": "train",
"index": 61092,
"acecode_id": "bigcode_python_fns_12677",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function in Python that merges two sorted lists A and B into a single sorted list. The function should take two sorted lists as input and return a new list that contains all the elements from both lists in sorted order. You must not modify the original lists A and B... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sorted_lists([3, 6, 8, 10, 11], [2, 5, 7, 12]) == [2, 3, 5, 6, 7, 8, 10, 11, 12]\", \"assert merge_sorted_lists([], []) == []\", \"assert merge_sorted_lists([1, 2, 3], []) == [1, 2, 3]\", \"assert merge_sorted_lists([], [4, 5, 6]) == [4, 5, 6]\", \"ass... | {
"split": "train",
"index": 61093,
"acecode_id": "evol_3059",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 28x28 pixel grayscale image represented as a 2D list of integers, where each integer is in the range [0, 255]. Your task is to implement a function that transforms this image into its flattened feature vector. The output should be a 1D list containing all the pi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten_image([[0]*28 for _ in range(28)]) == [0]*784\", \"assert flatten_image([[255]*28 for _ in range(28)]) == [255]*784\", \"assert flatten_image([[i for i in range(28)] for _ in range(28)]) == [i for i in range(28)]*28\", \"assert flatten_image([[j for ... | {
"split": "train",
"index": 61094,
"acecode_id": "bigcode_python_fns_28381",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a light control system. This system can retrieve information about the current status of the lights in a room. The function `get_light_information()` should return a dictionary containing the following keys: 'method', '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_light_information() == {'method': 'getLightInformation', 'apiVersion': '1.1', 'context': 'Axis library'}\", \"assert get_light_information() != {'method': 'setLightInformation', 'apiVersion': '1.0', 'context': 'Axis library'}\", \"assert get_light_inform... | {
"split": "train",
"index": 61095,
"acecode_id": "bigcode_python_fns_6502",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple function that simulates a user logout process in a web application. Your function should perform the following tasks: 1. Call a hypothetical function `logout_user()` that logs out the current user. 2. Use a hypothetical function `flash(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert user_logout() == 'You have been redirected to the login page.'\", \"assert user_logout() == 'You have been redirected to the login page.'\", \"assert user_logout() == 'You have been redirected to the login page.'\", \"assert user_logout() == 'You have been r... | {
"split": "train",
"index": 61096,
"acecode_id": "oss_28827",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a URL catalog for a network management system. The dictionary contains three keys: 'get_one', 'update', and 'get_all'. Your task is to update this dictionary with predefined URLs. The 'get_one' key should merge with given URLs for queryin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_url_catalog({'get_one': {}, 'update': {}, 'get_all': {}}) == None\", \"assert update_url_catalog({'get_one': {'old_key': 'old_value'}, 'update': {}, 'get_all': {}}) == None\", \"assert update_url_catalog({'get_one': {}, 'update': {'key': 'value'}, 'ge... | {
"split": "train",
"index": 61097,
"acecode_id": "bigcode_python_fns_3191",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes user information and modifies a given line of data based on certain conditions. The function takes in two parameters: `userInfo`, a list containing user information, and `line`, a list representing a line of data. The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_line(['John', 'Doe', '30'], ['John', 'Smith', '25', 'Engineer']) == ['John', 'Doe', '30', 'Smith', '25', 'Engineer']\", \"assert process_line(['Alice', 'Wonderland'], ['Alice', 'In', 'Wonderland']) == ['Alice', 'Wonderland', 'In', 'Wonderland']\", \"... | {
"split": "train",
"index": 61098,
"acecode_id": "oss_12621",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that finds the largest palindromic integer from a given list of numbers, which can include positive integers, negative integers, and floating-point numbers. The function should only return the largest integer palindrome found in the list. If no palindrom... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largest_palindrome_num([121, 33, 44, -44, 101]) == 121\", \"assert largest_palindrome_num([1.0, 2.2, 3.3, 4.4]) == None\", \"assert largest_palindrome_num([123, 456, 789]) == None\", \"assert largest_palindrome_num([-121, 121, 212]) == 212\", \"assert larges... | {
"split": "train",
"index": 61099,
"acecode_id": "evol_6442",
"num_tests": 13
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.