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 a list of distinct characters, implement a function that returns all possible unique arrangements (permutations) of those characters as a list of strings. The order of arrangements in the output list should follow the lexicographic order. For example, given the input list... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_all_arrangements(['A', 'B', 'C']) == ['ABC', 'ACB', 'BAC', 'BCA', 'CAB', 'CBA']\", \"assert find_all_arrangements(['A', 'B']) == ['AB', 'BA']\", \"assert find_all_arrangements(['A']) == ['A']\", \"assert find_all_arrangements(['A', 'B', 'C', 'D']) == ['... | {
"split": "train",
"index": 61400,
"acecode_id": "evol_24049",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a string `s`, check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. The substring can overlap with itself in the repeated pattern. Implement a function that returns `True` if such a substring exists, otherwise ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert repeatedSubstringPattern('abcabcabc') == True\", \"assert repeatedSubstringPattern('abcabcabcabc') == True\", \"assert repeatedSubstringPattern('abababab') == True\", \"assert repeatedSubstringPattern('aaaaaa') == True\", \"assert repeatedSubstringPattern('x... | {
"split": "train",
"index": 61401,
"acecode_id": "evol_11355",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a list of numbers and returns the product of all odd numbers in the list. The function should handle any non-numeric values gracefully by ignoring them during the calculation. Additionally, the function should check if the resulting product is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_of_odd([1, 3, 5]) == 15\", \"assert product_of_odd([2, 4, 6]) == None\", \"assert product_of_odd([1, 2, 'a', 3.5, None]) == 3\", \"assert product_of_odd([7, 2, 3]) == 21\", \"assert product_of_odd([]) == None\", \"assert product_of_odd(['hello', 3, 5... | {
"split": "train",
"index": 61402,
"acecode_id": "evol_32161",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom exception class in Python for handling specific errors in an application. Your goal is to create a custom exception class called `CustomError` that will be raised when a specific condition is met in your application. The `CustomError` c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert CustomError.__base__ is Exception\", \"assert issubclass(CustomError, Exception)\", \"assert CustomError().__str__() == ''\", \"assert isinstance(CustomError('An error occurred'), Exception)\", \"assert CustomError('An error occurred').args[0] == 'An error o... | {
"split": "train",
"index": 61403,
"acecode_id": "oss_19868",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strains and a corresponding list of isotypes. Your task is to write a function that checks if there are any unknown isotypes in the list. An unknown isotype is represented by the value `None`. If there are unknown isotypes, the function should return a l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_unknown_isotypes(['strain1', 'strain2', 'strain3'], ['isotype1', None, 'isotype3']) == ['strain2']\", \"assert find_unknown_isotypes(['strainA', 'strainB'], ['isotypeA', 'isotypeB']) == []\", \"assert find_unknown_isotypes(['strainX'], [None]) == ['stra... | {
"split": "train",
"index": 61404,
"acecode_id": "bigcode_python_fns_17046",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a dictionary containing address information and returns a formatted address string. The input dictionary will contain the following keys: 'addr:street', 'addr:city', 'addr:state', and 'addr:country'. The values assoc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_address({'addr:street': '123 Main St', 'addr:city': 'San Francisco', 'addr:state': 'CA', 'addr:country': 'USA'}) == '123 Main St, San Francisco, CA, USA'\", \"assert format_address({'addr:street': '456 Elm St', 'addr:city': 'Los Angeles', 'addr:countr... | {
"split": "train",
"index": 61405,
"acecode_id": "oss_8894",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a function in python called `word_frequency` that takes a string as input and returns a dictionary where the keys are the unique words present in the string and the values are their frequency of occurrence. The function should ignore case sensitivity and punctuation.\nP... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_frequency('Hello world! Hello') == {'hello': 2, 'world': 1}\", \"assert word_frequency('The quick brown fox jumps over the lazy dog.') == {'the': 2, 'quick': 1, 'brown': 1, 'fox': 1, 'jumps': 1, 'over': 1, 'lazy': 1, 'dog': 1}\", \"assert word_frequency... | {
"split": "train",
"index": 61406,
"acecode_id": "evol_19674",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `add_numbers(x, y)` that takes two parameters, `x` and `y`. The function should return the sum of `x` and `y` plus one. Handle the following edge cases: if either `x` or `y` is None, return 'Error: Null input detected'; if either `x` or `y` cannot be conver... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_numbers(2, 3) == 6\", \"assert add_numbers(-1, 1) == 1\", \"assert add_numbers(0, 0) == 1\", \"assert add_numbers(1.5, 2.5) == 5.0\", \"assert add_numbers(None, 5) == 'Error: Null input detected'\", \"assert add_numbers(5, None) == 'Error: Null input det... | {
"split": "train",
"index": 61407,
"acecode_id": "evol_4395",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of towers in a city. Your task is to determine the maximum height of any tower after performing a series of operations. In each operation, you can choose any tower and increase its height by 1. You can perform the operat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_height_after_operations([1, 1, 1], 5) == 6\", \"assert max_height_after_operations([1], 100) == 101\", \"assert max_height_after_operations([0, 0, 0], 0) == 0\", \"assert max_height_after_operations([1, 1, 1, 1], 1) == 2\", \"assert max_height_after_oper... | {
"split": "train",
"index": 61408,
"acecode_id": "bigcode_python_fns_28018",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Rosa is aiming to run a total of 1,200 miles in a year at a consistent daily running distance of 5 miles. Write a function `miles_remaining(d: int) -> int` that calculates the miles remaining for Rosa's goal after running for `d` days.\nPlease reason step by step, then write a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert miles_remaining(0) == 1200\", \"assert miles_remaining(1) == 1195\", \"assert miles_remaining(240) == 0\", \"assert miles_remaining(240) == 0\", \"assert miles_remaining(300) == -300\", \"assert miles_remaining(50) == 950\"]}"
} | {
"split": "train",
"index": 61409,
"acecode_id": "evol_55",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Write a function that removes all occurrences of a given fruit from a list of lists, ensuring that the removal is case insensitive. The function should take two arguments: a string representing the fruit to remove and a list of lists containing various fruits. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert eradicate_fruit('apple', [['banana', 'apple', 'mango', 'orange'], ['apple', 'guava'], ['Apple', 'kiwi']]) == [['banana', 'mango', 'orange'], ['guava'], ['kiwi']]\", \"assert eradicate_fruit('banana', [['banana', 'apple', 'mango'], ['banana', 'kiwi']]) == [['... | {
"split": "train",
"index": 61410,
"acecode_id": "evol_6539",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a binary input (string) to its octal representation (string) without using any built-in or imported functions. The function should return 'Invalid binary input' if the binary string contains any characters other than '0' or '1', or if the bina... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_binary_to_octal('1000') == '10'\", \"assert custom_binary_to_octal('1111') == '17'\", \"assert custom_binary_to_octal('11010') == '32'\", \"assert custom_binary_to_octal('0') == '0'\", \"assert custom_binary_to_octal('00') == 'Invalid binary input'\",... | {
"split": "train",
"index": 61411,
"acecode_id": "evol_4114",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that subtracts two complex numbers represented as strings. A complex number is in the form 'a + bi', where 'a' and 'b' are integers, and 'i' stands for the imaginary unit. The function should take two strings representing complex numbers and return a string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert subtract_complex_numbers('5+3i', '3+2i') == '2+1i'\", \"assert subtract_complex_numbers('0+0i', '0+0i') == '0+0i'\", \"assert subtract_complex_numbers('2+3i', '2+3i') == '0+0i'\", \"assert subtract_complex_numbers('3+4i', '1+1i') == '2+3i'\", \"assert subtra... | {
"split": "train",
"index": 61412,
"acecode_id": "evol_21798",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing labels of a training example, where the length of the list is Ty. You need to update the labels in such a way that all elements after a specified index segment_end_index (exclusive) are set to 1, for a total of 'steps' elements. If ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_labels([0, 0, 0, 0, 0], 4, 3) == [0, 0, 0, 0, 1]\", \"assert update_labels([0, 0, 0, 0, 0], 5, 3) == [0, 0, 0, 0, 0]\", \"assert update_labels([1, 2, 3, 4, 5], 0, 5) == [1, 1, 1, 1, 1]\", \"assert update_labels([1], 0, 1) == [1]\", \"assert update_lab... | {
"split": "train",
"index": 61413,
"acecode_id": "bigcode_python_fns_34622",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `lucas_numbers(n)` that returns the first `n` numbers in the Lucas sequence. The Lucas sequence starts with 2 and 1, and each subsequent number is the sum of the two preceding ones. For example, the sequence begins as follows: 2, 1, 3, 4, 7, 11, 18, ... You... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lucas_numbers(0) == []\", \"assert lucas_numbers(1) == [2]\", \"assert lucas_numbers(2) == [2, 1]\", \"assert lucas_numbers(3) == [2, 1, 3]\", \"assert lucas_numbers(4) == [2, 1, 3, 4]\", \"assert lucas_numbers(5) == [2, 1, 3, 4, 7]\", \"assert lucas_numbers... | {
"split": "train",
"index": 61414,
"acecode_id": "evol_4310",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats a notification message for a chat application. The function takes a mandatory channel name and a message string as input. Additionally, it can take an optional subject string. If the subject is provided, it should be formatte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_notification('#general', 'Hello, team!') == 'Hello, team!'\", \"assert format_notification('#alerts', 'Server is down', 'URGENT') == '*_URGENT_* | Server is down'\", \"assert format_notification('#updates', 'New version released') == 'New version rele... | {
"split": "train",
"index": 61415,
"acecode_id": "bigcode_python_fns_14371",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that updates a value in a data array. The data array can hold a maximum of 20 elements, initialized to zero. Your function should take in two parameters: `position`, which is the index of the array to update, and `number`, which is th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_value(0, 10) == None\", \"assert update_value(19, 5.5) == None\", \"assert update_value(10, -3) == None\", \"assert update_value(5, 0) == None\", \"assert update_value(15, 2.2) == None\", \"assert update_value(4, 10) == None\", \"assert update_value(1... | {
"split": "train",
"index": 61416,
"acecode_id": "evol_1178",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the amounts of Bitcoin in various wallets. Your task is to implement a function that calculates the total amount of Bitcoin across all wallets and returns this total as an integer. The function should handle the case where the list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_bitcoin([1, 2, 3]) == 6\", \"assert calculate_total_bitcoin([0, 0, 0]) == 0\", \"assert calculate_total_bitcoin([-1, -2, -3]) == 0\", \"assert calculate_total_bitcoin([1, -1, 2]) == 3\", \"assert calculate_total_bitcoin([-5, 5, 10]) == 15\", ... | {
"split": "train",
"index": 61417,
"acecode_id": "bigcode_python_fns_16019",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of dependencies and returns a dictionary representing the dependency graph. Each dependency is represented as a tuple containing two elements: the dependent module and the module it depends on. The function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_dependency_graph([]) == {}\", \"assert build_dependency_graph([('a', 'b')]) == {'a': ['b'], 'b': []}\", \"assert build_dependency_graph([('a', 'b'), ('c', 'd')]) == {'a': ['b'], 'b': [], 'c': ['d'], 'd': []}\", \"assert build_dependency_graph([('a', 'b... | {
"split": "train",
"index": 61418,
"acecode_id": "oss_33062",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with transforming a semantic versioning string into a specific format. Given a version string in the format 'X.Y.Z', where X, Y, and Z are non-negative integers, your function should return a new version string formatted as 'X.Y.devZ' if the minor version Y is od... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_version('1.0.0') == '1.0.0'\", \"assert transform_version('2.1.3') == '2.1.dev3'\", \"assert transform_version('3.2.1') == '3.2.1'\", \"assert transform_version('4.3.0') == '4.3.dev0'\", \"assert transform_version('5.0.5') == '5.0.5'\", \"assert tr... | {
"split": "train",
"index": 61419,
"acecode_id": "bigcode_python_fns_16865",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Develop a function that takes a list of integers as input and returns a dictionary representing the frequency of each integer in the list. Each integer should be a key in the dictionary, and its corresponding value should be the number of times that integer appears in the list.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert distribution_table([1, 2, 3, 1, 4, 5, 5, 2]) == {1: 2, 2: 2, 3: 1, 4: 1, 5: 2}\", \"assert distribution_table([1, 1, 1, 1]) == {1: 4}\", \"assert distribution_table([]) == {}\", \"assert distribution_table([0, 0, 0, 0, 0]) == {0: 5}\", \"assert distribution_... | {
"split": "train",
"index": 61420,
"acecode_id": "evol_3149",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that applies a convolution operation on a 2D image using a given square kernel matrix. The convolution operation involves sliding the kernel over the image, multiplying overlapping values, and summing them up to produce a new pixel va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_kernel_operation([[0, 0, 0], [0, 1, 0], [0, 0, 0]], [[0, 0], [0, 0]]) == [[0, 0], [0, 0]]\", \"assert apply_kernel_operation([[1]], [[100]] ) == [[100]]\", \"assert apply_kernel_operation([[0, 0, 0], [0, 1, 0], [0, 0, 0]], [[255, 255, 255], [255, 255, ... | {
"split": "train",
"index": 61421,
"acecode_id": "oss_30354",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates authentication for a cloud service. The function should support two versions of the authentication API. The function `authenticate_user` takes the following parameters: `username` (a string), `password` (a string), `aut... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert authenticate_user('user1', 'password1', 'http://auth.url', 2) == 'token_v2_user1'\", \"assert authenticate_user('user2', 'password2', 'http://auth.url', 3) == 'token_v3_user2'\", \"assert authenticate_user('user3', 'password3', 'http://auth.url', 2) == 'toke... | {
"split": "train",
"index": 61422,
"acecode_id": "oss_20875",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an integer `n` representing the total number of courses numbered from `1` to `n`, and an array `relations` where `relations[i] = [a, b]` indicates a prerequisite relationship between course `a` and course `b`: course `a` must be completed before course `b`. Write ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minSemesters(3, [[1,3],[2,3]]) == 2\", \"assert minSemesters(3, [[1,2],[2,3],[3,1]]) == -1\", \"assert minSemesters(4, [[2,1],[3,1],[1,4]]) == 3\", \"assert minSemesters(5, [[1,2],[2,3],[3,4],[4,5]]) == 5\", \"assert minSemesters(2, [[1,2]]) == 2\", \"assert... | {
"split": "train",
"index": 61423,
"acecode_id": "evol_34406",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines the appropriate GUI toolkit based on a given input string. The function should take a single string parameter `name`, which represents the name of the GUI toolkit, and return a string indicating the selected toolkit. The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_toolkit('choose something') == 'none'\", \"assert select_toolkit('qt') == 'qt4'\", \"assert select_toolkit('pyside') == 'pyside'\", \"assert select_toolkit('qt5') == 'qt5'\", \"assert select_toolkit('gtk') == 'gtk3'\", \"assert select_toolkit('gtk3') ... | {
"split": "train",
"index": 61424,
"acecode_id": "bigcode_python_fns_47041",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `extract_subdomain(url: str) -> str` that takes a URL as input and returns the subdomain of the URL. If there is no subdomain, return 'No subdomain'. The input URL will be a well-formed string starting with a valid scheme (e.g., 'http://', 'https://').\nPle... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_subdomain('https://subdomain.example.com/path') == 'subdomain'\", \"assert extract_subdomain('http://www.example.com') == 'www'\", \"assert extract_subdomain('https://blog.example.org') == 'blog'\", \"assert extract_subdomain('https://shop.example.co... | {
"split": "train",
"index": 61425,
"acecode_id": "evol_3381",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with counting the occurrences of domain names from a set of resource URLs. Write a function `count_domain_occurrences(resource_urls: set) -> dict` that takes a set of resource URLs as input and returns a dictionary containing the count of occurrences for each dom... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_domain_occurrences({'https://sub.example.com/page1', 'https://sub.example.com/page2'}) == {'sub.example.com': 2}\", \"assert count_domain_occurrences({'https://www.google.com/search', 'https://www.google.com/images', 'https://www.bing.com/search'}) == ... | {
"split": "train",
"index": 61426,
"acecode_id": "oss_14539",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `compile_c_code` that simulates the process of compiling C code based on given parameters. The function takes the following inputs: \n- `source`: A string representing the path to the C source file to be compiled. \n- `output_filename`: A... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compile_c_code('file.c', 'output.s', {'version': '1.0', 'preproc': '/usr/include', 'charmap': 'UTF-8', '-S': True, '-o': 'output.s', 'no_parse': False}, []) == True\", \"assert compile_c_code('file.c', 'output.o', {'version': '1.0', 'preproc': '', 'charmap':... | {
"split": "train",
"index": 61427,
"acecode_id": "oss_8042",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes in two arguments and identifies their data types within your function. If the types of both input parameters are not the same, handle the type error and return an appropriate error message. If both input arguments are numbers (either integer o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_sum(5, 10) == 15\", \"assert get_sum(5.5, 2.5) == 8.0\", \"assert get_sum('Hello', ' World') == 'Hello World'\", \"assert get_sum('Python', '3.8') == 'Python3.8'\", \"assert get_sum('Test', '123') == 'Test123'\", \"assert get_sum(0, 0) == 0\", \"assert g... | {
"split": "train",
"index": 61428,
"acecode_id": "evol_9630",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of integers according to specific rules. Given a list of integers, the function should return a modified list based on the following operations: 1. If an integer is even, square it. 2. If an integer is odd... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_numbers([1]) == [1]\", \"assert process_numbers([2]) == [4]\", \"assert process_numbers([4]) == [16]\", \"assert process_numbers([5]) == [125]\", \"assert process_numbers([6]) == [46]\", \"assert process_numbers([7]) == [343]\", \"assert process_numb... | {
"split": "train",
"index": 61429,
"acecode_id": "oss_15696",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function called `analyze_imports` that analyzes a predefined list of imported modules and returns a dictionary containing the count of unique modules imported from each package. Each import statement is represented as a string, and you should cons... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_imports() == {'numpy': 1, 'core': 1, 'getpath': 1, 'log': 1, 'collections': 1, 'makehuman': 1, 'material': 1}\", \"assert analyze_imports() == {'numpy': 1, 'core': 1, 'getpath': 1, 'log': 1, 'collections': 1, 'makehuman': 1, 'material': 1}\", \"asser... | {
"split": "train",
"index": 61430,
"acecode_id": "oss_2987",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that manages a collection of screw drive types. Your function should allow for adding new screw drive types, removing existing ones, and checking for the total count of screw drive types in the collection. Additionally, it should allow fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_screw_drives([('add', 'cruciform'), ('add', 'hex'), ('add', 'slotted'), ('count', None)]) == [3]\", \"assert manage_screw_drives([('add', 'cruciform'), ('add', 'hex'), ('remove', 'hex'), ('check', 'hex')]) == [False]\", \"assert manage_screw_drives([(... | {
"split": "train",
"index": 61431,
"acecode_id": "oss_11812",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function that returns a dictionary where the keys are the distinct characters in the string and the values are their corresponding frequencies in the string. The frequency count should be case-sensitive. For example, 'a' and 'A' should be counted sep... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert char_frequency('Hello') == {'H': 1, 'e': 1, 'l': 2, 'o': 1}\", \"assert char_frequency('') == {}\", \"assert char_frequency('abcABC') == {'a': 1, 'b': 1, 'c': 1, 'A': 1, 'B': 1, 'C': 1}\", \"assert char_frequency('Test123') == {'T': 1, 'e': 1, 's': 1, 't': 1... | {
"split": "train",
"index": 61432,
"acecode_id": "evol_15650",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining if a given review is locked based on its review ID. A review is considered 'locked' if it is included in a set of predefined locked reviews. Implement a function `is_review_locked(review_id: int) -> bool` that takes an integer `review_id` as inpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_review_locked(101) == True\", \"assert is_review_locked(202) == True\", \"assert is_review_locked(303) == True\", \"assert is_review_locked(404) == True\", \"assert is_review_locked(505) == True\", \"assert is_review_locked(100) == False\", \"assert is_re... | {
"split": "train",
"index": 61433,
"acecode_id": "bigcode_python_fns_19450",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fib(n)` that computes the Fibonacci number for a given input `n`. The function should handle positive integers, negative integers, and fractions. For positive integers, return the Fibonacci number at that position. For negative integers, return the Fibonac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fib(0) == 0\", \"assert fib(1) == 1\", \"assert fib(2) == 1\", \"assert fib(3) == 2\", \"assert fib(4) == 3\", \"assert fib(5) == 5\", \"assert fib(-1) == 1\", \"assert fib(-2) == -1\", \"assert fib(-3) == 2\", \"assert fib(-4) == -3\", \"assert fib(0.1) == ... | {
"split": "train",
"index": 61434,
"acecode_id": "evol_9064",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a variable number of inputs representing different files. Your task is to count the total number of lines of code across all provided files. Each input can be a string representing the content of a file. Write a function `count_lines_of_code(*files: str) -> int` t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_lines_of_code('line1\\\\nline2','line3\\\\n') == 3\", \"assert count_lines_of_code('line1\\\\n\\\\nline2\\\\nline3') == 3\", \"assert count_lines_of_code(' \\\\n ') == 0\", \"assert count_lines_of_code('single line') == 1\", \"assert count_lines_of... | {
"split": "train",
"index": 61435,
"acecode_id": "bigcode_python_fns_38484",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a tree represented as a dictionary where the keys are node IDs and the values are boolean values indicating whether the node exists (True) or does not exist (False). Implement a function `check_nodes(tree: Dict[str, bool]) -> List[str]` that returns a list of stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_nodes({'a': True, 'b': False, 'root': True}) == ['Node a exists', 'Node b does not exist', 'Node root exists']\", \"assert check_nodes({'root': False, 'c': True}) == ['Node root does not exist', 'Node c exists']\", \"assert check_nodes({'root': True}) ... | {
"split": "train",
"index": 61436,
"acecode_id": "bigcode_python_fns_9268",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given three strings, each containing only printable ASCII characters with a maximum length of 100 characters. Your task is to write a function that takes these three strings as input parameters and returns a list of these strings in reverse order. The function should re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_strings('Ahmad', 'Hello World', 'Not so Simple') == ['Not so Simple', 'Hello World', 'Ahmad']\", \"assert reverse_strings('First', 'Second', 'Third') == ['Third', 'Second', 'First']\", \"assert reverse_strings('One', 'Two', 'Three') == ['Three', 'Two... | {
"split": "train",
"index": 61437,
"acecode_id": "oss_26494",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that accepts a non-negative whole number and outputs a list of prime numbers smaller than the given number. The function should return an empty list if the input number is less than or equal to 1. Ensure that the output list contains only unique prime numbe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_up_to(5) == [2, 3]\", \"assert count_up_to(11) == [2, 3, 5, 7]\", \"assert count_up_to(0) == []\", \"assert count_up_to(1) == []\", \"assert count_up_to(20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert count_up_to(18) == [2, 3, 5, 7, 11, 13, 17]\", \"as... | {
"split": "train",
"index": 61438,
"acecode_id": "evol_21976",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a line from a configuration file. The configuration file contains sections defined by square brackets (e.g., `[section_name]`), followed by key-value pairs that define settings under those sections (e.g., `key=value`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_config(['[section1]', 'key1=value1', 'key2=value2']) == {'section1': {'key1': 'value1', 'key2': 'value2'}}\", \"assert parse_config(['[section1]', 'key1=value1', 'key1=value2']) == {'section1': {'key1': ['value1', 'value2']}}\", \"assert parse_config([... | {
"split": "train",
"index": 61439,
"acecode_id": "bigcode_python_fns_40001",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `count_recurring_elements` that returns a list of tuples. Each tuple should contain a recurring integer from the original list and its frequency, in the order of their first appearance. If there are no recurring elements, return an emp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_recurring_elements([1, 2, 3, 4, 5]) == []\", \"assert count_recurring_elements([1, 1, 1, 1]) == [(1, 4)]\", \"assert count_recurring_elements([5, 6, 5, 7, 8, 6, 9, 10]) == [(5, 2), (6, 2)]\", \"assert count_recurring_elements([]) == []\", \"assert coun... | {
"split": "train",
"index": 61440,
"acecode_id": "evol_11601",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of news article titles. Your task is to implement a function that takes this list and a title as input, and returns a boolean indicating whether the title is present in the list. If the title is present, it should return True indicating that the title is bl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_blacklisted(['Breaking News', 'Weather Update', 'Sports Highlights'], 'Weather Update') == True\", \"assert is_blacklisted(['Breaking News', 'Weather Update', 'Sports Highlights'], 'Political Debates') == False\", \"assert is_blacklisted(['Economy Today',... | {
"split": "train",
"index": 61441,
"acecode_id": "bigcode_python_fns_13526",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if specific user-defined fields (UDFs) for devices are already present in a system and creates them if they are not. The UDFs are represented as a list of dictionaries, each containing the following keys: 'name', 'displayName'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_and_create_udfs([{'name': 'new_udf', 'displayName': 'New UDF', 'type': 'TEXT'}]) == ['new_udf']\", \"assert check_and_create_udfs([{'name': 'app', 'displayName': 'App Profile', 'type': 'TEXT'}, {'name': 'new_udf', 'displayName': 'New UDF', 'type': 'TEX... | {
"split": "train",
"index": 61442,
"acecode_id": "bigcode_python_fns_46116",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the deletion of an application plan based on its ID. The function `delete_application_plan(service_id: int, plan_id: int) -> str` should take two parameters: the ID of the service and the ID of the application plan to b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_application_plan(1, 100) == 'Application plan id: 100 deleted'\", \"assert delete_application_plan(1, 101) == 'Application plan id: 101 not found'\", \"assert delete_application_plan(2, 200) == 'Application plan id: 200 deleted'\", \"assert delete_app... | {
"split": "train",
"index": 61443,
"acecode_id": "bigcode_python_fns_40253",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `capitalize_words` that takes a single string input and returns a modified version of the string where the first letter of each word is capitalized. A word is defined as a sequence of characters separated by spaces. The function should handle multipl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert capitalize_words('hello world') == 'Hello World'\", \"assert capitalize_words(' hello world ') == 'Hello World'\", \"assert capitalize_words('python programming') == 'Python Programming'\", \"assert capitalize_words(' multiple spaces here ') == 'Multi... | {
"split": "train",
"index": 61444,
"acecode_id": "oss_2918",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that registers a callback method for a given message type. The function should take two parameters: a callable 'callback' and a 'msgtype' which can either be a string or a tuple of strings. If 'msgtype' is a tuple, it should be converted ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_callback(lambda x: x, 'message.type') is None\", \"assert register_callback(lambda x: x, ('message', 'type')) is None\", \"assert register_callback(lambda x: x + 1, 'another.message') is None\", \"assert register_callback(lambda x: x * 2, ('another'... | {
"split": "train",
"index": 61445,
"acecode_id": "bigcode_python_fns_7223",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing filenames of astronomical images. Each filename consists of a prefix followed by additional characters, and the first six characters of all filenames in the list are expected to be the same. Your task is to implement a function 'vali... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_filenames(['abc123_flc.fits', 'abc456_flc.fits', 'abc789_flc.fits']) == False\", \"assert validate_filenames(['def0001_flc.fits', 'def0002_flc.fits', 'def0003_flc.fits']) == True\", \"assert validate_filenames(['ghi111_flc.fits', 'ghi222_flc.fits', ... | {
"split": "train",
"index": 61446,
"acecode_id": "bigcode_python_fns_12618",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Write a Python function `reverse_fibonacci(n: int) -> List[int]` that takes an integer `n` as input and returns a list of the first `n` Fibonacci numbers in reverse order. Ensure that the function handles any potential errors gracefully. The Fibonacci sequence starts with 0 and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_fibonacci(0) == []\", \"assert reverse_fibonacci(1) == [0]\", \"assert reverse_fibonacci(2) == [1, 0]\", \"assert reverse_fibonacci(3) == [1, 1, 0]\", \"assert reverse_fibonacci(4) == [2, 1, 1, 0]\", \"assert reverse_fibonacci(5) == [3, 2, 1, 1, 0]\"... | {
"split": "train",
"index": 61447,
"acecode_id": "evol_17937",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_user` that takes four parameters: `username` (str), `password` (str), `email` (str), and `interests` (list of str). The function should create a new user and return a success message if all required information is provided. If any information is mis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_user('john_doe', 'secure_password', 'john@example.com', ['technology', 'science']) == 'User created successfully.'\", \"assert create_user('', 'secure_password', 'john@example.com', ['technology', 'science']) == 'Missing required information: username... | {
"split": "train",
"index": 61448,
"acecode_id": "evol_1520",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a formatted email message. The function should take the subject of the email, the sender's email address, a list of recipient email addresses, and the HTML body of the email. Your function should return a dictionary represe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_email('Weekly Update', 'admin@example.com', ['team@example.com'], '<p>Here is your weekly update!</p>') == {'subject': 'Weekly Update', 'sender': 'admin@example.com', 'recipients': ['team@example.com'], 'html_body': '<p>Here is your weekly update!</... | {
"split": "train",
"index": 61449,
"acecode_id": "bigcode_python_fns_18044",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of mouse annotations represented as strings, create a function that processes each annotation by appending a unique identifier to it. The function should take a list of strings, where each string is an annotation, and return a new list of strings with the unique id... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_mouse_annotations(['annotation1', 'annotation2']) == ['annotation1_0', 'annotation2_1']\", \"assert process_mouse_annotations(['test1', 'test2', 'test3']) == ['test1_0', 'test2_1', 'test3_2']\", \"assert process_mouse_annotations(['data1', 'data2']) ... | {
"split": "train",
"index": 61450,
"acecode_id": "bigcode_python_fns_44896",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of strings and returns a new list containing those strings reversed, while maintaining the original character case and handling Unicode characters appropriately. Do not use the reverse() function or any built-in reverse methods.\nPlease re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_strings(['Hello', 'World']) == ['olleH', 'dlroW']\", \"assert reverse_strings(['\\u4f60\\u597d', '\\u4e16\\u754c']) == ['\\u597d\\u4f60', '\\u754c\\u4e16']\", \"assert reverse_strings(['OpenAI', 'ChatGPT']) == ['IAnepO', 'TPGtahC']\", \"assert revers... | {
"split": "train",
"index": 61451,
"acecode_id": "evol_23062",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of server events. Each event is either a connection event or a message event. The function should accept a list of events and return a summary of the total number of connections and the number of messages receive... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_events(['CONNECTION', 'MESSAGE: Hello', 'MESSAGE: World', 'CONNECTION']) == (2, 2)\", \"assert process_events(['MESSAGE: Test', 'MESSAGE: Another Message']) == (0, 2)\", \"assert process_events(['CONNECTION']) == (1, 0)\", \"assert process_events([])... | {
"split": "train",
"index": 61452,
"acecode_id": "oss_33563",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a Python function that identifies the maximum sum of any two numeric elements within a given array, returning the pair of elements with this maximum sum. The array may include integers, floating point numbers, complex numbers, nested arrays, None values, boolean values, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_sum([]) == 'Array is either empty or contains less than two numeric elements.'\", \"assert find_max_sum([42]) == 'Array is either empty or contains less than two numeric elements.'\", \"assert find_max_sum([1, 2, 3, 4]) == (4, 3)\", \"assert find_ma... | {
"split": "train",
"index": 61453,
"acecode_id": "evol_31863",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes two parameters, `num1` and `num2`, which can be of type integer, float, or string. The function should return the sum of these two numbers as a floating point value. If either of the inputs cannot be converted to a number (for example, if they ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_numbers(1, 2) == 3.0\", \"assert sum_numbers(1.5, 2.5) == 4.0\", \"assert sum_numbers('3', '4') == 7.0\", \"assert sum_numbers('1.2', '3.8') == 5.0\", \"assert sum_numbers('10', 5) == 15.0\", \"assert sum_numbers(3, '5.5') == 8.5\", \"assert sum_numbers(... | {
"split": "train",
"index": 61454,
"acecode_id": "evol_32109",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function named `create_dog_info` that takes in three parameters: `name` (a string), `age` (an integer), and `breed` (a string). The function should return a dictionary containing the dog's information with keys 'name', 'age', and 'breed'. The function should raise a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_dog_info('Buddy', 3, 'Golden Retriever') == {'name': 'Buddy', 'age': 3, 'breed': 'Golden Retriever'}\", \"assert create_dog_info('Max', 5, 'Bulldog') == {'name': 'Max', 'age': 5, 'breed': 'Bulldog'}\", \"assert create_dog_info('Bella', 2, 'Poodle') ==... | {
"split": "train",
"index": 61455,
"acecode_id": "evol_15064",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a dependency edge in the 'parenthesis' format, implement a function that returns a tuple of (parent_index, edge_label, child_index). The input string will be formatted as edge_label(parent_word-parent_index, child_word-child_index). The parent and ch... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dep_graph_parser_parenthesis('A(word1-1, word2-2)') == (0, 'A', 1)\", \"assert dep_graph_parser_parenthesis('B(foo-3, bar-4)') == (2, 'B', 3)\", \"assert dep_graph_parser_parenthesis('C(x-5, y-6)') == (4, 'C', 5)\", \"assert dep_graph_parser_parenthesis('D(h... | {
"split": "train",
"index": 61456,
"acecode_id": "bigcode_python_fns_4013",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given `coordinates`, a string that represents the coordinates of a square on a chessboard. Your task is to determine if the square is white or black. A square is considered white if its color is identified as such based on the chessboard pattern. Additionally, you are a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert chess_square_info('a1', 'b3') == (False, 'reachable')\", \"assert chess_square_info('c7', 'e6') == (False, 'reachable')\", \"assert chess_square_info('g7', 'h5') == (False, 'reachable')\", \"assert chess_square_info('e1', 'd2') == (False, 'not reachable')\",... | {
"split": "train",
"index": 61457,
"acecode_id": "evol_34515",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that simulates the storage and retrieval of weather data using a simple file-based approach but without actually using files. Your function should take a boolean parameter indicating whether to store or retrieve data. If the parameter i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_weather_data(True) == {'temperature': 75, 'humidity': 60, 'condition': 'Sunny'}\", \"assert get_weather_data(True) == {'temperature': 75, 'humidity': 60, 'condition': 'Sunny'}\", \"assert get_weather_data(True) == {'temperature': 75, 'humidity': 60, 'con... | {
"split": "train",
"index": 61458,
"acecode_id": "bigcode_python_fns_49134",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Write a function `check_common_chars_and_return` that takes two strings as input and checks if they have any common characters. If they do, return the longer string. If both strings are of the same length, return the concatenation of both strings. If there are no common charact... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_common_chars_and_return('hello', 'world') == 'hello'\", \"assert check_common_chars_and_return('abc', 'def') == ''\", \"assert check_common_chars_and_return('abc', 'cde') == 'abc'\", \"assert check_common_chars_and_return('test', 'best') == 'test'\", \... | {
"split": "train",
"index": 61459,
"acecode_id": "evol_15914",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that validates the input for constructing a Tuple object. A valid Tuple can only be initialized with a non-negative integer representing its size or a list of types (where each type is a built-in Python type such as int, str, bool, fl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_tuple_init(0) == True\", \"assert validate_tuple_init(5) == True\", \"assert validate_tuple_init(-1) == False\", \"assert validate_tuple_init('str') == False\", \"assert validate_tuple_init({}) == False\", \"assert validate_tuple_init([str]) == True... | {
"split": "train",
"index": 61460,
"acecode_id": "bigcode_python_fns_9846",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a binary string consisting of '0's and '1's. Your task is to write a function that takes this binary string as input and returns the count of the longest consecutive sequence of '1's in the string. For example, if the input string is '0011101111000111111001111', t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_consecutive_ones('111111') == 6\", \"assert longest_consecutive_ones('000000') == 0\", \"assert longest_consecutive_ones('101010101010101010') == 1\", \"assert longest_consecutive_ones('111000111') == 3\", \"assert longest_consecutive_ones('000111000... | {
"split": "train",
"index": 61461,
"acecode_id": "oss_31131",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `even_odd_count(num)` that takes an integer `num` as input and returns a tuple containing two integers: the first integer is the count of even digits in `num`, and the second integer is the count of odd digits in `num`. The function should handle both posit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert even_odd_count(-12) == (1, 1)\", \"assert even_odd_count(123) == (1, 2)\", \"assert even_odd_count(0) == (1, 0)\", \"assert even_odd_count(2468) == (4, 0)\", \"assert even_odd_count(13579) == (0, 5)\", \"assert even_odd_count(24680) == (5, 0)\", \"assert eve... | {
"split": "train",
"index": 61462,
"acecode_id": "evol_30850",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the connection to a database. The function should accept three parameters: `dbname` (a string representing the name of the database), `dbhost` (a string representing the host of the database), and `dbport` (an integer repre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_db_connection('test_db', 'localhost', 5432) == {'dbname': 'test_db', 'dbhost': 'localhost', 'dbport': 5432, 'debug': False}\", \"assert create_db_connection('prod_db', '192.168.1.1', 3306, True) == {'dbname': 'prod_db', 'dbhost': '192.168.1.1', 'dbpor... | {
"split": "train",
"index": 61463,
"acecode_id": "bigcode_python_fns_13983",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and a target integer. Your function should return a new list that contains only the integers from the original list that are greater than the target integer. If no integers are greater than the target, re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_greater_than([1, 2, 3, 4, 5], 3) == [4, 5]\", \"assert filter_greater_than([10, 20, 30], 25) == [30]\", \"assert filter_greater_than([-5, -3, -1, 0, 1], 0) == [1]\", \"assert filter_greater_than([1, 2, 3], 5) == []\", \"assert filter_greater_than([1],... | {
"split": "train",
"index": 61464,
"acecode_id": "bigcode_python_fns_886",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the differences in area under the curve (AUC) for a set of structural variants (svTypes). Given a list of base AUC values and a dictionary containing multiple lists of swap AUC values for different swap folders, your goal is to compute the total ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_differences([0.0, 0.0], {'folderX': [0.0, 0.0]}, ['typeX', 'typeY']) == [0.0, 0.0]\", \"assert calculate_differences([0.8], {'swap1': [0.0]}, ['type1']) == [0.0]\", \"assert calculate_differences([0.5, 0.5], {'swap1': [0.5, 0.5], 'swap2': [0.5, 0.5... | {
"split": "train",
"index": 61465,
"acecode_id": "oss_11778",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of non-negative integers, implement a function that returns a new list containing the factorial of each integer in the input list. The function should handle the case for 0 as well, which has a factorial of 1. Write a function named `calculate_factorials` that take... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_factorials([0]) == [1]\", \"assert calculate_factorials([1]) == [1]\", \"assert calculate_factorials([2]) == [2]\", \"assert calculate_factorials([3]) == [6]\", \"assert calculate_factorials([4]) == [24]\", \"assert calculate_factorials([5]) == [12... | {
"split": "train",
"index": 61466,
"acecode_id": "evol_7555",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_properties()` that constructs a dictionary with three distinct properties: 'integer', 'float', and 'boolean'. The function should initialize 'integer' to 0, 'float' to 0.0, and 'boolean' to False. The function should then validate the input types be... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_properties() == {'integer': 0, 'float': 0.0, 'boolean': False}\", \"assert isinstance(create_properties()['integer'], int)\", \"assert isinstance(create_properties()['float'], float)\", \"assert isinstance(create_properties()['boolean'], bool)\", \"as... | {
"split": "train",
"index": 61467,
"acecode_id": "evol_9402",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a dictionary based on a specified key. Given a dictionary `source` and a string `insert_after`, your goal is to insert a new key-value pair into the dictionary immediately after the specified key. The new key will be the st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_dictionary({'key1': 'value1'}, 'key1') == {'key1': 'value1', 'new_key': 'new_value'}\", \"assert update_dictionary({'key1': 'value1', 'key2': 'value2'}, 'key3') == {'key1': 'value1', 'key2': 'value2'}\", \"assert update_dictionary({}, 'a') == {}\", \"... | {
"split": "train",
"index": 61468,
"acecode_id": "oss_1346",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts information from a string representation of a package configuration. The input string will follow a specific format, including a list of libraries, a package name, and lists of extension and Python modules. Your task ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_package_config('libraries=[\\\"numpy\\\"]\\\\nsetup(name = \\\"numpy_package\\\",\\\\next_modules = [numpy_module],\\\\npy_modules = [\\\"numpy\\\"])') == {'name': 'numpy_package', 'libraries': ['numpy'], 'ext_modules': ['numpy_module'], 'py_modules': ... | {
"split": "train",
"index": 61469,
"acecode_id": "oss_31299",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a multi-tiered tree structure represented by a dictionary where each key is a node id, 'parent' represents the id of the parent node, 'value' is the specific value assigned to the node, and 'children' is a list of the ids of the child nodes, implement a function that calc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solve({1: {'parent': 0, 'value': 10, 'children': [2, 3, 4]}, 2: {'parent': 1, 'value': 20, 'children': [8]}, 3: {'parent': 1, 'value': 15, 'children': [5, 6]}, 4: {'parent': 1, 'value': 30, 'children': [7]}, 5: {'parent': 3, 'value': 40, 'children': []}, 6: ... | {
"split": "train",
"index": 61470,
"acecode_id": "evol_8673",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a project initialization function for a testing framework. Write a function called `initialize_project` that takes the following parameters: `alias` (a string representing the name of the project, with a default value of 'project'), `root` (a string... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_project() == {'name': 'project', 'jobs': []}\", \"assert initialize_project('test_project') == {'name': 'test_project', 'jobs': []}\", \"assert initialize_project('test_project', '/root') == {'name': 'test_project', 'jobs': []}\", \"assert initial... | {
"split": "train",
"index": 61471,
"acecode_id": "bigcode_python_fns_4223",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that finds and returns the two largest unique numbers in the array. If the array contains less than two unique elements, return 'Not enough unique elements'.\nPlease reason step by step, then write a self-contained Python solutio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_largest_two([10, 9, 8, 7, 6, 5, 10]) == [10, 9]\", \"assert find_largest_two([1, 2, 3, 4, 5]) == [5, 4]\", \"assert find_largest_two([1, 2]) == [2, 1]\", \"assert find_largest_two([3]) == 'Not enough unique elements'\", \"assert find_largest_two([-1, -2... | {
"split": "train",
"index": 61472,
"acecode_id": "evol_10618",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two strings, `evalue1` and `evalue2`. Your task is to write a function that determines if the two strings are different. The function should return `True` if the strings are different and `False` if they are exactly the same. Implement the function `are_strings_di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_strings_different('hello', 'world') == True\", \"assert are_strings_different('abc', 'abc') == False\", \"assert are_strings_different('123', '1234') == True\", \"assert are_strings_different('test', 'test') == False\", \"assert are_strings_different('',... | {
"split": "train",
"index": 61473,
"acecode_id": "bigcode_python_fns_3954",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that calculates the mode(s) of the list without using any built-in libraries. The function should return a list of integers representing the mode(s). If there are multiple modes, return all of them. If the list is empty, return an ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_modes([1, 1, 2, 2, 3]) == [1, 2]\", \"assert get_modes([1, 1, 1, 2, 2, 3, 3]) == [1]\", \"assert get_modes([5, 6, 6, 7, 7, 8]) == [6, 7]\", \"assert get_modes([]) == []\", \"assert get_modes([0, 0, 0, 1, 1, 1, 2, 2]) == [0, 1]\", \"assert get_modes([4]) ... | {
"split": "train",
"index": 61474,
"acecode_id": "evol_20433",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the deletion of a document from a database. The function should take in two parameters: a string representing the index of the document (ix) and a string representing the document ID (docid). If the document exists, your fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_document('index_1', 'doc_1') == 'Document deleted successfully.'\", \"assert delete_document('index_2', 'doc_42') == 'Document deleted successfully.'\", \"assert delete_document('index_3', 'doc_7') == 'Document deleted successfully.'\", \"assert delet... | {
"split": "train",
"index": 61475,
"acecode_id": "bigcode_python_fns_40531",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are implementing a command-line argument parser that supports a verbosity option. The verbosity level is an integer that ranges from 0 to 5. If the verbosity level exceeds 5, your function should raise an exception. Implement a function `check_verbosity(verbosity: int) -> N... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_verbosity(0) is None\", \"assert check_verbosity(1) is None\", \"assert check_verbosity(2) is None\", \"assert check_verbosity(3) is None\", \"assert check_verbosity(4) is None\", \"assert check_verbosity(5) is None\", \"assert check_verbosity(-1) is N... | {
"split": "train",
"index": 61476,
"acecode_id": "bigcode_python_fns_27142",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `filter_and_sort(lst)` that takes a list of dictionaries as input. Each dictionary contains two keys: 'score' (an integer) and 'age' (an integer). Your task is to filter out any dictionaries where the 'score' is less than 3 or the 'age' is greater than 50. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_and_sort([{ 'score': 1, 'age': 32 }, { 'score': 5, 'age': 51 }, { 'score': 8, 'age': 48 }, { 'score': 7, 'age': 23 }, { 'score': 2, 'age': 70 }]) == [{ 'score': 8, 'age': 48 }, { 'score': 7, 'age': 23 }]\", \"assert filter_and_sort([{ 'score': 3, 'age... | {
"split": "train",
"index": 61477,
"acecode_id": "evol_8574",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a list of groups where each group contains a list of sets of answers provided by individuals in that group. Each individual in a group has provided a set of answers represented as characters. Your task is to implement a function that calculates two things: 1) the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_answers([[{'apple'}, {'banana'}, {'cherry'}], [{'date'}, {'fig'}, {'grape'}]]) == (6, 0)\", \"assert calculate_answers([[{'cat', 'dog'}, {'dog', 'mouse'}], [{'elephant'}, {'elephant', 'fox'}, {'fox'}]]) == (5, 1)\", \"assert calculate_answers([[{'a... | {
"split": "train",
"index": 61478,
"acecode_id": "bigcode_python_fns_48698",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of integers through a series of workers that perform transformations on the data. Each worker performs a specific transformation to the data it receives. You need to implement a function `process_pipeline(workers: List[Callable[[List[int]],... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_pipeline([lambda x: [i * 2 for i in x], lambda x: [i + 1 for i in x]], [1, 2, 3]) == [3, 5, 7]\", \"assert process_pipeline([lambda x: [i - 1 for i in x]], [5, 10, 15]) == [4, 9, 14]\", \"assert process_pipeline([], [1, 2, 3]) == [1, 2, 3]\", \"asser... | {
"split": "train",
"index": 61479,
"acecode_id": "oss_23671",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a markdown list. Your task is to implement a function that converts this markdown list into its corresponding HTML representation. Specifically, your function should handle unordered lists denoted by '-' at the start of lines. Each '-' should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_markdown_to_html('- one\\\\n\\\\n two') == '<ul>\\\\n<li>one</li>\\\\n</ul>\\\\n<p>two</p>'\", \"assert convert_markdown_to_html('- item 1\\\\n- item 2') == '<ul>\\\\n<li>item 1</li>\\\\n<li>item 2</li>\\\\n</ul>'\", \"assert convert_markdown_to_html... | {
"split": "train",
"index": 61480,
"acecode_id": "bigcode_python_fns_11262",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Write a function that replaces all instances of a given substring (t) within a provided string (s) with another specified substring (r). The function should return the modified string. For example, if s is 'The quick brown fox jumps over the lazy dog.', t is 'fox', and r is 'ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_substring('The quick brown fox jumps over the lazy dog.', 'fox', 'cat') == 'The quick brown cat jumps over the lazy dog.'\", \"assert replace_substring('Hello world!', 'world', 'there') == 'Hello there!'\", \"assert replace_substring('abababab', 'ab'... | {
"split": "train",
"index": 61481,
"acecode_id": "evol_21138",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes weights for a machine learning model based on the types of features provided. The function should take two parameters: a list of strings called `feature_types`, which contains the types of features (either 'continuous' or... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_weights(['continuous', 'categorical'], 1.0) == [None, 1.0]\", \"assert initialize_weights(['categorical', 'categorical', 'continuous'], 2.5) == [2.5, 2.5, None]\", \"assert initialize_weights(['continuous', 'continuous'], 0.1) == [None, None]\", \... | {
"split": "train",
"index": 61482,
"acecode_id": "oss_762",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the production mix of energy sources for a given zone. Your function should take in a string `zone_key` representing the zone, and return a dictionary that contains the total production for each type of energy source. The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fetch_production('IN-GJ') == {'biomass': None, 'coal': 3000, 'gas': 2000, 'hydro': 1000, 'nuclear': 0, 'oil': None, 'solar': 1500, 'wind': 500, 'geothermal': None, 'unknown': 100}\", \"assert fetch_production('IN-GJ')['coal'] == 3000\", \"assert fetch_produc... | {
"split": "train",
"index": 61483,
"acecode_id": "bigcode_python_fns_45780",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that updates a user's profile attributes based on a given user ID and a dictionary of profile attributes. The function should take in the user's ID and a dictionary of profile attributes as inputs. It should return 'True' if the pr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_user_profile(1, {'name': 'Alice', 'age': 30}) == True\", \"assert update_user_profile(2, {'location': 'New York'}) == True\", \"assert update_user_profile(5, {'email': 'example@example.com'}) == False\", \"assert update_user_profile(11, {'profile_pict... | {
"split": "train",
"index": 61484,
"acecode_id": "oss_17008",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to allocate /24 subnets to a list of broadcast domains grouped by their Autonomous System Number (ASN). Your function should take in a list of broadcast domain ASNs and an iterator yielding available subnets. For each unique ASN in th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert allocate_subnets([1, 1, 2, 2, 3], iter(['192.168.1.0/24', '192.168.2.0/24', '192.168.3.0/24'])) == {1: ['192.168.1.0/24', '192.168.1.0/24'], 2: ['192.168.2.0/24', '192.168.2.0/24'], 3: ['192.168.3.0/24']}\", \"assert allocate_subnets([], iter(['10.0.0.0/24']... | {
"split": "train",
"index": 61485,
"acecode_id": "oss_23746",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a user registration process for a web application. The function should take a username and a password as input and return a success message if the registration is successful. The registration is successful only if the usern... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_user('user1', 'Password1') == 'Account was created for user1'\", \"assert register_user('user2', 'pass') == 'Registration failed: Password must be at least 8 characters long and contain an uppercase letter, a lowercase letter, and a digit.'\", \"ass... | {
"split": "train",
"index": 61486,
"acecode_id": "bigcode_python_fns_8721",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `matrix_addition(matrix1, matrix2)` that takes two matrices of the same dimensions as input and returns a new matrix that represents the element-wise addition of the two input matrices. Each matrix is represented as a list of lists, where each inner list co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert matrix_addition([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == [[6, 8], [10, 12]]\", \"assert matrix_addition([[0, 0], [0, 0]], [[1, 1], [1, 1]]) == [[1, 1], [1, 1]]\", \"assert matrix_addition([[1]], [[2]]) == [[3]]\", \"assert matrix_addition([[1, 2], [3, 4]], [[0... | {
"split": "train",
"index": 61487,
"acecode_id": "evol_12407",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program to parse and extract weather information from a raw text input. The input contains weather data in a specific format. Your program needs to extract relevant information based on a given regular expression pattern that matches specific weat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_weather_info('RA300CB') == {'type': 'RA', 'height': '300', 'cb_tcu': 'CB'}\", \"assert extract_weather_info('SN200TCU') == {'type': 'SN', 'height': '200', 'cb_tcu': 'TCU'}\", \"assert extract_weather_info('RA400TCU') == {'type': 'RA', 'height': '400'... | {
"split": "train",
"index": 61488,
"acecode_id": "oss_25143",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a sequence of characters. Your task is to write a function that processes the string by removing all vowels (a, e, i, o, u) and returning the resulting string. The function should be case-insensitive, meaning it should remove both uppercase a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_vowels('Hello World!') == 'Hll Wrld!'\", \"assert remove_vowels('Python Programming') == 'Pythn Prgrmmng'\", \"assert remove_vowels('LeetCode') == 'LtCd'\", \"assert remove_vowels('') == ''\", \"assert remove_vowels('AEIOUaeiou') == ''\", \"assert rem... | {
"split": "train",
"index": 61489,
"acecode_id": "bigcode_python_fns_15573",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that formats configuration information for a web application framework. The function should take two parameters: `framework_name` (string) and `app_name` (string). It should return a formatted string that represents the configuration in t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_config_info('bulma', 'MyApp') == 'Configuration for MyApp using bulma framework.'\", \"assert get_config_info('django', 'BlogApp') == 'Configuration for BlogApp using django framework.'\", \"assert get_config_info('flask', 'WebService') == 'Configuration... | {
"split": "train",
"index": 61490,
"acecode_id": "oss_19658",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `sync_data_to_api(data: List[Dict[str, Any]]) -> None` that takes a list of dictionaries representing rows of data and sends them to a specified RESTful API endpoint as a JSON payload. The function should handle sending data in batches of up to 10 rows at a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sync_data_to_api([{'id': 1, 'name': 'Alice'}, {'id': 2, 'name': 'Bob'}]) == None\", \"assert sync_data_to_api([{'id': 1, 'name': 'Alice'}]) == None\", \"assert sync_data_to_api([]) == None\", \"assert sync_data_to_api([{'id': 1, 'name': 'Alice'}, {'id': 2, '... | {
"split": "train",
"index": 61491,
"acecode_id": "evol_19631",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of coordinates representing a point cloud, implement a function `compute_spin_image_descriptor(points: List[Tuple[float, float, float]], radial_bins: int, height_bins: int, radius: float, normalize: bool) -> List[List[float]]` that computes spin image descriptors f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_spin_image_descriptor([(0, 0, 0), (0, 0, 0)], 2, 2, 1.0, False) == [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]]\", \"assert compute_spin_image_descriptor([(0, 0, 0)], 4, 4, 2.0, True) == [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0... | {
"split": "train",
"index": 61492,
"acecode_id": "bigcode_python_fns_35857",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs an interpolative search on a list of integers that are in arithmetic progression. The function should take the list, a target integer to search for, and return the index of the target if found, or -1 if not found. The function should also retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert interpolation_search(list(range(14, 1000014)), 100) == (86, 1)\", \"assert interpolation_search(list(range(14, 1000014)), 500000) == (499986, 1)\", \"assert interpolation_search(list(range(14, 1000014)), 999999) == (999985, 1)\", \"assert interpolation_searc... | {
"split": "train",
"index": 61493,
"acecode_id": "evol_28413",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of product reviews, where each review is represented as a dictionary containing the following keys: 'product_title' (str), 'verified_purchase' (str), and 'star_rating' (float). Your task is to implement a function that filters the reviews for products that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert query_top_reviews([{'product_title': 'Awesome Snack', 'verified_purchase': 'Y', 'star_rating': 5.0}, {'product_title': 'Awesome Snack', 'verified_purchase': 'Y', 'star_rating': 4.0}, {'product_title': 'Not Snack', 'verified_purchase': 'Y', 'star_rating': 3.5... | {
"split": "train",
"index": 61494,
"acecode_id": "bigcode_python_fns_28353",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with extracting specific values from a nested dictionary structure that represents various categories and their associated data. You need to implement a function `get_data(data: dict, category: str, subcategory: str, key: str) -> int` that retrieves the value ass... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_data({'category1': {'oorsprong': {'subcat1': {'key1': 10}}, 'profiel': {'profile1': 50}}}, 'category1', 'oorsprong', 'subcat1') == {'key1': 10}\", \"assert get_data({'category1': {'oorsprong': {'subcat1': {'key1': 10}}, 'profiel': {'profile1': 50}}}, 'ca... | {
"split": "train",
"index": 61495,
"acecode_id": "oss_33920",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function named 'is_num_even' that takes an integer as input and returns True if the integer is even, and False if it is odd.\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 is_num_even(0) == True\", \"assert is_num_even(1) == False\", \"assert is_num_even(2) == True\", \"assert is_num_even(-2) == True\", \"assert is_num_even(-1) == False\", \"assert is_num_even(10) == True\", \"assert is_num_even(11) == False\", \"assert is_num... | {
"split": "train",
"index": 61496,
"acecode_id": "evol_35072",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the weights of packages to be loaded onto a truck. The truck has a weight capacity defined by a positive integer. Your task is to find the maximum total weight that can be loaded onto the truck without exceeding its capacity. Write ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_weight([10, 20, 30], 50) == 50\", \"assert max_weight([5, 10, 15, 20], 30) == 30\", \"assert max_weight([1, 2, 3, 4, 5], 5) == 5\", \"assert max_weight([1, 2, 3, 4, 5], 7) == 7\", \"assert max_weight([10, 20, 30, 40, 50], 10) == 10\", \"assert max_weight... | {
"split": "train",
"index": 61497,
"acecode_id": "oss_24363",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a sentence. Your task is to write a function `count_words` that takes this list as input and returns a list of integers, where each integer represents the number of words in the corresponding sentence. A word is defi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_words(['Hello world', 'This is a test', 'LeetCode']) == [2, 4, 1]\", \"assert count_words(['', ' ', 'SingleWord']) == [0, 0, 1]\", \"assert count_words(['One', 'Two', 'Three', 'Four']) == [1, 1, 1, 1]\", \"assert count_words(['']) == [0]\", \"assert ... | {
"split": "train",
"index": 61498,
"acecode_id": "bigcode_python_fns_17404",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of 3D points represented as tuples of three integers, where each tuple corresponds to the coordinates of a point in space (x, y, z). Your task is to implement a function that calculates the maximum distance between any two points in the list using the Eucli... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_distance([(0, 0, 0), (1, 1, 1)]) == 1.7320508075688772\", \"assert max_distance([(0, 0, 0), (3, 4, 0)]) == 5.0\", \"assert max_distance([(1, 2, 3), (4, 5, 6)]) == 5.196152422706632\", \"assert max_distance([(1, 1, 1), (1, 1, 1), (1, 1, 1)]) == 0.0\", \"a... | {
"split": "train",
"index": 61499,
"acecode_id": "bigcode_python_fns_4011",
"num_tests": 14
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.