data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are given two lists of strings, `items` and `markets`, representing different categories of products. Your task is to find the items that are common to both lists. The function should return a list of these common items, sorted in lexicographical order. Note that the output...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_common_items(['coins', 'books', 'pens', 'markers', 'paper'], ['markets', 'coins', 'books', 'pencils', 'paper']) == ['books', 'coins', 'paper']\", \"assert find_common_items(['apple', 'banana', 'cherry'], ['banana', 'kiwi', 'cherry']) == ['banana', 'cher...
{ "split": "train", "index": 3300, "acecode_id": "oss_20745", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string T, locate the first appearing position, the count, and the last appearing position of a specific sequence q in T. The search should be case-sensitive. Implement a function that takes T and q as parameters and returns a tuple containing the first position, count, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_sequence('Hello World', 'o') == (4, 2, 7)\", \"assert analyze_sequence('12345', '3') == (2, 1, 2)\", \"assert analyze_sequence('abcdefg', 'h') == (-1, 0, -1)\", \"assert analyze_sequence('aaaaa', 'a') == (0, 5, 4)\", \"assert analyze_sequence('abcdef...
{ "split": "train", "index": 3301, "acecode_id": "evol_24253", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given an integer array `nums`, return `true` if there exists a quadruplet of indices `(i, j, k, l)` such that `i < j < k < l` and `nums[i] < nums[j] < nums[k] < nums[l]`. If no such indices exists, return `false`.\nPlease reason step by step, then write a self-contained Python ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert increasingQuadruplet([1,2,3,4,5]) == True\", \"assert increasingQuadruplet([5,4,3,2,1]) == False\", \"assert increasingQuadruplet([2,1,5,0,4,6,7]) == True\", \"assert increasingQuadruplet([1,3,2,4,5]) == True\", \"assert increasingQuadruplet([1,2,2,3,4]) == ...
{ "split": "train", "index": 3302, "acecode_id": "evol_5558", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_json(data: dict) -> str` that takes a dictionary as input and creates a JSON string that is compliant with ECMAScript 2019 standards. The function should handle invalid or inconsistent data, specifically by converting any value that is the string 'u...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_json({'Name': 'Alice', 'Age': 30, 'Gender': 'Female', 'Favorite Color': 'undefined'}) == '{\\\\n \\\"Age\\\": 30,\\\\n \\\"Favorite Color\\\": null,\\\\n \\\"Gender\\\": \\\"Female\\\",\\\\n \\\"Name\\\": \\\"Alice\\\"\\\\n}'\", \"assert c...
{ "split": "train", "index": 3303, "acecode_id": "evol_13826", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the new centroids for a set of clusters based on given data points. Each data point is associated with a cluster it belongs to, and you need to compute the new centroid for each cluster by averaging the x and y coordin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_new_centroids([{'cluster': 1, 'x': 1.0, 'y': 1.0}, {'cluster': 2, 'x': 2.0, 'y': 2.0}], [{'cluster': 1, 'x': 1.0, 'y': 1.0}, {'cluster': 1, 'x': 2.0, 'y': 2.0}]) == [{'cluster': 1, 'x': 1.5, 'y': 1.5}, {'cluster': 2, 'x': 2.0, 'y': 2.0}]\", \"assert fin...
{ "split": "train", "index": 3304, "acecode_id": "oss_32657", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that searches for a file in a given list of directories. The function should take in a filename and a list of directory paths, and return the absolute path of the file if it exists in any of the directories. If the file does not exist...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_file_in_directories('file1.txt', ['./', './dir1']) == '/absolute/path/to/file1.txt'\", \"assert find_file_in_directories('file2.txt', ['./', './dir1']) == '/absolute/path/to/dir1/file2.txt'\", \"assert find_file_in_directories('file5.txt', ['./dir3', '....
{ "split": "train", "index": 3305, "acecode_id": "bigcode_python_fns_32491", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a 2D list (matrix) of integers, write a function `transpose_matrix(matrix: List[List[int]]) -> List[List[int]]` that returns the transpose of the matrix. The transpose of a matrix is obtained by flipping it over its diagonal, which means that the row and column indices ar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transpose_matrix([[1, 2], [3, 4]]) == [[1, 3], [2, 4]]\", \"assert transpose_matrix([[1, 2, 3], [4, 5, 6]]) == [[1, 4], [2, 5], [3, 6]]\", \"assert transpose_matrix([[1]]) == [[1]]\", \"assert transpose_matrix([]) == []\", \"assert transpose_matrix([[1, 2], ...
{ "split": "train", "index": 3306, "acecode_id": "bigcode_python_fns_14253", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_primes_in_range(start: int, end: int) -> List[int]` that returns a list of all prime numbers within the inclusive range from `start` to `end`. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_primes_in_range(2, 10) == [2, 3, 5, 7]\", \"assert find_primes_in_range(11, 20) == [11, 13, 17, 19]\", \"assert find_primes_in_range(1, 1) == []\", \"assert find_primes_in_range(0, 5) == [2, 3, 5]\", \"assert find_primes_in_range(5, 5) == [5]\", \"asser...
{ "split": "train", "index": 3307, "acecode_id": "evol_12958", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of strings representing the names of shapes in a 3D scene, write a function `get_mesh_shapes(shape_names: List[str]) -> List[str]` that extracts and returns a list containing only the names of the mesh shapes. A shape name is considered a mesh if it contains the su...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_mesh_shapes(['cube_mesh', 'sphere', 'pyramid_mesh', 'cylinder']) == ['cube_mesh', 'pyramid_mesh']\", \"assert get_mesh_shapes(['mesh1', 'mesh2', 'object1', 'object2']) == ['mesh1', 'mesh2']\", \"assert get_mesh_shapes(['plane', 'wireframe_mesh', 'solid']...
{ "split": "train", "index": 3308, "acecode_id": "bigcode_python_fns_49963", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that transforms a given list of integers by applying a specified transformation function. The transformation function takes an integer and returns a modified integer. Your function should take in a list of integers and the transfor...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_list([1, 2, 3], lambda x: x * 2) == [2, 4, 6]\", \"assert transform_list([1, -1, 0], lambda x: x + 5) == [6, 4, 5]\", \"assert transform_list([10, 20, 30], lambda x: x // 10) == [1, 2, 3]\", \"assert transform_list([], lambda x: x + 1) == []\", \"a...
{ "split": "train", "index": 3309, "acecode_id": "oss_20029", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `binary_search` that takes a sorted list of integers and an integer `target`. The function should return the index of `target` in the list if it exists, otherwise return -1. The list is guaranteed to be sorted in ascending order. You may assume that the inp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_search([1, 3, 5, 7, 9], 5) == 2\", \"assert binary_search([1, 3, 5, 7, 9], 1) == 0\", \"assert binary_search([1, 3, 5, 7, 9], 9) == 4\", \"assert binary_search([1, 3, 5, 7, 9], 10) == -1\", \"assert binary_search([1, 3, 5, 7, 9], 0) == -1\", \"assert ...
{ "split": "train", "index": 3310, "acecode_id": "evol_26461", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `count_greater_than_k(nums: List[int], k: int) -> int` that counts how many integers in the list are greater than a given integer `k`. The function should return the count of such integers. Your function should handle cases where t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_greater_than_k([1, 3, 5, 7], 4) == 2\", \"assert count_greater_than_k([10, 20, 30], 25) == 1\", \"assert count_greater_than_k([5, 5, 5, 5], 5) == 0\", \"assert count_greater_than_k([], 0) == 0\", \"assert count_greater_than_k([1, 2, 3, 4, 5], 0) == 5\"...
{ "split": "train", "index": 3311, "acecode_id": "bigcode_python_fns_48967", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of lists of integers, implement a function `foo(nums_data)` that returns a new list of lists where each integer in the input list is increased by 2. The function should handle any number of sublists and any number of integers within those sublists.\nPlease reason s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert foo([[1, 2], [3, 4]]) == [[3, 4], [5, 6]]\", \"assert foo([[0]]) == [[2]]\", \"assert foo([[5, 6, 7], [8, 9]]) == [[7, 8, 9], [10, 11]]\", \"assert foo([[10], [20], [30]]) == [[12], [22], [32]]\", \"assert foo([[-1, -2], [-3, -4]]) == [[1, 0], [-1, -2]]\", \...
{ "split": "train", "index": 3312, "acecode_id": "evol_25856", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `factorial` that calculates the factorial of a given non-negative integer `n`. The function should return an integer result. The factorial of a non-negative integer `n` is the product of all positive integers less than or equal to `n`, denoted by `n!...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(...
{ "split": "train", "index": 3313, "acecode_id": "evol_1907", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `has_positive(nums: List[int]) -> bool` that returns True if the list contains at least one positive integer, and False otherwise. The function should handle an empty list by returning False.\nPlease reason step by step, then write a s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_positive([1, -1, 0]) == True\", \"assert has_positive([-1, -2, -3]) == False\", \"assert has_positive([0, 0, 0]) == False\", \"assert has_positive([3, 5, 7]) == True\", \"assert has_positive([-10, -5, 1]) == True\", \"assert has_positive([]) == False\", ...
{ "split": "train", "index": 3314, "acecode_id": "bigcode_python_fns_8307", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function, `get_credential_type`, that determines the type of credential based on a provided credential object. The credential object is a dictionary with the following keys: 'credential_type' (an integer representing the type of credential), and '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_credential_type({'credential_type': 1, 'credential_tuple': ('user', 'pass')}) == 'USERPASS_PLAINTEXT'\", \"assert get_credential_type({'credential_type': 2, 'credential_tuple': ('user', 'pubkey', 'privkey', 'passphrase')}) == 'SSH_KEY'\", \"assert get_cr...
{ "split": "train", "index": 3315, "acecode_id": "bigcode_python_fns_499", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `multidict_from_matrix` that takes a list of keys and a matrix (list of lists) as input and returns a dictionary where each key corresponds to a row in the matrix. If the number of keys does not match the number of rows in the matrix, the function should ra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multidict_from_matrix(['a', 'b', 'c'], [[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == {'a': [1, 2, 3], 'b': [4, 5, 6], 'c': [7, 8, 9]}\", \"assert multidict_from_matrix(['x', 'y'], [[10, 20], [30, 40]]) == {'x': [10, 20], 'y': [30, 40]}\", \"assert multidict_from_mat...
{ "split": "train", "index": 3316, "acecode_id": "evol_19012", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function called `intersperse` that takes a list of integers `numbers` and an integer `delimeter`. The function should return a new list that consists of the integer `delimeter` inserted between every two consecutive elements of the `numbers` list. If `delimeter` is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert intersperse([], 4) == []\", \"assert intersperse([1, 2, 3], 4) == [1, 4, 2, 4, 3]\", \"assert intersperse([1, 2, 3], -2) == [1, 2, 3]\", \"assert intersperse([5, 10], 1) == [5, 1, 10]\", \"assert intersperse([0, 0, 0], 3) == [0, 3, 0, 3, 0]\", \"assert inter...
{ "split": "train", "index": 3317, "acecode_id": "evol_2373", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the Euclidean distance between two points in a 2D space. The points will be given as tuples, where each tuple contains two integers representing the x and y coordinates of the point. Your function should take two such tup...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(calculate_distance((0, 0), (3, 4)) - 5.00) < 0.01\", \"assert abs(calculate_distance((1, 1), (1, 1)) - 0.00) < 0.01\", \"assert abs(calculate_distance((-1, -1), (1, 1)) - 2.83) < 0.01\", \"assert abs(calculate_distance((0, 0), (0, 5)) - 5.00) < 0.01\", \...
{ "split": "train", "index": 3318, "acecode_id": "bigcode_python_fns_49769", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string as input and returns a new string containing only the uppercase alphabetic characters from the input string. For example, given the input 'Hello World!', the function should return 'HW'.\nPlease reason step by step, then write a self-con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert upper_string_process('Hello World!') == 'HW'\", \"assert upper_string_process('Python Programming') == 'PP'\", \"assert upper_string_process('No Uppercase Here') == 'NUH'\", \"assert upper_string_process('12345') == ''\", \"assert upper_string_process('') ==...
{ "split": "train", "index": 3319, "acecode_id": "evol_4242", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers, where each integer represents a score. Your task is to implement a function that returns the average score rounded to the nearest integer. If the average is exactly halfway between two integers, round up to the nearest integer. The input list m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_score([10, 20, 30]) == 20\", \"assert average_score([1, 2, 3, 4, 5]) == 3\", \"assert average_score([]) == 0\", \"assert average_score([-5, 0, 5]) == 0\", \"assert average_score([1, 1, 1]) == 1\", \"assert average_score([0, 0, 0]) == 0\", \"assert av...
{ "split": "train", "index": 3320, "acecode_id": "bigcode_python_fns_34494", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `sum_of_squares(numbers: List[int]) -> int` that calculates the sum of the squares of all the integers in the list. If the list is empty, the function should return 0. The input list can contain both positive and negative integers. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_squares([1, 2, 3]) == 14\", \"assert sum_of_squares([-1, -2, -3]) == 14\", \"assert sum_of_squares([0]) == 0\", \"assert sum_of_squares([]) == 0\", \"assert sum_of_squares([1, -1, 2, -2]) == 10\", \"assert sum_of_squares([5, 5]) == 50\", \"assert sum_...
{ "split": "train", "index": 3321, "acecode_id": "bigcode_python_fns_2438", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `lcm(a: int, b: int) -> int` that calculates the lowest common multiple (LCM) of two integers. The function should use the relationship between LCM and GCD: LCM(a, b) = abs(a * b) // GCD(a, b). You can assume that both integers will be non-negative.\nPlease...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lcm(4, 5) == 20\", \"assert lcm(0, 5) == 0\", \"assert lcm(5, 0) == 0\", \"assert lcm(1, 1) == 1\", \"assert lcm(6, 8) == 24\", \"assert lcm(7, 3) == 21\", \"assert lcm(9, 6) == 18\", \"assert lcm(15, 10) == 30\", \"assert lcm(12, 15) == 60\", \"assert lcm(2...
{ "split": "train", "index": 3322, "acecode_id": "evol_30975", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given the dimensions of a rectangle defined by its height `h` and width `w`, along with two lists of cutting points: `horizontalCuts` and `verticalCuts`. Your task is to implement a function that calculates two values: 1) the maximum area of a piece of the rectangle tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxArea(5, 4, [1, 2, 4], [1, 3]) == [4, 5]\", \"assert maxArea(50, 50, [25], [25]) == [625, 2]\", \"assert maxArea(6, 8, [2, 4], [2, 6]) == [8, 4]\", \"assert maxArea(9, 9, [3, 6], [1, 4, 8]) == [12, 5]\", \"assert maxArea(15, 15, [5, 10], [5, 10]) == [25, 4...
{ "split": "train", "index": 3323, "acecode_id": "evol_5940", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that generates a random graph with a specified number of nodes and edges. The graph will be represented using a simple adjacency list. Your function should add a specified number of nodes to the graph and connect them with rand...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_graph(5, 0, (1, 10)) == {0: [], 1: [], 2: [], 3: [], 4: []}\", \"assert generate_graph(1, 0, (1, 5)) == {0: []}\", \"assert generate_graph(6, 5, (1, 3)) != generate_graph(6, 5, (1, 3))\", \"assert generate_graph(3, 2, (5, 10)) != generate_graph(3, 2...
{ "split": "train", "index": 3324, "acecode_id": "oss_8501", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function that checks if two given phrases are anagrams of each other. Two phrases are considered anagrams if they contain the exact same characters, including spaces and punctuation, with the same frequency. For example, the phrases 'listen' and 'silent' are anagram...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_word_sets_frequency('listen', 'silent') == True\", \"assert compare_word_sets_frequency('hello', 'world') == False\", \"assert compare_word_sets_frequency('a gentleman', 'elegant man') == True\", \"assert compare_word_sets_frequency('The eyes', 'They...
{ "split": "train", "index": 3325, "acecode_id": "evol_30115", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of floating-point numbers representing the daily earnings of a user for the past 24 hours, return the total earnings for the day. The list may contain both positive and negative values, where positive values represent earnings and negative values represent losses. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_earnings([10.0, 20.0, -5.0, 15.0]) == 40.0\", \"assert total_earnings([-5.0, -10.0, -15.0]) == -30.0\", \"assert total_earnings([0.0, 0.0, 0.0]) == 0.0\", \"assert total_earnings([5.5, 3.7, 2.8, -1.2]) == 10.8\", \"assert total_earnings([-1.0, 2.0, -3....
{ "split": "train", "index": 3326, "acecode_id": "bigcode_python_fns_47695", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of children represented by their names and two integers, 'from' and 'to'. Your task is to move a child from the 'from' index to the 'to' index in the list. If the 'from' or 'to' index is out of bounds, or if the input does not contain both indices, return a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert move_child_position(['Alice', 'Bob', 'Charlie'], 0, 2) == {'result': 'success'}\", \"assert move_child_position(['Alice', 'Bob', 'Charlie'], 2, 0) == {'result': 'success'}\", \"assert move_child_position(['Alice', 'Bob', 'Charlie'], 1, 1) == {'result': 'succ...
{ "split": "train", "index": 3327, "acecode_id": "bigcode_python_fns_14174", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating a command string based on provided parameters. Write a function `generate_command_string` that accepts keyword arguments representing different parameters and constructs a command string in the following format: 'command --param1 value1 --param2 v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_command_string(param1='value1') == 'command --param1 value1'\", \"assert generate_command_string(param2='value2') == 'command --param2 value2'\", \"assert generate_command_string(param1='value1', param2='value2') == 'command --param1 value1 --param2...
{ "split": "train", "index": 3328, "acecode_id": "bigcode_python_fns_7527", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages network settings for a custom communication protocol. The function should handle the timeout and buffer size configurations for network operations. Your function should take two arguments: a new timeout value (a floating-poin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_network_settings(5.0, 2048) == (5.0, 2048)\", \"assert update_network_settings(0.0, 0) == (0.0, 0)\", \"assert update_network_settings(10.5, 512) == (10.5, 512)\", \"assert update_network_settings(4.0, 1024) == (4.0, 1024)\", \"assert update_network_s...
{ "split": "train", "index": 3329, "acecode_id": "oss_15414", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function to remove duplicates from a list of dictionaries based on their values for a specified nested key. The function should accept a list of dictionaries and two keys: the first key to access the nested dictionary and the second key to access the value used f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates([{'name':'John', 'age': 25, 'address':{'city':'NYC', 'state':'NY'}}, {'name':'Jim', 'age': 25, 'address':{'city':'LA', 'state':'CA'}}, {'name':'Lisa', 'age': 20, 'address':{'city':'NYC', 'state':'NY'}}], 'address', 'city') == [{'name':'John...
{ "split": "train", "index": 3330, "acecode_id": "evol_22359", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of strings, implement a function that filters out these strings based on a user-defined character and returns a tuple containing the filtered list and a dictionary. The dictionary should map the indices of the filtered strings to the corresponding substrings starti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_list(['banana', 'orange', 'grape', 'kiwi'], 'o') == (['orange'], {0: 'orange'})\", \"assert filter_list(['peach', 'pear', 'plum'], 'z') == ([], {})\", \"assert filter_list([], 'a') == ([], {})\", \"assert filter_list(['apple', 'banana', 'cherry'], 'c'...
{ "split": "train", "index": 3331, "acecode_id": "evol_14848", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a Python function that computes the cumulative sum of each successive pair of numbers in a given array. For each pair, also determine if the absolute difference between the two numbers is greater than 1. The function should return a list of tuples, where each tuple co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_cumulative([1, 2, 3, 5, 6, 9, 10]) == [((1, 2), 3, False), ((2, 3), 5, False), ((3, 5), 8, True), ((5, 6), 11, False), ((6, 9), 15, True), ((9, 10), 19, False)]\", \"assert calculate_cumulative([10, 20, 30]) == [((10, 20), 30, True), ((20, 30), 50,...
{ "split": "train", "index": 3332, "acecode_id": "evol_34353", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers and returns a new list that is the reverse of the original list without modifying the original list. The function should maintain the order of elements in the new list. For example, given the input list [4, 3, 2, 1], the output...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert antipodal_copy([4, 3, 2, 1]) == [1, 2, 3, 4]\", \"assert antipodal_copy([1, 2, 3]) == [3, 2, 1]\", \"assert antipodal_copy([10, 20, 30, 40, 50]) == [50, 40, 30, 20, 10]\", \"assert antipodal_copy([5]) == [5]\", \"assert antipodal_copy([]) == []\", \"assert a...
{ "split": "train", "index": 3333, "acecode_id": "evol_4207", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called 'advanced_histogram' that takes a string containing a mixture of uppercase and lowercase alphabetic characters, numeric characters, and punctuation marks, separated by spaces. The function should return a dictionary with the characters that appear mo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert advanced_histogram('A B c 1 @') == {'a': 1, 'b': 1, 'c': 1, '1': 1, '@': 1}\", \"assert advanced_histogram('A b C a B 1 2 2') == {'a': 2, 'b': 2, '2': 2}\", \"assert advanced_histogram('B B B b A ! ! ! !') == {'b': 4, '!': 4}\", \"assert advanced_histogram('...
{ "split": "train", "index": 3334, "acecode_id": "evol_24217", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a specific item exists in a list of items. The function should take a string 'item_name' and a list of strings 'item_list' as input parameters. It should return True if 'item_name' is found in 'item_list', and False otherwi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_item_in_list('apple', ['banana', 'apple', 'orange']) == True\", \"assert is_item_in_list('grape', ['banana', 'apple', 'orange']) == False\", \"assert is_item_in_list('banana', ['banana', 'apple', 'orange']) == True\", \"assert is_item_in_list('orange', ['...
{ "split": "train", "index": 3335, "acecode_id": "bigcode_python_fns_4056", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a recursive function in Python that computes the factorial of a provided non-negative integer. The function should also return the number of recursive calls made during the computation. If the input is negative, the function should raise a ValueError.\nPlease reason s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(0) == (1, 0)\", \"assert factorial(1) == (1, 0)\", \"assert factorial(2) == (2, 1)\", \"assert factorial(3) == (6, 2)\", \"assert factorial(4) == (24, 3)\", \"assert factorial(5) == (120, 4)\", \"assert factorial(6) == (720, 5)\", \"assert factoria...
{ "split": "train", "index": 3336, "acecode_id": "evol_3041", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates class and instance level data parameters based on the number of classes and instances provided, as well as the device type on which these parameters will be placed. Your function should take the following inputs: an integer...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_data_parameters(3, 5, 'cpu') == ([0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0])\", \"assert get_data_parameters(0, 0, 'cuda') == ([], [])\", \"assert get_data_parameters(1, 1, 'cpu') == ([0.0], [0.0])\", \"assert get_data_parameters(10, 10, 'cuda') == ([0.0...
{ "split": "train", "index": 3337, "acecode_id": "bigcode_python_fns_29578", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_lcm(num1: int, num2: int, num3: int) -> int` that takes three integers and returns their least common multiple (LCM). The function should efficiently calculate the LCM using the relationship between GCD (greatest common divisor) and LCM.\nPlease reaso...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_lcm(3, 4, 5) == 60\", \"assert find_lcm(6, 8, 12) == 24\", \"assert find_lcm(1, 1, 1) == 1\", \"assert find_lcm(7, 5, 3) == 105\", \"assert find_lcm(10, 15, 20) == 60\", \"assert find_lcm(9, 12, 15) == 180\", \"assert find_lcm(25, 30, 35) == 1050\", \"a...
{ "split": "train", "index": 3338, "acecode_id": "evol_5723", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `primes_below_n(n: int) -> List[int]` that returns a list of all prime numbers less than the given integer `n`. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. If `n` is less tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert primes_below_n(1) == []\", \"assert primes_below_n(2) == []\", \"assert primes_below_n(3) == [2]\", \"assert primes_below_n(4) == [2, 3]\", \"assert primes_below_n(5) == [2, 3]\", \"assert primes_below_n(6) == [2, 3, 5]\", \"assert primes_below_n(10) == [2, ...
{ "split": "train", "index": 3339, "acecode_id": "evol_2470", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two points in 2D space represented by their coordinates, you need to determine the slope of the line that connects these two points. Each point is represented as a tuple of two integers (x, y). The slope is defined as (y2 - y1) / (x2 - x1) where (x1, y1) are the coordinat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_slope((1, 2), (3, 4)) == 1.0\", \"assert calculate_slope((0, 0), (0, 5)) == 'undefined'\", \"assert calculate_slope((1, 1), (1, -1)) == 'undefined'\", \"assert calculate_slope((2, 3), (4, 7)) == 2.0\", \"assert calculate_slope((5, 5), (5, 10)) == '...
{ "split": "train", "index": 3340, "acecode_id": "bigcode_python_fns_22184", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two positive integers, a and b, design a function that identifies and returns every even prime integer, alongside their respective squares, within the inclusive range defined by a and b. The output should be an array of subarrays, where each nested array contains a prime ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generatePrimesAndSquares(2, 8) == [[2, 4]]\", \"assert generatePrimesAndSquares(8, 2) == [[2, 4]]\", \"assert generatePrimesAndSquares(10, 14) == []\", \"assert generatePrimesAndSquares(1, 1) == []\", \"assert generatePrimesAndSquares(3, 5) == []\", \"assert...
{ "split": "train", "index": 3341, "acecode_id": "evol_6432", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `recurrence_rate` that takes a list of alphanumeric phrases and a unique term as input, and returns the recurrence rate of the term within the combined phrases. The recurrence rate is calculated as the number of times the term appears divided by the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert recurrence_rate(['This is a test', 'This is another test'], 'test') == 0.25\", \"assert recurrence_rate(['Hello world', 'Hello'], 'hello') == 0.6666666666666666\", \"assert recurrence_rate(['One two three', 'One two'], 'four') == 0.0\", \"assert recurrence_r...
{ "split": "train", "index": 3342, "acecode_id": "evol_32970", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function `substitution_cipher(text: str, key: int) -> str` that transforms the input text using a substitution cipher with a specified key. Each letter in the input text should be shifted by the key positions in the alphabet, wrapping around if necessary. Non-alphab...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert substitution_cipher('hello there', 1) == 'ifmmp uifsf'\", \"assert substitution_cipher('abc', 3) == 'def'\", \"assert substitution_cipher('xyz', 3) == 'abc'\", \"assert substitution_cipher('Hello, World!', 5) == 'Mjqqt, Btwqi!'\", \"assert substitution_ciphe...
{ "split": "train", "index": 3343, "acecode_id": "evol_28983", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating an animated GIF from a series of game states. Write a function called `generate_gif` that takes a list of game states and an integer representing the number of frames to include in the GIF. The function should return a list of frames representing th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_gif(['state1', 'state2', 'state3'], 5) == ['state1', 'state2', 'state3', 'state1', 'state2']\", \"assert generate_gif(['state1'], 3) == ['state1', 'state1', 'state1']\", \"assert generate_gif(['state1', 'state2'], 4) == ['state1', 'state2', 'state1'...
{ "split": "train", "index": 3344, "acecode_id": "bigcode_python_fns_33214", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, move the element at index 0 to the end of the list. If the element is already at the end, move it to the beginning. The function should modify the list in place and return the modified list. Implement the function `move_element(lst: List[int]) -> List[...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert move_element([]) == []\", \"assert move_element([1]) == [1]\", \"assert move_element([1, 2]) == [2, 1]\", \"assert move_element([1, 2, 3]) == [2, 3, 1]\", \"assert move_element([1, 2, 3, 4]) == [2, 3, 4, 1]\", \"assert move_element([1, 2, 3, 4, 5]) == [2, 3,...
{ "split": "train", "index": 3345, "acecode_id": "evol_13544", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a positive integer n, determine if it can be expressed as the sum of two abundant numbers. An abundant number is defined as a number for which the sum of its proper divisors exceeds the number itself. Implement a function `can_be_sum_of_abundant(n: int) -> bool` that retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_be_sum_of_abundant(1) == False\", \"assert can_be_sum_of_abundant(2) == False\", \"assert can_be_sum_of_abundant(3) == False\", \"assert can_be_sum_of_abundant(4) == False\", \"assert can_be_sum_of_abundant(5) == False\", \"assert can_be_sum_of_abundant(...
{ "split": "train", "index": 3346, "acecode_id": "evol_29970", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes an array of integers and returns a list of integers that do not have a matching inverse in the array. An integer 'x' is considered to have an inverse if '-x' exists in the array. For example, if the input array is [-2, -1, 0, 1, 3], the output sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_without_inverse([2, 1, 0, -1, -2]) == []\", \"assert find_without_inverse([5, -5, 1, -1, 2]) == [2]\", \"assert find_without_inverse([0, 0, 0]) == []\", \"assert find_without_inverse([10, -10, 20, 30]) == [20, 30]\", \"assert find_without_inverse([-4, 4...
{ "split": "train", "index": 3347, "acecode_id": "evol_7295", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two ordered numerical lists as input and returns a new list that contains all the elements from both lists. The new list should maintain the order of elements as they appear in the input lists. You may assume that both input lists are already ord...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert append_lists([1, 2, 3], [4, 5, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert append_lists([], [1, 2, 3]) == [1, 2, 3]\", \"assert append_lists([1, 2, 3], []) == [1, 2, 3]\", \"assert append_lists([1, 3, 5], [2, 4, 6]) == [1, 3, 5, 2, 4, 6]\", \"assert append_lists([...
{ "split": "train", "index": 3348, "acecode_id": "evol_17466", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a user's credentials in the format 'username:password', write a function `generate_auth_token(credentials: str) -> str` that generates an authentication token using a simple encoding method. The token should be created by concatenating the username a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_auth_token('user:pass') == 'user:pass:AUTH'\", \"assert generate_auth_token('admin:1234') == 'admin:1234:AUTH'\", \"assert generate_auth_token('testUser:password123') == 'testUser:password123:AUTH'\", \"assert generate_auth_token('johnDoe:securePass...
{ "split": "train", "index": 3349, "acecode_id": "bigcode_python_fns_9674", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the loss value for a machine learning model based on provided data. The loss value is represented as a numeric value that is calculated using a simple formula. Your function should take a list of numeric data points, c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_loss([50, 50, 50]) == {'loss_value': 0.0, 'size': 1}\", \"assert calculate_loss([0, 0, 0]) == {'loss_value': 50.0, 'size': 1}\", \"assert calculate_loss([40, 60, 80]) == {'loss_value': 10.0, 'size': 1}\", \"assert calculate_loss([50]) == {'loss_val...
{ "split": "train", "index": 3350, "acecode_id": "oss_25971", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a list of numerical sequences represented as lists of floats, implement a function that computes the Pearson correlation coefficient between each pair of sequences. The function should return a 2D list (matrix) where the element at the i-th row and j-th column represents ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pearson_correlation([[1.0, 2.0], [2.0, 3.0]]) == [[1.0, 1.0], [1.0, 1.0]]\", \"assert pearson_correlation([[1.0, 2.0, 3.0], [3.0, 2.0, 1.0], [2.0, 2.0, 2.0]]) == [[1.0, -1.0, 0.0], [-1.0, 1.0, 0.0], [0.0, 0.0, 1.0]]\", \"assert pearson_correlation([[1.0, 2.0...
{ "split": "train", "index": 3351, "acecode_id": "bigcode_python_fns_24527", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Write a function `roll_dice(sides: int) -> int` that simulates rolling a dice with a given number of sides. The function should return a random integer representing the outcome of the roll, which can be any integer from 1 to the specified number of sides (inclusive). The functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert roll_dice(6) in [1, 2, 3, 4, 5, 6]\", \"assert roll_dice(8) in [1, 2, 3, 4, 5, 6, 7, 8]\", \"assert roll_dice(10) in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\", \"assert roll_dice(12) in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]\", \"assert roll_dice(20) in [1, 2, 3, 4...
{ "split": "train", "index": 3352, "acecode_id": "evol_15117", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string of text that may contain punctuation and irrelevant words (stopwords). Your task is to implement a function that processes this string by performing the following steps: 1. Remove all punctuation from the string. 2. Remove all stopwords from the processed...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert text_process('Hello, world! This is a test.') == ['hello', 'world', 'test']\", \"assert text_process('Python is great for programming.') == ['python', 'great', 'programming']\", \"assert text_process('I love coding in Python. What about you?') == ['love', 'c...
{ "split": "train", "index": 3353, "acecode_id": "bigcode_python_fns_9902", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Design a function that converts a provided number of seconds into a more comprehensive format of decades, years, months, weeks, days, hours, minutes, and seconds. Your function should also account for leap years and differing lengths of months. Implement the function without us...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_seconds(315360000) == {'decades': 1, 'years': 0, 'months': 0, 'weeks': 0, 'days': 0, 'hours': 0, 'minutes': 0, 'seconds': 0}\", \"assert convert_seconds(50) == {'decades': 0, 'years': 0, 'months': 0, 'weeks': 0, 'days': 0, 'hours': 0, 'minutes': 0, '...
{ "split": "train", "index": 3354, "acecode_id": "evol_8635", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of various buildings in a city. Your task is to determine the maximum distance from the first building to the last building that can be achieved by jumping over buildings taller than the current building. A jump can only...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_jump_distance([1, 3, 2, 4, 1]) == 4\", \"assert max_jump_distance([5, 3, 4, 2, 1]) == 4\", \"assert max_jump_distance([1, 2, 1, 2, 1]) == 4\", \"assert max_jump_distance([2, 2, 2, 2, 2]) == 4\", \"assert max_jump_distance([1]) == 0\", \"assert max_jump_d...
{ "split": "train", "index": 3355, "acecode_id": "bigcode_python_fns_48071", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a two-dimensional list 'data' that represents a hierarchical structure. Each element in the list can either be a dictionary or an empty string. Your task is to implement a function 'validate_hierarchy(data: List[List[Union[Dict, str]]]) -> bool' that checks if the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_hierarchy([[{'key1': 'value1'}, {'key2': 'value2'}, {'key3': 'value3'}, {'key4': 'value4'}, {'key5': 'value5'}], [{'key1': 'value1'}, {'key2': 'value2'}, {'key3': 'value3'}, {'key4': 'value4'}, {'key5': 'value5'}], [{'key1': 'value1'}, {'key2': 'val...
{ "split": "train", "index": 3356, "acecode_id": "bigcode_python_fns_30440", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Create a function that sorts a list of dictionaries based on the 'public_id' key in descending order. The input will be a list of dictionaries, where each dictionary contains a 'name' and 'public_id'. The function should return a new list sorted by 'public_id'.\nPlease reason s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_data([{ 'name': 'Alice', 'public_id': 2 }, { 'name': 'Bob', 'public_id': 1 }, { 'name': 'Charlie', 'public_id': 3 }]) == [{'name': 'Charlie', 'public_id': 3}, {'name': 'Alice', 'public_id': 2}, {'name': 'Bob', 'public_id': 1}]\", \"assert sort_data([{ '...
{ "split": "train", "index": 3357, "acecode_id": "evol_18991", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of file names and a search pattern in the form of a string that may contain a wildcard character '*'. Your task is to implement a function that returns a set of file names that match the given pattern. The wildcard character '*' can represent zero or more c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert match_files(['file1.txt', 'file2.txt', 'test_file.py', 'example.md'], 'file*.txt') == {'file1.txt', 'file2.txt'}\", \"assert match_files(['report.pdf', 'data.csv', 'summary.docx', 'report_v2.pdf'], 'report*.pdf') == {'report.pdf', 'report_v2.pdf'}\", \"asser...
{ "split": "train", "index": 3358, "acecode_id": "bigcode_python_fns_7342", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that converts a given integer number to Roman numerals. The function should be able to handle numbers up to 1 million and must validate the input to ensure that it is a non-negative integer. If the input is not a non-negative integer, the function should throw ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert intToRoman(1) == 'I'\", \"assert intToRoman(4) == 'IV'\", \"assert intToRoman(5) == 'V'\", \"assert intToRoman(9) == 'IX'\", \"assert intToRoman(10) == 'X'\", \"assert intToRoman(40) == 'XL'\", \"assert intToRoman(50) == 'L'\", \"assert intToRoman(90) == 'XC...
{ "split": "train", "index": 3359, "acecode_id": "evol_26733", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple parameter-representation system for a data processing application. You need to create a function `parameter_to_json(name: str, value: Union[str, int, float]) -> Dict[str, Union[str, int, float]]` that takes a parameter name and its valu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parameter_to_json('temperature', 25) == {'temperature': 25}\", \"assert parameter_to_json('humidity', 45.5) == {'humidity': 45.5}\", \"assert parameter_to_json('status', 'active') == {'status': 'active'}\", \"assert parameter_to_json('pressure', 1013) == {'p...
{ "split": "train", "index": 3360, "acecode_id": "oss_28617", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing a list of strings. Your function should take a list of strings as input and return a dictionary where each unique string is a key, and its value is the count of occurrences in the list. Implement the function `count_occurrences(strings: List[str])...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_occurrences(['apple', 'banana', 'apple']) == {'apple': 2, 'banana': 1}\", \"assert count_occurrences(['hello', 'world', 'hello']) == {'hello': 2, 'world': 1}\", \"assert count_occurrences(['test', 'test', 'test']) == {'test': 3}\", \"assert count_occur...
{ "split": "train", "index": 3361, "acecode_id": "oss_28564", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to determine if a given undirected graph is connected. A graph is represented as an adjacency list, which is a dictionary where the keys are node identifiers and the values are lists of neighbors. Your task is to implement a function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_connected({1: [2], 2: [1]}) == True\", \"assert is_connected({1: [2, 3], 2: [1], 3: [1]}) == True\", \"assert is_connected({1: [2], 2: [3], 3: [1]}) == True\", \"assert is_connected({1: [], 2: []}) == False\", \"assert is_connected({1: [2], 2: [1], 3: []}...
{ "split": "train", "index": 3362, "acecode_id": "oss_18319", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a given string is a palindrome. A palindrome is a string that reads the same backward as forward. Your function should ignore case and non-alphanumeric characters. Implement the function `is_palindrome(s: str) -> bool` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome('race a car') == False\", \"assert is_palindrome('') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('Was it a car or a cat I saw?') =...
{ "split": "train", "index": 3363, "acecode_id": "oss_19728", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of package configurations and returns a dictionary containing the package names and their corresponding test requirements. Each package configuration is represented as a string in the format: `<package_name>,<...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_package_configurations(['sktools,setup1,test1,test2']) == {'sktools': ['test1', 'test2']}\", \"assert process_package_configurations(['numpy,setup2,test3,test4']) == {'numpy': ['test3', 'test4']}\", \"assert process_package_configurations(['pandas,se...
{ "split": "train", "index": 3364, "acecode_id": "oss_34789", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function `create_user(username: str, password: str, role: str) -> User` that creates a new user with the specified username, password, and role. The function should ensure that the role is either 'ADMIN' or 'USER'. If the role is invalid, the function should raise a Va...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_user('john_doe', 'password123', 'ADMIN').role == 'ADMIN'\", \"assert create_user('jane_smith', 'secure_pass', 'USER').role == 'USER'\", \"assert create_user('alice', 'mypassword', 'USER').username == 'alice'\", \"assert create_user('bob', 'bobspass', ...
{ "split": "train", "index": 3365, "acecode_id": "evol_13731", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the values of buttons in a sequence. Your task is to create a function that returns the index of the first button that has the maximum value. If there are multiple buttons with the maximum value, return the index of the first one. I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_button_index([1, 3, 5, 7, 5]) == 3\", \"assert find_max_button_index([5, 5, 5]) == 0\", \"assert find_max_button_index([10, 20, 20, 10]) == 1\", \"assert find_max_button_index([-1, -2, -3]) == 0\", \"assert find_max_button_index([1]) == 0\", \"asser...
{ "split": "train", "index": 3366, "acecode_id": "bigcode_python_fns_17876", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that removes the prefix '~/Documents/' from a given file path. The function should take a string input representing the file path and return the modified path with the '~/Documents/' part removed. If the input path does not start with...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert strip_documents_folder('~/Documents/file.txt') == 'file.txt'\", \"assert strip_documents_folder('~/Documents/folder/file.txt') == 'folder/file.txt'\", \"assert strip_documents_folder('~/Documents/') == ''\", \"assert strip_documents_folder('~/Downloads/file....
{ "split": "train", "index": 3367, "acecode_id": "oss_3817", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a non-negative integer n, implement a function `joy_print(n: int) -> None` that prints \"Coding brings joy!\" repeatedly n number of times. If a negative integer is passed as the argument, the function should raise a ValueError with the message 'Input number must be a non...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert joy_print(0) == None\", \"assert joy_print(1) == None\", \"assert joy_print(2) == None\", \"assert joy_print(3) == None\", \"assert joy_print(4) == None\", \"assert joy_print(5) == None\", \"assert joy_print(10) == None\", \"assert joy_print(100) == None\", ...
{ "split": "train", "index": 3368, "acecode_id": "evol_17196", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program that validates a single email address based on a set of rules. An email address is considered valid if it meets the following criteria: 1. It must start with a string of alphanumeric characters (letters and/or numbers). 2. It must contain ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_email('invalid.email@') == False\", \"assert validate_email('12345@example.net') == True\", \"assert validate_email('user@domain.co.uk') == True\", \"assert validate_email('user@invalid_domain') == False\", \"assert validate_email('@missingusername....
{ "split": "train", "index": 3369, "acecode_id": "oss_29259", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of integers representing lengths, your task is to implement a function that generates a binary mask composed of 1s and 0s. The mask should have a total length of 8, where the number of 1s in each row corresponds to the values in the input list, and the remaining po...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_binary_mask([4, 3, 5, 2]) == [[1, 1, 1, 1, 0, 0, 0, 0], [1, 1, 1, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 0, 0, 0], [1, 1, 0, 0, 0, 0, 0, 0]]\", \"assert generate_binary_mask([0, 0, 0, 0]) == [[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0,...
{ "split": "train", "index": 3370, "acecode_id": "evol_12688", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a mixed list containing both numerical and alphabetical elements and returns a new list that contains all the numerical elements sorted in ascending order followed by all the alphabetical elements sorted in ascending order. You must use the bubbl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert segregate_sort([3, 1, 5, 4, 2, 'a', 'k', 'f', 'c']) == [1, 2, 3, 4, 5, 'a', 'c', 'f', 'k']\", \"assert segregate_sort(['z', 'x', 'y', 2, 1]) == [1, 2, 'x', 'y', 'z']\", \"assert segregate_sort([5, 3, 8, 'apple', 'banana']) == [3, 5, 8, 'apple', 'banana']\", ...
{ "split": "train", "index": 3371, "acecode_id": "evol_27912", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates the retrieval of the number of available CPU cores on a system. Since we cannot access the actual system resources, you need to implement a function that returns a predefined number of CPU cores based on a given inpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_cpu_cores_count() == 8\", \"assert get_cpu_cores_count() == 8\", \"assert get_cpu_cores_count() == 8\", \"assert get_cpu_cores_count() == 8\", \"assert get_cpu_cores_count() == 8\", \"assert get_cpu_cores_count() == 8\", \"assert get_cpu_cores_count() ==...
{ "split": "train", "index": 3372, "acecode_id": "oss_5318", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that calculates the net income after tax has been deducted given an income, a tax rate, and a deduction amount. The net income is computed by first calculating the tax based on the income and tax rate, then subtracting both the tax and the deduction from the in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_net_income(50000, 0.20, 1000) == 39000.0\", \"assert calculate_net_income(80000, 0.05, 4000) == 72000.0\", \"assert calculate_net_income(0, 0.20, 0) == 0.0\", \"assert calculate_net_income(1000, 0.25, 0) == 750.0\", \"assert calculate_net_income(15...
{ "split": "train", "index": 3373, "acecode_id": "evol_4381", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes job options based on a given dictionary and a tuple. The function should validate the options and execute the specified job if all required options are present. Implement a function `process_job(options, jobs, job_name,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_job({'n': int, 'now': datetime}, ('source',), 'source', n=10, now=datetime.now()) == 'Job executed successfully'\", \"assert process_job({'n': int, 'now': datetime}, ('source',), 'source', n=5, now=datetime.now()) == 'Job executed successfully'\", \"...
{ "split": "train", "index": 3374, "acecode_id": "oss_1841", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a grid representing a map of an asteroid field. Each cell in the grid can either contain an asteroid ('#') or be empty ('.'). Your task is to find the location of the best observation point from which the maximum number of asteroids can be observed. The observatio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_best_observation_point(['#','#']) == (0, 0)\", \"assert find_best_observation_point(['.#..#','#....','.....']) == (1, 0)\", \"assert find_best_observation_point(['.##.','.##.','....']) == (1, 0)\", \"assert find_best_observation_point(['..#..','.....','...
{ "split": "train", "index": 3375, "acecode_id": "oss_18199", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a dynamic runner loader for a training framework. The loader should be able to return a string representing different types of training runners based on the configuration provided. The configuration specifies the type of runner to be instantiate...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dynamic_runner_loader({'type': 'default'}) == 'Default Training Runner'\", \"assert dynamic_runner_loader({'type': 'evaluation'}) == 'Evaluation Runner'\", \"assert dynamic_runner_loader({'type': 'coarse_to_fine'}) == 'Coarse to Fine Runner'\", \"assert dyna...
{ "split": "train", "index": 3376, "acecode_id": "oss_1428", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a string representing the name of a city and a string representing the name of a subway station. Your task is to write a function that combines these two strings into a single formatted string that follows the pattern 'City Name - Station Name'. The function shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_station_info('New York', 'Times Square') == 'New York - Times Square'\", \"assert format_station_info('Los Angeles', 'Hollywood') == 'Los Angeles - Hollywood'\", \"assert format_station_info('San Francisco', 'Union Square') == 'San Francisco - Union S...
{ "split": "train", "index": 3377, "acecode_id": "bigcode_python_fns_22253", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `get_ltc_exchange_rates()` that returns the current exchange rates for Litecoin (LTC) against USD. The function does not take any parameters and should return a dictionary containing the following keys and their respective values: 'avg', ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_ltc_exchange_rates() == {'avg': 100.50, 'last': 102.00, 'low': 99.00, 'high': 105.00, 'vol': 1500.75}\", \"assert isinstance(get_ltc_exchange_rates(), dict)\", \"assert 'avg' in get_ltc_exchange_rates()\", \"assert 'last' in get_ltc_exchange_rates()\", \...
{ "split": "train", "index": 3378, "acecode_id": "bigcode_python_fns_30152", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines whether a user has permission to access a specific task based on their user profile. You are given a task ID and a user profile, and you need to return a boolean value: `True` if the user has permission to access the task,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_permission(1, UserProfile(user_id=1)) == True\", \"assert has_permission(3, UserProfile(user_id=3)) == True\", \"assert has_permission(5, UserProfile(user_id=5)) == True\", \"assert has_permission(6, UserProfile(user_id=1)) == False\", \"assert has_permi...
{ "split": "train", "index": 3379, "acecode_id": "bigcode_python_fns_16321", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `register_user(name: str, email: str, password: str, users: List[Dict[str, str]]) -> str` that registers a new user in a simulated user database. The function should validate the input by checking the following criteria: the email must be in the correct for...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert register_user('Alice', 'alice@example.com', 'Password1!', []) == 'Registration successful'\", \"assert register_user('Bob', 'bob@example.com', 'password', []) == 'Password must be at least 8 characters long and contain at least one uppercase letter, one lowe...
{ "split": "train", "index": 3380, "acecode_id": "evol_1689", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a time period in a specific format. The input can be one of the following: '1 hour', '1 day', '1 week', or 'forever'. Your task is to convert this input into the corresponding number of seconds. If the input is 'forever', return -1. If the in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_seconds('1 hour') == 3600\", \"assert convert_to_seconds('1 day') == 86400\", \"assert convert_to_seconds('1 week') == 604800\", \"assert convert_to_seconds('forever') == -1\", \"assert convert_to_seconds('invalid input') == 0\", \"assert convert_...
{ "split": "train", "index": 3381, "acecode_id": "bigcode_python_fns_45051", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Develop a function that takes two tuples as input and identifies the non-identical elements present in them, quantifying the frequency of these non-identical elements and pinpointing the originating tuple of each element. The function should return a dictionary where the non-id...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert non_identical_frequency((1, 2), (2, 3)) == {1: (1, 'tuple1'), 3: (1, 'tuple2')}\", \"assert non_identical_frequency((), (1, 2)) == {1: (1, 'tuple2'), 2: (1, 'tuple2')}\", \"assert non_identical_frequency((1, 2), ()) == {1: (1, 'tuple1'), 2: (1, 'tuple1')}\",...
{ "split": "train", "index": 3382, "acecode_id": "evol_35099", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes device allocation for a machine learning task. The function should take two inputs: a string of comma-separated device IDs and a boolean flag indicating whether to resume from a previous run. If the resume flag i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_configuration('1,2,3', False) == 4\", \"assert process_configuration('4,5,6', False) == 4\", \"assert process_configuration('7,8,9', False) == 4\", \"assert process_configuration('', False) == 4\", \"assert process_configuration('12', False) == 4\", ...
{ "split": "train", "index": 3383, "acecode_id": "oss_8037", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a 3D image represented as a 3D list of integers (where each integer represents a pixel value) and a 4D vector field represented as a 4D list of floats (where the last dimension has 4 components representing the vector's x, y, z offsets and a weight for interpolation), imp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert warp_image([[[1]]], [[[[0.0, 0.0, 0.0, 0.0]]]]) == [[[1]]]\", \"assert warp_image([[[1, 2], [3, 4]]], [[[[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]], [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]]]]) == [[[1, 2], [3, 4]]]\", \"assert warp_image([[[1, 2], [3, 4...
{ "split": "train", "index": 3384, "acecode_id": "bigcode_python_fns_30337", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Develop a function that counts the frequency of lists within a given list. The function should return a dictionary where each list is converted to a tuple, and the corresponding value indicates how many times that list appears. The function must also handle nested lists by flat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_nested_lists([[1, 2], [3, 4], [1, 2]]) == {(1, 2): 2, (3, 4): 1}\", \"assert count_nested_lists([[1, 2], [1, 2, 3], [3, 4], [1, 2]]) == {(1, 2): 2, (1, 2, 3): 1, (3, 4): 1}\", \"assert count_nested_lists([[1, [2]], [1, [2]], [1, [3]]]) == {(1, 2): 2, (...
{ "split": "train", "index": 3385, "acecode_id": "evol_7741", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that removes any number that occurs more than once, while keeping the order of the remaining numbers the same as the original list. The function should return a new list containing only the unique integers. Implement the function `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 3, 2, 4]) == [1, 3, 4]\", \"assert remove_duplicates([5, 6, 7, 5, 6, 8]) == [7, 8]\", \"assert remove_duplicates([1, 1, 1, 1]) == []\", \"assert remove_duplicates([9, 10, 11, 10, 12]) == [9, 11, 12]\", \"assert remove_duplicates([]) ...
{ "split": "train", "index": 3386, "acecode_id": "evol_12587", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with developing a simple function that processes a list of integers and returns a new list containing only the even numbers from the input list. The function should take a single parameter, `numbers`, which is a list of integers, and return a list of integers. If...
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([0, -2, -3, -4]) == [0, -2, -4]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([...
{ "split": "train", "index": 3387, "acecode_id": "oss_23943", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to parse a simple custom file system format. The file system contains a collection of records, each represented as a dictionary with keys 'name', 'offset', and 'size'. You need to implement a function `parseFileSystem(records)` that t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parseFileSystem([]) == []\", \"assert parseFileSystem([{'name': 'file1', 'offset': 0, 'size': 256}]) == ['Record file1 at 0 with size 256']\", \"assert parseFileSystem([{'name': 'file2', 'offset': 512, 'size': 128}, {'name': 'file3', 'offset': 640, 'size': 5...
{ "split": "train", "index": 3388, "acecode_id": "oss_14850", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a dictionary containing key-value pairs where the keys are strings representing different technology acronyms and the values are the corresponding full names of the technologies. Your task is to write a function that converts the dictionary into a list of strings,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_tech_dict_to_list({'geo': 'Geolocation', 'http': 'Hypertext Transfer Protocol', 'meta': 'Metadata', 'ssl': 'Secure Sockets Layer', 'whois': 'Whois Protocol'}) == ['Geolocation (geo)', 'Hypertext Transfer Protocol (http)', 'Metadata (meta)', 'Secure S...
{ "split": "train", "index": 3389, "acecode_id": "oss_185", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, write a function `split_array` that determines if it is possible to split the array into three non-empty contiguous segments such that the product of the numbers in each segment is the same. If such a split is possible, return the segments as a tuple...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert split_array([1, 2, 2, 4, 8]) == -1\", \"assert split_array([0, 0, 0]) == ([0], [0], [0])\", \"assert split_array([2, 2, 2]) == ([2], [2], [2])\", \"assert split_array([1, 3, 1, 3, 1]) == -1\", \"assert split_array([1, 2, 3, 6]) == -1\", \"assert split_array(...
{ "split": "train", "index": 3390, "acecode_id": "evol_10349", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given URL matches a specific format defined by a regular expression. The URL should start with a base URL, followed by one or more words. Each word must start with an uppercase letter followed by one or more lowercase let...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_url('/MyPage123/') == False\", \"assert is_valid_url('/page/') == False\", \"assert is_valid_url('/invalidPageName/') == False\", \"assert is_valid_url('/123Page/') == False\", \"assert is_valid_url('/anotherpage/') == False\", \"assert is_valid_url...
{ "split": "train", "index": 3391, "acecode_id": "oss_1407", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, `mean` and `std`, each containing `n` elements. Write a function `normalize_data(mean: List[int], std: List[int]) -> List[float]` that computes the normalized values of the integers in the `mean` list using the corresponding values in the `s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_data([0, 0], [1, 1]) == [0.0, 0.0]\", \"assert normalize_data([1, 1, 1], [1, 1, 0]) == []\", \"assert normalize_data([1, 2, 3, 4, 5], [0, 1, 1, 1, 1]) == []\", \"assert normalize_data([1, 2], [1]) == []\", \"assert normalize_data([1], [1]) == [0.0]...
{ "split": "train", "index": 3392, "acecode_id": "bigcode_python_fns_38598", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of strings, implement a function that converts all the strings into uppercase. The function should also handle any given string that may have leading or trailing whitespaces. Write a function named `convert_to_upper` that takes a list of strings as input and return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_upper([' hello ', 'world ', ' python ']) == ['HELLO', 'WORLD', 'PYTHON']\", \"assert convert_to_upper(['']) == ['']\", \"assert convert_to_upper([' multiple spaces ']) == ['MULTIPLE SPACES']\", \"assert convert_to_upper(['single']) == ['S...
{ "split": "train", "index": 3393, "acecode_id": "evol_7523", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function that identifies a sequence of characters that starts with the letter 'a' and ends with the letter 'b', regardless of the characters in between. If the input string does not contain the letters 'a' or 'b', the function should return a suitable error message. P...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_sequence('a123b') == 'a123b'\", \"assert find_sequence('abxyz') == 'ab'\", \"assert find_sequence('aXYZb') == 'aXYZb'\", \"assert find_sequence('ab') == 'ab'\", \"assert find_sequence('a!@#$%^&*()b') == 'a!@#$%^&*()b'\", \"assert find_sequence('a b') ==...
{ "split": "train", "index": 3394, "acecode_id": "evol_11495", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function `generate_random_in_range()` that generates a random floating-point number between 5 (inclusive) and 20 (exclusive). The function should not take any parameters and should return the generated random number.\nPlease reason step by step, then write a self-co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert 5 <= generate_random_in_range() < 20\", \"assert 5 <= generate_random_in_range() < 20\", \"assert 5 <= generate_random_in_range() < 20\", \"assert 5 <= generate_random_in_range() < 20\", \"assert 5 <= generate_random_in_range() < 20\", \"assert 5 <= generate...
{ "split": "train", "index": 3395, "acecode_id": "evol_27873", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `extract_email_addresses(text: str) -> List[str]` that takes a string `text` as input and returns a list of all unique email addresses found in the text. The email addresses should be returned in the order they were found. An email address is defined as a s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_email_addresses('Contact us at support@example.com for more information.') == ['support@example.com']\", \"assert extract_email_addresses('Please reach out to info@example.com or sales@example.com for inquiries.') == ['info@example.com', 'sales@examp...
{ "split": "train", "index": 3396, "acecode_id": "evol_3253", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_perfect_squares_and_cubes(n)` that identifies all perfect squares and perfect cubes within the range from 1 to a user-defined integer `n`. The function should return a dictionary with two keys: 'Perfect Squares' and 'Perfect Cubes', where each key map...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_perfect_squares_and_cubes(1) == {'Perfect Squares': [1], 'Perfect Cubes': [1]}\", \"assert find_perfect_squares_and_cubes(2) == {'Perfect Squares': [1], 'Perfect Cubes': [1]}\", \"assert find_perfect_squares_and_cubes(3) == {'Perfect Squares': [1], 'Per...
{ "split": "train", "index": 3397, "acecode_id": "evol_17058", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple bank account's operations. The function should take a list of operations as input, where each operation is represented as a tuple. Each tuple consists of an operation type ('deposit' or 'withdraw') and an amount. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_account([('deposit', 100), ('withdraw', 50)]) == (50, 2)\", \"assert bank_account([]) == (0, 0)\", \"assert bank_account([('deposit', 50)]) == (50, 1)\", \"assert bank_account([('withdraw', 20)]) == (0, 0)\", \"assert bank_account([('deposit', 100), ('d...
{ "split": "train", "index": 3398, "acecode_id": "oss_11454", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Design a function in Python that takes an integer input 'y' and returns the smallest Pythagorean quadruplet (a, b, c, d) such that a + b + c + d = y and a^2 + b^2 + c^2 = d^2. The integers a, b, c, and d must be positive and distinct. If no such quadruplet exists, return an emp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert smallest_pythagorean_quadruplet(34) == []\", \"assert smallest_pythagorean_quadruplet(20) == []\", \"assert smallest_pythagorean_quadruplet(40) == []\", \"assert smallest_pythagorean_quadruplet(25) == []\", \"assert smallest_pythagorean_quadruplet(10) == []\...
{ "split": "train", "index": 3399, "acecode_id": "evol_26300", "num_tests": 7 }