data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple pagination system for a list of items. The pagination system should allow you to control the number of items displayed per page, and it should also allow you to determine which items are currently displayed based on the page number. You... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert paginate_items([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 3, 1) == [1, 2, 3]\", \"assert paginate_items([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 3, 2) == [4, 5, 6]\", \"assert paginate_items([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 3, 3) == [7, 8, 9]\", \"assert paginate_items([1, 2,... | {
"split": "train",
"index": 65100,
"acecode_id": "oss_15898",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Construct a function that detects a specific pattern within a string, where an 'x' is immediately followed by at least three 'w's. The function should return the starting indices of all occurrences of this pattern. The function should be case insensitive and must ignore any spe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_pattern('xwww') == [0]\", \"assert find_pattern('XWWW') == [0]\", \"assert find_pattern('xwwwwxwww') == [0, 5]\", \"assert find_pattern('abcxwwwxyz') == [3]\", \"assert find_pattern('x w w w') == [0]\", \"assert find_pattern('xxwww') == [1]\", \"assert ... | {
"split": "train",
"index": 65101,
"acecode_id": "evol_4402",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a graph represented as an adjacency list where each node is an integer and the edges connect these nodes. Your task is to implement a function that determines the connected components of the graph. A connected component is a subset of the graph where there is a pa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert connected_components([[0, 1], [1, 2], [3, 4]]) == [[0, 1, 2], [3, 4]]\", \"assert connected_components([]) == []\", \"assert connected_components([[1, 2], [2, 3], [4, 5], [5, 6], [7, 8], [8, 9]]) == [[1, 2, 3], [4, 5, 6], [7, 8, 9]]\", \"assert connected_com... | {
"split": "train",
"index": 65102,
"acecode_id": "bigcode_python_fns_15597",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `match_string(s: str) -> bool` that checks if a given string `s` matches the following criteria: 1. The string starts with 'abc'. 2. Immediately following 'abc', there should be a 3-digit number. 3. After the 3-digit number, there should be a combination of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert match_string('abc123AbcD') == True\", \"assert match_string('abc123ABcd') == True\", \"assert match_string('abc123abCD') == True\", \"assert match_string('abc123ABcd') == True\", \"assert match_string('abc123AB') == False\", \"assert match_string('abc1234ABc... | {
"split": "train",
"index": 65103,
"acecode_id": "evol_16344",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_valid_html(doc: str) -> bool` that checks if a given string `doc` is a valid HTML document. The function should return `True` if the HTML is well-formed and `False` otherwise. You can use any HTML parsing library of your choice to validate the document,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_html('<!DOCTYPE html><html><head><title>Test</title></head><body><p>Hello World</p></body></html>') == True\", \"assert is_valid_html('<html><body><h1>Header</h1><p>Paragraph</p></html>') == False\", \"assert is_valid_html('<!DOCTYPE html><html><bod... | {
"split": "train",
"index": 65104,
"acecode_id": "evol_9877",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the square of a given number `p` and checks if the absolute difference between this square and another number `n` is less than 0.0001. If the difference is within the threshold, return the square of `p`. However, if th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_square(2.0, 4.0) == 4.0\", \"assert find_square(3.0, 9.0) == 9.0\", \"assert find_square(10.0, 100.0) == 100.0\", \"assert find_square(5.0, 25.0) == 25.0\", \"assert find_square(7.0, 49.0) == 49.0\", \"assert find_square(1.0, 1.0) == 1.0\", \"assert fin... | {
"split": "train",
"index": 65105,
"acecode_id": "oss_29389",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing source code, write a function `find_print_statements(src_code: str) -> List[str]` that retrieves all lines containing the word 'print'. The function should return a list of these lines. The input string may represent large source code, so ensure that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_print_statements('if x == 1:\\\\n print(\\\"hello\\\")\\\\nif y == 2:\\\\n print(\\\"world\\\")\\\\n print(\\\"!\\\")') == [' print(\\\"hello\\\")', ' print(\\\"world\\\")', ' print(\\\"!\\\")']\", \"assert find_print_statements('print... | {
"split": "train",
"index": 65106,
"acecode_id": "evol_12542",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of labels and a dataset, and creates a training set for a machine learning model. The function should take in three parameters: a list of strings `labels`, a list of integers `data`, and a string `alias_ke... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_dataset(['cat', 'dog', 'cat', 'bird'], [1, 2, 3, 4], 'animal_set') == {'alias_key': 'animal_set', 'data': [1, 2, 3, 4], 'num_labels': 3}\", \"assert process_dataset(['apple', 'banana', 'apple'], [10, 20], 'fruit_set') == {'alias_key': 'fruit_set', 'd... | {
"split": "train",
"index": 65107,
"acecode_id": "oss_4517",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates a user's password based on certain criteria. Your function should take in the user's input password as a string and return a boolean value indicating whether the password is valid or not. The password must meet the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_password('Password1') == True\", \"assert validate_password('passw0rd') == False\", \"assert validate_password('PASSWORD') == False\", \"assert validate_password('password') == False\", \"assert validate_password('Pass word1') == False\", \"assert v... | {
"split": "train",
"index": 65108,
"acecode_id": "oss_6239",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list `correlation_matrix` containing float values that represent the correlation coefficients between features, write a function `generate_heatmap(correlation_matrix: List[List[float]]) -> List[List[str]]` that generates a textual representation of a heatmap, where e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_heatmap([[1.0]]) == [['1.00']]\", \"assert generate_heatmap([[0.5, -0.5], [-0.3, 0.8]]) == [['0.50', '-0.50'], ['-0.30', '0.80']]\", \"assert generate_heatmap([[0.0, 0.0], [0.0, 0.0]]) == [['0.00', '0.00'], ['0.00', '0.00']]\", \"assert generate_hea... | {
"split": "train",
"index": 65109,
"acecode_id": "bigcode_python_fns_10400",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a matrix multiplication operation. Your function should take two input matrices and return the result of their multiplication. The function signature should be: `def matrix_multiply(matrix1, matrix2):`. Where `matrix... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert matrix_multiply([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[19, 22], [43, 50]]\", \"assert matrix_multiply([[1]], [[2]]) == [[2]]\", \"assert matrix_multiply([[1, 2]], [[3], [4]]) == [[11]]\", \"assert matrix_multiply([[1, 0], [0, 1]], [[5, 5], [10, 10]]) == [[... | {
"split": "train",
"index": 65110,
"acecode_id": "oss_37663",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes a list of integers and returns a new list containing only the even integers from the input list in the same order they appeared. If there are no even integers, return an empty list. Implement the function `filter_even_numbers(nu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([1]) == []\", \"assert filter_even_numbers([2]) == [2]\", \"assert filter_even_numbers([1, 2, 3]) == [2]\", \"assert filter_even_numbers([1, 3, 5]) == []\", \"assert filter_even_numbers([2, 4, 6])... | {
"split": "train",
"index": 65111,
"acecode_id": "bigcode_python_fns_44732",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves the username associated with a given unique identifier (sciper). The function should simulate a database or directory search and return the username for a provided sciper. The usernames are stored in a predefined dictionary... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_username('123456') == 'john_doe'\", \"assert get_username('654321') == 'jane_smith'\", \"assert get_username('999999') == 'User not found'\", \"assert get_username('123123') == 'User not found'\", \"assert get_username('234234') == 'User not found'\", \"... | {
"split": "train",
"index": 65112,
"acecode_id": "bigcode_python_fns_47328",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of class objects, where each class object is represented as a dictionary containing the following keys: 'key', 'name', 'description', 'accentChampionImage', and 'bonuses'. The 'bonuses' key is an array of dictionaries, each containing 'needed' (an integer) ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classes_dict([{'key': 'robot', 'name': 'Blitzcrank', 'description': 'A robot', 'accentChampionImage': 'url1', 'bonuses': [{'needed': 1, 'effect': 'effect1'}, {'needed': 3, 'effect': 'effect2'}]}]) == {'robot': 3}\", \"assert classes_dict([{'key': 'warrior', ... | {
"split": "train",
"index": 65113,
"acecode_id": "bigcode_python_fns_9782",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Create a function in Python that takes in two arguments, n and m, representing the number of columns and rows respectively in a 2D array. The function should initialize a 2D array of size n x m, filled with random integers ranging from 1 to 100. Additionally, each row of the 2D... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert new_func(6, 8) is not None\", \"assert new_func(0, 5) == 'Error: Both arguments must be positive integers.'\", \"assert new_func(5, -3) == 'Error: Both arguments must be positive integers.'\", \"assert new_func(10, 10) is not None\", \"assert new_func(1, 1) ... | {
"split": "train",
"index": 65114,
"acecode_id": "evol_4497",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "LeetCode is planning to maximize its total capital by completing up to k unique projects before its Initial Public Offering (IPO). Each project has a profit Pi and requires a minimum capital Ci to start. Given your initial capital W, implement a function that selects and comple... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findMaximizedCapital(2, 0, [1, 2, 3], [0, 1, 1]) == 4\", \"assert findMaximizedCapital(1, 2, [5, 10, 15], [1, 1, 1]) == 17\", \"assert findMaximizedCapital(0, 0, [1, 2, 3], [0, 0, 0]) == 0\", \"assert findMaximizedCapital(2, 5, [5, 10, 15], [1, 2, 3]) == 30\... | {
"split": "train",
"index": 65115,
"acecode_id": "evol_19948",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates the first n Fibonacci numbers in a list. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the two preceding ones. Your function should take an int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_fibonacci(0) == []\", \"assert generate_fibonacci(1) == [0]\", \"assert generate_fibonacci(2) == [0, 1]\", \"assert generate_fibonacci(3) == [0, 1, 1]\", \"assert generate_fibonacci(4) == [0, 1, 1, 2]\", \"assert generate_fibonacci(5) == [0, 1, 1, 2... | {
"split": "train",
"index": 65116,
"acecode_id": "oss_37202",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function called `odd_squares` that returns a list containing the squares of all odd numbers from 0 to 10 (inclusive).\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block."
}
] | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert odd_squares() == [1, 9, 25, 49, 81]\", \"assert odd_squares() == [1, 9, 25, 49, 81]\", \"assert odd_squares() == [1, 9, 25, 49, 81]\", \"assert odd_squares() == [1, 9, 25, 49, 81]\", \"assert odd_squares() == [1, 9, 25, 49, 81]\", \"assert odd_squares() == [... | {
"split": "train",
"index": 65117,
"acecode_id": "evol_11171",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `text`, implement a function that removes all non-alphabetic characters from the string and returns the cleaned string. The function should maintain the order of the alphabetic characters and retain spaces between words. For example, if the input string is 'Hello... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert keep_text_characters('Python3.9 is great!') == 'Python is great'\", \"assert keep_text_characters('12345') == ''\", \"assert keep_text_characters('') == ''\", \"assert keep_text_characters('a1b2c3') == 'abc'\", \"assert keep_text_characters('No special chars... | {
"split": "train",
"index": 65118,
"acecode_id": "bigcode_python_fns_40781",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the creation of a client for a cloud service. The function should accept two parameters: `name`, which is a string representing the name of the cloud service resource, and `func`, which is a callable that simulates the crea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_client('EC2', lambda name, region_name, aws_access_key_id, aws_secret_access_key: (name, region_name, aws_access_key_id, aws_secret_access_key)) == ('EC2', 'us-west-2', 'dummy_access_key', 'dummy_secret_key')\", \"assert create_client('S3', lambda nam... | {
"split": "train",
"index": 65119,
"acecode_id": "bigcode_python_fns_5802",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that accepts two lists of integers and returns a list of the common elements between the two lists. The function should handle lists of varying lengths and should be optimized for performance to handle large input sizes. The order of the common elements in the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert common_elements([1, 2, 3], [4, 5, 6]) == []\", \"assert common_elements([1, 2, 3, 4], [2, 3, 5, 6]) == [2, 3]\", \"assert common_elements([10, 20, 30], [30, 40, 50]) == [30]\", \"assert common_elements([1, 2, 3, 4, 5], [5, 6, 7, 8, 9]) == [5]\", \"assert com... | {
"split": "train",
"index": 65120,
"acecode_id": "evol_29330",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the maximum sum of a contiguous subarray within a given list of integers. The subarray must contain at least one element. Write a function `maxSubarraySum` that takes a list of integers as input and returns the maximum... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maxSubarraySum([-2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6\", \"assert maxSubarraySum([-2, -3, 4, -1, -2, 1, 5, -3]) == 7\", \"assert maxSubarraySum([5]) == 5\", \"assert maxSubarraySum([-1]) == -1\", \"assert maxSubarraySum([3, -2, 5, -1]) == 6\", \"assert maxSub... | {
"split": "train",
"index": 65121,
"acecode_id": "oss_15417",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python decorator named `timed_logger` that measures the execution time of a function. The decorator should log the elapsed time in milliseconds using the `logging` module, including the function name and its execution time. Your decorator should b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert timed_logger(lambda: sum(range(100000)))() is not None\", \"assert timed_logger(lambda: ''.join(['a' for _ in range(10000)]))() is not None\", \"assert timed_logger(lambda: [x**2 for x in range(1000)])() is not None\", \"assert timed_logger(lambda: len('Hell... | {
"split": "train",
"index": 65122,
"acecode_id": "oss_32788",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `create_person_xml` that generates an XML representation of a person's details. The function should take in the following parameters: full_name (string), age (integer), occupation (string), street (string), city (string), state (string), and zip (string). The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_person_xml('Jane Smith', 27, 'Data Scientist', '123 Main St', 'Springfield', 'IL', '62701') == '<person><full_name>Jane Smith</full_name><age>27</age><occupation>Data Scientist</occupation><address><street>123 Main St</street><city>Springfield</city><... | {
"split": "train",
"index": 65123,
"acecode_id": "evol_32073",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that outputs a string in a specific format. The function, `formatText`, should take a single string input and return the string wrapped in asterisks ('*'). For example, if the input string is 'hello', the output should be '*hello*'. Your ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert formatText('hello') == '*hello*'\", \"assert formatText('') == '**'\", \"assert formatText('LeetCode') == '*LeetCode*'\", \"assert formatText('test string') == '*test string*'\", \"assert formatText('Python3') == '*Python3*'\", \"assert formatText('12345') =... | {
"split": "train",
"index": 65124,
"acecode_id": "bigcode_python_fns_48532",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that determines if a given positive integer is a perfect number. A perfect number is a number that is equal to the sum of its proper divisors (excluding itself). For example, 6 is a perfect number because its divisors are 1, 2, and 3, and 1 + 2 + 3 = 6. The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_perfect(6) == True\", \"assert is_perfect(28) == True\", \"assert is_perfect(496) == True\", \"assert is_perfect(8128) == True\", \"assert is_perfect(12) == False\", \"assert is_perfect(20) == False\", \"assert is_perfect(1) == False\", \"assert is_perfec... | {
"split": "train",
"index": 65125,
"acecode_id": "evol_23190",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and reverses it recursively without using any built-in functions, methods, or loops. The function should correctly handle both regular and unicode characters.\nPlease reason step by step, then write a self-contained Python solut... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_string('hello') == 'olleh'\", \"assert reverse_string('world') == 'dlrow'\", \"assert reverse_string('') == ''\", \"assert reverse_string('a') == 'a'\", \"assert reverse_string('abc') == 'cba'\", \"assert reverse_string('racecar') == 'racecar'\", \"a... | {
"split": "train",
"index": 65126,
"acecode_id": "evol_9809",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing appointments for a medical clinic. Implement a function `manage_appointments` that takes a list of operations and returns the resulting schedule for a specific date. Each operation can be one of the following: 'add', 'remove', 'reschedule', or 'get_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_appointments([('add', '2023-10-01', '10:00', 'John Doe'), ('add', '2023-10-01', '11:00', 'Jane Smith')], '2023-10-01') == [('10:00', 'John Doe'), ('11:00', 'Jane Smith')]\", \"assert manage_appointments([('add', '2023-10-01', '10:00', 'John Doe'), ('r... | {
"split": "train",
"index": 65127,
"acecode_id": "oss_35154",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given an array `nums` consisting of `n` elements, return the array rotated to the right by one position. This means that the last element will move to the first position, and all other elements will be shifted to the right by one index. For example, if the input is [1, 2, 3], t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rotateArray([2, 5, 1, 3, 4, 7]) == [7, 2, 5, 1, 3, 4]\", \"assert rotateArray([1, 2, 3, 4, 4, 3, 2, 1]) == [1, 1, 2, 3, 4, 4, 3, 2]\", \"assert rotateArray([1, 1, 2, 2]) == [2, 1, 1, 2]\", \"assert rotateArray([10]) == [10]\", \"assert rotateArray([1, 2]) ==... | {
"split": "train",
"index": 65128,
"acecode_id": "evol_35068",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks if a request is authenticated based on specified authentication requirements. The function should take a dictionary with the following keys: 'auth_required' (a boolean indicating whether authentication is required for the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert authenticate({'auth_required': False, 'secret_key': 'my_secret', 'request_obj': {}}) == True\", \"assert authenticate({'auth_required': True, 'secret_key': 'my_secret', 'request_obj': {'Authorization': 'my_secret'}}) == True\", \"assert authenticate({'auth_r... | {
"split": "train",
"index": 65129,
"acecode_id": "oss_12592",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a warning message. The function should take any number of string arguments representing warning messages and an optional keyword argument 'fileobj' to specify where the warning should be printed. If 'fileobj' is not provide... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_warning('Disk space low') == None\", \"assert generate_warning('CPU usage high', fileobj=sys.stdout) == None\", \"assert generate_warning('Memory leak detected') == None\", \"assert generate_warning('Unauthorized access attempt', fileobj=sys.stderr)... | {
"split": "train",
"index": 65130,
"acecode_id": "bigcode_python_fns_15578",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a player's exhaustion level represented as an integer. The player has a chance to create a fire, which can reduce their exhaustion. When creating a fire, the player expends a random amount of labor between 5 and 10. After expending labor, there is a 75% chance tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_fire(20) == (13, True)\", \"assert make_fire(15) == (8, True)\", \"assert make_fire(10) == (3, True)\", \"assert make_fire(0) == (0, False)\", \"assert make_fire(50) == (43, True)\", \"assert make_fire(30) == (23, True)\", \"assert make_fire(25) == (18,... | {
"split": "train",
"index": 65131,
"acecode_id": "bigcode_python_fns_48066",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given an integer length and an integer start_position, implement a function that constructs an array of a specified length using the sequence [7, 11, 19, 22]. The elements of the array should be populated in a circular manner starting from the specified start_position. The func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert populate_array(4, 0) == [7, 11, 19, 22]\", \"assert populate_array(4, 1) == [11, 19, 22, 7]\", \"assert populate_array(4, 2) == [19, 22, 7, 11]\", \"assert populate_array(4, 3) == [22, 7, 11, 19]\", \"assert populate_array(1, 0) == [7]\", \"assert populate_a... | {
"split": "train",
"index": 65132,
"acecode_id": "evol_35712",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given two dictionaries with unique key-value pairs, implement a function that merges these two dictionaries into one. If there are any overlapping keys, the values from the second dictionary should overwrite those from the first dictionary. Your function should return the merge... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_dicts({'a': 1, 'b': 2}, {'b': 3, 'c': 4}) == {'a': 1, 'b': 3, 'c': 4}\", \"assert merge_dicts({}, {'x': 5, 'y': 6}) == {'x': 5, 'y': 6}\", \"assert merge_dicts({'key1': 10}, {}) == {'key1': 10}\", \"assert merge_dicts({'name': 'Alice'}, {'name': 'Bob',... | {
"split": "train",
"index": 65133,
"acecode_id": "evol_18871",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `insertion_sort` that takes a list of integers and returns a new list containing the integers sorted in ascending order using the insertion sort algorithm. Do not modify the original list. The input list may contain duplicate values.\nPlease reason s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insertion_sort([4, 2, 6, 7, 1]) == [1, 2, 4, 6, 7]\", \"assert insertion_sort([5, 3, 8, 6, 2]) == [2, 3, 5, 6, 8]\", \"assert insertion_sort([1, 1, 1, 1]) == [1, 1, 1, 1]\", \"assert insertion_sort([10, -1, 2, 0]) == [-1, 0, 2, 10]\", \"assert insertion_sort... | {
"split": "train",
"index": 65134,
"acecode_id": "evol_11486",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that filters a list of strings based on a keyword search and case sensitivity options. The function should take three parameters: a list of strings, a keyword (string), and a boolean indicating whether the search should be case sensitive. The function should re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_strings(['This is Python', 'Python is fun', 'Hello world'], 'python', False) == ['This is Python', 'Python is fun']\", \"assert filter_strings(['This is Python', 'Python is fun', 'Hello world'], None, True) == []\", \"assert filter_strings([], 'Python... | {
"split": "train",
"index": 65135,
"acecode_id": "evol_32667",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of image file paths represented as strings. Your task is to implement a function that takes this list of paths and returns the number of successfully deleted images. The function should simulate the deletion of each image and count how many deletions were s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_deleted_images(['image1.jpg', 'image_delete2.png', 'image3.gif', 'delete_image4.bmp']) == 2\", \"assert count_deleted_images(['file1.txt', 'file2.txt', 'file3.txt']) == 0\", \"assert count_deleted_images(['delete_this_image.jpg', 'keep_this_image.png']... | {
"split": "train",
"index": 65136,
"acecode_id": "bigcode_python_fns_32711",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that parses metadata from a list of strings and organizes it into a dictionary. The metadata is in the form of key-value pairs, where the key is separated from the value by a double colon (::). Each string in the list represents a single m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_metadata(['Key1 :: Value1']) == {'Key1': 'Value1'}\", \"assert parse_metadata(['KeyA :: ValueA', 'KeyB :: ValueB']) == {'KeyA': 'ValueA', 'KeyB': 'ValueB'}\", \"assert parse_metadata(['Name :: John Doe', 'Age :: 30']) == {'Name': 'John Doe', 'Age': '30... | {
"split": "train",
"index": 65137,
"acecode_id": "oss_22413",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `identify_binary(lst)` that takes a list of elements as input and returns a new list containing only the binary values (0 and 1) present in the input list. The function should include both integer and boolean representations of binary values (i.e., True sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert identify_binary([0, 0, 1, 1, 2, 3]) == [0, 0, 1, 1]\", \"assert identify_binary([True, False, True]) == [1, 0, 1]\", \"assert identify_binary([]) == []\", \"assert identify_binary([3, 5, 7]) == []\", \"assert identify_binary([False, 1, 2, True]) == [0, 1, 1]... | {
"split": "train",
"index": 65138,
"acecode_id": "evol_610",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, each representing a gene name followed by a series of numerical values separated by tabs. Your task is to parse this input and create a list of dictionaries where each dictionary represents a gene. Each dictionary should have the keys 'gene_name... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_gene_data(['GENE1\\\\t1.0\\\\t2.0\\\\t3.0', 'GENE2\\\\t4.0\\\\t5.0\\\\t6.0']) == [{'gene_name': 'GENE1', 'values': [1.0, 2.0, 3.0]}, {'gene_name': 'GENE2', 'values': [4.0, 5.0, 6.0]}]\", \"assert parse_gene_data(['GENE3\\\\t7.0\\\\t8.0', 'GENE4\\\\t9.0... | {
"split": "train",
"index": 65139,
"acecode_id": "bigcode_python_fns_31031",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary of student names and their ages, implement a function `create_student_hash_map(students)` that takes the dictionary as an input and returns a hash map (dictionary in Python) mapping each student name to their respective age.\nPlease reason step by step, then ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_student_hash_map({'Alice': 20, 'Bob': 22, 'Charlie': 24}) == {'Alice': 20, 'Bob': 22, 'Charlie': 24}\", \"assert create_student_hash_map({'Tom': 30, 'Jerry': 28}) == {'Tom': 30, 'Jerry': 28}\", \"assert create_student_hash_map({'Eve': 18}) == {'Eve': ... | {
"split": "train",
"index": 65140,
"acecode_id": "evol_15611",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of tuples, `keys` and `values`, write a function `create_nested_dict(keys, values)` that constructs a nested dictionary from the provided keys and values. Each tuple in the `keys` list contains a pair representing a main key and a subkey, and each tuple in the `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_nested_dict([('key1','subkey1'), ('key2','subkey2')], [('value1','subvalue1'), ('value2','subvalue2')]) == {'key1': {'subkey1': 'subvalue1'}, 'key2': {'subkey2': 'subvalue2'}}\", \"assert create_nested_dict([('key1','subkey1')], [('value1','subvalue1'... | {
"split": "train",
"index": 65141,
"acecode_id": "evol_28461",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer `n`, return the n-th positive integer that does not contain the digit '7'. The sequence starts from 1 and skips any integer that includes the digit '7'. For example, the sequence is 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, ..., and so on. Note that 1 will be con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findNthWithoutSeven(1) == 1\", \"assert findNthWithoutSeven(2) == 2\", \"assert findNthWithoutSeven(3) == 3\", \"assert findNthWithoutSeven(4) == 4\", \"assert findNthWithoutSeven(5) == 5\", \"assert findNthWithoutSeven(6) == 6\", \"assert findNthWithoutSeve... | {
"split": "train",
"index": 65142,
"acecode_id": "evol_26818",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a line of text. Your task is to write a function that takes this list as input and returns a new list where each string is reversed. Implement a function named `reverse_lines(lines: List[str]) -> List[str]` that perf... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_lines(['hello', 'world', 'programming']) == ['olleh', 'dlrow', 'gnimmargorp']\", \"assert reverse_lines(['python', 'is', 'fun']) == ['nohtyp', 'si', 'nuf']\", \"assert reverse_lines(['123', '456', '789']) == ['321', '654', '987']\", \"assert reverse_... | {
"split": "train",
"index": 65143,
"acecode_id": "oss_23706",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates building an HTTP request and generating a response based on the given parameters. Your function should take in a dictionary representing the event of an incoming HTTP request, a context object, and return a dictionary t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_http_request({'httpMethod': 'GET', 'resource': '/api/data'}, None) == {'headers': {}, 'statusCode': 200, 'body': 'No Content'}\", \"assert handle_http_request({'httpMethod': 'POST', 'resource': '/api/data', 'body': 'Sample data'}, None) == {'headers':... | {
"split": "train",
"index": 65144,
"acecode_id": "oss_20109",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer 'depth', implement a function 'draw_square_limit' that simulates drawing a square by dividing it into four triangular sections. The function should return a list of strings representing each triangular section drawn for the given depth. The triangular s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert draw_square_limit(1) == ['Section 1 - Depth: 1', 'Section 2 - Depth: 1', 'Section 3 - Depth: 1', 'Section 4 - Depth: 1']\", \"assert draw_square_limit(2) == ['Section 1 - Depth: 2', 'Section 2 - Depth: 2', 'Section 3 - Depth: 2', 'Section 4 - Depth: 2']\", \... | {
"split": "train",
"index": 65145,
"acecode_id": "bigcode_python_fns_26130",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a python function that checks whether a given number is even or prime. The function should return the next even number if the input is even, and the next prime number if the input is prime. If the number is both even and prime, the function should return the next number t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_and_return(2) == 4\", \"assert check_and_return(3) == 5\", \"assert check_and_return(4) == 6\", \"assert check_and_return(5) == 7\", \"assert check_and_return(6) == 8\", \"assert check_and_return(7) == 11\", \"assert check_and_return(8) == 10\", \"asse... | {
"split": "train",
"index": 65146,
"acecode_id": "evol_34899",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a workflow process that consists of several steps. Each step can either succeed or fail. You need to implement a function `workflow_status(steps: List[Tuple[str, bool]]) -> Dict[str, bool]` that takes a list of tuples where each tuple contains a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert workflow_status([('step1', True), ('step2', True), ('step3', True)]) == {'step1': True, 'step2': True, 'step3': True}\", \"assert workflow_status([('step1', True), ('step2', False), ('step3', True)]) == {'step1': True, 'step2': True, 'step3': False}\", \"ass... | {
"split": "train",
"index": 65147,
"acecode_id": "bigcode_python_fns_11168",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a given string is a palindrome. A palindrome is a string that reads the same backward as forward. The function should ignore case differences. For example, 'Racecar' is considered a palindrome. Write a function named `is_palindrome` that take... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('racecar') == True\", \"assert is_palindrome('Racecar') == True\", \"assert is_palindrome('A man a plan a canal Panama') == False\", \"assert is_palindrome('No lemon no melon') == False\", \"assert is_palindrome('') == True\", \"assert is_palin... | {
"split": "train",
"index": 65148,
"acecode_id": "evol_13693",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function in Python that accepts a list of integers as input. The function should return a new list containing only the integers from the input list that are divisible by 3. If the input list does not contain any integers divisible by 3, the function should return a new ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_and_transform([]) == []\", \"assert filter_and_transform([1, 2, 4]) == [1.0, 1.4142135623730951, 2.0]\", \"assert filter_and_transform([3, 6, 9]) == [3, 6, 9]\", \"assert filter_and_transform([5, 10, 14]) == [2.23606797749979, 3.1622776601683795, 3.74... | {
"split": "train",
"index": 65149,
"acecode_id": "evol_19933",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that determines the total quantity of operational weekdays within a specified interval of two given dates, while excluding the days that fall on weekends. The function should also take into account public holidays, which should also be excluded from the count.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_operational_days('2022-01-01', '2022-01-10', ['2022-01-01']) == 6\", \"assert count_operational_days('2022-11-01', '2022-11-30', ['2022-11-24', '2022-11-25']) == 20\", \"assert count_operational_days('2022-03-01', '2022-03-31', []) == 23\", \"assert co... | {
"split": "train",
"index": 65150,
"acecode_id": "evol_5581",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of integers to return a new list containing only the even numbers from the original list. Write a function `filter_even_numbers(numbers: List[int]) -> List[int]` that takes a list of integers `numbers` as inpu... | 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, 30]) == [10, 20, 30]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert filter_even_... | {
"split": "train",
"index": 65151,
"acecode_id": "oss_30664",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing an inventory entry, such as '6 lobster cakes' or '3 apples', write a function that extracts the quantity, item, and unit from the string. The function should return a dictionary with keys 'amount', 'item', and 'unit'. If the input string does not con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode_inventory_entry('6 lobster cakes') == {'amount': '6', 'item': 'lobster cakes', 'unit': 'lobster cakes'}\", \"assert decode_inventory_entry('3 apples') == {'amount': '3', 'item': 'apples', 'unit': 'apples'}\", \"assert decode_inventory_entry('1 banana'... | {
"split": "train",
"index": 65152,
"acecode_id": "bigcode_python_fns_23577",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing monthly expenditures, return the maximum expenditure recorded in the list. The input list may contain both positive and negative integers, and the output should be a single integer representing the maximum value found in the list. If the li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_expenditure([]) == 0\", \"assert max_expenditure([10, -5, 3, 0]) == 10\", \"assert max_expenditure([-1, -2, -3]) == -1\", \"assert max_expenditure([5, 5, 5, 5]) == 5\", \"assert max_expenditure([100, 200, 300]) == 300\", \"assert max_expenditure([-100, 5... | {
"split": "train",
"index": 65153,
"acecode_id": "bigcode_python_fns_11613",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that finds the shortest substring containing all unique characters in a given string. The function should return a tuple consisting of the shortest substring and its starting and ending indices in the original string. If no such substring exists, return an ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shortest_substring('ab') == ('ab', 0, 1)\", \"assert shortest_substring('a') == ('a', 0, 0)\", \"assert shortest_substring('abcabc') == ('abc', 0, 2)\", \"assert shortest_substring('xyzxyz') == ('xyz', 0, 2)\", \"assert shortest_substring('') == ('', -1, -1)... | {
"split": "train",
"index": 65154,
"acecode_id": "evol_13125",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to calculate the final amount to be paid for a purchase based on the chosen payment method. The function should take the purchase amount (a float) and the payment method (an integer) as input and return the final amount to be paid along w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_payment(100.0, 1) == 'Final Amount: 90.0'\", \"assert calculate_payment(100.0, 2) == 'Final Amount: 95.0'\", \"assert calculate_payment(100.0, 5) == 'Error: Invalid payment method'\", \"assert calculate_payment(250.0, 1) == 'Final Amount: 225.0'\",... | {
"split": "train",
"index": 65155,
"acecode_id": "oss_9233",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `list_a` and `list_b`. Your task is to write a function that compares these two lists and identifies the first position where the elements differ. If the lists are identical, return (True, 0). If they differ, return (False, index) where `ind... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_lists([1, 2, 3], [1, 2, 3]) == (True, 0)\", \"assert compare_lists([1, 2, 3], [1, 2, 4]) == (False, 2)\", \"assert compare_lists([1, 2, 3], [1, 2]) == (False, 2)\", \"assert compare_lists([], []) == (True, 0)\", \"assert compare_lists([1], []) == (Fa... | {
"split": "train",
"index": 65156,
"acecode_id": "bigcode_python_fns_9070",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that identifies antivirus software based on a list of software products and their details. Each product in the list is represented as a dictionary containing keys: 'name', 'publisher', and 'enabled'. Your function should return a list of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_detected_antivirus([{'name': 'Norton Antivirus', 'publisher': 'Norton', 'enabled': True}, {'name': 'Some Other Software', 'publisher': 'Some Publisher', 'enabled': False}]) == [{'name': 'Norton Antivirus', 'version': None, 'publisher': 'Norton', 'enabled... | {
"split": "train",
"index": 65157,
"acecode_id": "bigcode_python_fns_45814",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function that concatenates an array of strings in a specified format defined by a second parameter. The format string may contain placeholders (like {0}, {1}, etc.) that your function will replace with elements from the array. If there are more placeholders than ele... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert placeholder_replacer(['A', 'B', 'C', 'D'], '{0} - {1} - {2} - {3}') == 'A - B - C - D'\", \"assert placeholder_replacer(['first', 'second', 'third', 'fourth'], '{0}, {1}, {2}, and {3}') == 'first, second, third, and fourth'\", \"assert placeholder_replacer([... | {
"split": "train",
"index": 65158,
"acecode_id": "evol_8484",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_fibonacci_number(n)` that accepts an integer n and returns 'yes' if n is a Fibonacci number and 'no' if it isn't. The function should also return 'invalid' if the input is not an integer. The function should efficiently handle larger integers while ensu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_fibonacci_number(0) == 'yes'\", \"assert is_fibonacci_number(1) == 'yes'\", \"assert is_fibonacci_number(2) == 'yes'\", \"assert is_fibonacci_number(3) == 'yes'\", \"assert is_fibonacci_number(5) == 'yes'\", \"assert is_fibonacci_number(8) == 'yes'\", \"a... | {
"split": "train",
"index": 65159,
"acecode_id": "evol_9752",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates listing properties of a target in a version control system. You need to implement a function `list_properties(target: str, revision: int, recurse: bool) -> List[str]` that returns a list of properties for the given target a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list_properties('folder1', 1, True) == ['prop1', 'prop2', 'subfolder1_prop']\", \"assert list_properties('folder1', 1, False) == ['prop1', 'prop2']\", \"assert list_properties('folder2', 2, True) == []\", \"assert list_properties('folder2', -1, False) == []\... | {
"split": "train",
"index": 65160,
"acecode_id": "bigcode_python_fns_23902",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing words separated by spaces. Your task is to implement a function that takes this string as input and returns the number of unique words in the string. A word is defined as a sequence of characters that does not contain spaces. The input string m... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_words('hello, world! hello') == 2\", \"assert count_unique_words('') == 0\", \"assert count_unique_words('The quick brown fox jumps over the lazy dog.') == 8\", \"assert count_unique_words('Hello, world; hello?') == 2\", \"assert count_unique_wo... | {
"split": "train",
"index": 65161,
"acecode_id": "bigcode_python_fns_16840",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts package information from a given configuration dictionary. The configuration dictionary is structured as follows: it contains an 'author', a list of 'packages', a list of 'install_requires' (dependencies), and an opti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_package_info({'author': 'Google Inc.', 'packages': ['package1', 'package2'], 'install_requires': ['dependency1'], 'extras_require': {'docs': ['sphinx'], 'testing': ['pytest']}}) == {'author': 'Google Inc.', 'packages': ['package1', 'package2'], 'depe... | {
"split": "train",
"index": 65162,
"acecode_id": "oss_25670",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes a list of integers and returns a list of their squares. The function should handle both positive and negative integers correctly. Write a function called `square_numbers` that accepts a list of integers as input and returns a ne... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_numbers([-1, 0, 1]) == [1, 0, 1]\", \"assert square_numbers([2, -2, 3]) == [4, 4, 9]\", \"assert square_numbers([10, -10]) == [100, 100]\", \"assert square_numbers([]) == []\", \"assert square_numbers([1, 2, 3, 4, 5]) == [1, 4, 9, 16, 25]\", \"assert ... | {
"split": "train",
"index": 65163,
"acecode_id": "oss_9809",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that handles authorization exceptions for a data source. Given an exception object that contains a message and a boolean indicating if the exception is related to a CKAN resource, your function should return a dictionary containing the ne... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_auth_exception(type('Exception', (object,), {'message': 'Authorization required', 'is_ckan': False})) == {'need_token': 'on', 'recipe_id': None}\", \"assert handle_auth_exception(type('Exception', (object,), {'message': None, 'is_ckan': True})) == {'n... | {
"split": "train",
"index": 65164,
"acecode_id": "bigcode_python_fns_10237",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns a list of unique integers that appear more than once in the input list. The input list can contain both positive and negative integers, and the order of the output list should reflect the order of their first occurrence in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_duplicates([1, 2, 3, 4, 1, 2, 3]) == [1, 2, 3]\", \"assert find_duplicates([5, 5, 5, 5]) == [5]\", \"assert find_duplicates([-1, -2, -3, -1, -2]) == [-1, -2]\", \"assert find_duplicates([10, 20, 30, 40]) == []\", \"assert find_duplicates([1, 2, 3, 2, 1]... | {
"split": "train",
"index": 65165,
"acecode_id": "bigcode_python_fns_48860",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `log_message` that takes a message string `msg` and logs it with a specific log level. The log level will always be 'TRACE'. The function should return a string formatted as 'TRACE: {msg}' where {msg} is the message passed to the func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_message('Hello World!') == 'TRACE: Hello World!'\", \"assert log_message('This is a test message.') == 'TRACE: This is a test message.'\", \"assert log_message('Error occurred!') == 'TRACE: Error occurred!'\", \"assert log_message('Debugging...') == 'TRA... | {
"split": "train",
"index": 65166,
"acecode_id": "bigcode_python_fns_14142",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of strings as input and returns a single string by concatenating all the strings in the list. However, the function should also ensure that the order of the characters in the final string is preserved from their firs... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concat_and_remove_duplicates(['abc', 'def', 'ghi']) == 'abcdefghi'\", \"assert concat_and_remove_duplicates(['aaa', 'bbb', 'ccc']) == 'abc'\", \"assert concat_and_remove_duplicates(['abcd', 'efgh', 'ijkl']) == 'abcdefghijkl'\", \"assert concat_and_remove_dup... | {
"split": "train",
"index": 65167,
"acecode_id": "oss_4817",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates revoking a token based on predefined conditions. The function should accept a token identifier (token_id) and a user role (user_role) as inputs. The function should check if the token_id follows a valid format (it must ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert revoke_token('user_123', 'user') == 'Token user_123 has been successfully revoked.'\", \"assert revoke_token('user_456', 'admin') == 'Token has been successfully revoked.'\", \"assert revoke_token('admin_789', 'admin') == 'Token has been successfully revoked... | {
"split": "train",
"index": 65168,
"acecode_id": "bigcode_python_fns_11740",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a file path formatted in a specific way, derive various components of the file path. The file path will always contain information about a scientific dataset and be structured as follows: '/path/to/data/case/component/variable/stream/start-end.extens... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_smyle('/data/case1/atm/temperature/stream1/20220101-20220131.txt') == {'component': 'atm', 'case': 'case1', 'experiment': 'case1', 'variable': 'temperature', 'frequency': 'daily', 'stream': 'stream1', 'member_id': '1', 'init_year': 2022, 'init_month': ... | {
"split": "train",
"index": 65169,
"acecode_id": "bigcode_python_fns_19013",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function that compares two strings for equality, considering case sensitivity. The function should return True if the strings are exactly equal, and if they are not, return a tuple containing False and a list of indices where the characters differ. Whitespace and punctu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_strings('abc', 'abc') == True\", \"assert compare_strings('abc', 'Abc') == (False, [0])\", \"assert compare_strings('', '') == True\", \"assert compare_strings('test', 'test ') == (False, [4])\", \"assert compare_strings('Python!', 'Python!') == True... | {
"split": "train",
"index": 65170,
"acecode_id": "evol_10149",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given two graphs represented by their node data and edges. Each graph's node data is a list of strings representing the elements of the nodes, and edges are represented as a list of tuples where each tuple consists of two elements indicating a connection between two nod... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_graph_isomorphic(['A', 'B'], [(0, 1)], ['X'], [(0, 0)]) == False\", \"assert is_graph_isomorphic(['A', 'B', 'C'], [(0, 1), (1, 2)], ['X', 'Y', 'W'], [(0, 1), (1, 2)]) == False\", \"assert is_graph_isomorphic(['A', 'B', 'C'], [(0, 1), (1, 2)], ['X', 'Y', '... | {
"split": "train",
"index": 65171,
"acecode_id": "bigcode_python_fns_23744",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to write a function that removes all duplicate integers from the list and returns a new list containing only unique integers in the order they first appeared. You must implement a function called `remove_duplicates(nums: List[int])... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 3, 1, 2, 4]) == [1, 2, 3, 4]\", \"assert remove_duplicates([5, 5, 5, 5, 5]) == [5]\", \"assert remove_duplicates([]) == []\", \"assert remove_duplicates([10, 9, 8, 10, 9]) == [10, 9, 8]\", \"assert remove_duplicates([1, 2, 2, 3, 4, 4... | {
"split": "train",
"index": 65172,
"acecode_id": "bigcode_python_fns_32900",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple text editor functionality. Your editor should support the following operations: clearing the text, moving the cursor position, appending a message, and checking the current text content. You need to implement a function `text_editor_ope... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert text_editor_operations([('append', 'This'), ('moveto', 4), ('append', ' is a test')]) == 'This is a test'\", \"assert text_editor_operations([('append', 'Good'), ('moveto', 3), ('append', 'bye')]) == 'Goodbye'\", \"assert text_editor_operations([]) == ''\", ... | {
"split": "train",
"index": 65173,
"acecode_id": "oss_25888",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of team members and a list of tasks, and returns the number of tasks that can be equally divided among the team members. If the tasks cannot be evenly distributed, return the maximum number of tasks that can be assig... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_tasks_per_member(['Alice', 'Bob', 'Charlie'], ['Task1', 'Task2', 'Task3', 'Task4', 'Task5']) == 1\", \"assert max_tasks_per_member(['Alice', 'Bob'], ['Task1', 'Task2', 'Task3', 'Task4']) == 2\", \"assert max_tasks_per_member(['Alice'], ['Task1', 'Task2']... | {
"split": "train",
"index": 65174,
"acecode_id": "evol_1223",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the dimensions of an irregularly shaped asteroid represented by three positive, non-zero values (a, b, c), write a function that calculates the volume of the asteroid using the formula (4/3) * π * a * b * c. If any of the dimensions are zero or negative, the function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_volume(1, 2, 3) == (4/3) * math.pi * 1 * 2 * 3\", \"assert calculate_volume(5, 5, 5) == (4/3) * math.pi * 5 * 5 * 5\", \"assert calculate_volume(0.5, 1, 1.5) == (4/3) * math.pi * 0.5 * 1 * 1.5\", \"assert calculate_volume(2, 3, 4) == (4/3) * math.p... | {
"split": "train",
"index": 65175,
"acecode_id": "evol_10874",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a list of unique modes for a device. Implement a function `device_modes(modes: List[str], operations: List[Tuple[str, str]]) -> List[bool]` that processes a list of operations on the modes. The function should take two parameters: a list of strings ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert device_modes(['mode1', 'mode2'], [('add', 'mode3'), ('check', 'mode3'), ('remove', 'mode2'), ('check', 'mode2'), ('check', 'mode1')]) == [True, False, True]\", \"assert device_modes([], [('add', 'mode1'), ('check', 'mode1'), ('add', 'mode1'), ('remove', 'mod... | {
"split": "train",
"index": 65176,
"acecode_id": "oss_27404",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the initialization of a graphical user interface (GUI) application. The function should accept two parameters: 'app_name' (a string representing the name of the application) and 'initialize' (a boolean indicating whethe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_gui('MyApp', True) == 'Created new application instance: MyApp'\", \"assert initialize_gui('MyApp', False) == 'Using existing application instance: MyApp'\", \"assert initialize_gui('TestApp', True) == 'Created new application instance: TestApp'\"... | {
"split": "train",
"index": 65177,
"acecode_id": "bigcode_python_fns_4441",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that removes a specified command from a list of existing commands. The commands are stored in a dictionary where the keys are the command names (strings) and the values are their descriptions (strings). Your function should take in th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_command({'help': 'Shows help', 'exit': 'Exits the program'}, 'exit') == {'help': 'Shows help'}\", \"assert remove_command({'help': 'Shows help', 'exit': 'Exits the program'}, 'start') == 'Command `start` does not exist.'\", \"assert remove_command({'l... | {
"split": "train",
"index": 65178,
"acecode_id": "bigcode_python_fns_40735",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `retrieve_json_data(url: str) -> Union[dict, None]` that retrieves data in JSON format from a specified URL. The function should handle potential errors that might arise during the process, returning a dictionary if the retrieval is successful or None if there ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert retrieve_json_data('https://invalid-url.com') is None\", \"assert retrieve_json_data('https://jsonplaceholder.typicode.com/posts/1') is not None\", \"assert retrieve_json_data('https://api.openweathermap.org/data/2.5/weather?q=London&appid=YOUR_API_KEY') is ... | {
"split": "train",
"index": 65179,
"acecode_id": "evol_449",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with extracting entry points from a string representation of a setup configuration. The input string contains various sections and their associated entry points, formatted as follows:\n\n```\n[section_name]\nentry_point_name = entry_point_value\n```\n\nYour funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_entry_points('[section1]\\\\nkey1 = value1') == {'section1': {'key1': 'value1'}}\", \"assert extract_entry_points('[section1]\\\\nkey1 = value1\\\\nkey2 = value2') == {'section1': {'key1': 'value1', 'key2': 'value2'}}\", \"assert extract_entry_points... | {
"split": "train",
"index": 65180,
"acecode_id": "oss_10192",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a positive integer `n` representing the number of items. You need to determine the total number of ways to select any number of items from these `n` items. Each selection can either include or exclude each item. Implement the function `count_selections(n: int) -> ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_selections(1) == 2\", \"assert count_selections(2) == 4\", \"assert count_selections(3) == 8\", \"assert count_selections(4) == 16\", \"assert count_selections(5) == 32\", \"assert count_selections(6) == 64\", \"assert count_selections(7) == 128\", \"a... | {
"split": "train",
"index": 65181,
"acecode_id": "bigcode_python_fns_49157",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the root of a binary tree, implement a function that returns the sum of all the values in the tree. A binary tree node is defined by the following class: class TreeNode: def __init__(self, x): self.val = x; self.left = None; self.right = None. You need to write a single f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_tree(TreeNode(5)) == 5\", \"assert sum_tree(TreeNode(5, TreeNode(3), TreeNode(7))) == 15\", \"assert sum_tree(TreeNode(1, TreeNode(2), TreeNode(3))) == 6\", \"assert sum_tree(TreeNode(0)) == 0\", \"assert sum_tree(TreeNode(-1)) == -1\", \"assert sum_tree... | {
"split": "train",
"index": 65182,
"acecode_id": "evol_21081",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary represents an object with various fields. Write a function that sorts the list of objects based on a specified field in ascending order. The function should take in two parameters: a list of objects and a string repres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_objects([{'name': 'John', 'age': 23}, {'name': 'Jane', 'age': 20}, {'name': 'Alice', 'age': 19}], 'age') == [{'name': 'Alice', 'age': 19}, {'name': 'Jane', 'age': 20}, {'name': 'John', 'age': 23}]\", \"assert sort_objects([{'name': 'John', 'age': 23}, {... | {
"split": "train",
"index": 65183,
"acecode_id": "evol_30013",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_sequence()` that produces a randomly-generated sequence consisting of 5 distinct alphanumeric characters. Each character in the sequence must differ by at least two ASCII values from its neighboring characters. The function should handle possible exce... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert len(generate_sequence()) == 5\", \"assert all(c.isalnum() for c in generate_sequence())\", \"assert len(set(generate_sequence())) == 5\", \"assert all(abs(ord(generate_sequence()[i]) - ord(generate_sequence()[i+1])) >= 2 for i in range(4))\", \"assert all(c ... | {
"split": "train",
"index": 65184,
"acecode_id": "evol_4650",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that checks if a given string is a palindrome. A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward as forward, ignoring spaces, punctuation, and capitalization. Write a function `is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal, Panama!') == True\", \"assert is_palindrome('Was it a car or a cat I saw?') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('Hello, World!') == False\", \"assert is_palindrome('... | {
"split": "train",
"index": 65185,
"acecode_id": "oss_3217",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function that takes a list of positive integers and returns a dictionary where the keys are the input integers and the values are tuples containing three elements: a boolean indicating whether the number of divisors is even, the list of divisors, and the sum of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_divisors(6) == {6: (True, [1, 2, 3, 6], 12)}\", \"assert get_divisors(1) == {1: (False, [1], 1)}\", \"assert get_divisors(15) == {15: (True, [1, 3, 5, 15], 24)}\", \"assert get_divisors(16) == {16: (False, [1, 2, 4, 8, 16], 31)}\", \"assert get_divisors(... | {
"split": "train",
"index": 65186,
"acecode_id": "evol_8933",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a hexadecimal color code, write a function `format_hexa(value: str) -> Tuple[int, int, int, int]` that converts it into an RGBA color representation. The input string can either be 3, 4, 6, or 8 characters long. If the input is 3 characters long, eac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_hexa('bda') == (187, 221, 170, 255)\", \"assert format_hexa('60B0C4') == (96, 176, 196, 255)\", \"assert format_hexa('2BEA40D0') == (43, 234, 64, 208)\", \"assert format_hexa('abc') == (170, 187, 204, 255)\", \"assert format_hexa('123456') == (18, 52,... | {
"split": "train",
"index": 65187,
"acecode_id": "bigcode_python_fns_11446",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that serves as a JSON decoder for specific data types. The function should return the following three pieces of information: 1) the class name of the decoder, 2) an RGBA color tuple, and 3) a tuple containing a string representing the sup... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert m44_decoder() == {'decoder_class': 'm44_decoder', 'color': (150, 0, 20, 255), 'supported_data_types': ('Matrix44Pin',)}\", \"assert m44_decoder()['decoder_class'] == 'm44_decoder'\", \"assert m44_decoder()['color'] == (150, 0, 20, 255)\", \"assert m44_decode... | {
"split": "train",
"index": 65188,
"acecode_id": "oss_30491",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `target` composed of lowercase alphabets and a `stamp` string, also composed of lowercase alphabets. Initially, the sequence is represented by `target.length` '?' marks. You can overlay the `stamp` on the sequence, replacing the '?' marks with the corresp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert movesToStamp('abc', 'a') == []\", \"assert movesToStamp('xyz', 'abcabc') == []\", \"assert movesToStamp('zz', 'z') == []\", \"assert movesToStamp('a', 'abcdef') == []\", \"assert movesToStamp('abc', '') == []\", \"assert movesToStamp('xyz', 'xxxxxyyyzzz') ==... | {
"split": "train",
"index": 65189,
"acecode_id": "evol_20880",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a list of Near Earth Object (NEO) data, each represented as a dictionary containing 'name', 'lunar_distance', and 'date', write a function that determines which month in a given year is statistically most likely to have the closest approach based on the lunar distance of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert most_likely_closest_month([{'name': 'NEO1', 'lunar_distance': 0.0025, 'date': '2022-01-15'}, {'name': 'NEO2', 'lunar_distance': 0.0012, 'date': '2022-02-20'}, {'name': 'NEO3', 'lunar_distance': 0.0030, 'date': '2022-03-10'}], 2022) == 2\", \"assert most_like... | {
"split": "train",
"index": 65190,
"acecode_id": "evol_9939",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats and prints a list of virtual machines (VMs) with their respective IP addresses and MAC addresses. Your function should take a list of tuples where each tuple contains the VM name, its IP address, and its MAC address. The func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_vm_list([('vm1', '192.168.1.1', '00:11:22:33:44:55'), ('vm2', '192.168.1.2', '66:77:88:99:AA:BB')]) == None\", \"assert format_vm_list([('test_vm', '10.0.0.1', 'AA:BB:CC:DD:EE:FF')]) == None\", \"assert format_vm_list([('vmA', '172.16.0.1', '11:22:33:... | {
"split": "train",
"index": 65191,
"acecode_id": "bigcode_python_fns_44590",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer y, implement a function that calculates the value of y such that when 36 is subtracted from it, the result equals 13. Return the calculated value of y.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_y() == 49\", \"assert calculate_y() == 49\", \"assert calculate_y() == 49\", \"assert calculate_y() == 49\", \"assert calculate_y() == 49\", \"assert calculate_y() == 49\", \"assert calculate_y() == 49\", \"assert calculate_y() == 49\", \"assert ca... | {
"split": "train",
"index": 65192,
"acecode_id": "evol_31667",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing the type of an entity (e.g., 'light', 'switch'), a brand name (e.g., 'hue'), a unique identifier (e.g., '1234'), and a suggested object ID (e.g., 'beer'), return a string that combines the entity type and the suggested object ID to form an entity ID ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_entity_id('light', 'hue', '1234', 'beer') == 'light.beer'\", \"assert get_entity_id('switch', 'philips', '5678', 'lamp') == 'switch.lamp'\", \"assert get_entity_id('sensor', 'xiaomi', '91011', 'motion_detector') == 'sensor.motion_detector'\", \"assert ge... | {
"split": "train",
"index": 65193,
"acecode_id": "bigcode_python_fns_14319",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer `fsp_id`, write a function that checks if it is within the valid range of 1 to 27 (inclusive). If the value of `fsp_id` is outside this range, the function should raise a ValueError with the message 'FSP ID must be between 1 and 27.'. Implement the function `ch... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_fsp_id(1) is None\", \"assert check_fsp_id(27) is None\", \"assert check_fsp_id(15) is None\", \"assert check_fsp_id(2) is None\", \"assert check_fsp_id(26) is None\", \"assert check_fsp_id(3) is None\", \"assert check_fsp_id(4) is None\", \"assert che... | {
"split": "train",
"index": 65194,
"acecode_id": "bigcode_python_fns_19370",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function `md5_hash` that calculates and returns the MD5 hash of the input string in hexadecimal format. The input string may contain any printable ASCII characters. The function should take one parameter: a string `content` and return its MD5 hash as... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert md5_hash('hello') == '5d41402abc4b2a76b9719d911017c592'\", \"assert md5_hash('') == 'd41d8cd98f00b204e9800998ecf8427e'\", \"assert md5_hash('123456') == 'e10adc3949ba59abbe56e057f20f883e'\", \"assert md5_hash('Hello, World!') == '65a8e27d8879283831b664bd8b7f... | {
"split": "train",
"index": 65195,
"acecode_id": "bigcode_python_fns_39210",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given an array of `n` distinct integers, write a function `MaxMeanSubarray(nums: List[int], k: int, m: int) -> float` that finds the maximum mean value of a continuous subarray of length `k` after optionally omitting up to `m` elements from that subarray. The subarray must not ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert MaxMeanSubarray([5, 15, 25, 35, 45], 3, 1) == 35.0\", \"assert MaxMeanSubarray([1, 3, 5, 7, 9], 3, 1) == 7.0\", \"assert MaxMeanSubarray([1000, 2000, 3000, 4000, 5000], 3, 1) == 4000.0\", \"assert MaxMeanSubarray([10, 20, 30], 2, 1) == 25.0\", \"assert MaxMe... | {
"split": "train",
"index": 65196,
"acecode_id": "evol_8084",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are asked to implement a Python function that processes a list of task objects and extracts specific attributes from each task. Each task object is represented as a dictionary containing various attributes. Your function should extract the 'task_id' and 'task_chain_id' attr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_task_attributes([{'task_id': 1, 'task_name': 'Task A', 'task_chain_id': 100}, {'task_id': 2, 'task_name': 'Task B', 'task_chain_id': None}, {'task_id': 3, 'task_name': 'Task C', 'task_chain_id': 101}]) == [(1, 100), (2, None), (3, 101)]\", \"assert e... | {
"split": "train",
"index": 65197,
"acecode_id": "oss_14151",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that takes two binary strings as input and determines if it's possible to transform the first binary string into the second binary string by flipping exactly one bit. The function should also handle erroneous binary inputs by returning appropriate error messa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_transform('1100', '1101') == True\", \"assert can_transform('1100', '1111') == False\", \"assert can_transform('1100', '1000') == True\", \"assert can_transform('0000', '0001') == True\", \"assert can_transform('1111', '1110') == True\", \"assert can_tra... | {
"split": "train",
"index": 65198,
"acecode_id": "evol_2891",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string `input_string`, write a function `longest_substring(input_string)` that finds the longest contiguous substring where the same character is repeated. The function should iterate through the string and return the longest substring of repeating characters. It must b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_substring('abcde') == 'a'\", \"assert longest_substring('aabbcc') == 'aa'\", \"assert longest_substring('zzzzyyyxx') == 'zzzz'\", \"assert longest_substring('') == ''\", \"assert longest_substring('a') == 'a'\", \"assert longest_substring('aaaabbbb')... | {
"split": "train",
"index": 65199,
"acecode_id": "evol_17454",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.