data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "Given two strings, determine if one string is a permutation of the other. Return True if they are permutations, otherwise return False. A permutation means that both strings contain the same characters in the same quantities, regardless of their order.\nPlease reason step by st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_permutations('listen', 'silent') == True\", \"assert are_permutations('abc', 'cab') == True\", \"assert are_permutations('hello', 'olelh') == True\", \"assert are_permutations('triangle', 'integral') == True\", \"assert are_permutations('apple', 'papel')... | {
"split": "train",
"index": 79700,
"acecode_id": "evol_35085",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a temperature monitoring system for a server room. The system should alert the administrators when the temperature exceeds certain thresholds. Write a Python function `temperature_alert(current_temp)` that takes the current temperature as input and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert temperature_alert(70.0) == 'Normal'\", \"assert temperature_alert(85.0) == 'Normal'\", \"assert temperature_alert(86.0) == 'High'\", \"assert temperature_alert(90.0) == 'High'\", \"assert temperature_alert(91.0) == 'Critical'\", \"assert temperature_alert(10... | {
"split": "train",
"index": 79701,
"acecode_id": "oss_12887",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of unsigned short integers, write a function that checks if the list has exactly 4 elements, and each element must be between 0 and 65535 (inclusive). The function should return True if the list meets these criteria; otherwise, it should return False.\nPlease reaso... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_unsigned_short_length([1000, 2000, 3000, 4000]) == True\", \"assert check_unsigned_short_length([0, 65535, 10000, 50000]) == True\", \"assert check_unsigned_short_length([0, 65536, 10000, 50000]) == False\", \"assert check_unsigned_short_length([1, 2, ... | {
"split": "train",
"index": 79702,
"acecode_id": "bigcode_python_fns_5780",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of CUDA library configurations and returns a dictionary containing the library name as the key and its respective version as the value. Each configuration in the input list is formatted as 'library_name: version'. Your f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_cuda_libraries(['cudnn: 8.0', 'cudnn: 7.6', 'cuda: 10.2', 'cuda: 11.0']) == {'cudnn': '8.0', 'cuda': '11.0'}\", \"assert parse_cuda_libraries(['cublas: 10.1', 'cublas: 10.2', 'cublas: 9.0']) == {'cublas': '10.2'}\", \"assert parse_cuda_libraries(['cudn... | {
"split": "train",
"index": 79703,
"acecode_id": "bigcode_python_fns_5316",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, lst1 and lst2, return a new list that contains the element-wise product of the two input lists. The two input lists are guaranteed to be of the same length. You need to implement a function named product_lists that takes in these two lists and retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_lists([1, 2, 3, 4], [0, 1, 2, 3]) == [0, 2, 6, 12]\", \"assert product_lists([-1, -2, -3], [1, 2, 3]) == [-1, -4, -9]\", \"assert product_lists([0, 0, 0], [1, 2, 3]) == [0, 0, 0]\", \"assert product_lists([1, 2, 3], [0, 0, 0]) == [0, 0, 0]\", \"asser... | {
"split": "train",
"index": 79704,
"acecode_id": "evol_16114",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string containing ASCII characters only and reverses the order of the words in the string, while preserving the original case of each character. The words in the string are separated by spaces. For example, given the input string 'Hello World',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_words_in_string('Hello World') == 'World Hello'\", \"assert reverse_words_in_string('Python is fun') == 'fun is Python'\", \"assert reverse_words_in_string('Leetcode problems are interesting') == 'interesting are problems Leetcode'\", \"assert revers... | {
"split": "train",
"index": 79705,
"acecode_id": "evol_30728",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of integers and returns a new list containing only the even numbers from the original list. The function should accept a list of integers as input and return a list of even integers. If there are no even integers... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([1, 3, 5, 7, 9]) == []\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([0, 2, 4, 6]) == [0,... | {
"split": "train",
"index": 79706,
"acecode_id": "oss_23322",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to generate HTML code for displaying publication records in a table row. The function `generate_pub_row` takes five parameters: `count` (an integer representing the record count), `pub_id` (a string representing the publication ID)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_pub_row(1, 'pub123', 'http://example.com', 'Example Title', True) == '<tr class=\\\"table1\\\"><td>1</td><td><a href=\\\"http://example.com\\\">Example Title</a></td><td>http://example.com</td><td><a href=\\\"http://example.com\\\">Resolve Bad URL</... | {
"split": "train",
"index": 79707,
"acecode_id": "oss_15681",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that parses a simplified HTML content and extracts the text within anchor tags. Your function should take a string representing the HTML content as input and return a list of the text within all anchor tags found in the HTML. The i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_anchor_text('<div><a href=\\\"link1\\\">Link One</a></div>') == ['Link One']\", \"assert extract_anchor_text('<a href=\\\"link2\\\">Link Two</a><a href=\\\"link3\\\">Link Three</a>') == ['Link Two', 'Link Three']\", \"assert extract_anchor_text('<p>N... | {
"split": "train",
"index": 79708,
"acecode_id": "oss_14355",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n and a list of integers dep_keys, implement a function that returns a list of integers, where each element in the returned list is the result of raising each element in dep_keys to the power of n. The function signature is `def x_power_dependence(n: int, dep_k... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert x_power_dependence(2, [1, 2, 3]) == [1, 4, 9]\", \"assert x_power_dependence(3, [1, 2, 3]) == [1, 8, 27]\", \"assert x_power_dependence(0, [1, 2, 3]) == [1, 1, 1]\", \"assert x_power_dependence(1, [1, 2, 3]) == [1, 2, 3]\", \"assert x_power_dependence(4, [2,... | {
"split": "train",
"index": 79709,
"acecode_id": "bigcode_python_fns_19746",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a string representing a file path and a string representing a file name, and returns the full path to the file by combining them appropriately. The function should ensure that the file path ends with a slash (/) before appe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_file_path('home/user/', 'file.txt') == 'home/user/file.txt'\", \"assert combine_file_path('home/user', 'file.txt') == 'home/user/file.txt'\", \"assert combine_file_path('/home/user', 'file.txt') == '/home/user/file.txt'\", \"assert combine_file_path(... | {
"split": "train",
"index": 79710,
"acecode_id": "bigcode_python_fns_1217",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function `make_palindrome` that returns the shortest palindrome that starts with the provided string. The function should ignore case, non-alphanumeric characters, and spaces between words. If the input string is empty, return an empty string. For in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_palindrome('') == ''\", \"assert make_palindrome('cat') == 'catac'\", \"assert make_palindrome('cata') == 'catac'\", \"assert make_palindrome('race') == 'racecar'\", \"assert make_palindrome('12321') == '12321'\", \"assert make_palindrome('1234') == '12... | {
"split": "train",
"index": 79711,
"acecode_id": "evol_4861",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the number of registers that have been read from a Modbus TCP connection. Your task is to implement a function that returns the total number of registers read. The function should take a list of integers as input and output a single... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_registers_read([0, 1, 2, 3]) == 6\", \"assert total_registers_read([5, 5, 5]) == 15\", \"assert total_registers_read([-1, -2, -3]) == -6\", \"assert total_registers_read([]) == 0\", \"assert total_registers_read([1, 2, 3, 4, 5]) == 15\", \"assert total... | {
"split": "train",
"index": 79712,
"acecode_id": "bigcode_python_fns_3196",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple image repository system. The system should allow users to manage images and their members. Create a function named `manage_image_members` that takes three parameters: a list of tuples `images` where each tuple contains the image name an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_image_members([('image1', ['member1']), ('image2', ['member2'])], 'add', ('image1', 'member3')) == [('image1', ['member1', 'member3']), ('image2', ['member2'])]\", \"assert manage_image_members([('image1', ['member1']), ('image2', ['member2'])], 'remo... | {
"split": "train",
"index": 79713,
"acecode_id": "oss_2484",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function `addPost(postId: int, likes: int) -> None` that updates a post ranking system by adding `likes` to a given post identified by `postId`. If there is no post with such id in the ranking system, the function should add it to the ranking system with the given `lik... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert addPost(1, 73) is None\", \"assert addPost(2, 56) is None\", \"assert addPost(3, 39) is None\", \"assert addPost(4, 51) is None\", \"assert addPost(5, 4) is None\", \"assert addPost(1, 10) is None\", \"assert addPost(2, 20) is None\", \"assert addPost(3, 30)... | {
"split": "train",
"index": 79714,
"acecode_id": "evol_22420",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that sanitizes a given block of text. The function should perform the following operations: 1. Replace all occurrences of CRLF (\\r\\n) with LF (\\n). 2. Remove any remaining carriage return characters (\\r). 3. Ensure that the text ends ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sanitise_text('Hello World\\\\r\\\\nThis is a test.') == 'Hello World\\\\nThis is a test.\\\\n'\", \"assert sanitise_text('Line 1\\\\rLine 2\\\\r\\\\nLine 3') == 'Line 1\\\\nLine 2\\\\nLine 3\\\\n'\", \"assert sanitise_text('No CRs or LFs here') == 'No CRs o... | {
"split": "train",
"index": 79715,
"acecode_id": "bigcode_python_fns_32460",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers, two indices n and m, and a string indicating sorting order (either 'asc' for ascending or 'desc' for descending). The function should return a new list where the elements of the original list at indices between n and m (inclus... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_sort([10, 20, 30, 40], 1, 3, 'desc') == [10, 1600, 900, 400]\", \"assert custom_sort([2, 4, 6], 0, 1, 'asc') == [4, 16, 6]\", \"assert custom_sort([1], 0, 0, 'asc') == [1]\", \"assert custom_sort([2, 2, 2, 2], 0, 2, 'asc') == [4, 4, 4, 2]\", \"assert ... | {
"split": "train",
"index": 79716,
"acecode_id": "evol_4393",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a given decimal number into its binary representation as a string. The function should take an integer as input and return the corresponding binary string without the '0b' prefix. For example, given the input 122, the output should be '1111010... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decimal_to_binary(0) == '0'\", \"assert decimal_to_binary(1) == '1'\", \"assert decimal_to_binary(2) == '10'\", \"assert decimal_to_binary(3) == '11'\", \"assert decimal_to_binary(4) == '100'\", \"assert decimal_to_binary(5) == '101'\", \"assert decimal_to_b... | {
"split": "train",
"index": 79717,
"acecode_id": "evol_4757",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the behavior of a smart 404 error handler for a web application. The function should process a URL path and return a response indicating whether a specific resource was found or not. The URL path will be represented as ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert smart_404('123/issues/procedures') == {'not_found': {'type': 'no_procedure', 'redirect_url': 'http://example.com/123/issues/procedures/'}}\", \"assert smart_404('123/issues') == {'not_found': {'type': 'no_issue', 'redirect_url': 'http://example.com/123/issue... | {
"split": "train",
"index": 79718,
"acecode_id": "bigcode_python_fns_38539",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `validate_user_data(request_args)` that takes a dictionary `request_args` as input. The function should check for the presence of 'name' and 'age'. If 'name' is missing or is an empty string, the function should return 'Name is missing.'. If 'age' is missin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_user_data({'name': '', 'age': 25}) == 'Name is missing.'\", \"assert validate_user_data({'name': 'Bob', 'age': -5}) == 'Age should be a positive integer.'\", \"assert validate_user_data({'name': 'Charlie', 'age': '0'}) == 'Age should be a positive i... | {
"split": "train",
"index": 79719,
"acecode_id": "evol_4624",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D grid representing temperature values at different points. Each cell in the grid can have a temperature value, and it's guaranteed that all values are integers. Your task is to return a new 2D grid where each cell contains the average temperature of its surrou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_temperature([[1]]) == [[1]]\", \"assert average_temperature([[1, 1, 1], [1, 1, 1], [1, 1, 1]]) == [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]\", \"assert average_temperature([[0]]) == [[0]]\", \"assert average_temperature([[1, 2, 3]]) == [[2.... | {
"split": "train",
"index": 79720,
"acecode_id": "bigcode_python_fns_22179",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that checks if a user is enrolled in a specific group based on their access token. The function should take a string `access_token` as input and return a boolean value. Your function will simulate the enrollment confirmation by che... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert confirm_indok_enrollment('valid_token_1') == True\", \"assert confirm_indok_enrollment('valid_token_2') == True\", \"assert confirm_indok_enrollment('invalid_token') == False\", \"assert confirm_indok_enrollment('some_random_token') == False\", \"assert conf... | {
"split": "train",
"index": 79721,
"acecode_id": "oss_8746",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a mathematical expression represented as a nested structure involving variables and operations. Your task is to create a Python function `evaluate_expression(expression, variables)` that evaluates this expression using the provided variable values. The expression ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_expression(('Add', ('Dot', 'x', 'y'), 'a'), {'x': 2, 'y': 3, 'a': 4}) == 10\", \"assert evaluate_expression(('Add', ('Dot', 'x', 'y'), 'a'), {'x': 1, 'y': 5, 'a': 2}) == 7\", \"assert evaluate_expression(('Dot', ('Add', 'x', 'y'), 'a'), {'x': 3, 'y'... | {
"split": "train",
"index": 79722,
"acecode_id": "oss_19852",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a sequence of numeric values. The function should calculate the square of each number and return a list of these squared values. The provided code snippet demonstrates how to process a list of numbers to achieve ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_squares([1, 2, 3, 4]) == [1, 4, 9, 16]\", \"assert calculate_squares([-1, -2, -3]) == [1, 4, 9]\", \"assert calculate_squares([0]) == [0]\", \"assert calculate_squares([10, 20, 30]) == [100, 400, 900]\", \"assert calculate_squares([5]) == [25]\", \... | {
"split": "train",
"index": 79723,
"acecode_id": "oss_18618",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a message received over a socket connection. The function will validate the message based on its length and a predefined maximum message size. The function should take in three parameters: the message length, the expect... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_message_length(20, 1, 1, 100) == 'Valid message'\", \"assert validate_message_length(30, 2, 2, 50) == 'Valid message'\", \"assert validate_message_length(50, 6, 6, 60) == 'Valid message'\", \"assert validate_message_length(17, 9, 9, 30) == 'Valid me... | {
"split": "train",
"index": 79724,
"acecode_id": "bigcode_python_fns_24499",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of flags represented by tuples, where each flag has a primary color and a secondary color, implement a function `look_for_flags(flags, main_color, sub_color=None)` that returns a list of flags that match the specified primary and secondary colors. If `sub_color` is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert look_for_flags([('red', 'blue'), ('green', 'yellow'), ('red', 'green')], 'red', 'blue') == [('red', 'blue')]\", \"assert look_for_flags([('red', 'blue'), ('green', 'yellow'), ('red', 'green')], 'red') == [('red', 'blue'), ('red', 'green')]\", \"assert look_f... | {
"split": "train",
"index": 79725,
"acecode_id": "bigcode_python_fns_18777",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function to concatenate an array of strings into a single string, with each word separated by a space. The function should take a list of words as input and return the concatenated string. For example, given the input ['hello', 'world'], the output should be 'hello worl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert join_words(['apple', 'banana', 'cherry']) == 'apple banana cherry'\", \"assert join_words(['one']) == 'one'\", \"assert join_words(['this', 'is', 'a', 'test']) == 'this is a test'\", \"assert join_words(['']) == ''\", \"assert join_words(['python', 'is', 'fu... | {
"split": "train",
"index": 79726,
"acecode_id": "evol_22787",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that checks whether a given version of Django requires a workaround for importing tests. The workaround is necessary for versions prior to 1.6. Write a Python function `check_test_import(version)` that takes a tuple `version` repre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_test_import((1, 5)) == True\", \"assert check_test_import((1, 4)) == True\", \"assert check_test_import((1, 6)) == False\", \"assert check_test_import((2, 0)) == False\", \"assert check_test_import((1, 5, 1)) == True\", \"assert check_test_import((1, 5... | {
"split": "train",
"index": 79727,
"acecode_id": "oss_23192",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of event log files, where each log file has properties such as an ID, event type, log date, and the length of the log file. Implement a function `get_log_file_lengths(logs)` that takes a list of log file dictionaries and returns a list of t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_log_file_lengths([{'Id': '0ATD000000001bROAQ', 'EventType': 'API', 'LogDate': '2014-03-14T00:00:00.000+0000', 'LogFileLength': 2692.0}, {'Id': '0ATD000000001SdOAI', 'EventType': 'API', 'LogDate': '2014-03-13T00:00:00.000+0000', 'LogFileLength': 1345.0}])... | {
"split": "train",
"index": 79728,
"acecode_id": "bigcode_python_fns_19243",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function called 'get_zodiac_sign' that takes a birth date as a string in the format 'DD-MM-YYYY' and returns the corresponding astrological zodiac sign. The zodiac signs are determined based on the following date ranges: \n- Capricorn: December 22 - January 19 \n- A... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_zodiac_sign('01-01-2000') == 'Capricorn'\", \"assert get_zodiac_sign('20-01-2000') == 'Aquarius'\", \"assert get_zodiac_sign('20-02-2000') == 'Pisces'\", \"assert get_zodiac_sign('21-03-2000') == 'Aries'\", \"assert get_zodiac_sign('19-04-2000') == 'Arie... | {
"split": "train",
"index": 79729,
"acecode_id": "evol_35216",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the configuration of a secure MESH network between two devices. Each device can be configured with a security group identifier, which is represented by an integer. The function should accept two lists of integers, `dev1... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_connect([19, 20, 21], [22, 19]) == True\", \"assert can_connect([1, 2, 3], [4, 5, 6]) == False\", \"assert can_connect([10], [10]) == True\", \"assert can_connect([], [1, 2, 3]) == False\", \"assert can_connect([1, 2, 3], []) == False\", \"assert can_con... | {
"split": "train",
"index": 79730,
"acecode_id": "bigcode_python_fns_13416",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that calculates the number of lowercase consonants located at odd indices in a string, excluding the first and last characters. The function should be defined as follows: def count_lower(s): where 's' is a string. The function should return an integer represent... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_lower('ABCDEFG') == 0\", \"assert count_lower('cdeFgHi') == 1\", \"assert count_lower('') == 0\", \"assert count_lower('a') == 0\", \"assert count_lower('xYzABcDef') == 1\", \"assert count_lower('mnopqr') == 2\", \"assert count_lower('AEIOU') == 0\", \... | {
"split": "train",
"index": 79731,
"acecode_id": "evol_351",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_duplicates(lst)` that returns a list of duplicate integers found in the input list. The order of the duplicates in the output list should reflect the order of their first appearance in the input list. If there are no duplicates, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_duplicates([1, 2, 3, 4, 5]) == []\", \"assert find_duplicates([1, 1, 2, 3, 4]) == [1]\", \"assert find_duplicates([1, 2, 2, 3, 4, 4]) == [2, 4]\", \"assert find_duplicates([5, 5, 5, 5]) == [5]\", \"assert find_duplicates([]) == []\", \"assert find_dupli... | {
"split": "train",
"index": 79732,
"acecode_id": "evol_19598",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists: `inputs` and `results`. Your task is to create a function `save_convergence_statistics(inputs: List[int], results: List[int], display: bool = True) -> str` that processes these lists to generate a report. The report should be a string that summarizes th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert save_convergence_statistics([1, 2, 3], [4, 5, 6], display=True) == 'Total Inputs: 3, Average Input: 2.0, Total Results: 3, Average Result: 5.0, Report displayed.'\", \"assert save_convergence_statistics([10, 20, 30], [40, 50], display=False) == 'Total Inputs... | {
"split": "train",
"index": 79733,
"acecode_id": "bigcode_python_fns_43291",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a recursive function in Python that outputs the numbers from 1 to n, where n is a positive integer provided as an argument to the function. The function should not use any looping statements like for or while. The output should be a list of integers from 1 to n. If n ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert recursive_numbers(5) == [1, 2, 3, 4, 5]\", \"assert recursive_numbers(1) == [1]\", \"assert recursive_numbers(0) == []\", \"assert recursive_numbers(10) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\", \"assert recursive_numbers(2) == [1, 2]\", \"assert recursive_numbe... | {
"split": "train",
"index": 79734,
"acecode_id": "evol_28794",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing a list of software package updates. Your job is to implement a function that takes in two lists of strings, `security_updates` and `plain_updates`, representing security updates and regular updates, respectively. The function should return a string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_updates(['pkg1', 'pkg2'], ['pkg3'], 3, 2) == '2 security updates (pkg1, pkg2); CRITICAL'\", \"assert check_updates([], ['pkg1', 'pkg2', 'pkg3'], 3, 2) == '3 updates pending; WARNING'\", \"assert check_updates([], [], 3, 2) == 'No updates; OK'\", \"asse... | {
"split": "train",
"index": 79735,
"acecode_id": "bigcode_python_fns_25966",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function `remove_duplicates(s: str) -> Tuple[str, int]` that takes a string `s` as input and returns a tuple containing a new string with all duplicate characters removed while maintaining the original order of non-duplicated characters, and an integer representing the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates('aabbcc') == ('abc', 3)\", \"assert remove_duplicates('abc') == ('abc', 0)\", \"assert remove_duplicates('') == ('', 0)\", \"assert remove_duplicates('a') == ('a', 0)\", \"assert remove_duplicates('aabb') == ('ab', 2)\", \"assert remove_dup... | {
"split": "train",
"index": 79736,
"acecode_id": "evol_25726",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that analyzes the copyright information in a given source code string. The program should extract the name and email of the copyright holder and determine the license under which the software is distributed. Write a function `analyze_copyr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_copyright_info('''# Copyright (c) 2015 John Doe <john.doe@example.com>''') == {'name': 'John Doe', 'email': 'john.doe@example.com', 'license': None}\", \"assert analyze_copyright_info('''# Copyright (c) 2020 Alice Smith <alice.smith@example.com>''') ... | {
"split": "train",
"index": 79737,
"acecode_id": "oss_25521",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a 2D matrix represented as a list of lists, implement a function that converts the matrix to a specified format. The available formats are 'dense' and 'sparse'. A dense matrix is represented as a list of lists, while a sparse matrix is represented as a list of tuples, whe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_matrix([[1, 0, 0], [0, 0, 3]], 'sparse') == [(0, 0, 1), (1, 2, 3)]\", \"assert convert_matrix([[1, 0, 0], [0, 0, 3]], 'dense') == [[1, 0, 0], [0, 0, 3]]\", \"assert convert_matrix([[0, 0], [0, 0]], 'sparse') == []\", \"assert convert_matrix([[1]], 's... | {
"split": "train",
"index": 79738,
"acecode_id": "bigcode_python_fns_35268",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `say_hello(name: str) -> str` that takes a string `name` as input and returns a greeting message in the format 'Hello, {name}!' where `{name}` is the input name. The function should handle empty strings by returning 'Hello, !'.\nPlease reason step by step, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert say_hello('Alice') == 'Hello, Alice!'\", \"assert say_hello('Bob') == 'Hello, Bob!'\", \"assert say_hello('') == 'Hello, !'\", \"assert say_hello('Charlie') == 'Hello, Charlie!'\", \"assert say_hello('') == 'Hello, !'\", \"assert say_hello('Diana') == 'Hello... | {
"split": "train",
"index": 79739,
"acecode_id": "evol_23764",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple authentication check for a messaging application. The function `authenticate_user(scope: dict) -> str` should take a dictionary `scope` as input that contains information about the user. The function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert authenticate_user({'user_authenticated': True}) == 'User authenticated'\", \"assert authenticate_user({'user_authenticated': False}) == 'User not authenticated'\", \"assert authenticate_user({'user_authenticated': True, 'user_id': 123}) == 'User authenticate... | {
"split": "train",
"index": 79740,
"acecode_id": "oss_32707",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a formatted string representing a filename based on a given count. The filename should follow the format 'id:XXXXXX,driller', where 'XXXXXX' is the count padded with leading zeros to ensure it is always 6 digits long. Your ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_filename(0) == 'id:000000,driller'\", \"assert generate_filename(1) == 'id:000001,driller'\", \"assert generate_filename(10) == 'id:000010,driller'\", \"assert generate_filename(99) == 'id:000099,driller'\", \"assert generate_filename(100) == 'id:00... | {
"split": "train",
"index": 79741,
"acecode_id": "bigcode_python_fns_38839",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that verifies if two provided sentences contain the same distinct words, disregarding case and any non-alphanumeric symbols, and whether the words appear in the same sequence. The function should return True if both conditions are met, and False otherwise. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_word_sets_order('apple banana', 'banana apple') == False\", \"assert compare_word_sets_order('Python 3.8!', 'python three point eight') == False\", \"assert compare_word_sets_order('Data Science', 'data science') == True\", \"assert compare_word_sets... | {
"split": "train",
"index": 79742,
"acecode_id": "evol_12290",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a non-negative integer as an argument and returns the sum of all integers from 1 to that integer, inclusive. If the input is 0, return 0.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a singl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_integers(0) == 0\", \"assert sum_of_integers(1) == 1\", \"assert sum_of_integers(2) == 3\", \"assert sum_of_integers(3) == 6\", \"assert sum_of_integers(4) == 10\", \"assert sum_of_integers(5) == 15\", \"assert sum_of_integers(6) == 21\", \"assert sum... | {
"split": "train",
"index": 79743,
"acecode_id": "evol_15980",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an object, determine if it is a JSON serializable object. A JSON serializable object can be converted to a JSON string using the `json.dumps()` function from the Python standard library. Implement a function `is_jsonable(obj)` that returns `True` if the object can be seri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_jsonable({'key': 'value'}) == True\", \"assert is_jsonable([1, 2, 3]) == True\", \"assert is_jsonable('Hello, World!') == True\", \"assert is_jsonable(123) == True\", \"assert is_jsonable(None) == True\", \"assert is_jsonable({'key': None}) == True\", \"a... | {
"split": "train",
"index": 79744,
"acecode_id": "bigcode_python_fns_37536",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that extracts and returns the timestamps of camera frames from a given list of sync matrices. Each sync matrix is represented as a list of lists, where each inner list contains integers representing the timestamps of camera frames. Yo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_camera_timestamps([[1, 2], [3, 4]]) == [1, 2, 3, 4]\", \"assert extract_camera_timestamps([[5, 1], [2]]) == [1, 2, 5]\", \"assert extract_camera_timestamps([[10, 20, 30], [5, 15]]) == [5, 10, 15, 20, 30]\", \"assert extract_camera_timestamps([[], [1,... | {
"split": "train",
"index": 79745,
"acecode_id": "bigcode_python_fns_3226",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a filename. Your task is to implement a function that checks if the filename has a specific format, which is defined as having an extension of '.xh'. The function should return True if the filename ends with '.xh', and False otherwise. For ex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_xh('file.xh') == True\", \"assert is_xh('document.xh') == True\", \"assert is_xh('image.jpg') == False\", \"assert is_xh('notes.txt') == False\", \"assert is_xh('archive.xh') == True\", \"assert is_xh('report.pdf') == False\", \"assert is_xh('test.xh') ==... | {
"split": "train",
"index": 79746,
"acecode_id": "bigcode_python_fns_18965",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings consisting of alphanumeric characters. Write a function `even_characters(lst)` that returns a list of formatted strings, where each formatted string describes the number of even numeric characters and the total number of numeric characters in eac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert even_characters(['1234567abc']) == ['The total number of even characters present is 3, and the frequency of numericals is 7 in the processed string.']\", \"assert even_characters(['4abc', '22222222efgh']) == ['The total number of even characters present is 1... | {
"split": "train",
"index": 79747,
"acecode_id": "evol_7948",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates sending a reset command to a server through a socket. The function should take the server's IP address as a string and return a response message. If the provided IP address is valid, the function should return 'Command ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_reset_command('192.168.1.256') == 'Not connected'\", \"assert send_reset_command('192.168.1') == 'Not connected'\", \"assert send_reset_command('192.168.-1.1') == 'Not connected'\", \"assert send_reset_command('abc.def.ghi.jkl') == 'Not connected'\", \"... | {
"split": "train",
"index": 79748,
"acecode_id": "bigcode_python_fns_42868",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a string representation of a list of blocks in JSON format, where each block contains a dictionary with details about the block such as its 'index', 'previous_hash', and 'data'. Your task is to implement a function that takes this JSON string as input and returns ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unpack_blockchain('[{\\\"index\\\": 1, \\\"previous_hash\\\": \\\"0\\\", \\\"data\\\": \\\"SGVsbG8gd29ybGQ=\\\"}, {\\\"index\\\": 2, \\\"previous_hash\\\": \\\"abc123\\\", \\\"data\\\": \\\"U29tZSBkYXRh\\\"}]') == [{'index': 1, 'previous_hash': '0', 'data': ... | {
"split": "train",
"index": 79749,
"acecode_id": "bigcode_python_fns_6969",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a given sentence into title case, where the first letter of each major word is capitalized, and the rest of the letters are in lowercase. Minor words (such as 'and', 'or', 'the', 'in', etc.) should be lowercase unless they are the first or las... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert headline('the quick brown fox') == 'The Quick Brown Fox'\", \"assert headline('to be or not to be') == 'To Be or Not to Be'\", \"assert headline('the quick brown dog jumped over the lazy fox') == 'The Quick Brown Dog Jumped Over the Lazy Fox'\", \"assert hea... | {
"split": "train",
"index": 79750,
"acecode_id": "evol_8540",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a Sensor class that can manage child sensors and track their desired values based on different states. Implement the function `get_desired_value(sensor_id: int, child_id: int, value_type: int) -> Optional[str]` which returns the desired value of a specified child ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_desired_value(1, 0, 1) == '50'\", \"assert get_desired_value(1, 100, 1) is None\", \"assert get_desired_value(1, 0, 9999) is None\", \"assert get_desired_value(2, 0, 1) is None\", \"assert get_desired_value(1, 0, 2) is None\", \"assert get_desired_value(... | {
"split": "train",
"index": 79751,
"acecode_id": "bigcode_python_fns_27615",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list (matrix) of probabilities, write a function `normalize_matrix(mat)` that normalizes the values in the matrix to the range [0, 1]. The normalization should ensure that the minimum value in the matrix becomes 0 and the maximum value becomes 1. If the matrix contai... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_matrix([[0.2, 0.5], [0.1, 0.9]]) == [[0.125, 0.5], [0.0, 1.0]]\", \"assert normalize_matrix([[0, 0, 0], [0, 0, 0]]) == [[0, 0, 0], [0, 0, 0]]\", \"assert normalize_matrix([[1, 2], [3, 4]]) == [[0.0, 0.3333333333333333], [0.6666666666666666, 1.0]]\"... | {
"split": "train",
"index": 79752,
"acecode_id": "bigcode_python_fns_12891",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple key-value store using a dictionary. Your function should accept a list of operations where each operation is represented as a tuple. The first element of the tuple is a string indicating the operation type ('ad... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert key_value_store_operations([('add', 'name', 'Alice'), ('add', 'age', 25), ('get', 'name')]) == [None, None, 'Alice']\", \"assert key_value_store_operations([('add', 'name', 'Alice'), ('add', 'age', 25), ('get', 'city')]) == [None, None, None]\", \"assert key... | {
"split": "train",
"index": 79753,
"acecode_id": "oss_34198",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers that represent the ages of a group of people. Write a function `average_age(ages: List[int]) -> float` that calculates and returns the average age of the group. If the list is empty, return 0.0. The average should be calculated as a floating-poi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_age([20, 30, 40]) == 30.00\", \"assert average_age([15, 25, 35, 45, 55]) == 35.00\", \"assert average_age([10]) == 10.00\", \"assert average_age([100, 200]) == 150.00\", \"assert average_age([0, 0, 0]) == 0.00\", \"assert average_age([18, 22, 19, 25,... | {
"split": "train",
"index": 79754,
"acecode_id": "bigcode_python_fns_15321",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function that returns all unique permutations of three elements from that array. If the input array contains duplicate numbers, the function should ensure that duplicate permutations are not included in the result. The output should be a list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert permute([1, 2, 3, 4]) == [[1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4]]\", \"assert permute([1, 2, 3, 3]) == [[1, 2, 3], [1, 3, 3], [2, 3, 3]]\", \"assert permute([10, 20, 30]) == [[10, 20, 30]]\", \"assert permute([1, 2, 3, 4, 5]) == [[1, 2, 3], [1, 2, 4], [1... | {
"split": "train",
"index": 79755,
"acecode_id": "evol_12105",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of phrases and concatenates them into a single string, where each phrase is separated by a semicolon followed by a space. The function should handle cases where the input list is empty or contains only one phrase. For example, given the in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert join_phrases(['Hello', 'world', 'this is a test']) == 'Hello; world; this is a test'\", \"assert join_phrases(['This is one phrase']) == 'This is one phrase'\", \"assert join_phrases([]) == ''\", \"assert join_phrases(['Only one']) == 'Only one'\", \"assert ... | {
"split": "train",
"index": 79756,
"acecode_id": "evol_34452",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that generates an SVG string of an apple with a bite taken out of it and a worm coming out of the apple. The worm can be represented as a polygon. The function should return the SVG as a string instead of saving it to a file. The apple should be a red circle wi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_svg() == '<svg height=\\\"100\\\" width=\\\"200\\\"><circle cx=\\\"50\\\" cy=\\\"50\\\" r=\\\"30\\\" stroke=\\\"black\\\" stroke-width=\\\"2\\\" fill=\\\"red\\\" /><path d=\\\"M 50 50 Q 60 30 70 50 Q 60 70 50 50 Z\\\" fill=\\\"red\\\" /><polygon poi... | {
"split": "train",
"index": 79757,
"acecode_id": "evol_33317",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate(a: int, b: int) -> str` that takes two integers 'a' and 'b' as input. The function should return the result of dividing 'b' by 'a' if 'a' is not zero. If 'a' is zero, it should return the string 'Division by zero is undefined'. Additionally, if '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate(3, 5) == 1.6666666666666667\", \"assert calculate(1, 2) == 2.0\", \"assert calculate(0, 5) == 'Division by zero is undefined'\", \"assert calculate(5, 10) == 2.0\", \"assert calculate(0, 0) == 'Division by zero is undefined'\", \"assert calculate(4... | {
"split": "train",
"index": 79758,
"acecode_id": "evol_4547",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that converts a given dictionary into a list of dictionaries, where each dictionary represents a row with specified keys. The input will be a dictionary where the keys are unique identifiers and the values are lists of values correspondin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_dict_to_list({'a': [1, 2], 'b': [3, 4]}, ['a', 'b']) == [{'a': 1, 'b': 3}, {'a': 2, 'b': 4}]\", \"assert convert_dict_to_list({'x': [10, 20], 'y': [30]}, ['x', 'y']) == [{'x': 10, 'y': 30}, {'x': 20, 'y': None}]\", \"assert convert_dict_to_list({'nam... | {
"split": "train",
"index": 79759,
"acecode_id": "bigcode_python_fns_19478",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a face detection system in a video feed. The function should take a list of rectangles representing detected faces in the format [(x1, y1, w1, h1), (x2, y2, w2, h2), ...], where (xi, yi) is the top-left corner of the re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_faces([]) == []\", \"assert merge_faces([(1, 1, 2, 2)]) == [(1, 1, 2, 2)]\", \"assert merge_faces([(1, 1, 2, 2), (2, 2, 2, 2)]) == [(1, 1, 3, 3)]\", \"assert merge_faces([(1, 1, 2, 2), (3, 3, 2, 2)]) == [(1, 1, 2, 2), (3, 3, 2, 2)]\", \"assert merge_fa... | {
"split": "train",
"index": 79760,
"acecode_id": "oss_35756",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are working for a financial analysis company that needs to process stock data. Each stock has several attributes, including '價值比' (value ratio), 'PBR' (Price-to-Book Ratio), and '現金股利' (cash dividend). Your task is to implement a function that takes a list of stock data, wh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_valid_stocks([['1.2', 1.5, '3.0'], ['0.8', 0, '2.0'], ['1.5', 2.0, '1.0']]) == [['1.2', 1.5, '3.0'], ['1.5', 2.0, '1.0']]\", \"assert filter_valid_stocks([['1.0', 0, '5.0'], ['1.0', -1.0, '4.0'], ['1.0', 2.0, '0.0'], ['1.0', 1.0, '2.5']]) == [['1.0', ... | {
"split": "train",
"index": 79761,
"acecode_id": "oss_7524",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function called `count_python_occurrences` that takes a nested list as input and returns the number of times the term 'python' appears within that list. The search should be case-sensitive and should handle lists nested to any depth.\nPlease reason step by step, then wr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_python_occurrences(['I', ['have', ['a', ['deep', ['affinity', ['for', ['the', ['programming', ['dialect', ['known', 'as', 'Python']]]]]]]]]]) == 0\", \"assert count_python_occurrences(['I', ['have', ['a', ['deep', ['python', ['for', ['the', ['programmi... | {
"split": "train",
"index": 79762,
"acecode_id": "evol_25351",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of trials and their corresponding parameters to generate suggested parameter sets. Each trial is represented as a dictionary containing the trial's parameters, and each parameter is represented as a dictionary co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_suggested_parameter_sets([{'parameters': [{'parameter': 'param1', 'floatValue': 3.14}, {'parameter': 'param2', 'intValue': 5}, {'parameter': 'param3', 'stringValue': 'abc'}]}]) == ({'param1': 3.14, 'param2': 5, 'param3': 'abc'},)\", \"assert generat... | {
"split": "train",
"index": 79763,
"acecode_id": "oss_27632",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of instance group manager (IGM) definitions and a list of autoscalers. Each IGM is represented as a tuple containing the name of the IGM, its scope type, and its scope name. Your task is to implement a function that returns a list of all autoscalers whose t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_matching_autoscalers([('igm1', 'zone', 'us-central1-a')], ['/projects/my_project/zones/us-central1-a/instanceGroupManagers/igm2'], 'my_project') == []\", \"assert find_matching_autoscalers([('igm1', 'zone', 'us-central1-a'), ('igm2', 'region', 'us-centr... | {
"split": "train",
"index": 79764,
"acecode_id": "bigcode_python_fns_8963",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `cube_of_odds(start, end)` that takes two integers, `start` and `end`, and returns a list of the cubes of all odd numbers within that range, inclusive. If the input range is invalid (e.g., `start` > `end`, negative numbers, or non-integer inputs), the funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cube_of_odds(1, 10) == [1, 27, 125, 343, 729]\", \"assert cube_of_odds(1, 1) == [1]\", \"assert cube_of_odds(9, 9) == [729]\", \"assert cube_of_odds(15, 15) == [3375]\", \"assert cube_of_odds(21, 21) == [9261]\", \"assert cube_of_odds(3, 3) == [27]\"]}"
} | {
"split": "train",
"index": 79765,
"acecode_id": "evol_14460",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "In a cycling race, multiple cyclists participate and each cyclist has a different speed. You are given two lists, X and Y, where each list contains tuples representing the distance covered by each cyclist at specific time intervals. Each tuple consists of a time (in seconds) an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_distance([(1, 10), (2, 20)], [(1, 5), (2, 15)]) == 5\", \"assert max_distance([], [(1, 20)]) == 0\", \"assert max_distance([(1, 0)], []) == 0\", \"assert max_distance([(1, 10), (2, 15)], [(1, 10), (2, 10)]) == 5\", \"assert max_distance([(1, 100)], [(1, ... | {
"split": "train",
"index": 79766,
"acecode_id": "evol_11438",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of user memberships in various organizations along with their roles. Each membership is represented as a dictionary containing the user's ID, organization name, and their role. Implement a function `get_active_organizations(memberships: List[Dict[str, Union... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_active_organizations([{'user_id': '2', 'org_name': 'Meta', 'role': 'member', 'is_organization': True}, {'user_id': '2', 'org_name': 'Meta', 'role': 'member', 'is_organization': True}, {'user_id': '2', 'org_name': 'Meta', 'role': 'inactive', 'is_organizat... | {
"split": "train",
"index": 79767,
"acecode_id": "bigcode_python_fns_19586",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `echo_server_response(data: str) -> str` that simulates the response of a TCP server that echoes back the received data. The function takes a string `data` as input and returns the same string as output. The server should handle any string input and provide... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert echo_server_response('Hello, World!') == 'Hello, World!'\", \"assert echo_server_response('TCP Test') == 'TCP Test'\", \"assert echo_server_response('Data') == 'Data'\", \"assert echo_server_response('') == ''\", \"assert echo_server_response('12345') == '12... | {
"split": "train",
"index": 79768,
"acecode_id": "evol_27539",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the behavior of a deque (double-ended queue) by allowing elements to be added to the front and back. Your function should accept a list of operations that will either add an integer to the front of the deque (denoted by... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_elements([('appendleft', 3), ('appendleft', 2), ('appendleft', 1)]) == 3\", \"assert count_elements([]) == 0\", \"assert count_elements([('appendleft', 0)]) == 1\", \"assert count_elements([('append', 1), ('append', 2), ('append', 3), ('appendleft', 0)... | {
"split": "train",
"index": 79769,
"acecode_id": "bigcode_python_fns_39769",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a `Player` class with attributes `position` (a tuple representing (x, y) coordinates), `vector` (a tuple representing the direction and speed of movement), and a `Ball` class that has an attribute `player` indicating the player currently controlling the ball. Impl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert predict_future_position(Player((0, 0), (1, 1)), 5) == (5, 5)\", \"assert predict_future_position(Player((2, 3), (0, 2)), 3) == (2, 9)\", \"assert predict_future_position(Player((1, 1), (3, 4)), 2) == (7, 9)\", \"assert predict_future_position(Player((0, 0), ... | {
"split": "train",
"index": 79770,
"acecode_id": "bigcode_python_fns_16895",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `validate_name(name: str) -> str` that accepts a string input representing a comprehensive legal identity. The function should return the input string if it is valid (non-empty and contains only valid characters, including letters, numbers, and special characte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_name('John Doe') == 'John Doe'\", \"assert validate_name('Jane123') == 'Jane123'\", \"assert validate_name('Mary Jane') == 'Mary Jane'\", \"assert validate_name('Alice in Wonderland') == 'Alice in Wonderland'\", \"assert validate_name('123456') == '... | {
"split": "train",
"index": 79771,
"acecode_id": "evol_26158",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a division operation. Your function should accept two integers, numerator and denominator. If the denominator is zero, the function should raise a ZeroDivisionError. Otherwise, it should return the result of the divisio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert safe_divide(10, 2) == 5.0\", \"assert safe_divide(5, 2) == 2.5\", \"assert safe_divide(-10, 2) == -5.0\", \"assert safe_divide(10, -2) == -5.0\", \"assert safe_divide(0, 1) == 0.0\", \"assert safe_divide(100, 10) == 10.0\", \"assert safe_divide(10, 3) == 3.3... | {
"split": "train",
"index": 79772,
"acecode_id": "bigcode_python_fns_16514",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that takes in a list of numbers and returns their sum. The function should have the following signature: `def sum_numbers(numbers: List[int]) -> int:`. Your function should handle the following scenarios: if the input list is e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_numbers([1, 2, 3, 4]) == 10\", \"assert sum_numbers([-1, -2, -3, -4]) == -10\", \"assert sum_numbers([]) == 0\", \"assert sum_numbers([1, 2, 'a', None]) == 3\", \"assert sum_numbers([1, 2, 3, 4, 5]) == 15\", \"assert sum_numbers([-1, 1, 2]) == 2\", \"ass... | {
"split": "train",
"index": 79773,
"acecode_id": "oss_31486",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `extract_positive_integers(s: str) -> List[int]` that takes a string `s` as input and returns a list of all positive integers that are greater than zero found within the string. A positive integer is defined as any integer that is greater than zero, and the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_positive_integers('There are 3 cats and 7 dogs.') == [3, 7]\", \"assert extract_positive_integers('100 is greater than 0.') == [100]\", \"assert extract_positive_integers('No numbers here!') == []\", \"assert extract_positive_integers('0 is not posit... | {
"split": "train",
"index": 79774,
"acecode_id": "evol_33440",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to calculate the sum of rewards collected by an A2C agent after training in the Snake game environment. The function should take a list of rewards for each environment as input and return the total sum of these rewards. Your implem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_rewards([10, -5, 3, 7]) == 15\", \"assert calculate_total_rewards([-1, -2, -3]) == -6\", \"assert calculate_total_rewards([0, 0, 0]) == 0\", \"assert calculate_total_rewards([100, 200, 300]) == 600\", \"assert calculate_total_rewards([-10, 10... | {
"split": "train",
"index": 79775,
"acecode_id": "oss_16413",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `name`, return a greeting message in the format 'hello {name}'. The `name` will always be a non-empty string containing only alphabetical characters. Implement a function `arg_return_greetings(name: str) -> str` that takes the `name` as input and returns the gree... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert arg_return_greetings('Alice') == 'hello Alice'\", \"assert arg_return_greetings('Bob') == 'hello Bob'\", \"assert arg_return_greetings('Charlie') == 'hello Charlie'\", \"assert arg_return_greetings('Diana') == 'hello Diana'\", \"assert arg_return_greetings('... | {
"split": "train",
"index": 79776,
"acecode_id": "bigcode_python_fns_9627",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a collection of products, each of which can have various properties. Implement a function `remove_property_from_products(property_id: int, group_products: List[Tuple[int, List[int]]]) -> List[int]` that removes a property, identified by `property_id... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_property_from_products(2, [(1, [1, 2, 3]), (2, [2, 3]), (3, [1, 4])]) == [1, 2]\", \"assert remove_property_from_products(1, [(1, [1, 2, 3]), (2, [2, 3]), (3, [1, 4])]) == [1, 3]\", \"assert remove_property_from_products(3, [(1, [1, 2, 3]), (2, [2, 3]... | {
"split": "train",
"index": 79777,
"acecode_id": "bigcode_python_fns_35278",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers x, write a function that returns a sorted list of unique positive integers that have an odd sum of their digits. The same integer should not appear twice. Sort the final output list in ascending order. For example: unique_odd_digit_sum([15, 38, 1420, 1,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_odd_digit_sum([3, 5, 7, 9]) == [3, 5, 7, 9]\", \"assert unique_odd_digit_sum([1, 2, 3, 4, 5]) == [1, 3, 5]\", \"assert unique_odd_digit_sum([0, 1, 2, 3]) == [1, 3]\", \"assert unique_odd_digit_sum([]) == []\", \"assert unique_odd_digit_sum([9]) == [9]... | {
"split": "train",
"index": 79778,
"acecode_id": "evol_26226",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with analyzing a list of build statuses and counting the number of failed builds and the number of failed builds triggered by pull requests (PRs). You need to implement a function called `count_failed_builds` that takes a list of build statuses as input and retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_failed_builds(['success', 'success', 'success']) == (0, 0)\", \"assert count_failed_builds(['failed', 'failed', 'failed']) == (3, 0)\", \"assert count_failed_builds(['success', 'failed']) == (1, 0)\", \"assert count_failed_builds(['failed', 'success', ... | {
"split": "train",
"index": 79779,
"acecode_id": "oss_14594",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a first name and an optional last name as arguments and returns a string formatted as 'My name is <first name> <last name>'. If the last name is not provided, only the first name should be included in the output. The function should raise a TypeError... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert say_my_name('John', 'Doe') == 'My name is John Doe'\", \"assert say_my_name('Alice', 'Smith') == 'My name is Alice Smith'\", \"assert say_my_name('Bob', 'Brown') == 'My name is Bob Brown'\", \"assert say_my_name('Dave', 'Wilson') == 'My name is Dave Wilson'\... | {
"split": "train",
"index": 79780,
"acecode_id": "bigcode_python_fns_35109",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given two integers, `x` and `y`, which represent your current location on a Cartesian grid: `(x, y)`. You are also given an array `points` where each `points[i] = [ai, bi]` represents that a point exists at `(ai, bi)`. A point is valid if it shares the same x-coordinate... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert nearestValidPoint(3, 4, [[2,3]]) == -1\", \"assert nearestValidPoint(5, 5, [[5,2],[3,5],[1,1],[5,5]]) == 0\", \"assert nearestValidPoint(7, 8, [[7,2],[3,8],[6,6],[1,1]]) == 1\", \"assert nearestValidPoint(2, 2, [[2,3],[1,2],[3,2],[2,1]]) == 0\", \"assert nea... | {
"split": "train",
"index": 79781,
"acecode_id": "evol_15127",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_complete_alphabet(s: str) -> bool` that checks if a given string is a complete alphabet. A complete alphabet is defined as a sentence that contains every letter of the English alphabet at least once, regardless of the case. The input string may contain ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_complete_alphabet('The quick brown fox jumps over the lazy dog') == True\", \"assert is_complete_alphabet('Pack my box with five dozen liquor jugs') == True\", \"assert is_complete_alphabet('Sphinx of black quartz, judge my vow') == True\", \"assert is_co... | {
"split": "train",
"index": 79782,
"acecode_id": "evol_4345",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple text-based interactive shell that can handle basic commands. Your function should simulate a shell environment where predefined variables (like `__grains__`, `__opts__`, `__pillar__`, and `__salt__`) can be accessed. The shell should have a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simple_shell('echo __grains__') == \\\"{'os': 'Linux', 'version': '5.4.0'}\\\"\", \"assert simple_shell('echo __opts__') == \\\"{'verbose': True, 'log_level': 'info'}\\\"\", \"assert simple_shell('echo __pillar__') == \\\"{'environment': 'production'}\\\"\",... | {
"split": "train",
"index": 79783,
"acecode_id": "bigcode_python_fns_27819",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a three-dimensional binary tree, design an algorithm that identifies and marks all nodes holding a specified value. The function should return the root of the tree after marking the nodes. Each node in the tree is represented as a class with properties for its value, left... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_and_mark(TreeNode(1), 1).marked == True\", \"assert search_and_mark(TreeNode(1), 2).marked == False\", \"assert search_and_mark(TreeNode(2), 2).marked == True\", \"assert search_and_mark(TreeNode(3), 3).marked == True\", \"assert search_and_mark(TreeN... | {
"split": "train",
"index": 79784,
"acecode_id": "evol_11227",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that takes a list of strings as input and returns a set of unique strings sorted in ascending order. The function should remove any duplicate strings from the input list and return the sorted result as a set. Write a Python fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_sorted_set(['b', 'a', 'c', 'a']) == {'a', 'b', 'c'}\", \"assert unique_sorted_set(['apple', 'banana', 'apple', 'orange']) == {'apple', 'banana', 'orange'}\", \"assert unique_sorted_set(['x', 'y', 'z', 'x', 'y']) == {'x', 'y', 'z'}\", \"assert unique_s... | {
"split": "train",
"index": 79785,
"acecode_id": "oss_1912",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates the contents of a `setup.py` file for a Python package aimed at statistical analysis. The function should return a dictionary containing the necessary metadata for the package, including the following fields: version, descr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_setup_config() == {'version': '0.1.2', 'description': 'A data structure for accurate on-line accumulation of rank-based statistics.', 'long_description': 'This package provides a data structure for rank-based statistics.', 'url': 'https://github.com... | {
"split": "train",
"index": 79786,
"acecode_id": "oss_25636",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates connecting to a server via SSH using a simple retry mechanism. The function should take the following parameters: hostname (string), username (string), retries (integer), key_filename (string or None), and auth_timeout (int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert connect_to_server('example.com', 'user1', 3, None, 60) == 'Connection successful'\", \"assert connect_to_server('example.com', 'user1', 0, None, 60) == 'Connection failed'\", \"assert connect_to_server('example.com', 'user2', 5, 'key.pem', 120) == 'Connectio... | {
"split": "train",
"index": 79787,
"acecode_id": "bigcode_python_fns_30202",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the average value of a specified numeric column in a dataset represented as a list of dictionaries. Each dictionary represents a row in the dataset, where the keys are the column names and the values are the corresponding cell values. Implement a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average([{'Name': 'John', 'Age': '25', 'Salary': '50000'}, {'Name': 'Alice', 'Age': '30', 'Salary': '60000'}, {'Name': 'Bob', 'Age': '28', 'Salary': '55000'}, {'Name': 'Eve', 'Age': '35', 'Salary': '62000'}], 'Age') == 29.5\", \"assert calculate_av... | {
"split": "train",
"index": 79788,
"acecode_id": "oss_3694",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the weights of different items. Your task is to implement a function `calculate_weights_summary(weights)` that computes the total weight of all items, the average weight, and the maximum weight among the items. The function should r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_weights_summary([10, 20, 30]) == {'TotalWeight': 60, 'AverageWeight': 20.0, 'MaxWeight': 30}\", \"assert calculate_weights_summary([0, 0, 0]) == {'TotalWeight': 0, 'AverageWeight': 0.0, 'MaxWeight': 0}\", \"assert calculate_weights_summary([-5, -10... | {
"split": "train",
"index": 79789,
"acecode_id": "oss_32393",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple event processor that handles a queue of events. You need to create a class called `EventProcessor` that has the following functionality:\n\n1. The class should have an instance variable `event_queue` that stores a list of events.\n2. Im... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert EventProcessor().add_event('event1') is None\", \"assert EventProcessor().add_event('event2') is None\", \"assert EventProcessor().add_event('event3') is None\", \"assert EventProcessor().add_event('event4') is None\", \"assert EventProcessor().add_event('ev... | {
"split": "train",
"index": 79790,
"acecode_id": "oss_3621",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a given monetary value from one currency to another based on predefined exchange rates. The function should take three parameters: the monetary_value (a float), originating_currency (a string), and target_currency (a string). The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert currency_conversion(10, 'USD', 'GBP') == 7.5\", \"assert currency_conversion(10, 'USD', 'EUR') == 8.5\", \"assert currency_conversion(10, 'GBP', 'USD') == 13.3\", \"assert currency_conversion(10, 'EUR', 'GBP') == 8.8\", \"assert currency_conversion(0, 'USD',... | {
"split": "train",
"index": 79791,
"acecode_id": "evol_30407",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to find the maximum sum of a contiguous subarray of a specified size from a given list of integers. The function should take a list of integers and an integer representing the size of the subarray as input, and return the maximum sum ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxSumSubarray([1, 2, 3, 4, 5], 2) == 9\", \"assert maxSumSubarray([-1, -2, -3, -4], 2) == -3\", \"assert maxSumSubarray([10, 20, 30, 40], 3) == 90\", \"assert maxSumSubarray([1, 1, 1, 1, 1], 1) == 1\", \"assert maxSumSubarray([1, 2, 3, 4, 5], 5) == 15\", \"... | {
"split": "train",
"index": 79792,
"acecode_id": "oss_3596",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string identifier for a machine learning application instance as input. The function should return a message indicating that some magic is being performed on the specified instance. The return message should be formatted as '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ml_app_instance_magic('instance_1') == 'Performing magic on instance: instance_1'\", \"assert ml_app_instance_magic('test_id_123') == 'Performing magic on instance: test_id_123'\", \"assert ml_app_instance_magic('app_instance_42') == 'Performing magic on ins... | {
"split": "train",
"index": 79793,
"acecode_id": "bigcode_python_fns_14670",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a vocabulary list represented as a list of strings. Your task is to implement a function `add_pattern(vocabulary: List[str], pattern: List[List[str]]) -> None`. This function should raise a ValueError if the `pattern` provided is empty (i.e., it contains no sub-li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_pattern(['apple', 'banana'], [['fruit']]) == None\", \"assert add_pattern(['car', 'bus'], [['vehicle', 'transport']]) == None\", \"assert add_pattern(['cat', 'dog'], [['animal']]) == None\", \"assert add_pattern(['x', 'y', 'z'], [['letter']]) == None\", ... | {
"split": "train",
"index": 79794,
"acecode_id": "bigcode_python_fns_33548",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given the definition of a binary tree node, write a function `sumOfNodes(root)` that calculates the sum of all nodes in a binary tree. The root of the binary tree is given as input to the function. If the tree is empty (i.e., root is None), return 0. The function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sumOfNodes(TreeNode(1, TreeNode(2), TreeNode(3))) == 6\", \"assert sumOfNodes(TreeNode(0)) == 0\", \"assert sumOfNodes(TreeNode(5, TreeNode(3, TreeNode(1), TreeNode(4)), TreeNode(7))) == 20\", \"assert sumOfNodes(TreeNode(10, TreeNode(5), TreeNode(15))) == 3... | {
"split": "train",
"index": 79795,
"acecode_id": "oss_8408",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a floating-point number in base 10 and an integer base (ranging from 2 to 36), write a function that converts the number into its string representation in the specified base. The function should handle both integer and fractional parts of the number correctly. If the numb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert encode_into_any_base(10.5, 16, '') == 'A.8'\", \"assert encode_into_any_base(255.75, 10, '') == '255.75'\", \"assert encode_into_any_base(1.0, 36, '') == '1'\", \"assert encode_into_any_base(100.0, 8, '') == '144'\", \"assert encode_into_any_base(15.25, 4, '... | {
"split": "train",
"index": 79796,
"acecode_id": "bigcode_python_fns_36301",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_random_number(lower_limit: int, upper_limit: int) -> float` that generates a random floating-point number within the specified interval [lower_limit, upper_limit). The function should ensure that the generated number is greater than or equal to th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert 5 <= generate_random_number(5, 20) < 20\", \"assert 5 <= generate_random_number(5, 20) < 20\", \"assert 5 <= generate_random_number(5, 20) < 20\", \"assert 5 <= generate_random_number(5, 20) < 20\", \"assert 5 <= generate_random_number(5, 20) < 20\", \"asser... | {
"split": "train",
"index": 79797,
"acecode_id": "evol_32251",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a function 'func' that takes a callable and returns a decorator named 'Check'. Implement a function 'create_check' that takes 'func' as an argument and returns a 'Check' object. The 'Check' object should be callable and when called, it should return True if the provided c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_check(lambda x: x > 0)(5) == True\", \"assert create_check(lambda x: isinstance(x, str))(\\\"hello\\\") == True\", \"assert create_check(lambda x: x == x)(10) == True\", \"assert create_check(lambda x: x % 2 == 0)(4) == True\", \"assert create_check(l... | {
"split": "train",
"index": 79798,
"acecode_id": "bigcode_python_fns_21015",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `shuffle_list` that randomly shuffles the elements of the list and returns the shuffled list. The original list should not be modified.\nPlease reason step by step, then write a self-contained Python solution. Give your final progr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shuffle_list([1, 2, 3]) != [1, 2, 3]\", \"assert sorted(shuffle_list([4, 5, 6])) == [4, 5, 6]\", \"assert len(shuffle_list([7, 8, 9, 10])) == 4\", \"assert shuffle_list([1]) == [1]\", \"assert shuffle_list([]) == []\", \"assert shuffle_list([10, 20, 30]) != ... | {
"split": "train",
"index": 79799,
"acecode_id": "evol_30182",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.