data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "Given an array of strings, write a function that returns an array containing only the longest strings based on a specified character counting method. The function should take a parameter that determines whether to count whitespace characters. If two or more strings have the sam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_strings(['hello world!', 'how are you?', 'I am fine.', 'thisisaverylongsentencewithoutanyspacesorspecialcharacters'], True) == ['thisisaverylongsentencewithoutanyspacesorspecialcharacters']\", \"assert longest_strings(['hello world!', 'how are you?',... | {
"split": "train",
"index": 73000,
"acecode_id": "evol_35948",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Write a function `create_fibonacci_sequence(n: int) -> List[int]` that generates a sequence of Fibonacci numbers up to the n-th element. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the previous two nu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_fibonacci_sequence(1) == [0]\", \"assert create_fibonacci_sequence(2) == [0, 1]\", \"assert create_fibonacci_sequence(3) == [0, 1, 1]\", \"assert create_fibonacci_sequence(4) == [0, 1, 1, 2]\", \"assert create_fibonacci_sequence(5) == [0, 1, 1, 2, 3]\... | {
"split": "train",
"index": 73001,
"acecode_id": "evol_2270",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the number of clusters based on a specified range and clustering parameters. Implement a function `calculate_clusters` that takes in the following parameters: \n- `N_range`: A list containing two integers representing the minimum and maximum numb... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_clusters([2, 5], 'euclidean', 'complete', [0.1, 0.2]) == 7\", \"assert calculate_clusters([3, 3], 'manhattan', 'average', [0.5, 0.6]) == 3\", \"assert calculate_clusters([1, 4], 'euclidean', 'single', [0.3, 0.4]) == 5\", \"assert calculate_clusters... | {
"split": "train",
"index": 73002,
"acecode_id": "oss_20428",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `text` that may contain some special characters. Your task is to implement a function `raw(text: str) -> str` that returns a new string where each character in `text` is transformed according to a predefined mapping stored in a dictionary called `trans_ma... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert raw('abcde') == '12345'\", \"assert raw('abcdef') == '12345f'\", \"assert raw('xyz') == 'xyz'\", \"assert raw('aabbccdd') == '11223344'\", \"assert raw('') == ''\", \"assert raw('edcba') == '54321'\", \"assert raw('abcdxyz') == '1234xyz'\", \"assert raw('aaa... | {
"split": "train",
"index": 73003,
"acecode_id": "bigcode_python_fns_30580",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `set_number_of_legs(num_legs: int) -> int` that simulates the behavior of an animal's legs. The function should accept a non-negative integer `num_legs` and return the number of legs set for the animal. If the input is negative or not an integer, the functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_number_of_legs(4) == 4\", \"assert set_number_of_legs(0) == 0\", \"assert set_number_of_legs(2) == 2\", \"assert set_number_of_legs(-1) == -1\", \"assert set_number_of_legs(7) == 7\", \"assert set_number_of_legs(10) == 10\", \"assert set_number_of_legs(-... | {
"split": "train",
"index": 73004,
"acecode_id": "evol_4335",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of equal length, `rho` and `delta`, return a new list that contains the product of corresponding elements from the `rho` and `delta` lists. The output list should be sorted in descending order. You can assume that both input lists will contain at least one eleme... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_product_and_sort([1, 2, 3], [4, 5, 6]) == [18, 10, 4]\", \"assert compute_product_and_sort([0, 0, 0], [1, 2, 3]) == [0, 0, 0]\", \"assert compute_product_and_sort([-1, -2, -3], [4, 5, 6]) == [-4, -10, -18]\", \"assert compute_product_and_sort([3, 1, ... | {
"split": "train",
"index": 73005,
"acecode_id": "bigcode_python_fns_24752",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of GPS coordinate records, where each record consists of a timestamp and three floating-point values representing the east, north, and up coordinates. Your task is to implement a function that normalizes these coordinates based on a specified method. You ne... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_gps_coordinates([['2023-01-01', 1.0, 2.0, 3.0], ['2023-01-02', 4.0, 5.0, 6.0], ['2023-01-03', 7.0, 8.0, 9.0], ['2023-01-04', 10.0, 11.0, 12.0], ['2023-01-05', 13.0, 14.0, 15.0], ['2023-01-06', 16.0, 17.0, 18.0], ['2023-01-07', 19.0, 20.0, 21.0], ['... | {
"split": "train",
"index": 73006,
"acecode_id": "bigcode_python_fns_13008",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Write a function `calculate_torus_volume(r, R)` that calculates the volume of a torus using the formula `(pi * r^2) * (2 * pi * R)`, where 'r' is the radius of the tube and 'R' is the distance from the center of the tube to the center of the torus. The function should reject an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_torus_volume(1, -1) == 'Invalid input'\", \"assert calculate_torus_volume(-1, 1) == 'Invalid input'\", \"assert calculate_torus_volume('a', 2) == 'Invalid input'\", \"assert calculate_torus_volume(1, 'b') == 'Invalid input'\", \"assert calculate_to... | {
"split": "train",
"index": 73007,
"acecode_id": "evol_34417",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of variable names and their associated dimensions in a dictionary format. Each variable is represented by a string key, and its dimensions are represented as a tuple of strings (e.g., ('t', 'x')). Your task is to implement a function `find_major_minor_vars(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_major_minor_vars({'var1': ('t',), 'var2': ('t', 'x'), 'var3': ('y',), 'var4': ('t', 'y', 'z')}) == (['var2', 'var4'], ['var1', 'var3'])\", \"assert find_major_minor_vars({'a': ('t', 'b'), 'b': ('t',), 'c': ('c', 'd')}) == (['a'], ['b', 'c'])\", \"assert... | {
"split": "train",
"index": 73008,
"acecode_id": "bigcode_python_fns_37949",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of expected parameters and a dictionary representing a request. The function should check if all expected parameters are present in the request dictionary, and if so, return a new dictionary containing only those... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_params({'param1': 'value1', 'param2': 'value2'}, ['param1', 'param2']) == {'param1': 'value1', 'param2': 'value2'}\", \"assert get_params({'param1': 'value1'}, ['param1', 'param2']) == None\", \"assert get_params({'param1': 'value1', 'param2': 'value2', ... | {
"split": "train",
"index": 73009,
"acecode_id": "bigcode_python_fns_20620",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function that simulates accessing a photo library. However, this function may raise an exception if the library is not accessible. Your task is to implement a function `access_photo_library()` that checks if the photo library is accessible and returns a message ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert access_photo_library() == 'Photo library accessed successfully'\", \"assert access_photo_library() == 'Photo library accessed successfully'\", \"assert access_photo_library() == 'Photo library accessed successfully'\", \"assert access_photo_library() == 'Pho... | {
"split": "train",
"index": 73010,
"acecode_id": "bigcode_python_fns_29135",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves the names of databases from a given list of database entries. Each database entry is represented as a dictionary with various attributes, including 'name', 'description', and 'created_at'. Your function should take a li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_database_names([]) == []\", \"assert get_database_names([{ 'name': 'db1', 'description': 'test db', 'created_at': '2023-01-01' }]) == ['db1']\", \"assert get_database_names([{ 'name': 'db1', 'description': 'test db', 'created_at': '2023-01-01' }, { 'name... | {
"split": "train",
"index": 73011,
"acecode_id": "bigcode_python_fns_16489",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string of comments separated by commas, determine if any of the comments contain the word 'part' at the beginning of the comment. The function should return True if at least one comment starts with 'part', and False otherwise. The input string may contain leading or tra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_if_partial('part1, part2, part3') == True\", \"assert check_if_partial('part of the series') == True\", \"assert check_if_partial('no parts here') == False\", \"assert check_if_partial(' partA, something else') == True\", \"assert check_if_partial(' ... | {
"split": "train",
"index": 73012,
"acecode_id": "bigcode_python_fns_49375",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, write a function that counts the number of vowels (case-insensitive) in the string. Return the total count of vowels found in the input string.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```pytho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_vowels('Hello, World!') == 3\", \"assert count_vowels('A quick brown fox jumps over the lazy dog.') == 11\", \"assert count_vowels('') == 0\", \"assert count_vowels('BCDFG') == 0\", \"assert count_vowels('The quick brown fox') == 5\", \"assert count_vo... | {
"split": "train",
"index": 73013,
"acecode_id": "evol_13601",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates the sum of squares of all the elements in a given list of integers. Your function should take a list of integers as input and return the sum of squares of all the elements in the list. For example, given the input l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_squares([1, 2, 3, 4]) == 30\", \"assert sum_of_squares([0, 0, 0]) == 0\", \"assert sum_of_squares([-1, -2, -3]) == 14\", \"assert sum_of_squares([2]) == 4\", \"assert sum_of_squares([3, 4, 5]) == 50\", \"assert sum_of_squares([10, 20, 30]) == 1400\", ... | {
"split": "train",
"index": 73014,
"acecode_id": "oss_5305",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a JSON string representing configuration settings. The function should accept a JSON string as input, parse it, and return a dictionary where each key is a configuration variable and its value is the corresponding value fro... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_config('{\\\"marsdir\\\": \\\"\\\", \\\"igradir\\\": \\\"\\\", \\\"rasodir\\\": \\\"/home/user/raso_archive\\\"}') == {'marsdir': '', 'igradir': '', 'rasodir': '/home/user/raso_archive'}\", \"assert parse_config('{\\\"key1\\\": \\\"value1\\\", \\\"key2... | {
"split": "train",
"index": 73015,
"acecode_id": "bigcode_python_fns_44151",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a directed graph represented as an adjacency list, implement a function that returns the number of strongly connected components in the graph. A strongly connected component is defined as a subgraph in which every vertex is reachable from every other vertex. The function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_strongly_connected_components({'A': ['B'], 'B': ['A'], 'C': [], 'D': ['E'], 'E': ['D']}) == 3\", \"assert count_strongly_connected_components({'A': [], 'B': [], 'C': []}) == 3\", \"assert count_strongly_connected_components({'A': ['B'], 'B': ['C'], 'C'... | {
"split": "train",
"index": 73016,
"acecode_id": "oss_25454",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Construct a Python function, named 'calculate_circle_area', designed to compute the area of a circular entity given a radius. The function should compute the area using the formula area = π * radius². Additionally, incorporate error-checking mechanisms within your function, suc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_circle_area(5) == 78.53981633974483\", \"assert calculate_circle_area(0) == 0.0\", \"assert calculate_circle_area(3) == 28.274333882308138\", \"assert calculate_circle_area(10) == 314.1592653589793\", \"assert calculate_circle_area(2.5) == 19.63495... | {
"split": "train",
"index": 73017,
"acecode_id": "evol_32761",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a sequence of characters that may include letters, digits, and special characters. Your task is to create a function `anonymise_string` that takes the input string and replaces all occurrences of the names of certain predefined sensitive fiel... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert anonymise_string('My name is John Doe and my surname is Doe.') == 'My [ANONYMOUS] is John Doe and my [ANONYMOUS] is Doe.'\", \"assert anonymise_string('Patient birthdate is 01/01/1990 and folder is A123.') == 'Patient [ANONYMOUS] is 01/01/1990 and [ANONYMOUS... | {
"split": "train",
"index": 73018,
"acecode_id": "bigcode_python_fns_38186",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a signal that has been corrupted by noise. Your task is to implement a function that denoises the signal using a simple thresholding method. The function should take the following parameters: \n\n- `signal`: a list of integers repre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert denoise_signal([10, 20, 30, 40], 25) == [0, 0, 30, 40]\", \"assert denoise_signal([-1, -2, -3, 5, 10], 0) == [0, 0, 0, 5, 10]\", \"assert denoise_signal([5, 4, 3, 2, 1], 2) == [5, 4, 3, 0, 0]\", \"assert denoise_signal([0, 0, 0, 0], 1) == [0, 0, 0, 0]\", \"a... | {
"split": "train",
"index": 73019,
"acecode_id": "bigcode_python_fns_39493",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of numerical values representing feature scores and a positive integer n, write a function `get_top_n_features(scores: List[float], n: int) -> List[float]` that returns the top n scores from the list. The scores should be returned in descending order. If there are ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_top_n_features([3.2, 2.1, 5.0, 4.3], 2) == [5.0, 4.3]\", \"assert get_top_n_features([1.5, 3.5, 2.0, 4.0], 3) == [4.0, 3.5, 2.0]\", \"assert get_top_n_features([10.0, 20.0, 30.0], 5) == [30.0, 20.0, 10.0]\", \"assert get_top_n_features([0.1, 0.5, 0.3], 2... | {
"split": "train",
"index": 73020,
"acecode_id": "bigcode_python_fns_19364",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a multi-dimensional array containing string type elements, implement a function that transforms this array into a single-dimensional array of integer type elements. The function should handle null and undefined string values in the input array, converting valid string rep... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten_convert([['1', '2', None], ['4', '5', None], ['6', '7', '8']]) == [1, 2, 4, 5, 6, 7, 8]\", \"assert flatten_convert([['10', '20', None], [None, '30', '40']]) == [10, 20, 30, 40]\", \"assert flatten_convert([[None, '1', 'two'], ['3', None, '4']]) == [... | {
"split": "train",
"index": 73021,
"acecode_id": "evol_30121",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two points in a 2D space, represented as tuples (x1, y1) and (x2, y2). Write a function `calculate_grasp(contact1: Tuple[int, int], contact2: Tuple[int, int]) -> Dict[str, Union[Tuple[float, float], float, Tuple[float, float]]]` that calculates the midpoint betwee... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_grasp((0, 0), (2, 2)) == {'midpoint': (1.0, 1.0), 'direction': (0.7071067811865475, 0.7071067811865475), 'distance': 2.8284271247461903}\", \"assert calculate_grasp((-1, -1), (1, 1)) == {'midpoint': (0.0, 0.0), 'direction': (0.7071067811865475, 0.7... | {
"split": "train",
"index": 73022,
"acecode_id": "bigcode_python_fns_3919",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Write a function that evaluates a postfix expression given as a string. The expression will consist of non-negative integers and operators ('+', '-', '*', '/'). The function should return the evaluated value of the expression as an integer. For simplicity, assume that the postf... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_postfix('2 3 +') == 5\", \"assert evaluate_postfix('5 1 2 + 4 * + 3 -') == 14\", \"assert evaluate_postfix('4 2 / 3 +') == 5\", \"assert evaluate_postfix('9 3 / 1 +') == 4\", \"assert evaluate_postfix('6 2 3 + -') == 1\", \"assert evaluate_postfix('... | {
"split": "train",
"index": 73023,
"acecode_id": "evol_33346",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and a target integer. Your task is to implement a function that checks if any two distinct integers in the list add up to the target integer. If such a pair exists, return True; otherwise, return False. Please implement the function `has_pair_wi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_pair_with_sum([1, 2, 3, 4, 5], 9) == True\", \"assert has_pair_with_sum([1, 2, 3, 4, 5], 10) == False\", \"assert has_pair_with_sum([0, -1, 2, -3, 1], -2) == True\", \"assert has_pair_with_sum([], 5) == False\", \"assert has_pair_with_sum([1, 5, 3, 4], 8... | {
"split": "train",
"index": 73024,
"acecode_id": "bigcode_python_fns_31481",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of open position IDs and a range of potential order IDs, implement a function that determines which order ID can be used to place a new order. The function should return the first order ID from the range that is not already in the list of open positions. If all ord... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_available_order_id([1, 2, 3], 5) == 4\", \"assert find_available_order_id([1, 2, 3], 3) == -1\", \"assert find_available_order_id([], 5) == 1\", \"assert find_available_order_id([5, 6, 7], 7) == 1\", \"assert find_available_order_id([1, 3, 4], 4) == 2\"... | {
"split": "train",
"index": 73025,
"acecode_id": "evol_27793",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of test module names and a dictionary of common keyword arguments. Your function should return a dictionary where each key is a test module name and each value is the result of running that test module with the provi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert run_tests([], {}) == {}\", \"assert run_tests(['module1', 'module2'], {}) == {'module1': 'success', 'module2': 'success'}\", \"assert run_tests(['module1', ''], {}) == {'module1': 'success'}\", \"assert run_tests(['', 'module2'], {}) == {'module2': 'success'... | {
"split": "train",
"index": 73026,
"acecode_id": "bigcode_python_fns_42861",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that calculates the nth Fibonacci number using memoization. The function should return the result modulo 10^9 + 7. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and for n >= 2, F(n) = F(n-1) + F(n-2). Your function should be named... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2... | {
"split": "train",
"index": 73027,
"acecode_id": "evol_3047",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple banking transaction. Given two bank account balances and a transfer amount, determine the resulting balances after attempting to transfer the specified amount from the first account to the second. If the first ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transfer_balances(100.0, 50.0, 25.0) == (75.0, 75.0)\", \"assert transfer_balances(100.0, 50.0, 150.0) == (100.0, 50.0)\", \"assert transfer_balances(0.0, 0.0, 10.0) == (0.0, 0.0)\", \"assert transfer_balances(50.0, 100.0, 50.0) == (0.0, 150.0)\", \"assert t... | {
"split": "train",
"index": 73028,
"acecode_id": "oss_3902",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two numerical coordinates, easting and northing, and a resolution value, implement a function that determines whether the point defined by the coordinates lies on a vertex based on the resolution. A point is considered to be on a vertex if both the easting and northing va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert _on_vertex(10, 20, 5) == True\", \"assert _on_vertex(30.0, 40.0, 10) == True\", \"assert _on_vertex(33.5, 45.0, 3) == False\", \"assert _on_vertex(0, 0, 1) == True\", \"assert _on_vertex(100, 200, 50) == True\", \"assert _on_vertex(99, 199, 5) == False\", \"... | {
"split": "train",
"index": 73029,
"acecode_id": "bigcode_python_fns_49656",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a job scheduling system for a computing cluster. The function should be able to allocate a variable number of workers to perform calculations and manage the distribution of tasks across these workers. Implement the function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert schedule_jobs(1, 3, [('task1', 5), ('task2', 3), ('task3', 2)]) == [('task1', 'completed'), ('task2', 'completed'), ('task3', 'completed')]\", \"assert schedule_jobs(2, 5, [('task1', 10), ('task2', 5), ('task3', 8)]) == [('task1', 'completed'), ('task2', 'co... | {
"split": "train",
"index": 73030,
"acecode_id": "oss_27980",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a file path. Your task is to implement a function that checks whether the file has a valid data file extension. The valid extensions are: '.em', '.hdf', '.mrc', and '.rec'. Your function should return True if the file has a valid extension an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_valid_extension('data/sample.em') == True\", \"assert has_valid_extension('data/sample.hdf') == True\", \"assert has_valid_extension('data/sample.mrc') == True\", \"assert has_valid_extension('data/sample.rec') == True\", \"assert has_valid_extension('da... | {
"split": "train",
"index": 73031,
"acecode_id": "bigcode_python_fns_48143",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers 'arr', implement a function that returns the first 'N' smallest integers from the array in ascending order. If 'N' is greater than the length of the array, return the entire array sorted in ascending order. Please implement the function 'solution(arr,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solution([8, 7, 6, 5, 4, 1], 4) == [1, 4, 5, 6]\", \"assert solution([10, 3, 5, 7, 2], 3) == [2, 3, 5]\", \"assert solution([1, 2, 3], 5) == [1, 2, 3]\", \"assert solution([5], 1) == [5]\", \"assert solution([-1, -5, 0, 3], 2) == [-5, -1]\", \"assert solutio... | {
"split": "train",
"index": 73032,
"acecode_id": "evol_3323",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a bubble sort algorithm to sort the provided sequence of numbers. The algorithm should be optimized such that no additional comparisons are done once the sequence is sorted. Additionally, the function should accept a parameter that indicates whether the sorting should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([17, 2, 11, 6, 13, 2, 11, 13, 17, 6], 'ascending') == [2, 2, 6, 6, 11, 11, 13, 13, 17, 17]\", \"assert bubble_sort([17, 2, 11, 6, 13, 2, 11, 13, 17, 6], 'descending') == [17, 17, 13, 13, 11, 11, 6, 6, 2, 2]\", \"assert bubble_sort([], 'ascending'... | {
"split": "train",
"index": 73033,
"acecode_id": "evol_24985",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a non-negative integer n, write a function `count_bits` that returns the number of set bits (binary 1s) in the binary representation of n. The input n will be a non-negative integer. For example, if n is 5, its binary representation is 101, which contains 2 set bits. Ther... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_bits(0) == 0\", \"assert count_bits(1) == 1\", \"assert count_bits(2) == 1\", \"assert count_bits(3) == 2\", \"assert count_bits(4) == 1\", \"assert count_bits(5) == 2\", \"assert count_bits(6) == 2\", \"assert count_bits(7) == 3\", \"assert count_bits... | {
"split": "train",
"index": 73034,
"acecode_id": "oss_17728",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates whether a user has administrative privileges on a Windows machine. Implement the function `has_admin_privileges()` that takes no parameters and returns a boolean value: `True` if the user has administrative privileges, and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_admin_privileges() == True\", \"assert has_admin_privileges() == True\", \"assert has_admin_privileges() == True\", \"assert has_admin_privileges() == True\", \"assert has_admin_privileges() == True\", \"assert has_admin_privileges() == True\", \"assert ... | {
"split": "train",
"index": 73035,
"acecode_id": "bigcode_python_fns_25458",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given an array of integers. Your task is to implement a function that determines if the array can be sorted by performing at most one of the following operations: swapping two elements, deleting one element, or inverting a subarray. If it is possible to sort the array w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert advanced_sort([1, 3, 2, 4]) == (True, ['swap element 1 and 2'])\", \"assert advanced_sort([1, 2, 3]) == (True, [])\", \"assert advanced_sort([3, 4, 5, 2]) == (True, ['delete element 3'])\", \"assert advanced_sort([2, 1]) == (True, ['swap element 0 and 1'])\"... | {
"split": "train",
"index": 73036,
"acecode_id": "evol_33315",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of CSV file names that follow a specific naming convention. Each CSV file name contains a number followed by an underscore and then the original name. Your goal is to extract the original name from the file names, map it to a processed name... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_csv_files(['1_data.csv', '2_info.csv', '3_metrics.csv'], {'data': 'dataset', 'info': 'information'}) == [('data', 'dataset', [{'key1': 'value1', 'key2': 'value2'}]), ('info', 'information', [{'key1': 'value1', 'key2': 'value2'}])]\", \"assert process... | {
"split": "train",
"index": 73037,
"acecode_id": "bigcode_python_fns_14342",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the average performance metric from two lists of metrics: training metrics and validation metrics. The function `calculate_average_metrics` takes in the following parameters: \n- `train_metrics`: A list of floating-point ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_metrics([1.0, 1.0, 1.0], [1.0, 1.0, 1.0]) == (1.0, 1.0)\", \"assert calculate_average_metrics([], [0.8, 0.85]) == (0.0, 0.825)\", \"assert calculate_average_metrics([0.9], [0.9]) == (0.9, 0.9)\", \"assert calculate_average_metrics([0.1, 0.2... | {
"split": "train",
"index": 73038,
"acecode_id": "oss_15688",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Design a function that verifies a user's access pin. The pin must be deemed valid if it meets the following criteria: (i) It has an odd number of digits. (ii) It contains at least two non-sequential numbers. (iii) It does not form any known number patterns (like '1234', '1111',... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_pin('1111') == 'Invalid'\", \"assert check_pin('1234') == 'Invalid'\", \"assert check_pin('4321') == 'Invalid'\", \"assert check_pin('123456') == 'Invalid'\", \"assert check_pin('00000') == 'Invalid'\", \"assert check_pin('13579') == 'Valid'\", \"asser... | {
"split": "train",
"index": 73039,
"acecode_id": "evol_22658",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function that accepts a value (string) representing a number and two integers, low and high, which define a range. The function should return the closest integer to the input value without using built-in functions like round(). The function must validate that the in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert special_rounding('10', 0, 20) == 10\", \"assert special_rounding('15.6', 10, 20) == 16\", \"assert special_rounding('9.5', 0, 10) == 10\", \"assert special_rounding('3.3', 3, 5) == 3\", \"assert special_rounding('3.7', 3, 5) == 4\", \"assert special_rounding... | {
"split": "train",
"index": 73040,
"acecode_id": "evol_5663",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given two dictionaries, `parcels_old` and `parcels_new`, where each dictionary represents a mapping of sample assignments to their respective connected component vertices. The keys of the dictionaries are unique identifiers for connected components, and the values are l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delta_vertices({'A': [1, 2, 3], 'B': [4]}, {'A': [1, 2], 'B': [4, 5]}) == 1\", \"assert delta_vertices({'A': [1]}, {'A': [1], 'B': [2]}) == 1\", \"assert delta_vertices({}, {'A': [1, 2, 3]}) == 3\", \"assert delta_vertices({'A': [1, 2]}, {}) == 0\", \"assert... | {
"split": "train",
"index": 73041,
"acecode_id": "bigcode_python_fns_9633",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating basic banking operations for a single bank account. Implement a function that takes an initial balance and a series of transactions (deposits and withdrawals) and returns the final balance after performing all the transactions. Each transaction is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert final_balance(1000, [('deposit', 500), ('withdraw', 200)]) == 1300\", \"assert final_balance(1000, [('deposit', 200), ('withdraw', 500), ('withdraw', 100)]) == 600\", \"assert final_balance(1000, [('withdraw', 1500)]) == 1000\", \"assert final_balance(0, [('... | {
"split": "train",
"index": 73042,
"acecode_id": "oss_37669",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of elements representing different types of UI components in a web application, such as 'Button', 'Input', and 'Link'. Each component is represented as a dictionary with a key 'type' that indicates its type. Your task is to implement a function that verifie... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_component_types([{'type': 'Button'}, {'type': 'Input'}, {'type': 'Link'}]) is None\", \"assert validate_component_types([{'type': 'Button'}, {'type': 'Input'}]) is None\", \"assert validate_component_types([{'type': 'Link'}, {'type': 'Button'}, {'ty... | {
"split": "train",
"index": 73043,
"acecode_id": "bigcode_python_fns_33492",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with designing a function that calculates the weights for different intensity measures (IMs) based on a conditioning intensity measure (IM_j). The function should behave as follows: If the conditioning IM is of type 'pSA' (spectral acceleration), assign 70% of th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert default_IM_weights('pSA', ['pSA', 'pSA', 'other1', 'other2']) == [0.35, 0.35, 0.15, 0.15]\", \"assert default_IM_weights('pSA', ['pSA', 'other1']) == [0.7, 0.3]\", \"assert default_IM_weights('pSA', ['pSA']) == [1.0]\", \"assert default_IM_weights('other', [... | {
"split": "train",
"index": 73044,
"acecode_id": "bigcode_python_fns_14302",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates a custom form based on specific criteria. The function `validate_custom_form` takes in two parameters: `is_generic_valid` (a boolean indicating whether the generic validation passed) and `custom_validation_condition` (a boo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_custom_form(True, True) == True\", \"assert validate_custom_form(True, False) == False\", \"assert validate_custom_form(False, True) == False\", \"assert validate_custom_form(False, False) == False\", \"assert validate_custom_form(True, True) == Tru... | {
"split": "train",
"index": 73045,
"acecode_id": "oss_10920",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that returns the total number of unique elements in a given list of integers. The function should take a list of integers as input and return the count of distinct integers. For example, if the input list is [1, 2, 2, 3, 4, 4, 5], the out... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_elements([]) == 0\", \"assert count_unique_elements([1, 1, 1, 1]) == 1\", \"assert count_unique_elements([1, 2, 2, 3, 4]) == 4\", \"assert count_unique_elements([5, 5, 5, 5, 5]) == 1\", \"assert count_unique_elements([1, 2, 3, 4, 5]) == 5\", \"a... | {
"split": "train",
"index": 73046,
"acecode_id": "bigcode_python_fns_23405",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of sequences (each a list of integers), write a function that pads each sequence with a specified value to ensure that all sequences have the same length. If a maximum length is not specified, the function should pad to the length of the longest sequence in the inp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pad_sequences([[1, 2, 3], [4, 5]], 5, 0) == [[0, 0, 1, 2, 3], [0, 0, 0, 4, 5]]\", \"assert pad_sequences([[1, 2], [3, 4]], 3, 0) == [[0, 1, 2], [0, 3, 4]]\", \"assert pad_sequences([[1, 2]], 2, 99) == [[1, 2]]\", \"assert pad_sequences([[1, 2, 3], []], None,... | {
"split": "train",
"index": 73047,
"acecode_id": "bigcode_python_fns_14150",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that converts a given temperature in Celsius to Fahrenheit and Kelvin. The conversion formulas are as follows: Fahrenheit = (Celsius / 5) * 9 + 32 and Kelvin = Celsius + 273. Write a function called `temperature_converter` that tak... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert temperature_converter(0) == (32.0, 273)\", \"assert temperature_converter(100) == (212.0, 373)\", \"assert temperature_converter(-40) == (-40.0, 233)\", \"assert temperature_converter(25) == (77.0, 298)\", \"assert temperature_converter(30) == (86.0, 303)\",... | {
"split": "train",
"index": 73048,
"acecode_id": "oss_1113",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the state of pins (where 0 means the pin is LOW and 1 means the pin is HIGH). Write a function `count_low_pins(pins: List[int]) -> int` that returns the number of pins that are in the LOW state (0). The function should take a list o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_low_pins([0, 1, 0, 1, 0]) == 3\", \"assert count_low_pins([1, 1, 1, 1, 1]) == 0\", \"assert count_low_pins([0, 0, 0, 0, 0]) == 5\", \"assert count_low_pins([1, 0, 1, 0, 1]) == 2\", \"assert count_low_pins([1]) == 0\", \"assert count_low_pins([0]) == 1\... | {
"split": "train",
"index": 73049,
"acecode_id": "bigcode_python_fns_1570",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, your task is to filter out the integers that are within the range of 1 to 9, sort them in ascending order, and then reverse the order of the sorted integers. Finally, replace each integer with its corresponding English word representation from 1 to 9... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert by_length([2, 1, 1, 4, 5, 8, 2, 3]) == ['Eight', 'Five', 'Four', 'Three', 'Two', 'Two', 'One', 'One']\", \"assert by_length([]) == []\", \"assert by_length([1, -1, 55]) == ['One']\", \"assert by_length([10, 11, 12]) == []\", \"assert by_length([9, 8, 7, 6, 5... | {
"split": "train",
"index": 73050,
"acecode_id": "evol_4078",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `permute` that takes a list of alphanumeric variables and returns a new list with the elements rearranged in reverse order. The function should handle empty lists, lists with a single element, lists with duplicate elements, and maintain the integrity of the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert permute([]) == []\", \"assert permute(['a']) == ['a']\", \"assert permute(['a', 'a', 'b']) == ['b', 'a', 'a']\", \"assert permute(['a', 'b', 1, 2]) == [2, 1, 'b', 'a']\", \"assert permute(['a', 'b', 'c']) == ['c', 'b', 'a']\", \"assert permute(['1', '2', '3'... | {
"split": "train",
"index": 73051,
"acecode_id": "evol_36125",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that converts a given Python dictionary into a string formatted in YAML (YAML Ain't Markup Language). The function should take a dictionary as input and return a string representation of that dictionary in YAML format. You can assume that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dict_to_yaml({'item': {'id': 1, 'value': 'apple'}}) == 'item:\\\\n id: 1\\\\n value: apple\\\\n'\", \"assert dict_to_yaml({'level': {'one': 1, 'two': {'three': 3}}}) == 'level:\\\\n one: 1\\\\n two:\\\\n three: 3\\\\n'\", \"assert dict_to_yaml({}) == ... | {
"split": "train",
"index": 73052,
"acecode_id": "bigcode_python_fns_4544",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Create a function `get_customer_info(customer_db: Dict[str, Dict[str, str]], name: str) -> Union[Dict[str, str], str]` that takes a dictionary representing a customer database and a customer name as inputs. The function should return the customer's information (name, email, and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_customer_info({'Alice': {'name': 'Alice', 'email': 'alice@example.com', 'phone': '1234567890'}}, 'Alice') == {'name': 'Alice', 'email': 'alice@example.com', 'phone': '1234567890'}\", \"assert get_customer_info({'Bob': {'name': 'Bob', 'email': 'bob@exampl... | {
"split": "train",
"index": 73053,
"acecode_id": "evol_23430",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_closest_elements(input_list)` that takes a list of integers as input and returns a tuple containing the two closest unique numbers in the list. The input list must contain at least four unique integers. If there are fewer than four unique integers, th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_closest_elements([1, 3, 5, 7, 9]) == (1, 3)\", \"assert find_closest_elements([2, 4, 6, 8, 10]) == (2, 4)\", \"assert find_closest_elements([1, 2, 3, 4, 5, 6]) == (1, 2)\", \"assert find_closest_elements([4, 4, 4, 4]) == 'Error: Input list should contai... | {
"split": "train",
"index": 73054,
"acecode_id": "evol_25757",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the factorial of a non-negative integer using tail recursion. The function should take two parameters: `n`, the number for which to calculate the factorial, and `acc`, an accumulator that should default to 1. The function should return the f... | 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": 73055,
"acecode_id": "evol_34793",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the votes for different questions on a platform. Your task is to write a function that takes this list as input and returns a new list containing the titles of questions that have received more than a specified number of votes. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_questions([('Question 1', 5), ('Question 2', 15), ('Question 3', 7)], 10) == ['Question 2']\", \"assert filter_questions([('Title 1', 0), ('Title 2', 0), ('Title 3', 0)], 1) == []\", \"assert filter_questions([('Low Votes', 1), ('Medium Votes', 5), ('... | {
"split": "train",
"index": 73056,
"acecode_id": "oss_26664",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the even numbers from the original list. The function should maintain the order of the even numbers as they appeared in the input list. Implement a function called `filt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) == [2, 4,... | {
"split": "train",
"index": 73057,
"acecode_id": "oss_29607",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of programming languages and their respective line counts in a GitHub repository. Your task is to create a function `get_language_statistics` that takes this list as input and returns a dictionary containing the programming languages and their total line co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_language_statistics([('Python', 1500), ('JavaScript', 800), ('HTML', 300), ('CSS', 200)]) == {'Python': 1500, 'JavaScript': 800, 'HTML': 300, 'CSS': 200}\", \"assert get_language_statistics([('Python', 500), ('Python', 1000), ('Java', 300)]) == {'Python'... | {
"split": "train",
"index": 73058,
"acecode_id": "oss_15562",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `check_user_access(headers: Dict[str, str]) -> bool` that checks if a user has access based on their roles. The function takes a dictionary `headers` containing two keys: 'X-Identity-Status' and 'X-Roles'. The 'X-Identity-Status' can be e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_user_access({'X-Identity-Status': 'valid', 'X-Roles': 'admin'}) == True\", \"assert check_user_access({'X-Identity-Status': 'valid', 'X-Roles': 'user'}) == False\", \"assert check_user_access({'X-Identity-Status': 'invalid', 'X-Roles': 'admin'}) == Fal... | {
"split": "train",
"index": 73059,
"acecode_id": "bigcode_python_fns_12631",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string, write a function that extracts and returns a comma-separated string of unique words that contain the character 'a'. The words should be considered case-insensitively and should be displayed in alphabetical order. Punctuation and whitespace should be properly han... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_words('No words here!') == ''\", \"assert extract_words('The sun shines brightly.') == ''\", \"assert extract_words('Apples are awesome, bananas are too.') == 'apples, are, awesome, bananas'\", \"assert extract_words('Can you see the stars?') == 'can... | {
"split": "train",
"index": 73060,
"acecode_id": "evol_22602",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of timestamps representing events that occurred in a trial. Each timestamp is an integer representing milliseconds. Your task is to filter out timestamps based on a given time threshold. Specifically, you should keep only those timestamps where the differen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_events([100, 200, 300, 400], 50) == [100, 200, 300, 400]\", \"assert filter_events([100, 300, 500], 50) == [100, 300, 500]\", \"assert filter_events([100, 350, 600], 200) == [100, 350, 600]\", \"assert filter_events([100, 101, 102, 103, 104], 0) == [1... | {
"split": "train",
"index": 73061,
"acecode_id": "bigcode_python_fns_45061",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a storage system for different sizes of items. The sizes of items are defined by two constants, 'xlarge' and 'quadlarge'. Your function should take a list of tuples as input, where each tuple consists of a size (either ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert item_storage([('xlarge', 5), ('quadlarge', 3)]) == {'xlarge': 5, 'quadlarge': 3}\", \"assert item_storage([('xlarge', 0), ('quadlarge', 0)]) == {}\", \"assert item_storage([('xlarge', 10)]) == {'xlarge': 10}\", \"assert item_storage([('quadlarge', 7)]) == {'... | {
"split": "train",
"index": 73062,
"acecode_id": "oss_18576",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing a deck of cards. Your task is to implement a function `hasGroupsSizeX(deck: List[int]) -> bool` that returns `true` if it is possible to partition the deck into one or more groups, such that each group contains exactly `X` cards whe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hasGroupsSizeX([1,2,3,4,4,3,2,1]) == True\", \"assert hasGroupsSizeX([1,1,1,2,2,2,3,3]) == False\", \"assert hasGroupsSizeX([1]) == False\", \"assert hasGroupsSizeX([1,1]) == True\", \"assert hasGroupsSizeX([1,1,2,2,2,2]) == True\", \"assert hasGroupsSizeX([... | {
"split": "train",
"index": 73063,
"acecode_id": "evol_5760",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that sets the visibility of specific heads-up displays (HUDs) in a virtual environment. The function should take a boolean value indicating whether to show or hide the HUDs and a list of HUD names. If the list of HUD names is not provided... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_hud_visibility(True, ['speed', 'health']) == None\", \"assert set_hud_visibility(False, ['ammo', 'map']) == None\", \"assert set_hud_visibility(True, []) == None\", \"assert set_hud_visibility(False, ['score', 'stamina']) == None\", \"assert set_hud_visi... | {
"split": "train",
"index": 73064,
"acecode_id": "bigcode_python_fns_22155",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are developing a rule-based decision-making system, and you need to implement a function that prunes an attribute from the antecedent of a rule and returns the updated antecedent. The antecedent is represented as a dictionary, where each key-value pair represents a conditio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prune_attribute({'condition1': True, 'condition2': False}, 'condition1') == {'condition2': False}\", \"assert prune_attribute({'condition1': True, 'condition2': False}, 'condition3') == {'condition1': True, 'condition2': False}\", \"assert prune_attribute({}... | {
"split": "train",
"index": 73065,
"acecode_id": "oss_20689",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that calculates the depth of a nested directory structure represented as a string. The function should take a string representing the path of the directory and return the depth of the directory structure. The depth is defined a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_depth('root/') == 1\", \"assert calculate_depth('root/dir1/') == 2\", \"assert calculate_depth('root/dir1/dir2/') == 3\", \"assert calculate_depth('root/dir1/dir2/dir3/') == 4\", \"assert calculate_depth('root/dir1/dir2/dir3/dir4/') == 5\", \"asser... | {
"split": "train",
"index": 73066,
"acecode_id": "oss_13406",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list (matrix) of integers, implement a function that calculates the sum of all the prime numbers contained in the matrix. A prime number is defined as a natural number greater than 1 that has no positive divisors other than 1 and itself. Write a function `matrix_prim... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert matrix_prime_sum([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == 17\", \"assert matrix_prime_sum([[10, 11, 12], [13, 14, 15]]) == 24\", \"assert matrix_prime_sum([[0, -1, -2], [-3, -4, -5]]) == 0\", \"assert matrix_prime_sum([[2, 3, 5], [7, 11, 13]]) == 41\", \"assert... | {
"split": "train",
"index": 73067,
"acecode_id": "evol_14861",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of floating-point numbers and a positive integer window size, implement a function that calculates the rolling mean of the numbers in the list. The rolling mean for a given index is defined as the average of the numbers in the window defined by the index and the pr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rma([3, 5, 7, 2, 8, 10, 11, 65, 72, 81, 99, 100, 150], 3) == [5.0, 4.666666666666667, 5.666666666666667, 6.666666666666667, 9.666666666666666, 28.666666666666668, 49.333333333333336, 72.66666666666667, 84.0, 93.33333333333333, 116.33333333333333]\", \"assert... | {
"split": "train",
"index": 73068,
"acecode_id": "oss_30112",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a passage of text. Your task is to classify the passage under one of these five divisions: maritime, quantum computing, holistic health, performance art, or classical music. Implement a function `classify_text(text: str) -> str` that returns the appropriate divisi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_text('CMA CGM recently launched their new fleet of cargo ships, powered by lightweight composites and an advanced navigation system.') == 'maritime'\", \"assert classify_text('Exploring the realms of quantum mechanics and its implications on computi... | {
"split": "train",
"index": 73069,
"acecode_id": "evol_11523",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a nested dictionary where the keys can be integers and the values can either be integers or other dictionaries. Your task is to write a function `dict_expand(d)` that flattens this nested dictionary into a single dictionary. The keys in the resulting dictionary sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dict_expand({}) == {}\", \"assert dict_expand({1: {2: {3: 4}}}) == {(1, 2, 3): 4}\", \"assert dict_expand({1: {}}) == {}\", \"assert dict_expand({1: {2: {3: {4: 5}}}}) == {(1, 2, 3, 4): 5}\", \"assert dict_expand({1: {2: 3, 4: {5: 6}}}) == {(1, 2): 3, (1, 4,... | {
"split": "train",
"index": 73070,
"acecode_id": "bigcode_python_fns_28802",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers as input and returns a list of the integers in random order. The function should not modify the original list but should return a new list containing the same integers in a shuffled manner. Implement the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shuffle_list([1, 2, 3]) != [1, 2, 3] or shuffle_list([1, 2, 3]) == [1, 2, 3] or shuffle_list([1, 2, 3]) == [2, 1, 3] or shuffle_list([1, 2, 3]) == [3, 2, 1]\", \"assert len(shuffle_list([])) == 0\", \"assert len(shuffle_list([5])) == 1\", \"assert shuffle_li... | {
"split": "train",
"index": 73071,
"acecode_id": "oss_11615",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `find_larger_elements(lst, k)` that takes a list `lst` which contains integers and string representations of integers, and an integer `k`. The function should return a tuple containing the count of elements in the list that are larger than `k`, along with a lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_larger_elements([10, 15, 20, 25, '30', '5', 10, '40'], 15) == (4, [2, 3, 4, 7])\", \"assert find_larger_elements([1, 2, 3, 4, 5, '6', '7', '8'], 5) == (3, [5, 6, 7])\", \"assert find_larger_elements(['10', '20', '30'], 15) == (2, [1, 2])\", \"assert fin... | {
"split": "train",
"index": 73072,
"acecode_id": "evol_959",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a test matrix for evaluating extreme conditions based on a given model. The model is represented as a list of dictionaries, where each dictionary contains the keys 'Real Name', 'Comment', and 'bounds'. The 'bounds' key cont... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_extreme_conditions_test_matrix([{'Real Name': 'Var1', 'Comment': 'Test variable', 'bounds': '0,10'}]) == [{'Real Name': 'Var1', 'Comment': 'Test variable', 'Value': 0}, {'Real Name': 'Var1', 'Comment': 'Test variable', 'Value': 10}]\", \"assert create... | {
"split": "train",
"index": 73073,
"acecode_id": "bigcode_python_fns_45901",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a robot's movements. Implement a function that takes three floating-point numbers representing the target x, y, and z positions of the robot's body within the range of -0.2 to 0.3. The function should return a string indicating the robot's target po... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert robot_position(0.1, 0.1, 0.1) == 'Target position set to (0.1, 0.1, 0.1)'\", \"assert robot_position(-0.2, 0.2, 0.3) == 'Target position set to (-0.2, 0.2, 0.3)'\", \"assert robot_position(0.3, -0.2, 0.0) == 'Target position set to (0.3, -0.2, 0.0)'\", \"ass... | {
"split": "train",
"index": 73074,
"acecode_id": "oss_20183",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a number n representing the count of distinct prime numbers. Write a function that calculates the probability of a derangement of these n prime numbers, which means that none of the prime numbers appear in their original positions. The function should return the p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert deranged_probability(0) == 1.000000000000\", \"assert deranged_probability(1) == 0.000000000000\", \"assert deranged_probability(2) == 0.500000000000\", \"assert deranged_probability(3) == 0.333333333333\", \"assert deranged_probability(5) == 0.366666666667\... | {
"split": "train",
"index": 73075,
"acecode_id": "evol_16222",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing each integer squared. The function should handle an empty list by returning an empty list. Implement the function `square_integers(integers: List[int]) -> List[int]`, whe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_integers([]) == []\", \"assert square_integers([0]) == [0]\", \"assert square_integers([1]) == [1]\", \"assert square_integers([-1]) == [1]\", \"assert square_integers([1, 2, 3]) == [1, 4, 9]\", \"assert square_integers([-1, -2, -3]) == [1, 4, 9]\", \... | {
"split": "train",
"index": 73076,
"acecode_id": "oss_21958",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a URL routing function for a web application. Write a function `generate_url_config` that takes the following parameters: \n- `url_pattern`: a string representing the URL pattern, e.g., `'^forgot-password$'`. \n- `view_name`: a string representi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_url_config('^login$', 'LoginView.as_view()', 'login_v1', 'user_login') == \\\"url(^login$, user_login(LoginView.as_view()), name='login_v1'),\\\"\", \"assert generate_url_config('^signup$', 'SignupView.as_view()', 'signup_v1', 'user_signup') == \\\"... | {
"split": "train",
"index": 73077,
"acecode_id": "oss_6748",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an unsorted list of integers and two distinct numerical values. Your task is to implement a function that takes this list and inserts the first value into the list while maintaining ascending order. Then, insert the second value into the list as a character, where... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert_values([5, 3, 8, 9], 7, 66) == [3, 5, 7, 8, 9, 'B']\", \"assert insert_values([10, 4, 2, 1], 3, 65) == [1, 2, 3, 4, 10, 'A']\", \"assert insert_values([], 5, 70) == [5, 'F']\", \"assert insert_values([1, 2, 3], 4, 90) == [1, 2, 3, 4, 'Z']\", \"assert ... | {
"split": "train",
"index": 73078,
"acecode_id": "evol_13333",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a square matrix containing integers, develop an algorithm to rearrange the elements of the matrix such that no two identical elements share the same row or column. If it is impossible to achieve this arrangement, return the string 'Matrix cannot be arranged'. Implement th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert arrange_matrix([[4, 8, 2, 4], [3, 4, 9, 3], [2, 2, 8, 9], [8, 3, 4, 4]]) == 'Matrix cannot be arranged'\", \"assert arrange_matrix([[1, 1], [1, 1]]) == 'Matrix cannot be arranged'\", \"assert arrange_matrix([[5, 5, 5], [5, 5, 5], [5, 5, 5]]) == 'Matrix canno... | {
"split": "train",
"index": 73079,
"acecode_id": "evol_18514",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that determines if a given timestamp has valid data based on a 24-hour threshold. The function takes a timestamp as input and returns True if the timestamp is within the last 24 hours from the current UTC time, and False otherwise. The inp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_recent_data(datetime.datetime.utcnow() - datetime.timedelta(hours=1)) == True\", \"assert has_recent_data(datetime.datetime.utcnow() - datetime.timedelta(hours=23, minutes=59)) == True\", \"assert has_recent_data(datetime.datetime.utcnow() - datetime.tim... | {
"split": "train",
"index": 73080,
"acecode_id": "bigcode_python_fns_4740",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a sentence in the form of a string. Your task is to implement a function `compute_likelihood(sent: str, temperature: float) -> float` that calculates a likelihood score for the given sentence based on a hypothetical scoring model. The scoring model is defined by t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_likelihood('hello world', 1.0) == 10.0\", \"assert compute_likelihood('openai', 1.0) == 6.0\", \"assert compute_likelihood('test', 0.0) == 0.0\", \"assert compute_likelihood('', 1.0) == 0.0\", \"assert compute_likelihood('hello', -1.0) == 0.0\", \"as... | {
"split": "train",
"index": 73081,
"acecode_id": "bigcode_python_fns_12347",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given three lists of equal length representing the components of a magnetic field in 3D space: 'bx', 'by', and 'bz'. Your task is to compute the current density vector's components (jx, jy, jz) using the curl operation. The curl of a vector field F = (F1, F2, F3) is def... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_current_density([1, 2], [3, 4], [5, 6]) == (0.0, 0.0, 0.0, 0.0)\", \"assert calculate_current_density([0, 0], [0, 0], [0, 0]) == (0.0, 0.0, 0.0, 0.0)\", \"assert calculate_current_density([1, 1], [1, 1], [1, 1]) == (0.0, 0.0, 0.0, 0.0)\", \"assert ... | {
"split": "train",
"index": 73082,
"acecode_id": "bigcode_python_fns_15265",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Design a function that identifies the largest numerical value in an array consisting of integers. The function should take a list of integers as input and return the largest integer found in that list.\nPlease reason step by step, then write a self-contained Python solution. Gi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max([1, 2, 3, 4, 5]) == 5\", \"assert find_max([-1, -2, -3, -4, -5]) == -1\", \"assert find_max([0, 0, 0]) == 0\", \"assert find_max([10, 20, 30, 40, 50]) == 50\", \"assert find_max([5]) == 5\", \"assert find_max([-5, -4, -3, -2, -1]) == -1\", \"assert ... | {
"split": "train",
"index": 73083,
"acecode_id": "evol_13419",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to calculate the average of a list of numbers. Write a function `calculate_average` that takes in the following parameters: \n- `numbers` (list of floats): A list of numerical values for which the average is to be calculated. The l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average([1.0, 2.0, 3.0]) == 2.0\", \"assert calculate_average([10.0, 20.0, 30.0]) == 20.0\", \"assert calculate_average([5.5, 5.5, 5.5]) == 5.5\", \"assert calculate_average([-1.0, 1.0]) == 0.0\", \"assert calculate_average([0.0, 0.0, 0.0]) == 0.0\... | {
"split": "train",
"index": 73084,
"acecode_id": "oss_6174",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes an integer n and returns the result of n raised to the power of three (n^3).\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 power_of_three(0) == 0\", \"assert power_of_three(1) == 1\", \"assert power_of_three(-1) == -1\", \"assert power_of_three(2) == 8\", \"assert power_of_three(-2) == -8\", \"assert power_of_three(3) == 27\", \"assert power_of_three(-3) == -27\", \"assert power... | {
"split": "train",
"index": 73085,
"acecode_id": "evol_29669",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are developing a permissions system for a note-taking application. In this application, users can create notes, but they can only edit their own notes. Your task is to implement a function `has_permission_to_edit` that checks if a user has permission to edit a specific note... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_permission_to_edit(1, 'GET', 2) == True\", \"assert has_permission_to_edit(1, 'HEAD', 1) == True\", \"assert has_permission_to_edit(1, 'OPTIONS', 3) == True\", \"assert has_permission_to_edit(1, 'POST', 1) == True\", \"assert has_permission_to_edit(1, 'P... | {
"split": "train",
"index": 73086,
"acecode_id": "oss_1775",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given user has access to a specific endpoint based on their authentication status. The function should take two parameters: a boolean `is_authenticated` indicating whether the user is authenticated, and a string `endpoint... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert access_control(True, 'exception-project') == 'Access granted to exception-project'\", \"assert access_control(True, 'home') == 'Access granted to home'\", \"assert access_control(False, 'exception-project') == 'Unauthorized access'\", \"assert access_control... | {
"split": "train",
"index": 73087,
"acecode_id": "oss_37417",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that filters a list of data items based on specific criteria. Each data item is represented as a dictionary containing two keys: 'type' and 'status', both of which are integers. Your function should return a new list that includes onl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_data([{'type': 0, 'status': 0}, {'type': 1, 'status': 1}]) == [{'type': 0, 'status': 0}]\", \"assert filter_data([{'type': 3, 'status': 0}, {'type': 4, 'status': 1}]) == [{'type': 3, 'status': 0}, {'type': 4, 'status': 1}]\", \"assert filter_data([{'t... | {
"split": "train",
"index": 73088,
"acecode_id": "oss_19290",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that updates the state of a software repository based on a given input. The input will be a dictionary that contains a key 'state', which can either have a value of 'enabled' or 'disabled'. Your function should return 1 if the state i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_repo_state({'state': 'enabled'}) == 1\", \"assert update_repo_state({'state': 'disabled'}) == 0\", \"assert update_repo_state({'state': 'unknown'}) == 0\", \"assert update_repo_state({}) == 0\", \"assert update_repo_state({'state': 'enabled', 'other_k... | {
"split": "train",
"index": 73089,
"acecode_id": "oss_7972",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of layers representing a neural network model, where each layer is a string. Your task is to implement a function that returns the last layer in the list. If the list is empty, return 'No layers present'. The function should have the following signature: `d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_last_layer(['InputLayer', 'HiddenLayer1', 'HiddenLayer2', 'OutputLayer']) == 'OutputLayer'\", \"assert find_last_layer(['Layer1']) == 'Layer1'\", \"assert find_last_layer(['ConvLayer', 'ReluLayer', 'PoolingLayer']) == 'PoolingLayer'\", \"assert find_las... | {
"split": "train",
"index": 73090,
"acecode_id": "bigcode_python_fns_34396",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function called `dynamic_serialize` that takes in a Python object `data` and a string `format`. The function should serialize the `data` using the appropriate serialization method based on the `format` string and return the serialized data. The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dynamic_serialize({'key': 'value'}, 'json') == '{\\\"key\\\": \\\"value\\\"}'\", \"assert dynamic_serialize([1, 2, 3], 'json') == '[1, 2, 3]'\", \"assert dynamic_serialize('string data', 'json') == '\\\"string data\\\"'\", \"assert dynamic_serialize({'a': 1,... | {
"split": "train",
"index": 73091,
"acecode_id": "oss_5281",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates the format of a given URL. The function should take a URL as input and return a message indicating whether the URL is valid or not. A valid URL must start with 'http://' or 'https://'. If the URL is valid, return 'Va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_url_format('http://www.example.com') == 'Valid URL format'\", \"assert validate_url_format('https://www.example.com') == 'Valid URL format'\", \"assert validate_url_format('http://example.com/path') == 'Valid URL format'\", \"assert validate_url_for... | {
"split": "train",
"index": 73092,
"acecode_id": "oss_29743",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function that adheres to the subsequent specification: int computeSum(int a, int b), wherein a and b represent two integer inputs. The function should return the sum of these two integers.\nPlease reason step by step, then write a self-contained Python solution. Give ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert computeSum(1, 2) == 3\", \"assert computeSum(-1, 1) == 0\", \"assert computeSum(0, 0) == 0\", \"assert computeSum(100, 200) == 300\", \"assert computeSum(-10, -10) == -20\", \"assert computeSum(50, 50) == 100\", \"assert computeSum(999, 1) == 1000\", \"asser... | {
"split": "train",
"index": 73093,
"acecode_id": "evol_21973",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates the title of a book based on specific criteria. The title must be a string with a maximum length of 250 characters. Your function should return True if the title meets these criteria and False otherwise. Write a function ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_title('A Brief History of Time') == True\", \"assert is_valid_title('') == True\", \"assert is_valid_title('This is a very long title that should be valid as it is under the limit of 250 characters and serves as an example of a correctly formatted b... | {
"split": "train",
"index": 73094,
"acecode_id": "oss_11512",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `convert_to_squared_list` that returns a new list containing the squares of each integer from the input list. The input list can have both positive and negative integers. If the input list is empty, return an empty list. The function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_to_squared_list([1, 2, 3]) == [1, 4, 9]\", \"assert convert_to_squared_list([-1, -2, -3]) == [1, 4, 9]\", \"assert convert_to_squared_list([-1, 0, 1]) == [1, 0, 1]\", \"assert convert_to_squared_list([]) == []\", \"assert convert_to_squared_list([0])... | {
"split": "train",
"index": 73095,
"acecode_id": "bigcode_python_fns_5202",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `format_timedelta(value: Union[int, timedelta], time_format: Optional[str] = None) -> str` that formats a given duration into a human-readable string. The duration can either be provided as an integer (representing total seconds) or as a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_timedelta(86400) == '1 days, 00:00:00'\", \"assert format_timedelta(3661) == '0 days, 01:01:01'\", \"assert format_timedelta(0) == '0 days, 00:00:00'\", \"assert format_timedelta(3600) == '0 days, 01:00:00'\", \"assert format_timedelta(7257600) == '84... | {
"split": "train",
"index": 73096,
"acecode_id": "bigcode_python_fns_13001",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a Python object, implement a function `extract_values` that retrieves and returns the values contained within that object. The input will be a valid Python data structure (like a list, tuple, dictionary, or set) and the output should be a list of the values extracted from... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_values({'a': 1, 'b': 2, 'c': 3}) == [1, 2, 3]\", \"assert extract_values([1, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert extract_values((10, 20, 30)) == [10, 20, 30]\", \"assert extract_values({1, 2, 3}) == [1, 2, 3]\", \"assert extract_values({'x': 'hello... | {
"split": "train",
"index": 73097,
"acecode_id": "bigcode_python_fns_27645",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts version information and concatenates the contents of multiple files to generate a long description for a software package. Your function should replicate the behavior of the given code snippet without accessing any ex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_version_and_description(['src/icalendar/__init__.py', 'README.rst', 'CONTRIBUTING.rst', 'CHANGES.rst', 'LICENSE.rst']) == ('1.0.0', 'iCalendar parser/generator\\\\n<contents of README.rst>\\\\n<contents of CONTRIBUTING.rst>\\\\n<contents of CHANGES.r... | {
"split": "train",
"index": 73098,
"acecode_id": "oss_25343",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given an array `c` of length 3, where each element is an integer. Your task is to determine the outcome of a game based on the values of these elements. If all three elements in the array are equal, the function should return the string 'Won'. If they are not all equal,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert gameOutcome([1, 1, 1]) == 'Won'\", \"assert gameOutcome([2, 2, 2]) == 'Won'\", \"assert gameOutcome([3, 3, 3]) == 'Won'\", \"assert gameOutcome([4, 5, 4]) == 'Lost'\", \"assert gameOutcome([6, 6, 6]) == 'Won'\", \"assert gameOutcome([7, 8, 7]) == 'Lost'\", \... | {
"split": "train",
"index": 73099,
"acecode_id": "oss_19885",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.