data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the process of downloading an image from a cloud storage service. The function takes a string representing the image name as input and returns a success message if the image is 'windows2019', and an error message otherw... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert download_image('windows2019') == 'Download successful for image: windows2019'\", \"assert download_image('ubuntu20') == 'Error: Image not found.'\", \"assert download_image('centos7') == 'Error: Image not found.'\", \"assert download_image('fedora34') == 'Er... | {
"split": "train",
"index": 81200,
"acecode_id": "bigcode_python_fns_7310",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two unsorted lists of positive integers, implement a function `get_intersection(list1, list2)` that returns a new list containing the intersection of the two lists. The intersection should not contain any duplicates, and the output should maintain the order of the element... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_intersection([1, 2, 3], [3, 4, 5]) == [3]\", \"assert get_intersection([1, 1, 2, 2], [2, 3]) == [2]\", \"assert get_intersection([5, 6, 7], [1, 2, 3]) == []\", \"assert get_intersection([], [1, 2, 3]) == []\", \"assert get_intersection([1, 2, 3], []) == ... | {
"split": "train",
"index": 81201,
"acecode_id": "evol_9749",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of strings representing options and returns a new list of strings where each string has been modified to include a prefix 'Option: '. The function should handle an empty list and return an empty list in that case. Write ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_options([]) == []\", \"assert modify_options(['a', 'b', 'c']) == ['Option: a', 'Option: b', 'Option: c']\", \"assert modify_options(['first', 'second']) == ['Option: first', 'Option: second']\", \"assert modify_options(['apple']) == ['Option: apple']\... | {
"split": "train",
"index": 81202,
"acecode_id": "bigcode_python_fns_20037",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that processes a list of audio and proximity data entries for a badge device. Each entry consists of a timestamp, voltage, and additional metadata (like samples for audio data or device IDs for proximity data). The function should summa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data([{'type': 'audio received', 'voltage': 3.3}, {'type': 'proximity received', 'voltage': 2.5}]) == (1, 3.3, 1, 2.5)\", \"assert process_data([{'type': 'audio received', 'voltage': 1.2}, {'type': 'audio received', 'voltage': 2.3}, {'type': 'proximi... | {
"split": "train",
"index": 81203,
"acecode_id": "bigcode_python_fns_6602",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to estimate the area under a curve using the trapezoidal rule. Your function should approximate the integral of a given mathematical function within a specified interval. Implement a function `trapezoidal_integration(func, a, b, n)` t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(trapezoidal_integration(lambda x: x**2, 0, 1, 1000) - 1/3) < 1e-5\", \"assert abs(trapezoidal_integration(lambda x: x**3, 0, 1, 1000) - 0.25) < 1e-5\", \"assert abs(trapezoidal_integration(lambda x: x, 0, 1, 1000) - 0.5) < 1e-5\", \"assert abs(trapezoida... | {
"split": "train",
"index": 81204,
"acecode_id": "oss_7936",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, `y_true` and `y_score`, where `y_true` represents the actual binary labels (0 or 1) and `y_score` represents the predicted binary labels (0 or 1), implement a function `precision_score(y_true: List[int], y_score: List[int]) -> float` that calculates... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert precision_score([1, 1, 1, 1], [1, 1, 1, 1]) == 1.0\", \"assert precision_score([0, 0, 0, 0], [0, 0, 0, 0]) == 0.0\", \"assert precision_score([1, 0, 0, 1], [1, 1, 0, 0]) == 0.5\", \"assert precision_score([1, 1, 0, 0], [0, 0, 0, 1]) == 0.0\", \"assert precis... | {
"split": "train",
"index": 81205,
"acecode_id": "bigcode_python_fns_38005",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing filenames and a list of integers representing values. Your task is to create a new list of strings where each string is formed by appending the corresponding integer value from the values list to the filename. If the lengths of the t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_filenames(['file1', 'file2'], [1, 2]) == ['file11', 'file22']\", \"assert generate_filenames(['doc', 'image'], [3, 4]) == ['doc3', 'image4']\", \"assert generate_filenames(['report', 'summary'], [5]) == []\", \"assert generate_filenames([], []) == [... | {
"split": "train",
"index": 81206,
"acecode_id": "bigcode_python_fns_4022",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a 10x10 matrix (an array of arrays) and populate each element with random integers ranging from 1 to 100. Implement a function that takes this matrix and applies a transformation to it based on a given command. The command can either be 'transpose', 'flip_horizontal', 'f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_matrix([[1,2,3],[4,5,6],[7,8,9]], 'transpose') == [[1,4,7],[2,5,8],[3,6,9]]\", \"assert transform_matrix([[1,2,3],[4,5,6],[7,8,9]], 'rotate_90') == [[7,4,1],[8,5,2],[9,6,3]]\", \"assert transform_matrix([[10,20,30],[40,50,60],[70,80,90]], 'transpos... | {
"split": "train",
"index": 81207,
"acecode_id": "evol_30066",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `bubble_sort(arr: List[int]) -> List[int]` that takes a list of integers and sorts it in ascending order using the bubble sort algorithm. The function should return the sorted list. You may not use any built-in sorting functions or libraries.\nPlease reason... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([5, 3, 8, 1, 2]) == [1, 2, 3, 5, 8]\", \"assert bubble_sort([10, 9, 8, 7, 6]) == [6, 7, 8, 9, 10]\", \"assert bubble_sort([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert bubble_sort([3]) == [3]\", \"assert bubble_sort([]) == []\", \"assert bubble... | {
"split": "train",
"index": 81208,
"acecode_id": "evol_18512",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, determine if there exists at least one pair of distinct integers in the list such that their multiplication yields an even number. The function should return True if such a pair exists, and False otherwise. Your function should handle edge cases such a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_even_product_pair([1, 3, 5]) == False\", \"assert find_even_product_pair([2, 3, 5]) == True\", \"assert find_even_product_pair([1, 2, 3]) == True\", \"assert find_even_product_pair([]) == False\", \"assert find_even_product_pair([1]) == False\", \"asser... | {
"split": "train",
"index": 81209,
"acecode_id": "evol_32570",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer value x and a number of bits n, implement a function that converts the integer x into a bit vector constant. The conversion should follow these rules: if n is less than 32, truncate x to the least significant n bits; if n is more than 32, sign-extend x to n bit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bit_vector_constant(0, 5) == -1\", \"assert bit_vector_constant(32, 5) == 5\", \"assert bit_vector_constant(5, 29) == 29 & 0b11111\", \"assert bit_vector_constant(33, -1) == -1\", \"assert bit_vector_constant(64, -1) == -1\", \"assert bit_vector_constant(32,... | {
"split": "train",
"index": 81210,
"acecode_id": "bigcode_python_fns_46000",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of experiment names in the format 'repo_uoa:module_uoa:data_uoa'. Your task is to select an experiment name from the list based on the index provided. If the index is out of bounds (i.e., less than 0 or greater than or equal to the length of the list), retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_experiment(['repo1:module1:data1', 'repo2:module2:data2', 'repo3:module3:data3'], 1) == 'repo2:module2:data2'\", \"assert select_experiment(['experiment1', 'experiment2', 'experiment3'], 0) == 'experiment1'\", \"assert select_experiment(['expA', 'expB... | {
"split": "train",
"index": 81211,
"acecode_id": "bigcode_python_fns_792",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents the data for a chemical reaction. The string contains lines with Chebyshev fitting parameters for temperature and pressure limits, as well as polynomial coefficients. Your task is to implement a function `parse_chebyshev_parameters(rxn_dst... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_chebyshev_parameters('TCHEB / 300.00 2500.00 / PCHEB / 0.001 100.00 / CHEB / 2 2 / 1.0 1.0 2.0 2.0') == {'t_limits': [300.0, 2500.0], 'p_limits': [0.001, 100.0], 'alpha_elm': [[1.0, 1.0], [2.0, 2.0]]}\", \"assert parse_chebyshev_parameters('PCHEB / 0.0... | {
"split": "train",
"index": 81212,
"acecode_id": "bigcode_python_fns_6218",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts specific information from a given string representing the content of a README file. The string contains details about a software package, and you need to extract the package name, version, description, long descriptio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_package_info_from_string('geots2img\\\\nGeo Time Series to Image\\\\nThis package converts geo time series data into images.\\\\nVersion: 0.1.3\\\\nContent-Type: text/markdown\\\\nURL: https://github.com/juliandehoog/geo-timeseries-to-image') == {'na... | {
"split": "train",
"index": 81213,
"acecode_id": "oss_14912",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_user_existing(username: str) -> bool` that checks if a user with the given username exists. The function should return `True` if the username exists, and `False` otherwise. You can assume that the list of existing usernames is predefined as `existing_us... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_user_existing('alice') == True\", \"assert is_user_existing('bob') == True\", \"assert is_user_existing('charlie') == True\", \"assert is_user_existing('david') == True\", \"assert is_user_existing('eve') == False\", \"assert is_user_existing('john') == F... | {
"split": "train",
"index": 81214,
"acecode_id": "bigcode_python_fns_6687",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a sorted array of distinct integers that has been rotated at an unknown pivot. Write a function to determine if a target element is present in the array. If the target is found in the array, return true; otherwise, return false. The input will be a list of integer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_in_rotated_array([4, 5, 6, 7, 0, 1, 2], 0) == True\", \"assert search_in_rotated_array([4, 5, 6, 7, 0, 1, 2], 3) == False\", \"assert search_in_rotated_array([1, 2, 3, 4, 5], 1) == True\", \"assert search_in_rotated_array([1, 2, 3, 4, 5], 5) == True\"... | {
"split": "train",
"index": 81215,
"acecode_id": "oss_22457",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes two arrays as input and checks if they have the same length. If they do, merge the elements from both arrays into a dictionary where the elements from the first array are the keys and the elements from the second array are the values. If the arra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_arrays_to_dict(['a', 'b'], [1, 2]) == {'a': 1, 'b': 2}\", \"assert merge_arrays_to_dict(['name', 'age'], ['Alice', 30]) == {'name': 'Alice', 'age': 30}\", \"assert merge_arrays_to_dict(['x', 'y', 'z'], [100, 200, 300]) == {'x': 100, 'y': 200, 'z': 300}... | {
"split": "train",
"index": 81216,
"acecode_id": "evol_35836",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given the time it takes for a car and a train to finish a race, along with a specified time in minutes, write a function that calculates the distances of both the car and the train from the starting point after the given time. The function should return a tuple containing the d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Race(40, 30, 30) == (1.0, 0.75, 0.25)\", \"assert Race(40, 30, 15) == (0.5, 0.375, 0.125)\", \"assert Race(40, 30, 0) == (0.0, 0.0, 0.0)\", \"assert Race(50, 25, 50) == (2.0, 1.0, 1.0)\", \"assert Race(100, 50, 100) == (2.0, 1.0, 1.0)\", \"assert Race(30, 20... | {
"split": "train",
"index": 81217,
"acecode_id": "evol_32181",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates the coordinates of a dropdown arrow based on the state of the dropdown (opened or closed) and its dimensions (width and height). The coordinates should be returned as a list of tuples. The function takes three parameters: `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_arrow_coordinates(800, 600, False) == [(133.33333333333334, 200.0), (400.0, 400.0), (666.6666666666666, 200.0)]\", \"assert generate_arrow_coordinates(800, 600, True) == [(133.33333333333334, 400.0), (400.0, 200.0), (666.6666666666666, 400.0)]\", \"... | {
"split": "train",
"index": 81218,
"acecode_id": "bigcode_python_fns_24939",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `filter_strings(my_list: List[str], character: str) -> List[str]` that filters an array of strings, returning a new list containing only the strings that include the specified character. The function should be case-sensitive. For example, if the input list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_strings(['apple', 'banana', 'cherry', 'date'], 'a') == ['apple', 'banana', 'date']\", \"assert filter_strings(['cat', 'dog', 'bird', 'fish'], 'x') == []\", \"assert filter_strings(['Hello', 'World', 'Python', 'Programming'], 'P') == ['Python', 'Progra... | {
"split": "train",
"index": 81219,
"acecode_id": "evol_13090",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating whether a wildcard is required for a given source address in an Access Control List (ACL) entry. The source address can be an IPv4 address, an IPv4 network, or the literal value 'any'. Your task is to implement a function called `is_wildcard_requi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_wildcard_required('192.168.1.0/24', None) == True\", \"assert is_wildcard_required('192.168.1.0/24', '0.0.0.0') == False\", \"assert is_wildcard_required('192.168.1.1', None) == False\", \"assert is_wildcard_required('192.168.1.1', '0.0.0.0') == False\", ... | {
"split": "train",
"index": 81220,
"acecode_id": "oss_34080",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a boolean expression represented as a string, return the result of evaluating the expression. The expression can be in the following formats: \"t\" (true), \"f\" (false), \"!(expr)\" (logical NOT), \"&(expr1,expr2,... )\" (logical AND), and \"|(expr1,expr2,... )\" (logica... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parseBoolExpr('!(f)') == True\", \"assert parseBoolExpr('|(f,t)') == True\", \"assert parseBoolExpr('&(t,f)') == False\", \"assert parseBoolExpr('|(&(t,f,t),!(t))') == False\", \"assert parseBoolExpr('!(|(&(t,f,t),!(t)))') == True\", \"assert parseBoolExpr('... | {
"split": "train",
"index": 81221,
"acecode_id": "evol_30751",
"num_tests": 14
} |
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 integers from the original list, in the same order they appeared. If there are no even integers in the input list, return an empty list. Implement this function... | 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([2, 4, 6]) == [2, 4, 6]\", \"assert filter_even_numbers([]) == []... | {
"split": "train",
"index": 81222,
"acecode_id": "oss_25951",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of a series of buildings. Your task is to implement a function that calculates the maximum area of a rectangle that can be formed using the buildings as boundaries. The function should take the following parameters: a li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largest_rectangle_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert largest_rectangle_area([1, 1, 1, 1]) == 4\", \"assert largest_rectangle_area([]) == 0\", \"assert largest_rectangle_area([5]) == 5\", \"assert largest_rectangle_area([4, 2, 0, 3, 2, 5]) == 6\", \"a... | {
"split": "train",
"index": 81223,
"acecode_id": "bigcode_python_fns_6867",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a sorted list of integers and a target integer, implement a function that calculates the number of comparisons required to find the target value using a binary search. The function should return the total number of comparisons made, including the final comparison that det... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_search_comparisons([1, 2, 3, 4, 5], 5) == 3\", \"assert binary_search_comparisons([1, 2, 3, 4, 5], 6) == 3\", \"assert binary_search_comparisons([], 1) == 0\", \"assert binary_search_comparisons([1], 1) == 1\", \"assert binary_search_comparisons([1], ... | {
"split": "train",
"index": 81224,
"acecode_id": "evol_15025",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns a new list containing only the unique positive integers from the input list, sorted in ascending order. The function should ignore any negative numbers and zeros. Write a function named `get_positive_and_sort` that tak... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_positive_and_sort([-1, 2, -4, 5, 6]) == [2, 5, 6]\", \"assert get_positive_and_sort([5, -5, 2, -3, 3, 9, 0, 123, 1, 10]) == [1, 2, 3, 5, 9, 10, 123]\", \"assert get_positive_and_sort([-1, -2, -3, -4]) == []\", \"assert get_positive_and_sort([0, 0, 0, 0])... | {
"split": "train",
"index": 81225,
"acecode_id": "evol_25015",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two points in a 2D space represented as tuples (x1, y1) and (x2, y2), write a function `distance(point1: Tuple[float, float], point2: Tuple[float, float]) -> float` that computes the Euclidean distance between these two points. The distance is defined as the square root o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert distance((0, 0), (3, 4)) == 5.0\", \"assert distance((1, 1), (1, 1)) == 0.0\", \"assert distance((-1, -1), (1, 1)) == 2.8284271247461903\", \"assert distance((2.5, 3.5), (2.5, 3.5)) == 0.0\", \"assert distance((0, 0), (0, 5)) == 5.0\", \"assert distance((0, ... | {
"split": "train",
"index": 81226,
"acecode_id": "bigcode_python_fns_45420",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if the total sum of all elements in a list, plus the sum of half of those elements, falls within a specified range defined by two integer parameters (lower_bound and upper_bound). The length of the list is guaranteed to be even. The function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_within_bounds([1, 1, 1, 1], 2, 10) == True\", \"assert sum_within_bounds([10, 10, 10, 10], 0, 60) == True\", \"assert sum_within_bounds([0, 0, 0, 0], 0, 0) == True\", \"assert sum_within_bounds([-1, -1, -1, -1], -10, 0) == True\", \"assert sum_within_bou... | {
"split": "train",
"index": 81227,
"acecode_id": "evol_11154",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function that determines whether a given list of numbers (including integers and floating-point numbers) forms a geometric progression. A geometric progression is defined as a sequence where each term after the first is found by multiplying the previous term by a fi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_geometric_progression([3, 9, 27]) == True\", \"assert is_geometric_progression([1, 2, 4, 8]) == True\", \"assert is_geometric_progression([5, 10]) == True\", \"assert is_geometric_progression([2, 0, -2]) == False\", \"assert is_geometric_progression([-2, ... | {
"split": "train",
"index": 81228,
"acecode_id": "evol_35467",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that analyzes a list of integers and identifies potential issues within the list, providing suggestions for fixes. The function should take a list of integers as input and return a list of suggestions for improving the list's integ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_integer_list([1, 2, 3, 4, 5]) == []\", \"assert analyze_integer_list([1, 2, 2, 3, 4]) == ['Duplicate values found: 2. Consider removing duplicates.']\", \"assert analyze_integer_list([1, 1, 1, 1]) == ['Duplicate values found: 1. Consider removing dup... | {
"split": "train",
"index": 81229,
"acecode_id": "oss_27462",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a point in a 3D space in the format: '<category> <identifier> <x/mm> <y/mm> <z/mm>'. The allowed categories are 'hpi', 'cardinal', 'eeg', and 'extra'. Your task is to write a function that processes this list and ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_points(['cardinal 2 -5.6729 -12.3873 -30.3671', 'cardinal 1 -37.6782 -10.4957 91.5228', 'hpi 1 -30.4493 -11.8450 83.3601']) == {'cardinal': [('2', (-5.6729, -12.3873, -30.3671)), ('1', (-37.6782, -10.4957, 91.5228))], 'hpi': [('1', (-30.4493, -11.... | {
"split": "train",
"index": 81230,
"acecode_id": "bigcode_python_fns_2060",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of distinct integers, implement a function that returns the second smallest and second largest numbers from the list. The input list will contain at least four distinct integers. Please define the function as follows: def find_penultimate_numbers(numbers: List[int]... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_penultimate_numbers([45, 88, 12, 67, 29, 76]) == (29, 76)\", \"assert find_penultimate_numbers([1, 2, 3, 4, 5]) == (2, 4)\", \"assert find_penultimate_numbers([-10, -5, 0, 5, 10]) == (-5, 5)\", \"assert find_penultimate_numbers([100, 200, 300, 400]) == ... | {
"split": "train",
"index": 81231,
"acecode_id": "evol_5600",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the number of examples in different input files and a batch size. Your task is to create a function that returns the total number of batches that can be formed from these examples. A batch is formed when the number of examples in a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_batches([10, 20, 30], 10) == 6\", \"assert calculate_batches([10, 20, 30], 25) == 2\", \"assert calculate_batches([5, 5, 5], 5) == 3\", \"assert calculate_batches([0, 0, 0], 5) == 0\", \"assert calculate_batches([100, 200, 300], 100) == 6\", \"asse... | {
"split": "train",
"index": 81232,
"acecode_id": "bigcode_python_fns_21772",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_exponent(input: int) -> Tuple[int, int]` that takes an integer input and returns a tuple containing the base and the exponent such that base raised to the exponent equals the input. If no such base and exponent exist, return None. The base should be g... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_exponent(512) == (2, 9)\", \"assert find_exponent(27) == (3, 3)\", \"assert find_exponent(16) == (2, 4)\", \"assert find_exponent(81) == (3, 4)\", \"assert find_exponent(1) == None\", \"assert find_exponent(64) == (2, 6)\", \"assert find_exponent(243) =... | {
"split": "train",
"index": 81233,
"acecode_id": "evol_1909",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and a target integer, write a function that returns a list of indices where the target integer occurs in the list. The function should be named `find_occurrences` and take two parameters: a list of integers `lst` and an integer `target`. If the target i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_occurrences([1, 2, 3, 2, 4, 2, 5, 2, 3, 2, 1], 2) == [1, 3, 5, 7, 9]\", \"assert find_occurrences([4, 5, 6, 7, 8], 4) == [0]\", \"assert find_occurrences([1, 2, 3], 3) == [2]\", \"assert find_occurrences([], 1) == []\", \"assert find_occurrences([1, 1, ... | {
"split": "train",
"index": 81234,
"acecode_id": "evol_36154",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of strings, `words` and `substitutes`, write a function `str_substitution(words: List[str], substitutes: List[str]) -> List[str]` that replaces every occurrence of the strings in the `words` list with their corresponding strings from the `substitutes` list. If a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert str_substitution(['apple', 'banana'], ['fruit', 'tasty']) == ['fruit', 'tasty']\", \"assert str_substitution(['apple', 'orange', 'banana'], ['fruit', 'citrus', 'tasty']) == ['fruit', 'citrus', 'tasty']\", \"assert str_substitution(['apple', 'banana', 'cherry... | {
"split": "train",
"index": 81235,
"acecode_id": "evol_18695",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats a given error message by adding a specific prefix based on the type of error and wrapping the text to fit within a specified width. The function should accept a string 'text', an optional integer 'width' that defines the maxi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_error('This is a test error message.', 80, 'error') == 'ERROR: This is a test error message.'\", \"assert format_error('This is a test warning message.', 80, 'warning') == 'WARNING: This is a test warning message.'\", \"assert format_error('This is a ... | {
"split": "train",
"index": 81236,
"acecode_id": "bigcode_python_fns_24912",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a training process for a machine learning model. The function should take in the following parameters: a list of integers representing training steps, a list of integers representing evaluation steps, and a boolean indi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert train_model([100, 200], [10, 20], True) >= 0.0 and train_model([100, 200], [10, 20], True) <= 1.0\", \"assert train_model([50], [5], False) >= 0.0 and train_model([50], [5], False) <= 1.0\", \"assert train_model([150], [15], True) >= 0.0 and train_model([150... | {
"split": "train",
"index": 81237,
"acecode_id": "bigcode_python_fns_15955",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `print_odd_integers(data)` that takes a nested array (which can include integers and other types) and returns a list of all the odd integers found within the nested structure. The function should handle erroneous input gracefully, returning an empty list if... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_odd_integers([1, 2, 3, 4]) == [1, 3]\", \"assert print_odd_integers([2, 4, 6]) == []\", \"assert print_odd_integers([1, [2, 3], [4, [5, 6]]]) == [1, 3, 5]\", \"assert print_odd_integers([1, [2, 'a'], [4, [5, None]]]) == [1, 5]\", \"assert print_odd_int... | {
"split": "train",
"index": 81238,
"acecode_id": "evol_10132",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `assign_grade(num_grade)` that determines the letter grade of a student based on the provided numerical grade. The letter grade should include pluses and minuses (e.g., A+, A, A-, etc.) based on the following criteria: A for grades 90 and above, B for grade... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert assign_grade(85) == 'B'\", \"assert assign_grade(95) == 'A'\", \"assert assign_grade(73) == 'C'\", \"assert assign_grade(59) == 'F'\", \"assert assign_grade(89.1) == 'B+'\", \"assert assign_grade(75.4) == 'C'\", \"assert assign_grade(99.9) == 'A+'\", \"asser... | {
"split": "train",
"index": 81239,
"acecode_id": "evol_35025",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the connection and disconnection of multiple devices (STAs) to different access points (APs). Your goal is to determine if a device can successfully connect to its designated AP and then disconnect from it. The function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_device_connections(['device1', 'device2'], 'target_ap', 'secondary_ap') == [True, True]\", \"assert simulate_device_connections(['device1', 'device2', 'device3'], 'target_ap', 'secondary_ap') == [True, True, True]\", \"assert simulate_device_connect... | {
"split": "train",
"index": 81240,
"acecode_id": "bigcode_python_fns_43064",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of integers and a target integer as input. The function should return a list of indices where the target integer occurs in the input list. If the target integer is not present in the list, return an empty list.\nPlease reason step by step,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_element([1, 2, 3, 4, 5, 3, 2], 2) == [1, 6]\", \"assert search_element([1, 2, 3, 4, 5, 3, 2], 3) == [2, 5]\", \"assert search_element([1, 2, 3, 4, 5, 3, 2], 6) == []\", \"assert search_element([1, 1, 1, 1], 1) == [0, 1, 2, 3]\", \"assert search_elemen... | {
"split": "train",
"index": 81241,
"acecode_id": "evol_26162",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages a queue of tasks to be executed in a loop. The function should take two parameters: an operation (a string) and a loop count (an integer). The function will simulate the task execution by checking if the loop count has re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_queue('task1', 0) == True\", \"assert manage_queue('task1', 1) == False\", \"assert manage_queue('task2', 5) == False\", \"assert manage_queue('task2', 1) == False\", \"assert manage_queue('task3', 3) == False\", \"assert manage_queue('task4', 2) == F... | {
"split": "train",
"index": 81242,
"acecode_id": "oss_24908",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the area of a circle given its radius. The radius will be a positive floating-point number. Your function should take the radius as input and return the area of the circle. Use the formula area = π * radius² for the calculation. Implement a funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_circle_area(0.1) == 0.031415926535897934\", \"assert calculate_circle_area(1.0) == 3.141592653589793\", \"assert calculate_circle_area(2.0) == 12.566370614359172\", \"assert calculate_circle_area(3.5) == 38.48451000647496\", \"assert calculate_circ... | {
"split": "train",
"index": 81243,
"acecode_id": "oss_20096",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a game loop function that manages game events and updates the game screen. Write a function `game_loop(screen, buttons, items, music, sound, g_settings, particles=None, percentthing=None)` that simulates the event checking process and updates the ga... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert game_loop('main_screen', ['start'], [], '', '', {}) == 'Game Started'\", \"assert game_loop('main_screen', ['exit'], [], '', '', {}) == 'Game Over'\", \"assert game_loop('main_screen', ['resume'], [], '', '', {}) == 'Game Running'\", \"assert game_loop('main... | {
"split": "train",
"index": 81244,
"acecode_id": "bigcode_python_fns_39530",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the sizes of various backups. Your task is to implement a function that verifies the integrity of the backups by checking if each backup size is positive. The function should return True if all backup sizes are positive and False if... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_backups([1, 2, 3, 4, 5]) == True\", \"assert verify_backups([1, 0, 3]) == False\", \"assert verify_backups([-1, 2, 3]) == False\", \"assert verify_backups([5, 10, 15]) == True\", \"assert verify_backups([0]) == False\", \"assert verify_backups([-10, -... | {
"split": "train",
"index": 81245,
"acecode_id": "bigcode_python_fns_5912",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a class named `AvataxClient`, write a function `create_client` that takes no parameters and returns an instance of `AvataxClient`. The function should ensure that the returned object is indeed an instance of `AvataxClient`. If the object is created successfully, return th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isinstance(create_client(), AvataxClient)\", \"assert create_client() is not None\", \"assert isinstance(create_client(), AvataxClient)\", \"assert isinstance(create_client(), AvataxClient)\", \"assert create_client() is not None\", \"assert isinstance(creat... | {
"split": "train",
"index": 81246,
"acecode_id": "bigcode_python_fns_3971",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists, `licenses` and `fines`, each containing integers that represent the number of licenses issued and the number of fines imposed in a specific year. Your task is to implement a function that calculates the percentage of licenses that resulted in fines and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_fine_ratios([0], []) == (0.0, 0.0)\", \"assert calculate_fine_ratios([], []) == (0.0, 0.0)\", \"assert calculate_fine_ratios([100], [0]) == (100.0, 0.0)\", \"assert calculate_fine_ratios([100], [100]) == (0.0, 100.0)\", \"assert calculate_fine_rati... | {
"split": "train",
"index": 81247,
"acecode_id": "bigcode_python_fns_12515",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a Mad Libs story based on given inputs. A Mad Libs story is a phrasal template word game where specific types of words are substituted into a story template. Your function should take in four parameters: an adjective, a nou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mad_libs_story('happy', 'dog', 'jumps', 'cat') == 'The happy dog jumps over the lazy cat.'\", \"assert mad_libs_story('brave', 'knight', 'fights', 'dragon') == 'The brave knight fights over the lazy dragon.'\", \"assert mad_libs_story('colorful', 'bird', 'si... | {
"split": "train",
"index": 81248,
"acecode_id": "oss_375",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a plot based on a specified image type. The function `generate_plot(image_type)` should accept a single parameter, `image_type`, which can be one of the following three values: 'spectrum', 'lightcurve', or 'test'. Depen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_plot('spectrum') == 'Spectrum plot generated'\", \"assert generate_plot('lightcurve') == 'Lightcurve plot generated'\", \"assert generate_plot('test') == 'Test plot generated'\", \"assert generate_plot('spectrum') == 'Spectrum plot generated'\", \"a... | {
"split": "train",
"index": 81249,
"acecode_id": "bigcode_python_fns_8226",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples representing peaks in a landscape, where each tuple contains an index and the height of the peak at that index. Your task is to implement a function that returns the index of the ith largest peak. The peaks are represented as a list of tuples (i, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_peak_index([(0, 5), (1, 3), (2, 2)], 0) == 0\", \"assert get_peak_index([(0, 5), (1, 3), (2, 2)], 1) == 1\", \"assert get_peak_index([(0, 5), (1, 3), (2, 2)], 2) == 2\", \"assert get_peak_index([(0, 5), (1, 3), (2, 2)], 3) == None\", \"assert get_peak_in... | {
"split": "train",
"index": 81250,
"acecode_id": "bigcode_python_fns_40584",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that may contain LaTeX accents, represented in the format '{\\`{X}}' where X is a single letter. Your task is to write a function that decodes this string into its ASCII equivalent. Additionally, replace any occurrences of '{\\textquotesingle}' with an un... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode_tex_accents('{\\\\`{O}}') == 'O'\", \"assert decode_tex_accents('{\\\\`{e}}') == 'e'\", \"assert decode_tex_accents('This is a test with {\\\\`{a}} and {\\\\`{e}}.') == 'This is a test with a and e.'\", \"assert decode_tex_accents('No accents here!') ... | {
"split": "train",
"index": 81251,
"acecode_id": "bigcode_python_fns_25750",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `reset_pose_and_offset()` that resets a given pose and a global offset to a default state. The function should take no parameters and return a dictionary indicating the success of the operation and a message. The reset operation should set the pose to (0, 0... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reset_pose_and_offset() == {'success': True, 'message': 'Reset pose: True'}\", \"assert reset_pose_and_offset() == {'success': True, 'message': 'Reset pose: True'}\", \"assert reset_pose_and_offset() == {'success': True, 'message': 'Reset pose: True'}\", \"a... | {
"split": "train",
"index": 81252,
"acecode_id": "bigcode_python_fns_47491",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a positive integer 'num', write a function 'is_perfect_number(num)' that determines if 'num' is a perfect number. A perfect number is a positive integer that is equal to the sum of its proper divisors, excluding itself. Return 'True' if 'num' is a perfect number, and 'Fal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_perfect_number(6) == True\", \"assert is_perfect_number(28) == True\", \"assert is_perfect_number(496) == True\", \"assert is_perfect_number(8128) == True\", \"assert is_perfect_number(1) == False\", \"assert is_perfect_number(2) == False\", \"assert is_p... | {
"split": "train",
"index": 81253,
"acecode_id": "oss_15896",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of inputs, calculates the cube of each numeric input, and returns a sorted list of the resulting cubes. If any of the inputs are not numeric, they should be ignored. The function should be able to handle exceptions gracefully without crash... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert cube_numbers([1, 2, 3]) == [1, 8, 27]\", \"assert cube_numbers(['1', '2', '3']) == [1, 8, 27]\", \"assert cube_numbers([1, 'two', 3]) == [1, 27]\", \"assert cube_numbers([]) == []\", \"assert cube_numbers(['a', 'b', 'c']) == []\", \"assert cube_numbers([4, 5... | {
"split": "train",
"index": 81254,
"acecode_id": "evol_26185",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Implement a function that takes the list and two indices as input, and swaps the elements at those indices in the list. The function should modify the list in place. If the indices are out of bounds, the function should return the list unchange... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert swap_elements([1, 2, 3, 4], 0, 1) == [2, 1, 3, 4]\", \"assert swap_elements([1, 2, 3, 4], 1, 2) == [1, 3, 2, 4]\", \"assert swap_elements([1, 2, 3, 4], 2, 3) == [1, 2, 4, 3]\", \"assert swap_elements([1, 2, 3, 4], 0, 3) == [4, 2, 3, 1]\", \"assert swap_eleme... | {
"split": "train",
"index": 81255,
"acecode_id": "bigcode_python_fns_1661",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples, where each tuple represents the coordinates of a region in a 2D space. Each tuple contains two integers representing the x and y coordinates of a region's centroid. Your task is to implement a function that extracts and returns a list of these ce... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_centroids([(1, 2), (3, 4), (5, 6)]) == [(1, 2), (3, 4), (5, 6)]\", \"assert extract_centroids([(0, 0), (1, 1), (2, 2)]) == [(0, 0), (1, 1), (2, 2)]\", \"assert extract_centroids([(10, 20), (30, 40)]) == [(10, 20), (30, 40)]\", \"assert extract_centro... | {
"split": "train",
"index": 81256,
"acecode_id": "bigcode_python_fns_36679",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a DataFrame represented as a list of dictionaries where each dictionary contains information about various options, including a 'severity' key and a 'select_list_column' key. Implement the function `get_ti_select_options(data, severities=None)` that takes the list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_ti_select_options([{'severity': 'error', 'select_list_column': 'Option1'}, {'severity': 'warning', 'select_list_column': 'Option2'}, {'severity': 'info', 'select_list_column': 'Option3'}, {'severity': 'warning', 'select_list_column': 'Option1'}], severit... | {
"split": "train",
"index": 81257,
"acecode_id": "oss_13746",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program that analyzes audio data and visualizes its waveform. Given a list of sample amplitudes and a sampling rate, your task is to implement a function that generates the waveform data and returns it along with the sampling rate. The waveform da... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_waveform_data([0.1, 0.5, -0.3], 2) == [(0.0, 0.1), (0.5, 0.5), (1.0, -0.3)]\", \"assert generate_waveform_data([-1.0, 1.0, 0.0], 1) == [(0.0, -1.0), (1.0, 1.0), (2.0, 0.0)]\", \"assert generate_waveform_data([0.7, 0.2, 0.9, 0.4], 4) == [(0.0, 0.7), ... | {
"split": "train",
"index": 81258,
"acecode_id": "oss_23412",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of consecutive buildings. Your task is to calculate the total area of the 'skyline' formed by these buildings when viewed from a distance. The skyline is defined as the area covered by the maximum height of the buildings... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_skyline_area([0, 0, 0]) == 0\", \"assert calculate_skyline_area([5, 5, 5]) == 15\", \"assert calculate_skyline_area([1, 2, 3, 4, 5]) == 15\", \"assert calculate_skyline_area([2, 2, 2, 2]) == 8\", \"assert calculate_skyline_area([3, 3, 3, 3, 3]) == ... | {
"split": "train",
"index": 81259,
"acecode_id": "bigcode_python_fns_35336",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a list of items, implement a function `frequency_distribution` that takes a list as input and returns a dictionary where the keys are unique items from the list and the values are their respective frequencies. The order of the items in the output dictionary should match t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert frequency_distribution(['apple', 'banana', 'apple', 'orange', 'banana', 'kiwi']) == {'apple': 2, 'banana': 2, 'orange': 1, 'kiwi': 1}\", \"assert frequency_distribution([]) == {}\", \"assert frequency_distribution(['a', 'b', 'a', 'c', 'b', 'a']) == {'a': 3, ... | {
"split": "train",
"index": 81260,
"acecode_id": "evol_19242",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with extracting the version number from a given string. The version number follows the format 'x.y.z+additional_info', where x, y, and z are non-negative integers, and 'additional_info' is optional. Implement a function `extract_version` that takes a string as in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_version('0.2.7+depop.6.1') == (0, 2, 7)\", \"assert extract_version('1.0.0') == (1, 0, 0)\", \"assert extract_version('10.5.3+build.123') == (10, 5, 3)\", \"assert extract_version('2.3.4') == (2, 3, 4)\", \"assert extract_version('3.2.1+extra') == (3... | {
"split": "train",
"index": 81261,
"acecode_id": "oss_36822",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `find_or_create_user(name: str) -> str` that simulates user management in a fictional system. The function should take a user's name as input and return the user's name if it already exists in the system. If the user does not exist, t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_or_create_user('Alice') == 'Alice'\", \"assert find_or_create_user('Bob') == 'Bob'\", \"assert find_or_create_user('Alice') == 'Alice'\", \"assert find_or_create_user('Charlie') == 'Charlie'\", \"assert find_or_create_user('Bob') == 'Bob'\", \"assert fi... | {
"split": "train",
"index": 81262,
"acecode_id": "oss_33248",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a distinguished name (DN) and its associated attributes in a specific format. The DN is followed by attributes, where each attribute can span multiple lines. Your task is to write a function that parses this string and extracts the DN and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_dn_attributes('dn: uid=john.doe,ou=users,dc=example,dc=com\\\\nmail: john@example.com\\\\nmail: john.doe@example.com\\\\n') == ('uid=john.doe,ou=users,dc=example,dc=com', {'mail': ['john@example.com', 'john.doe@example.com']})\", \"assert parse_dn_attr... | {
"split": "train",
"index": 81263,
"acecode_id": "bigcode_python_fns_13239",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with searching for a specific substring pattern within a given string. Your function should take a string and a pattern as input and return a list of the starting indices where the pattern is found in the string. If the pattern does not occur in the string, retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_pattern_in_string('abababab', 'ab') == [0, 2, 4, 6]\", \"assert search_pattern_in_string('No match here', 'xyz') == []\", \"assert search_pattern_in_string('Case Sensitive Test', 'test') == []\", \"assert search_pattern_in_string('Pattern matching is ... | {
"split": "train",
"index": 81264,
"acecode_id": "oss_30298",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents an intent of a bot. Your task is to implement a function that takes this list of intents and returns a list of unique intents sorted in ascending order. Write a function `get_unique_intents(intents: List[str]) -> Lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_intents(['greet', 'farewell', 'greet', 'query']) == ['farewell', 'greet', 'query']\", \"assert get_unique_intents(['query', 'query', 'query']) == ['query']\", \"assert get_unique_intents([]) == []\", \"assert get_unique_intents(['command', 'action... | {
"split": "train",
"index": 81265,
"acecode_id": "bigcode_python_fns_19367",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of client objects, each represented by a dictionary containing two keys: 'client_credentials' (a boolean) and 'name' (a string). Write a function `test_clients(clients: List[Dict[str, Union[str, bool]]]) -> List[str]` that tests the clients' connectivity an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert test_clients([]) == []\", \"assert test_clients([{'client_credentials': False, 'name': 'Client1'}]) == ['ok']\", \"assert test_clients([{'client_credentials': True, 'name': 'Client1'}]) == ['Invalid configuration for Client1']\", \"assert test_clients([{'cli... | {
"split": "train",
"index": 81266,
"acecode_id": "bigcode_python_fns_35971",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages a simple configuration dictionary. Your task is to implement a function `manage_config(operations: List[Tuple[str, Union[str, Any]]]) -> Dict[str, Any]` that processes a list of operations on the configuration settings. Each ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_config([('load', None)]) == {}\", \"assert manage_config([('load', None), ('update', ('key1', 'value1'))]) == {'key1': 'value1'}\", \"assert manage_config([('load', None), ('update', ('key1', 'value1')), ('get', 'key1')]) == {'key1': 'value1'}\", \"as... | {
"split": "train",
"index": 81267,
"acecode_id": "oss_29350",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function that returns the mode of the array. The mode is defined as the value that appears most frequently in the array. If there are multiple modes, return them in a sorted list. If the array is empty, return an empty list.\nPlease reason st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_mode([1, 2, 2, 3, 3]) == [2, 3]\", \"assert calculate_mode([1, 1, 2, 2, 3, 3]) == [1, 2, 3]\", \"assert calculate_mode([1]) == [1]\", \"assert calculate_mode([4, 4, 4, 5, 5, 5]) == [4, 5]\", \"assert calculate_mode([1, 2, 2, 3, 3, 3, 4]) == [3]\", ... | {
"split": "train",
"index": 81268,
"acecode_id": "evol_26862",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of entity ids and a data provider id. Your task is to compute a list of unique encoding ids based on the input entity ids and the data provider id. Each encoding id is derived from the entity id by a specific formula: `encoding_id = entity_id * dp_id + 1`. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_encoding_ids([1, 1, 2], 2) == [3, 5]\", \"assert compute_encoding_ids([0, 0, 0], 3) == [1]\", \"assert compute_encoding_ids([], 1) == []\", \"assert compute_encoding_ids([5], 2) == [11]\", \"assert compute_encoding_ids([100], 10) == [1001]\", \"asser... | {
"split": "train",
"index": 81269,
"acecode_id": "bigcode_python_fns_42435",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `normalize_and_flatten(image: List[List[List[int]]]) -> List[float]`, which takes a 3D list representing a grayscale image (with dimensions height x width x channels) and normalizes its pixel values to the range of [-0.5, 0.5]. The in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_and_flatten([[[0]]*80]*20) == [-0.5]*1600\", \"assert normalize_and_flatten([[[255]]*80]*20) == [0.5]*1600\", \"assert normalize_and_flatten([[[10]]*80]*20) == [-0.5 + (10/255)]*1600\", \"assert normalize_and_flatten([[[245]]*80]*20) == [0.5 - (10/... | {
"split": "train",
"index": 81270,
"acecode_id": "bigcode_python_fns_11893",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Implement a function `sort_descending(nums: List[int]) -> List[int]` that takes this list and returns a new list containing the same integers sorted in descending order. The output list should not be modified in place. Your function should hand... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_descending([4, 2, 5, 1, 3]) == [5, 4, 3, 2, 1]\", \"assert sort_descending([10, 20, 15]) == [20, 15, 10]\", \"assert sort_descending([-1, -2, -3]) == [-1, -2, -3]\", \"assert sort_descending([1]) == [1]\", \"assert sort_descending([]) == []\", \"assert ... | {
"split": "train",
"index": 81271,
"acecode_id": "bigcode_python_fns_28632",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that removes consecutive duplicate elements from an input list of strings. The function should take a single parameter, a list of strings, and return a new list with consecutive duplicates removed. For example, given the input ['Hello', 'World', 'Wor... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_consecutive_duplicates(['Hello', 'World', 'World', 'This', 'Is', 'Is', 'Sample']) == ['Hello', 'World', 'This', 'Is', 'Sample']\", \"assert remove_consecutive_duplicates(['A', 'A', 'B', 'B', 'C', 'C', 'C']) == ['A', 'B', 'C']\", \"assert remove_consec... | {
"split": "train",
"index": 81272,
"acecode_id": "evol_15789",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Write a function `aggregate_operations` that takes this list and returns a dictionary containing the sum and the maximum value of the integers in the list. The keys in the dictionary should be 'sum' and 'max', and their corresponding values sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert aggregate_operations([1, 2, 3, 4, 5]) == {'sum': 15, 'max': 5}\", \"assert aggregate_operations([-1, -2, -3, -4, -5]) == {'sum': -15, 'max': -1}\", \"assert aggregate_operations([0]) == {'sum': 0, 'max': 0}\", \"assert aggregate_operations([]) == {'sum': 0, ... | {
"split": "train",
"index": 81273,
"acecode_id": "bigcode_python_fns_42748",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a password, write a function that checks if the password is valid based on the following criteria: it must be at least 8 characters long, contain at least one uppercase letter, one lowercase letter, one digit, and one special character (e.g., !@#$%^&... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_password('Password1!') == True\", \"assert is_valid_password('password') == False\", \"assert is_valid_password('PASSWORD1!') == False\", \"assert is_valid_password('Pass1') == False\", \"assert is_valid_password('Passw0rd') == False\", \"assert is_... | {
"split": "train",
"index": 81274,
"acecode_id": "bigcode_python_fns_30747",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a python function that replaces all occurrences of a given character with another character in a string only if the length of the string is greater than a specific threshold. If the length of the string is less than or equal to the threshold, return the original string un... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_in_string('Hello World!', 'e', 'E', 5) == 'HEllo World!'\", \"assert replace_in_string('Short', 'o', 'O', 5) == 'Short'\", \"assert replace_in_string('Long enough', 'e', 'E', 5) == 'Long Enough'\", \"assert replace_in_string('Python', 'y', 'Y', 6) ==... | {
"split": "train",
"index": 81275,
"acecode_id": "evol_13954",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates CSV output based on a list of records and a flag indicating whether to include extended fields. Write a function `generate_csv_output(data: List[Dict[str, Any]], extended: bool) -> str` that takes a list of dictionaries... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_csv_output([], False) == 'RESOLVED_ENTITY_ID,RELATED_ENTITY_ID,MATCH_LEVEL,MATCH_KEY,DATA_SOURCE,RECORD_ID,LENS_CODE'\", \"assert generate_csv_output([], True) == 'RESOLVED_ENTITY_ID,RELATED_ENTITY_ID,MATCH_LEVEL,MATCH_KEY,DATA_SOURCE,RECORD_ID,LENS... | {
"split": "train",
"index": 81276,
"acecode_id": "oss_26906",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of non-negative floating-point numbers, write a function `reciprocal_square_root(nums)` that computes the reciprocal of the square root for each number in the list. If the number is zero, return 'inf' (infinity), and for negative numbers, return 'nan' (not a number... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reciprocal_square_root([4.0, 0.0, -1.0, 9.0]) == [0.5, 'inf', 'nan', 0.3333333333333333]\", \"assert reciprocal_square_root([1.0, 16.0, 25.0]) == [1.0, 0.25, 0.2]\", \"assert reciprocal_square_root([0.0]) == ['inf']\", \"assert reciprocal_square_root([-4.0, ... | {
"split": "train",
"index": 81277,
"acecode_id": "bigcode_python_fns_44291",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that extracts specific information from a given Swagger documentation data structure represented as a dictionary. The Swagger documentation contains the following keys: 'tags', 'description', and 'parameters'. Your function should tak... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_swagger_doc({'tags': ['card_template'], 'description': 'Obtain structure data of a card template', 'parameters': [{'name': 'param1', 'type': 'string'}]}) == {'tags': ['card_template'], 'description': 'Obtain structure data of a card template', 'paramet... | {
"split": "train",
"index": 81278,
"acecode_id": "oss_15981",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a neural network model represented as a list of layers, where each layer is represented by a string. Your task is to implement a function that modifies the model by freezing a specified number of layers from the end of the list. Freezing a layer means marking it a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert freeze_layers(['layer1', 'layer2', 'layer3', 'layer4'], 2) == ['layer1', 'layer2', 'frozen', 'frozen']\", \"assert freeze_layers(['conv1', 'relu1', 'pool1'], 1) == ['conv1', 'relu1', 'frozen']\", \"assert freeze_layers(['layerA', 'layerB'], 3) == ['frozen', ... | {
"split": "train",
"index": 81279,
"acecode_id": "bigcode_python_fns_42841",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates command-line arguments for a hypothetical program. The function should take a list of arguments as input and return an error message if any of the arguments are deemed invalid. An argument is considered invalid if it is an ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_command_arguments(['arg1', 'arg2']) == 'All arguments are valid'\", \"assert validate_command_arguments(['arg1', '']) == 'Error: Invalid input arguments'\", \"assert validate_command_arguments(['arg1', ' ', 'arg3']) == 'Error: Invalid input argument... | {
"split": "train",
"index": 81280,
"acecode_id": "bigcode_python_fns_13547",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `text` which may contain multiple sentences. Your task is to implement a function `detect_repeated_words(text: str, sensitivity: int) -> str` that identifies the most frequently occurring word in the string. If there are multiple words with the highest fr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_repeated_words('Hello world! Hello everyone.', 2) == 'hellohello'\", \"assert detect_repeated_words('This is a test. This test is simple.', 3) == 'thisthisthis'\", \"assert detect_repeated_words('No repeated words here.', 1) == 'no'\", \"assert detect... | {
"split": "train",
"index": 81281,
"acecode_id": "bigcode_python_fns_47981",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists: `indices` and `data`. The `indices` list contains a list of integer indices, where each index corresponds to a specific position in the output tensor. The `data` list contains values that need to be placed in the output tensor based on the provided indi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dynamic_stitch([[0], [1], [2]], [[1], [2], [3]]) == [[1], [2], [3]]\", \"assert dynamic_stitch([[0]], [[4]]) == [[4]]\", \"assert dynamic_stitch([[0]], [[0]]) == [[0]]\", \"assert dynamic_stitch([[0, 0, 0]], [[1, 2, 3]]) == [[1, 2, 3]]\", \"assert dynamic_st... | {
"split": "train",
"index": 81282,
"acecode_id": "bigcode_python_fns_43629",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a given input string contains the words 'hello' and 'world', allowing for up to three words to appear between them. The intermediate words should not contain any punctuation marks. The function should return True if the criteria are met, and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_hello_world('hello world') == True\", \"assert check_hello_world('hello beautiful world') == True\", \"assert check_hello_world('hello amazing wonderful world') == True\", \"assert check_hello_world('hello to the world') == True\", \"assert check_hello... | {
"split": "train",
"index": 81283,
"acecode_id": "evol_31913",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 3x3 board for a Tic-Tac-Toe game represented by a list of lists. Each cell on the board can contain either 'X', 'O', or None (representing an empty cell). Write a function `winner(board)` that determines the winner of the game. The function should return 'X' if ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert winner([['X', 'O', 'X'], ['O', 'X', 'O'], ['X', None, None]]) == 'X'\", \"assert winner([['O', 'X', 'O'], ['X', 'O', 'X'], ['O', None, None]]) == 'O'\", \"assert winner([['X', 'X', 'X'], ['O', 'O', None], [None, None, None]]) == 'X'\", \"assert winner([['O',... | {
"split": "train",
"index": 81284,
"acecode_id": "bigcode_python_fns_24476",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of words, implement a function `filter_long_words` that returns a new list containing only the words that have a length greater than 5. For example, if the input is ['apple', 'cat', 'banana', 'dog'], the output should be ['banana'].\nPlease reason step by step, the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_long_words(['apple', 'cat', 'banana', 'dog']) == ['banana']\", \"assert filter_long_words(['hello', 'world', 'python', 'coding']) == ['python', 'coding']\", \"assert filter_long_words(['short', 'tiny', 'large', 'massive']) == ['massive']\", \"assert f... | {
"split": "train",
"index": 81285,
"acecode_id": "evol_15150",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats a message for sending through a messenger API. The function should take three parameters: a string `token`, a string `recipient`, and a string `text`. The function should return a dictionary that represents the message struct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_message('abc123', 'recipient_id_1', 'Hello!') == {'recipient': {'id': 'recipient_id_1'}, 'message': {'text': 'Hello!'}}\", \"assert format_message('xyz789', 'recipient_id_2', 'Test message.') == {'recipient': {'id': 'recipient_id_2'}, 'message': {'tex... | {
"split": "train",
"index": 81286,
"acecode_id": "bigcode_python_fns_36594",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function `print_reverse(arr)` that prints the elements in reverse order, one per line. Handle edge cases such as empty arrays and arrays with a single element. Do not return anything from the function, simply print the result directly.\nPleas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_reverse([]) == None\", \"assert print_reverse([42]) == None\", \"assert print_reverse([1, 2, 3]) == None\", \"assert print_reverse([5, 10, 15, 20]) == None\", \"assert print_reverse([100]) == None\", \"assert print_reverse([-1, -2, -3]) == None\", \"as... | {
"split": "train",
"index": 81287,
"acecode_id": "evol_16612",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to detect circular spots in a given 2D binary image represented as a list of lists, where 1s represent spots and 0s represent the background. Your function should identify all coordinates of spots (1s) present in the image and return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_spots([[0, 0, 0], [0, 0, 0], [0, 0, 0]]) == []\", \"assert detect_spots([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) == [(0, 0), (1, 1), (2, 2)]\", \"assert detect_spots([[1, 1, 1], [1, 0, 1], [1, 1, 1]]) == [(0, 0), (0, 1), (0, 2), (1, 0), (1, 2), (2, 0), (2, ... | {
"split": "train",
"index": 81288,
"acecode_id": "oss_22321",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that verifies if a given string represents a valid image file format. The valid formats are 'png', 'jpg', 'jpeg', and 'gif'. The function should check if the string ends with one of these extensions. If the format is valid, return True; o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_image_format('image.png') == True\", \"assert is_valid_image_format('photo.jpg') == True\", \"assert is_valid_image_format('graphic.jpeg') == True\", \"assert is_valid_image_format('animation.gif') == True\", \"assert is_valid_image_format('document... | {
"split": "train",
"index": 81289,
"acecode_id": "bigcode_python_fns_38661",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a sequence of integers based on a specified number of terms. The sequence starts from 1, and each subsequent term is calculated by adding the previous term with the index of that term in the sequence. Your task is to implem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_sequence(1) == [1]\", \"assert generate_sequence(2) == [1, 3]\", \"assert generate_sequence(3) == [1, 3, 6]\", \"assert generate_sequence(4) == [1, 3, 6, 10]\", \"assert generate_sequence(5) == [1, 3, 6, 10, 15]\", \"assert generate_sequence(6) == [... | {
"split": "train",
"index": 81290,
"acecode_id": "oss_6603",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, each representing the content of a file. Your task is to implement a function that takes this list of strings and returns a single string that concatenates all the strings in the list into one string, with each original string separated by a new... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concatenate_files_content(['file1', 'file2', 'file3']) == 'file1\\\\nfile2\\\\nfile3'\", \"assert concatenate_files_content(['file1', '', 'file3']) == 'file1\\\\n\\\\nfile3'\", \"assert concatenate_files_content(['file1', 'file2']) == 'file1\\\\nfile2'\", \"... | {
"split": "train",
"index": 81291,
"acecode_id": "bigcode_python_fns_1994",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates the initialization of a Git repository and performs basic Git operations. Your function should accept a project directory path as an input and perform the following operations in order: 1) Initialize a new Git reposi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert setup_git('/path/to/project') == ['Initialized repository at /path/to/project', 'Added files to staging', 'Made initial commit: Initial commit']\", \"assert setup_git('/another/project') == ['Initialized repository at /another/project', 'Added files to stagi... | {
"split": "train",
"index": 81292,
"acecode_id": "oss_863",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the behavior of command line argument parsing. The function should take a list of strings as input, representing command line arguments, and return a dictionary that maps each recognized option to its corresponding valu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_arguments(['-p']) == ({'print': True, 'format': '%Y-%m-%d', 'editor': 'xdg-open', 'locale': '', 'is_force_read_cache': False, 'theme': 'classic_dark'}, [])\", \"assert parse_arguments(['-f', '%Y-%m-%d']) == ({'print': False, 'format': '%Y-%m-%d', 'edit... | {
"split": "train",
"index": 81293,
"acecode_id": "bigcode_python_fns_3054",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string 'word', implement a function `get_closest_vowel(word)` that finds the closest vowel from the right side of the word that is located between two consonants. Vowels at the beginning or end of the word should be ignored. If no such vowel exists, return an empty stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_closest_vowel('yogurt') == 'u'\", \"assert get_closest_vowel('FULL') == 'U'\", \"assert get_closest_vowel('quick') == ''\", \"assert get_closest_vowel('ab') == ''\", \"assert get_closest_vowel('AEIOU') == ''\", \"assert get_closest_vowel('Python') == 'o'... | {
"split": "train",
"index": 81294,
"acecode_id": "evol_1162",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that receives a list of directory paths and a glob pattern string. Your function should return a list of matching directory paths that conform to the provided glob pattern. The glob pattern can include the wildcard '**' which matches ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert match_directories(['dir1', 'dir2', 'dir3'], '**') == ['dir1', 'dir2', 'dir3']\", \"assert match_directories(['dir1', 'dir2', 'dir3'], 'dir*') == ['dir1', 'dir2', 'dir3']\", \"assert match_directories(['dir1', 'dir2', 'dir3'], 'dir1') == ['dir1']\", \"assert ... | {
"split": "train",
"index": 81295,
"acecode_id": "bigcode_python_fns_598",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple progress tracker for a file download. Implement a function `track_progress(bytes_amount: int) -> str` that takes an integer `bytes_amount`, representing the number of bytes downloaded, and returns a string indicating the download progress i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert track_progress(0) == 'Downloaded 0 bytes'\", \"assert track_progress(1) == 'Downloaded 1 bytes'\", \"assert track_progress(10) == 'Downloaded 10 bytes'\", \"assert track_progress(100) == 'Downloaded 100 bytes'\", \"assert track_progress(250) == 'Downloaded 2... | {
"split": "train",
"index": 81296,
"acecode_id": "bigcode_python_fns_23013",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a list of document metadata based on different types of sheets. Each sheet type has a unique URL and description. The function should take a list of tuples, where each tuple consists of the sheet type, description, and a un... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_documents([('huddle', 'Daily Huddle Sheet', 1), ('training', 'Training Sign-in Sheet', 2), ('meeting', 'Meeting Sign-in Sheet', 3)]) == [{'description': 'Daily Huddle Sheet', 'url': 'https://example.com/huddle_sheet.doc', 'permissions': ['IS_TEAM']}... | {
"split": "train",
"index": 81297,
"acecode_id": "bigcode_python_fns_41149",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of strings and returns a dictionary containing the count of each unique string in the list. Your function should raise a ValueError if the input list is empty. For instance, given the input ['apple', 'bana... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_symbols(['apple', 'banana', 'apple', 'orange', 'banana', 'apple']) == {'apple': 3, 'banana': 2, 'orange': 1}\", \"assert count_symbols(['a', 'b', 'c', 'a', 'b', 'a']) == {'a': 3, 'b': 2, 'c': 1}\", \"assert count_symbols(['x', 'y', 'x', 'z', 'y', 'x', ... | {
"split": "train",
"index": 81298,
"acecode_id": "oss_22032",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string of words that can be separated by commas, spaces, or a combination of both. Your task is to create a function that takes this string and a target word as input and returns an array of the component words in their original sequence, excluding any occurrenc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_words('A, B, C, D, E, F', 'C') == ['A', 'B', 'D', 'E', 'F']\", \"assert filter_words('Python, Java, Python, C++', 'Python') == ['Java', 'C++']\", \"assert filter_words('apple, banana, cherry, date', 'banana') == ['apple', 'cherry', 'date']\", \"assert... | {
"split": "train",
"index": 81299,
"acecode_id": "evol_16694",
"num_tests": 15
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.