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 calculates the average of the negative values of a list of numbers. The function should take in a list of floating point numbers, which can contain both positive and negative values. Your goal is to compute the average of the neg... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_negative_average([-1.0, 2.0, -3.0, 4.0]) == -2.0\", \"assert calculate_negative_average([-1.5, -2.5, -3.5]) == -2.5\", \"assert calculate_negative_average([1.0, 2.0, 3.0]) == 0.0\", \"assert calculate_negative_average([-1.0, 0.0, 1.0]) == -1.0\", \... | {
"split": "train",
"index": 82300,
"acecode_id": "oss_32192",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D grid of integers representing a heatmap. Your task is to implement a function that returns the maximum value in the heatmap, as well as the minimum value in the heatmap. The function should take a 2D list (list of lists) as input and return a tuple containing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_min_heatmap([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == (9, 1)\", \"assert max_min_heatmap([[5, 3, 6], [1, 2, 8], [7, 4, 0]]) == (8, 0)\", \"assert max_min_heatmap([[10]]) == (10, 10)\", \"assert max_min_heatmap([[0, 0, 0], [0, 0, 0]]) == (0, 0)\", \"assert ma... | {
"split": "train",
"index": 82301,
"acecode_id": "bigcode_python_fns_22835",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function that counts the number of distinct strings starting with the letter 'a' (case insensitive) and returns a dictionary representing each distinct 'a'-initiated string paired with its frequency. The function should ignore non-string ele... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_and_freq(['Apple', 'Cat', 'Ant', 'Table', 'apple', 5, 'Apple', True, 'ant']) == {'Apple': 2, 'Ant': 1, 'apple': 1, 'ant': 1}\", \"assert count_and_freq(['avocado', 'apple', 'Avocado', 'ANOTHER', 'banana', 'apple']) == {'avocado': 1, 'apple': 2, 'Avocad... | {
"split": "train",
"index": 82302,
"acecode_id": "evol_33784",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing a sequence of characters. Your task is to count the occurrences of each unique character in the string and return a list of tuples containing each character and its frequency, sorted in descending order of frequency. If two characters have the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert character_frequency('aabbcc') == [('a', 2), ('b', 2), ('c', 2)]\", \"assert character_frequency('abcde') == [('a', 1), ('b', 1), ('c', 1), ('d', 1), ('e', 1)]\", \"assert character_frequency('aabb') == [('a', 2), ('b', 2)]\", \"assert character_frequency('')... | {
"split": "train",
"index": 82303,
"acecode_id": "oss_25083",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list representing a sliding tile puzzle. Each element in the list is an integer representing a tile number, where 0 represents the empty space. Your task is to implement a function that returns the current state of the puzzle in a dictionary format. The dicti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_puzzle_state([[1, 2, 3], [4, 0, 5]]) == {'sliding_tile': [[1, 2, 3], [4, 0, 5]], 'size1': 2, 'size2': 3}\", \"assert get_puzzle_state([[0, 1], [2, 3]]) == {'sliding_tile': [[0, 1], [2, 3]], 'size1': 2, 'size2': 2}\", \"assert get_puzzle_state([[5, 1, 2],... | {
"split": "train",
"index": 82304,
"acecode_id": "bigcode_python_fns_26033",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `char_frequency(sentence: str) -> Dict[str, int]` that calculates the frequency of each unique character in a given sentence, while ignoring spaces, punctuation, and considering uppercase and lowercase characters as the same. The function should return a dictio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert char_frequency('Hello, World!') == {'h': 1, 'e': 1, 'l': 3, 'o': 2, 'w': 1, 'r': 1, 'd': 1}\", \"assert char_frequency('!@#$%^&*()') == {}\", \"assert char_frequency('') == {}\", \"assert char_frequency('abc ABC') == {'a': 2, 'b': 2, 'c': 2}\", \"assert char... | {
"split": "train",
"index": 82305,
"acecode_id": "evol_15142",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a list of lists representing multiple transition matrices, write a function that combines these matrices by summing the corresponding elements. The function should accept a list of matrices, where each matrix is represented as a list of lists of integers. Your function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combine_matrices([[[1, 2], [3, 4]], [[5, 6], [7, 8]]]) == [[6, 8], [10, 12]]\", \"assert combine_matrices([[[0, 0], [0, 0]], [[0, 0], [0, 0]]]) == [[0, 0], [0, 0]]\", \"assert combine_matrices([[[1, 1]], [[2, 2]], [[3, 3]]]) == [[6, 6]]\", \"assert combine_m... | {
"split": "train",
"index": 82306,
"acecode_id": "bigcode_python_fns_21409",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes in a list of integers and returns a tuple containing the largest and smallest integers from the list. You must implement this without using any external libraries or modules. Create a function called `find_max_min` that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_min([3, 5, 1, 4, 2]) == (5, 1)\", \"assert find_max_min([-1, -5, -3, -4]) == (-1, -5)\", \"assert find_max_min([10]) == (10, 10)\", \"assert find_max_min([0, 0, 0]) == (0, 0)\", \"assert find_max_min([]) == (None, None)\", \"assert find_max_min([1, ... | {
"split": "train",
"index": 82307,
"acecode_id": "oss_34324",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of lists representing a 2D matrix, write a function `transpose_matrix(matrix)` that takes this matrix as input and returns a new matrix that is the transpose of the input matrix. Transposing a matrix means that the rows of the original matrix become the columns of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transpose_matrix([[1, 2], [3, 4], [5, 6]]) == [[1, 3, 5], [2, 4, 6]]\", \"assert transpose_matrix([[1]]) == [[1]]\", \"assert transpose_matrix([[1, 2, 3]]) == [[1], [2], [3]]\", \"assert transpose_matrix([[1, 2], [3, 4]]) == [[1, 3], [2, 4]]\", \"assert tran... | {
"split": "train",
"index": 82308,
"acecode_id": "oss_37656",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string containing a sentence, write a function `clean_sentence` that processes the sentence by removing all punctuation, converting all characters to lowercase, and removing any common English stopwords (e.g., 'the', 'is', 'in'). Your function should return a list of cl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clean_sentence('The quick brown fox jumps over the lazy dog.') == ['quick', 'brown', 'fox', 'jumps', 'over', 'lazy', 'dog']\", \"assert clean_sentence('Hello, World! This is a test.') == ['hello', 'world', 'test']\", \"assert clean_sentence('Python programmi... | {
"split": "train",
"index": 82309,
"acecode_id": "bigcode_python_fns_37834",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `binary_insertion_sort(arr)` that takes a list of integers `arr` and returns a new list that contains the same integers sorted in ascending order. The function should use the binary search algorithm to find the appropriate position to insert each element. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_insertion_sort([8, 6, 1, 9, 4]) == [1, 4, 6, 8, 9]\", \"assert binary_insertion_sort([3, 1, 2]) == [1, 2, 3]\", \"assert binary_insertion_sort([10, 7, 8, 9]) == [7, 8, 9, 10]\", \"assert binary_insertion_sort([5, 3, 5, 2, 1]) == [1, 2, 3, 5, 5]\", \"a... | {
"split": "train",
"index": 82310,
"acecode_id": "evol_32958",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that takes two dictionaries: a base configuration and an override configuration. Your goal is to merge these two configurations into a new dictionary. The merged configuration should contain all keys from the base configuration... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_configs({'a': 1, 'b': 2}, {'b': 3, 'c': 4}) == {'a': 1, 'b': 3, 'c': 4}\", \"assert merge_configs({'x': 10, 'y': 20}, {'y': 25}) == {'x': 10, 'y': 25}\", \"assert merge_configs({}, {'key': 'value'}) == {'key': 'value'}\", \"assert merge_configs({'name'... | {
"split": "train",
"index": 82311,
"acecode_id": "oss_20892",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a routing system for a web application framework's admin module. Write a function `get_application_routes(handler_cls=None)` that retrieves the application routes for the admin module based on the provided handler class. If `handler_cls` is not ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_application_routes() == (('appengine_admin.index', 'GET', '/', AdminHandler, 'index'), ('appengine_admin.list', 'GET', '/<model_name>/list/', AdminHandler, 'list'))\", \"assert get_application_routes(AdminHandler) == (('appengine_admin.index', 'GET', '/'... | {
"split": "train",
"index": 82312,
"acecode_id": "oss_19111",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that finds and returns the two integers with the smallest difference in value. The function should return a tuple containing the smaller integer, the larger integer, and the frequency of this smallest difference within the list. If... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_closest_elements([2, 2, 4, 4]) == (2, 2, 2)\", \"assert find_closest_elements([1, 1, 1, 2, 2]) == (1, 1, 3)\", \"assert find_closest_elements([1000, 999, 1002]) == (999, 1000, 1)\", \"assert find_closest_elements([10, 11, 12, 10, 11]) == (10, 10, 2)\", ... | {
"split": "train",
"index": 82313,
"acecode_id": "evol_30008",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Create a function `employee_greeting(name: str, role: str) -> str` that takes an employee's name and role as input parameters and returns a greeting message. The greeting message should be in the format: 'Hello, my name is {name} and I work as a/an {role}.'\nPlease reason step ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert employee_greeting('Alice', 'Engineer') == 'Hello, my name is Alice and I work as a/an Engineer.'\", \"assert employee_greeting('Bob', 'Manager') == 'Hello, my name is Bob and I work as a/an Manager.'\", \"assert employee_greeting('Charlie', 'Intern') == 'Hel... | {
"split": "train",
"index": 82314,
"acecode_id": "evol_18911",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that simulates a quiz question feature for a chatbot. The function `create_quiz_poll` takes three parameters: `question`, `answers`, and `correct_answer_index`. The `question` is a string representing the poll question, `answers` i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_quiz_poll('What is the capital of France?', ['Paris', 'Berlin', 'London'], 0) == {'question': 'What is the capital of France?', 'answers': ['Paris', 'Berlin', 'London'], 'correct_answer_index': 0}\", \"assert create_quiz_poll('What is 2 + 2?', ['3', '... | {
"split": "train",
"index": 82315,
"acecode_id": "oss_34582",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with counting the occurrences of specific words in a given text. Implement a function `count_word_occurrences(text: str, words: List[str]) -> Dict[str, int]` that takes in the text as a string and a list of words to count occurrences for. The function should retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_word_occurrences('Hello, world! Hello everyone.', ['hello', 'world']) == {'hello': 2, 'world': 1}\", \"assert count_word_occurrences('This is an example example.', ['example']) == {'example': 2}\", \"assert count_word_occurrences('Python is great. Pyth... | {
"split": "train",
"index": 82316,
"acecode_id": "oss_13732",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dataset name and a dictionary representing materialization versions with their corresponding timestamps. Your task is to implement a function `get_materialization_versions(dataset_name: str, materialization_data: Dict[str, str]) -> Dict[str, str]` that returns a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_materialization_versions('dataset1', {'v1': {'time_stamp': '2021-01-01T00:00:00Z', 'valid': True}, 'v2': {'time_stamp': '2021-02-01T00:00:00Z', 'valid': False}, 'v3': {'time_stamp': '2021-03-01T00:00:00Z', 'valid': True}}) == {'v1': '2021-01-01T00:00:00Z... | {
"split": "train",
"index": 82317,
"acecode_id": "bigcode_python_fns_46293",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a shopping cart. The function should take a list of items, where each item is represented as a tuple containing the item's name (a string), price (a float), and quantity (an integer). The function should also take a discoun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_cart_total([], 10) == 0.00\", \"assert calculate_cart_total([('apple', 1.50, 2)], 0) == 3.00\", \"assert calculate_cart_total([('banana', 0.75, 4)], 10) == 2.70\", \"assert calculate_cart_total([('strawberry', 1.75, 2), ('blueberry', 2.50, 1)], 0) ... | {
"split": "train",
"index": 82318,
"acecode_id": "oss_25147",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function that filters out any strings containing the phrase 'despite the fact that'. The function should return a new list containing only the strings that do not include this phrase.\nPlease reason step by step, then write a self-contained ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_strings(['I went despite the fact that it was raining', 'I love painting', 'Despite the fact that he was ill, he went to school']) == ['I love painting']\", \"assert filter_strings(['Hello World', 'This is a test', 'despite the fact that it is sunny']... | {
"split": "train",
"index": 82319,
"acecode_id": "evol_12205",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program to assist a donut shop in processing customer requests. Your function should take a customer's response to a question and determine if they want to buy donuts based on their input. Write a function `wants_to_buy_donuts(pergunta: str) -> bo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert wants_to_buy_donuts('Sim') == True\", \"assert wants_to_buy_donuts('sim') == True\", \"assert wants_to_buy_donuts('QUERO') == True\", \"assert wants_to_buy_donuts('quero') == True\", \"assert wants_to_buy_donuts('Sim quero') == False\", \"assert wants_to_buy... | {
"split": "train",
"index": 82320,
"acecode_id": "oss_19602",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_indices(target: int, arr: List[int]) -> Union[List[int], str]` that takes an integer `target` and a list of integers `arr`. The function should return a list of all indices where `target` is found in `arr`. If the `target` does not exist in the list, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_indices(5, [1,2,5,7,2,1,5,7]) == [2, 6]\", \"assert find_indices(2, [1,2,5,7,2,1,5,7]) == [1, 4]\", \"assert find_indices(1, [1,2,5,7,2,1,5,7]) == [0, 5]\", \"assert find_indices(7, [1,2,5,7,2,1,5,7]) == [3, 7]\", \"assert find_indices(0, [1,2,5,7,2,1,5... | {
"split": "train",
"index": 82321,
"acecode_id": "evol_1691",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a message and generates a response based on its content. The function should take in a string `message` and return a response string according to the following rules: If the input message contains the word \"hello\",... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_message('hello there!') == 'Hello there!'\", \"assert process_message('say hello') == 'Hello there!'\", \"assert process_message('bye now') == 'Goodbye!'\", \"assert process_message('how are you doing?') == \\\"I'm doing well, thank you!\\\"\", \"ass... | {
"split": "train",
"index": 82322,
"acecode_id": "oss_35829",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a variable `LFIR` which represents the total far-infrared luminosity of a galaxy in erg/s. Your task is to implement a function `SFRfromLFIR(LFIR)` that calculates the star formation rate (SFR) in solar masses per year (Msun/year) based on the given formula: SFR =... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(SFRfromLFIR(0) - 0.0) < 1e-9\", \"assert abs(SFRfromLFIR(1) - 4.5E-44) < 1e-9\", \"assert abs(SFRfromLFIR(1e+10) - 4.5E-34) < 1e-9\", \"assert abs(SFRfromLFIR(1e+20) - 4.5E-24) < 1e-9\", \"assert abs(SFRfromLFIR(2) - 9.0E-44) < 1e-9\", \"assert abs(SFRfr... | {
"split": "train",
"index": 82323,
"acecode_id": "bigcode_python_fns_3608",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `s` and a character `c` that occurs in `s`, return an array of integers `answer` where `answer.length == s.length` and `answer[i]` is the distance from index `i` to the closest occurrence of character `c` in `s`. The distance should be calculated as 0 for charact... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shortestToChar('aaab', 'b') == [3,2,1,0]\", \"assert shortestToChar('aabbcc', 'b') == [2,1,0,0,1,2]\", \"assert shortestToChar('abccba', 'c') == [2,1,0,0,1,2]\", \"assert shortestToChar('a', 'a') == [0]\", \"assert shortestToChar('ab', 'b') == [1,0]\", \"ass... | {
"split": "train",
"index": 82324,
"acecode_id": "evol_19237",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that calculates the hinge loss for a given set of predicted and true labels. The hinge loss is a loss function used for training classifiers, particularly in the context of support vector machines (SVMs). It is defined as: \\[ ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hinge_loss([1, 1, 1], [0.0, 0.0, 0.0]) == 3.0\", \"assert hinge_loss([-1, -1, -1], [0.0, 0.0, 0.0]) == 3.0\", \"assert hinge_loss([1, -1], [1.0, -1.0]) == 0.0\", \"assert hinge_loss([1], [0.5]) == 0.5\", \"assert hinge_loss([-1, 1], [-2.0, 2.0]) == 0.0\", \"... | {
"split": "train",
"index": 82325,
"acecode_id": "oss_26382",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Write a function `calculate_stats(numbers)` that takes a list of integers `numbers` and returns a tuple containing the highest value, lowest value, and median of the list. The median should be calculated such that if the list has an even number of elements, it should be the ave... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_stats([2, 4, 5, 7, 9, 12, 15, 17, 20, 22]) == (22, 2, 10.5)\", \"assert calculate_stats([1, 3, 5, 7, 9]) == (9, 1, 5)\", \"assert calculate_stats([10, 20, 30]) == (30, 10, 20)\", \"assert calculate_stats([-5, -1, 0, 1, 5]) == (5, -5, 0)\", \"assert... | {
"split": "train",
"index": 82326,
"acecode_id": "evol_22369",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the creation of a pull request. The function should accept several parameters representing the details of the pull request and return a dictionary containing these details. The parameters are as follows: \n\n- `title` (str)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_pull_request('my title', 'my body', set(), True, 'issue title', True, 'main', 'branch', False, True) == {'title': 'my title', 'body': 'my body', 'labels': set(), 'confirmation': True, 'issues_title_query': 'issue title', 'inherit_labels': True, 'head'... | {
"split": "train",
"index": 82327,
"acecode_id": "bigcode_python_fns_16740",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating a list of video URLs. Write a function `validate_video_urls(video_urls: List[str], max_width: Optional[int] = None) -> List[bool]` that takes in a list of video URLs and an optional maximum width for the video. The function should return a list of... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_video_urls(['http://validurl.com/video', 'https://validurl.com/video'], None) == [True, True]\", \"assert validate_video_urls(['http://short.com', 'http://longurl.com/video1234567890'], None) == [True, True]\", \"assert validate_video_urls([], None)... | {
"split": "train",
"index": 82328,
"acecode_id": "oss_13750",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a two-dimensional list of integers as input and returns a list containing the count of even numbers in each sublist, followed by the total count of even numbers in the entire list. For example, given the input [[1, 2, 3], [4, 5, 6]], the output s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_evens([[1, 2, 3], [4, 5, 6]]) == [1, 2, 3]\", \"assert count_evens([[1, 1, 1], [1, 1, 1]]) == [0, 0, 0]\", \"assert count_evens([[2, 4, 6], [1, 3, 5]]) == [3, 0, 3]\", \"assert count_evens([[0, -2, -4], [3, 5, 7]]) == [3, 0, 3]\", \"assert count_evens(... | {
"split": "train",
"index": 82329,
"acecode_id": "evol_33856",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that switches the positions of the first and last elements in the list. The list must contain at least 5 elements, including both negative and positive integers, and must not contain any duplicates. Return the modified list. If the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert switch_positions([1, -2, 3, 4, -5]) == [-5, -2, 3, 4, 1]\", \"assert switch_positions([0, -1, 2, 3, 4]) == [4, -1, 2, 3, 0]\", \"assert switch_positions([-1, 0, 1, 2, 3]) == [3, 0, 1, 2, -1]\", \"assert switch_positions([1, -1, 2, -2, 3]) == [3, -1, 2, -2, 1... | {
"split": "train",
"index": 82330,
"acecode_id": "evol_4539",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that analyzes a given string to determine the frequency of each word in the string. Your function should tokenize the words, count the occurrences of each word, and ignore any punctuation marks. The function should also consider words in ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_frequency('Hello world! Hello everyone.') == [('hello', 2), ('world', 1), ('everyone', 1)]\", \"assert word_frequency('Python is awesome. Python is fun!') == [('python', 2), ('is', 2), ('awesome', 1), ('fun', 1)]\", \"assert word_frequency('Data Science... | {
"split": "train",
"index": 82331,
"acecode_id": "oss_8167",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing an XML tag which may contain namespaces in the format `{namespace}`. Your task is to write a function `remove_namespace(tag: str, ns: Dict[str, str]) -> str` that removes all occurrences of the specified namespaces from the XML tag. The `ns` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_namespace('{http://example.com/ns}myTag', {'ns': 'http://example.com/ns'}) == 'myTag'\", \"assert remove_namespace('{http://example.com/ns}myTag', {'ns': 'http://example.com/other'}) == '{http://example.com/ns}myTag'\", \"assert remove_namespace('{htt... | {
"split": "train",
"index": 82332,
"acecode_id": "bigcode_python_fns_16897",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a raw message data represented as a string and a signature represented as a list of tuples. Each tuple contains a type identifier and a specification string. Your task is to implement a function `unmarshal(raw: str, signature: List[Tuple[str, str]]) -> Tuple[Any]`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unmarshal('42,3.14,hello', [('int', ''), ('float', ''), ('str', '')]) == (42, 3.14, 'hello')\", \"assert unmarshal('123,456.78,world', [('int', ''), ('float', ''), ('str', '')]) == (123, 456.78, 'world')\", \"assert unmarshal('0,0.0,test', [('int', ''), ('fl... | {
"split": "train",
"index": 82333,
"acecode_id": "bigcode_python_fns_32433",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes a database index by simulating the loading of data. The function should take no parameters and print a message 'Loading data into Database Index' when called. Additionally, it should simulate the action of building the in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert init_index() == 'Index built successfully'\", \"assert init_index() == 'Index built successfully'\", \"assert init_index() == 'Index built successfully'\", \"assert init_index() == 'Index built successfully'\", \"assert init_index() == 'Index built successfu... | {
"split": "train",
"index": 82334,
"acecode_id": "bigcode_python_fns_22543",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `safe_str(val, default=None)` that safely converts a given value to a string. If the value is `None`, the function should return the provided default value if it is not `None`. If the value cannot be converted to a string due to an error, the function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert safe_str(123) == '123'\", \"assert safe_str(3.14) == '3.14'\", \"assert safe_str([1, 2, 3]) == '[1, 2, 3]'\", \"assert safe_str({'key': 'value'}) == \\\"{'key': 'value'}\\\"\", \"assert safe_str(True) == 'True'\", \"assert safe_str(False) == 'False'\", \"ass... | {
"split": "train",
"index": 82335,
"acecode_id": "bigcode_python_fns_1390",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to generate a specific sequence of numbers based on a given pattern. The pattern is defined as the cumulative sum of the first n natural numbers. Your function should take an integer n as input and return a list containing the first n... | 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(0) == [... | {
"split": "train",
"index": 82336,
"acecode_id": "oss_20085",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integers, `a` and `b`, implement a function that returns the result of subtracting `b` from `a`. Your function should be defined as `def subtract(a: int, b: int) -> int:`. The input values `a` and `b` can be any integer within the range of -10^9 to 10^9. Please ensure... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert subtract(10, 5) == 5\", \"assert subtract(0, 0) == 0\", \"assert subtract(-5, -10) == 5\", \"assert subtract(100, 200) == -100\", \"assert subtract(50, 50) == 0\", \"assert subtract(-100, 100) == -200\", \"assert subtract(1, -1) == 2\", \"assert subtract(-1,... | {
"split": "train",
"index": 82337,
"acecode_id": "bigcode_python_fns_45133",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function in Python that takes a dictionary with string keys and integer values, and returns the total sum of all the integer values in the dictionary.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_values({'a': 5, 'b': 10, 'c': 15}) == 30\", \"assert sum_values({'x': 1, 'y': 2, 'z': 3}) == 6\", \"assert sum_values({'apple': 10, 'banana': 20}) == 30\", \"assert sum_values({'key1': 100, 'key2': 200, 'key3': 300}) == 600\", \"assert sum_values({'a': -... | {
"split": "train",
"index": 82338,
"acecode_id": "evol_22372",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple game of rock-paper-scissors without user interaction. The function should take two parameters, `user_choice` and `computer_choice`, both of which can be 'rock', 'paper', or 'scissors'. The function should return a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rock_paper_scissors('rock', 'rock') == \\\"It's a tie!\\\"\", \"assert rock_paper_scissors('rock', 'scissors') == 'You win!'\", \"assert rock_paper_scissors('rock', 'paper') == 'You lose!'\", \"assert rock_paper_scissors('paper', 'rock') == 'You win!'\", \"a... | {
"split": "train",
"index": 82339,
"acecode_id": "oss_8224",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an integer value, `val`, and two other integers, `min_` and `max_`. Your task is to implement a function that clamps the value of `val` to be within the range defined by `min_` and `max_`. This means if `val` is less than `min_`, you should return `min_`. If `val`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clamp_value(5, 1, 10) == 5\", \"assert clamp_value(0, 1, 10) == 1\", \"assert clamp_value(15, 1, 10) == 10\", \"assert clamp_value(10, 1, 10) == 10\", \"assert clamp_value(-1, -5, 5) == -1\", \"assert clamp_value(3, -5, 5) == 3\", \"assert clamp_value(6, 6, ... | {
"split": "train",
"index": 82340,
"acecode_id": "bigcode_python_fns_30583",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the total cost based on the quantity of items and their price per item. Write a function named `calculate_total` that takes two parameters: an integer `quantity` and a float `price`. The function should return the tota... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total(5, 10) == 50\", \"assert calculate_total(0, 10) == 0\", \"assert calculate_total(5, 0) == 0\", \"assert calculate_total(-5, -10) == 50\", \"assert calculate_total(3, 4.5) == 13.5\", \"assert calculate_total(7, -3) == -21\", \"assert calculate... | {
"split": "train",
"index": 82341,
"acecode_id": "oss_8048",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that transforms a provided phrase into camel case. The input can either be a string or a list of strings, where each string may contain uppercase and lowercase letters, numbers, and special characters. The output should be a single string in camel case form... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_camel_case('hello world') == 'helloWorld'\", \"assert to_camel_case(['hello', 'world']) == 'helloWorld'\", \"assert to_camel_case('make-it_camel_case') == 'makeItCamelCase'\", \"assert to_camel_case('a-quick_brown-fox') == 'aQuickBrownFox'\", \"assert to_... | {
"split": "train",
"index": 82342,
"acecode_id": "evol_13248",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `compute_tax(salary: float) -> float` that calculates the fiscal contribution on a salary amount. A 15% tax is applied on the portion of the salary that exceeds $10,000, while any income equivalent to or below $10,000 remains non-taxable. You need to return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_tax(10000) == 0.0\", \"assert compute_tax(15000) == 750.0\", \"assert compute_tax(0) == 0.0\", \"assert compute_tax(5000) == 0.0\", \"assert compute_tax(9999) == 0.0\", \"assert compute_tax(10001) == 0.15\", \"assert compute_tax(12000) == 300.0\", \"... | {
"split": "train",
"index": 82343,
"acecode_id": "evol_31804",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a string representing the name of a planet, return the corresponding reference for the planet's orbit fit. The function should accept a single string input, `planet_name`, which represents the name of the planet with no spaces. The function should return a string referenc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_reference('mercury') == 'Reference for Mercury orbit fit'\", \"assert get_reference('venus') == 'Reference for Venus orbit fit'\", \"assert get_reference('earth') == 'Reference for Earth orbit fit'\", \"assert get_reference('mars') == 'Reference for Mars... | {
"split": "train",
"index": 82344,
"acecode_id": "bigcode_python_fns_11655",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the execution of basic SQL statements: SELECT, INSERT, UPDATE, and DELETE. The function should take an SQL statement as input and return a corresponding output based on the type of SQL statement provided. The function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_sql_statement('SELECT * FROM employees') == [('John Doe', 30), ('Jane Smith', 25)]\", \"assert execute_sql_statement('INSERT INTO employees (name, age) VALUES (\\\"John Doe\\\", 30)') == 'Insert successful'\", \"assert execute_sql_statement('UPDATE e... | {
"split": "train",
"index": 82345,
"acecode_id": "oss_15170",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a list of integers as input and returns a dictionary containing the frequency of each unique integer in the input list. The function should be named `calculate_frequency` and should take a single parameter: `input_list`:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_frequency([1, 2, 2, 3, 3, 3]) == {1: 1, 2: 2, 3: 3}\", \"assert calculate_frequency([1, 1, 1, 1]) == {1: 4}\", \"assert calculate_frequency([5, 5, 5, 5, 6, 6]) == {5: 4, 6: 2}\", \"assert calculate_frequency([-1, -1, 0, 0, 0, 1]) == {-1: 2, 0: 3, 1... | {
"split": "train",
"index": 82346,
"acecode_id": "oss_12104",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function `rotate_list(num_list, direction)` that rotates the values of a given list of numerical variables. The function should shift the list in either the left or right direction based on the provided `direction` argument. For a left shift, the function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rotate_list([1, 2, 3, 4, 5], 'left') == [2, 3, 4, 5, 1]\", \"assert rotate_list([1, 2, 3, 4, 5], 'right') == [5, 1, 2, 3, 4]\", \"assert rotate_list([], 'left') == []\", \"assert rotate_list([], 'right') == []\", \"assert rotate_list([5, 5, 5], 'left') == [5... | {
"split": "train",
"index": 82347,
"acecode_id": "evol_20857",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that computes the sum of two non-negative integers and returns the result as a string representing that sum in a specified base-n number system. The function should take three parameters: two integers x and y (both non-negative) and an integer n (where n >=... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_two_numbers(2, 3, 2) == '101'\", \"assert add_two_numbers(10, 5, 10) == '15'\", \"assert add_two_numbers(10, 5, 2) == '1111'\", \"assert add_two_numbers(0, 0, 2) == '0'\", \"assert add_two_numbers(1, 1, 3) == '2'\", \"assert add_two_numbers(5, 5, 6) == '... | {
"split": "train",
"index": 82348,
"acecode_id": "evol_8127",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to decrypt messages that have been encrypted using a simple substitution cipher. Each letter in the message is replaced by another letter a fixed number of positions down the alphabet according to a specified shift value. Your task is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decrypt_message('ifmmp xpsme', 1) == 'hello world'\", \"assert decrypt_message('khoor zruog', 3) == 'hello world'\", \"assert decrypt_message('uryyb jbeyq', 13) == 'hello world'\", \"assert decrypt_message('whvw phvvdjh', 3) == 'test message'\", \"assert dec... | {
"split": "train",
"index": 82349,
"acecode_id": "oss_27536",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a function `fibonacci(n, start)` that generates the first `n` numbers of the Fibonacci sequence starting from a given number `start`. The Fibonacci sequence starts with `0` and `1`, but should include the first `n` Fibonacci numbers that follow, starting from the closest ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(10, 0) == [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]\", \"assert fibonacci(0, 0) == []\", \"assert fibonacci(10, 1_000) == []\", \"assert fibonacci(1, 0) == [0]\", \"assert fibonacci(1, 1) == [1]\"]}"
} | {
"split": "train",
"index": 82350,
"acecode_id": "evol_9697",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `has_square_root_prime_factor(n)` that returns `True` if the square root of the input number `n` is a prime number, and `False` otherwise. The function should only consider perfect squares for its input. For example, `has_square_root_prime_factor(36)` shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert has_square_root_prime_factor(4) == True\", \"assert has_square_root_prime_factor(9) == True\", \"assert has_square_root_prime_factor(25) == True\", \"assert has_square_root_prime_factor(36) == False\", \"assert has_square_root_prime_factor(49) == True\", \"a... | {
"split": "train",
"index": 82351,
"acecode_id": "evol_19030",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts specific database configurations from a given settings dictionary. Your function should take a dictionary as input, which may contain a key called 'DATABASES'. This key maps to another dictionary containing database c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_database_configurations({'DATABASES': {'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:'}}}) == [('default', 'django.db.backends.sqlite3', ':memory:')]\", \"assert extract_database_configurations({'DATABASES': {'test_db': {'ENGIN... | {
"split": "train",
"index": 82352,
"acecode_id": "oss_12213",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a given semantic segmentation map into a discrete representation based on a specified discretization method. The function should take in a dictionary containing the semantic segmentation map under the key 'sem_seg' and a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_discrete({'sem_seg': [1, 2, 3]}, 'gumbel') == [2, 4, 6]\", \"assert to_discrete({'sem_seg': [1, 2, 3]}, 'max') == 3\", \"assert to_discrete({'sem_seg': [0, 0, 0]}, 'none') == [0, 0, 0]\", \"assert to_discrete({'sem_seg': [5, 3, 4]}, 'gumbel') == [10, 6, 8... | {
"split": "train",
"index": 82353,
"acecode_id": "oss_7305",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to validate dates for stock readings. Your function should check if a given date is not in the future when compared to today's date. If the provided date is in the future, your function should return False; otherwise, it should return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_stock_reading_date('2023-10-01') == True\", \"assert is_valid_stock_reading_date('2023-09-30') == True\", \"assert is_valid_stock_reading_date('2022-05-01') == True\", \"assert is_valid_stock_reading_date('2023-09-01') == True\", \"assert is_valid_s... | {
"split": "train",
"index": 82354,
"acecode_id": "oss_26499",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a list of services, each represented by a unique identifier, and a list of available IP addresses. Your task is to assign an IP address from the available list to each service, ensuring that each service gets a unique IP address. If there are not enough IP address... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert assign_ip_addresses(['service1', 'service2', 'service3'], ['192.168.1.1', '192.168.1.2']) == []\", \"assert assign_ip_addresses(['service1'], ['192.168.1.1']) == [('service1', '192.168.1.1')]\", \"assert assign_ip_addresses(['service1', 'service2'], ['192.16... | {
"split": "train",
"index": 82355,
"acecode_id": "bigcode_python_fns_17407",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that takes two alphanumerical strings as arguments. The function should identify numeric characters inside the strings, add the corresponding numbers together, and return the sum as a string. If non-numeric characters are encountered in the strings, they shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_numeric_strings('abc5def', 'ghi7jkl') == '12'\", \"assert sum_numeric_strings('1abc', '2xyz') == '3'\", \"assert sum_numeric_strings('abc3xy4z', '1mno9pqr') == '17'\", \"assert sum_numeric_strings('0', '0') == '0'\", \"assert sum_numeric_strings('abc', '... | {
"split": "train",
"index": 82356,
"acecode_id": "evol_26559",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that takes a single parameter called `target`. The function should return a string describing the type and length of the target. If the target is a list, return a string in the format '<list, length X>', where X is the length of the list. If the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_object_description([]) == '<list, length 0>'\", \"assert get_object_description([1, 2, 3]) == '<list, length 3>'\", \"assert get_object_description({'a': 1}) == '<dict, length 1>'\", \"assert get_object_description({'a': 1, 'b': 2}) == '<dict, length 2>'... | {
"split": "train",
"index": 82357,
"acecode_id": "bigcode_python_fns_22530",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2x2 matrix J represented as a list of lists, where each element is a numeric value, and a determinant detJ, implement a function that manually inverts the 2x2 matrix J in place using the determinant. The function should return the inverted matrix. The matrix J is struct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert invert_matrix([[5, 6], [7, 8]], -2) == [[-4.0, 3.0], [3.5, -2.5]]\", \"assert invert_matrix([[0, 0], [0, 0]], 0) == [[0, 0], [0, 0]]\", \"assert invert_matrix([[1, -1], [2, -2]], 0) == [[0, 0], [0, 0]]\", \"assert invert_matrix([[1, 0], [0, 1]], 1) == [[1.0,... | {
"split": "train",
"index": 82358,
"acecode_id": "bigcode_python_fns_12920",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function called `median` that calculates the median of the elements in the list without sorting it. The list may contain both an even and an odd number of elements. The median is defined as the middle element in a sorted list, or the averag... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median([3, 1, 2, 4, 5]) == 3\", \"assert median([7]) == 7\", \"assert median([1, 3]) == 2.0\", \"assert median([1, 2, 3]) == 2\", \"assert median([1, 2, 3, 4]) == 2.5\", \"assert median([-1, -2, -3, -4]) == -2.5\", \"assert median([2, 2, 2]) == 2\", \"assert... | {
"split": "train",
"index": 82359,
"acecode_id": "evol_9231",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary `data` representing the attributes of a project, including a mandatory field `project_id` and several optional fields. Your task is to write a function `test_optional_fields(data: dict, fld: str) -> bool` that simulates creating a project item by sett... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert test_optional_fields({'project_id': 1, 'name': 'Project A'}, 'name') == True\", \"assert test_optional_fields({'project_id': 2, 'description': 'Description B'}, 'description') == True\", \"assert test_optional_fields({'project_id': 3}, 'optional_field') == T... | {
"split": "train",
"index": 82360,
"acecode_id": "bigcode_python_fns_20894",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an initial learning rate, a weight decay value, an optimizer with parameter groups, the current epoch, and a list of epoch steps at which the learning rate should decay. Implement a function that adjusts the learning rate and weight decay of the optimizer based on... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert adjust_learning_rate(0.1, 0.01, {'param_groups': [{'lr_mult': 1.0, 'decay_mult': 1.0}]}, 0, [20, 30]) == None\", \"assert adjust_learning_rate(0.1, 0.01, {'param_groups': [{'lr_mult': 1.0, 'decay_mult': 1.0}]}, 20, [20, 30]) == None\", \"assert adjust_learni... | {
"split": "train",
"index": 82361,
"acecode_id": "bigcode_python_fns_29751",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two data structures, `lhs` and `rhs`, which can be integers, strings, lists, or dictionaries. Your task is to implement a function called `compare_data_structures(lhs, rhs)` that compares these two data structures for equality. The function should return a string ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_data_structures(1, 1) == 'Equal'\", \"assert compare_data_structures(1, 2) == 'Not Equal'\", \"assert compare_data_structures('hello', 'hello') == 'Equal'\", \"assert compare_data_structures('hello', 'world') == 'Not Equal'\", \"assert compare_data_s... | {
"split": "train",
"index": 82362,
"acecode_id": "bigcode_python_fns_23015",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a list of integers and a target sum, and returns a set of unique pairs of numbers from the list whose sum is equal to the target sum. The function should ensure that the pairs are unique and can include both positive and negative integers. Imp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_pairs([0, 0, 0, 0], 0) == {(0, 0)}\", \"assert find_pairs([1, 1, 1, 1], 2) == {(1, 1)}\", \"assert find_pairs([-1, 1, 2, -2], 0) == {(-2, 2), (-1, 1)}\", \"assert find_pairs([-1, -1, 2, -2], 0) == {(-2, 2)}\", \"assert find_pairs([], 1) == set()\", \"as... | {
"split": "train",
"index": 82363,
"acecode_id": "evol_20342",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function named `adjust_to_power_of_two` that takes an integer as an argument. If the integer is a power of two, return the integer itself. If it is not a power of two, raise it to the power of two and return the result. If a non-integer value is passed in, the funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert adjust_to_power_of_two(1) == 1\", \"assert adjust_to_power_of_two(2) == 2\", \"assert adjust_to_power_of_two(4) == 4\", \"assert adjust_to_power_of_two(8) == 8\", \"assert adjust_to_power_of_two(16) == 16\", \"assert adjust_to_power_of_two(32) == 32\", \"ass... | {
"split": "train",
"index": 82364,
"acecode_id": "evol_1775",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that retrieves a specific class from a given module based on a subtype. The function should take two parameters: `module_name`, a string representing the name of a module, and `subtype`, a string representing the specific class type y... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_class_from_module('math', 'sqrt') is not None\", \"assert get_class_from_module('os', 'path') is not None\", \"assert get_class_from_module('sys', 'modules') is not None\", \"assert get_class_from_module('random', 'choice') is not None\", \"assert get_cl... | {
"split": "train",
"index": 82365,
"acecode_id": "bigcode_python_fns_2582",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a sample publisher's name based on a given input. The function should take a string parameter called 'name' which represents the name of the publisher. If the name is not provided, it should default to 'EA'. Your function s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_publisher_name('EA') == 'EA'\", \"assert generate_publisher_name('Ubisoft') == 'Ubisoft'\", \"assert generate_publisher_name('Activision') == 'Activision'\", \"assert generate_publisher_name('') == ''\", \"assert generate_publisher_name('Nintendo') ... | {
"split": "train",
"index": 82366,
"acecode_id": "bigcode_python_fns_24423",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks the uniqueness of a username and an email for a user registration system. The function should take two parameters: `username` and `email`, and check them against a predefined list of already registered usernames and emails... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_unique('user123', 'user123@example.com') == 'Both username and email are available'\", \"assert is_unique('admin', 'admin@example.com') == 'Both username and email are available'\", \"assert is_unique('test_user', 'test@example.com') == 'Both username and... | {
"split": "train",
"index": 82367,
"acecode_id": "oss_5612",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that processes a given hostname through a series of transformations. The function should take a string input representing a hostname and apply two specific transformations in order: first, it should replace any occurrence of '.com' in the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_hostname('Example.com') == 'example.net'\", \"assert process_hostname('Mysite.org') == 'mysite.org'\", \"assert process_hostname('example.com/path') == 'example.net/path'\", \"assert process_hostname('www.Example.com') == 'www.example.net'\", \"asser... | {
"split": "train",
"index": 82368,
"acecode_id": "bigcode_python_fns_45922",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that counts the number of unique characters in a given string. The function should ignore spaces and consider only alphanumeric characters. Implement the function `count_unique_characters(s: str) -> int` where `s` is the input string.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_unique_characters('Python 3.9') == 8\", \"assert count_unique_characters('') == 0\", \"assert count_unique_characters('1234567890') == 10\", \"assert count_unique_characters('abcABC') == 6\", \"assert count_unique_characters('!@#$%^&*()') == 0\", \"ass... | {
"split": "train",
"index": 82369,
"acecode_id": "oss_10023",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `remove_punctuation` that takes a string as input and returns a new string with all punctuation characters removed. The punctuation characters are defined as any character that is not an alphanumeric character or whitespace. For example, given the input str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_punctuation('Hello, World!') == 'Hello World'\", \"assert remove_punctuation('Python is great.') == 'Python is great'\", \"assert remove_punctuation('No punctuation here') == 'No punctuation here'\", \"assert remove_punctuation('What a day!!!') == 'Wh... | {
"split": "train",
"index": 82370,
"acecode_id": "evol_35790",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes two numerical inputs, which can be either integers or floating-point numbers, and returns the result of the first input divided by the second input. If the second input is zero, the function should return 'undefined'.\nPlease reason step by step,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert divide_numbers(10, 2) == 5.0\", \"assert divide_numbers(17, 5) == 3.4\", \"assert divide_numbers(15.5, 3.1) == 5.0\", \"assert divide_numbers(20, 0) == 'undefined'\", \"assert divide_numbers(0, 5) == 0.0\", \"assert divide_numbers(9, 3) == 3.0\", \"assert di... | {
"split": "train",
"index": 82371,
"acecode_id": "evol_18763",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `validate_string` that checks if a given string contains only unique alphabets and is in alphabetical order. The function should ignore any digits or special characters, and it should treat uppercase and lowercase letters as the same. The function should re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_string('abc') == True\", \"assert validate_string('aBc') == True\", \"assert validate_string('abcdefg') == True\", \"assert validate_string('abcd123') == True\", \"assert validate_string('') == True\", \"assert validate_string('abcdeedcba') == False... | {
"split": "train",
"index": 82372,
"acecode_id": "evol_17063",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a string as input and returns a boolean value indicating whether the string is a pangram. A pangram is a sentence that contains every letter of the English alphabet at least once. Your function should ignore any special characters, numbers, an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_pangram('The quick brown fox jumps over the lazy dog') == True\", \"assert is_pangram('Pack my box with five dozen liquor jugs') == True\", \"assert is_pangram('Sphinx of black quartz, judge my vow') == True\", \"assert is_pangram('Lorem ipsum dolor sit a... | {
"split": "train",
"index": 82373,
"acecode_id": "evol_12640",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that determines if two strings are anagrams of each other, ignoring spaces, punctuation, and capitalization. Additionally, the function should return the number of distinct anagrams that can be formed from each string. The function should have the signature `de... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert anagram_details('a b c', 'c b a') == (True, 6, 6)\", \"assert anagram_details('a', 'a') == (True, 1, 1)\", \"assert anagram_details('abc', 'cba') == (True, 6, 6)\", \"assert anagram_details('abc', 'def') == (False, 6, 6)\", \"assert anagram_details('123', '3... | {
"split": "train",
"index": 82374,
"acecode_id": "evol_32305",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given two line segments represented by their endpoints in the form of tuples (start, end), write a function `in_line_rate(line: Tuple[int, int], container_line: Tuple[int, int]) -> float` that calculates the ratio of the length of the intersection of the two line segments to th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert in_line_rate((1, 5), (5, 9)) == 0.0\", \"assert in_line_rate((1, 5), (0, 1)) == 0.0\", \"assert in_line_rate((1, 3), (2, 3)) == 0.5\", \"assert in_line_rate((2, 4), (1, 3)) == 0.5\", \"assert in_line_rate((0, 10), (5, 5)) == 0.0\", \"assert in_line_rate((0, ... | {
"split": "train",
"index": 82375,
"acecode_id": "bigcode_python_fns_32512",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to simulate a circular buffer behavior. A circular buffer is a fixed-size structure that overwrites the oldest data when full. Your function should accept an array of integers representing the buffer and an integer `n` which indicates... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_element_after_rotation([3, 1, 4, 1, 5, 9], 0) == 1\", \"assert get_element_after_rotation([5, 6, 7], 3) == 6\", \"assert get_element_after_rotation([], 1) == -1\", \"assert get_element_after_rotation([42], 1) == -1\", \"assert get_element_after_rotation(... | {
"split": "train",
"index": 82376,
"acecode_id": "oss_33038",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing Wikipedia page titles in a specific category. Write a function that takes this list of titles and returns a single string containing all the page titles concatenated together, separated by commas. If the input list is empty, return a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert concatenate_titles(['Python', 'Java', 'C++']) == 'Python,Java,C++'\", \"assert concatenate_titles(['Machine Learning', 'Natural Language Processing', 'Computer Vision']) == 'Machine Learning,Natural Language Processing,Computer Vision'\", \"assert concatenat... | {
"split": "train",
"index": 82377,
"acecode_id": "bigcode_python_fns_8517",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a nested list containing integers and other nested lists, write a function that flattens the list into a single list of integers. The function should take a single parameter, which is the nested list, and return a new list containing all the integers in the same order the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten_list([1, 2, [3, 4], 5]) == [1, 2, 3, 4, 5]\", \"assert flatten_list([[1, 2], [3, [4, 5]], 6]) == [1, 2, 3, 4, 5, 6]\", \"assert flatten_list([[[1]], 2, [3, 4]]) == [1, 2, 3, 4]\", \"assert flatten_list([1, [2, [3, 4]], 5]) == [1, 2, 3, 4, 5]\", \"ass... | {
"split": "train",
"index": 82378,
"acecode_id": "bigcode_python_fns_44057",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing an interpreter for a simple programming language that supports let-in declarations and block expressions. The language consists of three types of nodes: `LetInNode`, `BlockNode`, and `ParenthesisNode`. Each node represents a specific construct i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert interpret(BlockNode(expr_list=[ParenthesisNode(expr='3'), ParenthesisNode(expr='5')])) == 5\", \"assert interpret(ParenthesisNode(expr='10 * 2')) == 20\", \"assert interpret(ParenthesisNode(expr='(4 + 5) * 2')) == 18\", \"assert interpret(BlockNode(expr_list... | {
"split": "train",
"index": 82379,
"acecode_id": "oss_3485",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a class named 'ArrayReader' that has a method 'get(index: int)'. The method retrieves the value at the specified index of an array. Your task is to implement a function 'searchName' in a class 'Solution' that receives an instance of 'ArrayReader', an integer 'targ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert Solution().searchName(ArrayReader([1, 2, 3, 4, 5]), 3, 5) == (2, 2)\", \"assert Solution().searchName(ArrayReader([1, 2, 3, 4, 5]), 1, 5) == (0, 0)\", \"assert Solution().searchName(ArrayReader([1, 2, 3, 4, 5, 5]), 5, 6) == (4, 5)\", \"assert Solution().sear... | {
"split": "train",
"index": 82380,
"acecode_id": "evol_24075",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and returns a new string that contains only the alphabetic characters (both uppercase and lowercase), removing all other characters such as numbers, punctuation, and whitespace.\nPlease reason step by step, then write a self-con... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_non_letters('Hello, World!') == 'HelloWorld'\", \"assert remove_non_letters('12345') == ''\", \"assert remove_non_letters('Python3.9') == 'Python'\", \"assert remove_non_letters('C++ Programming!') == 'CProgramming'\", \"assert remove_non_letters('') ... | {
"split": "train",
"index": 82381,
"acecode_id": "evol_8008",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that accepts a list of strings and returns a dictionary containing the frequency of each distinct character from all the strings combined. The function should ignore case sensitivity when counting characters. For example, 'A' and 'a' should be counted as the sa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_chars(['Hello', 'World']) == {'h': 1, 'e': 1, 'l': 3, 'o': 2, 'r': 1, 'w': 1, 'd': 1}\", \"assert count_chars(['Python', 'is', 'fun']) == {'p': 1, 'y': 1, 't': 1, 'h': 1, 'o': 1, 'n': 2, 'i': 1, 's': 1, 'f': 1, 'u': 1}\", \"assert count_chars(['aaa', '... | {
"split": "train",
"index": 82382,
"acecode_id": "evol_9007",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that asks the user a yes or no question and returns 'Yes' if the user responds affirmatively and 'No' otherwise. The function should take a string input representing the question. Your function should simulate the user's response using a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_user_response('Should we continue?') == 'Yes'\", \"assert get_user_response('Do you like ice cream?') == 'Yes'\", \"assert get_user_response('Can we go outside?') == 'Yes'\", \"assert get_user_response('Is today Monday?') == 'Yes'\", \"assert get_user_re... | {
"split": "train",
"index": 82383,
"acecode_id": "bigcode_python_fns_40355",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of class names representing a class hierarchy in a programming language. Each class may inherit from one or more base classes. Your task is to implement a function that determines the direct base classes of a specified class name. The function should return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_base_classes('ChildClass', {'ChildClass': ['ParentClass'], 'ParentClass': ['GrandparentClass'], 'GrandparentClass': []}) == ['ParentClass']\", \"assert get_base_classes('GrandparentClass', {'ChildClass': ['ParentClass'], 'ParentClass': ['GrandparentClass... | {
"split": "train",
"index": 82384,
"acecode_id": "bigcode_python_fns_3673",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `double_list` that takes the list as input and returns a new list where each integer in the input list is doubled. Do not modify the input list.\nPlease reason step by step, then write a self-contained Python solution. Give your fi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert double_list([1, 2, 3]) == [2, 4, 6]\", \"assert double_list([-1, 0, 1]) == [-2, 0, 2]\", \"assert double_list([]) == []\", \"assert double_list([10, 20, 30]) == [20, 40, 60]\", \"assert double_list([5]) == [10]\", \"assert double_list([-5, -10]) == [-10, -20... | {
"split": "train",
"index": 82385,
"acecode_id": "evol_34131",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the nth Fibonacci number using an iterative approach. The Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding ones, starting with 0 and 1. Your function should take a non-nega... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculateFibonacci(0) == 0\", \"assert calculateFibonacci(1) == 1\", \"assert calculateFibonacci(2) == 1\", \"assert calculateFibonacci(3) == 2\", \"assert calculateFibonacci(4) == 3\", \"assert calculateFibonacci(5) == 5\", \"assert calculateFibonacci(6) ==... | {
"split": "train",
"index": 82386,
"acecode_id": "oss_4942",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a Python datetime object to its string representation in MongoDB's ISODate format. The function should take a datetime object as input and return a string formatted as 'YYYY-MM-DDTHH:MM:SS.sssZ'. Your implementation shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert datetime_to_mongodate(datetime(2023, 10, 1, 12, 30, 45, 123456)) == '2023-10-01T12:30:45.123456Z'\", \"assert datetime_to_mongodate(datetime(2021, 1, 1, 0, 0, 0, 0)) == '2021-01-01T00:00:00.000000Z'\", \"assert datetime_to_mongodate(datetime(2000, 12, 31, 23... | {
"split": "train",
"index": 82387,
"acecode_id": "oss_17831",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing command-line options and a parser that defines the structure of expected command-line arguments. Your task is to implement a function that converts the dictionary of options into a list of command-line arguments as strings. The parser is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert argunparse({'quiet': True}, [{'args': ['-q', '--quiet'], 'dest': 'quiet'}]) == ['-q']\", \"assert argunparse({}, [{'args': ['-q', '--quiet'], 'dest': 'quiet'}]) == []\", \"assert argunparse({'flag': True}, [{'args': ['--flag'], 'dest': 'flag'}]) == ['--flag'... | {
"split": "train",
"index": 82388,
"acecode_id": "bigcode_python_fns_41248",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating poetic meter patterns. Implement a function named `validate_meter_pattern(pattern: str) -> bool` that takes a string `pattern` as input and checks if it exists in a predefined set of meter patterns. The meter patterns to validate against are: 'Iam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_meter_pattern('Iambic Pentameter') == True\", \"assert validate_meter_pattern('Trochaic Tetrameter') == True\", \"assert validate_meter_pattern('Anapestic Trimeter') == True\", \"assert validate_meter_pattern('Iambic Pentameter') == True\", \"assert... | {
"split": "train",
"index": 82389,
"acecode_id": "oss_24267",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_euclidean_distance(point1, point2)` that calculates the Euclidean distance between two points in a 2D space. The points are represented as lists of two integers, where `point1` and `point2` are the coordinates of the two points. The Euclidean dis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_euclidean_distance([0, 0], [3, 4]) == 5.0\", \"assert calculate_euclidean_distance([-5, -5], [5, 5]) == 14.142135623730951\", \"assert calculate_euclidean_distance([1, 1], [1, 1]) == 0.0\", \"assert calculate_euclidean_distance([2, 2], [2, 5]) == 3... | {
"split": "train",
"index": 82390,
"acecode_id": "evol_33921",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `get_uri_component(uri: str) -> Tuple[str, str, str]` that takes a Uniform Resource Identifier (URI) as a string and returns a tuple containing the scheme, hostname, and path of the URI. If any of these components are not present, return an empty string for... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_uri_component('https://example.com/path/to/resource') == ('https', 'example.com', '/path/to/resource')\", \"assert get_uri_component('ftp://files.example.com/downloads/file.txt') == ('ftp', 'files.example.com', '/downloads/file.txt')\", \"assert get_uri_... | {
"split": "train",
"index": 82391,
"acecode_id": "evol_2290",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function `process_sequence(sequence: str) -> List[str]` that processes a given alphanumeric string by transforming each character based on the following rules: if the character is a vowel (a, e, i, o, u), convert it to uppercase; if it is a consonant, convert it to ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_sequence('AEIOU') == ['A', 'E', 'I', 'O', 'U']\", \"assert process_sequence('12345') == []\", \"assert process_sequence('') == []\", \"assert process_sequence(' ') == []\", \"assert process_sequence('@#$%^&*()') == []\"]}"
} | {
"split": "train",
"index": 82392,
"acecode_id": "evol_15821",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of pipelines, each represented by a dictionary containing its name and ID. Write a function `get_pipeline_id(pipelines: List[Dict[str, str]], target_name: str) -> str` that returns the ID of the pipeline with the specified name. If no pipeline with the give... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_pipeline_id([{'name': 'Test Pipeline', 'id': '1234'}, {'name': 'Other', 'id': '5678'}], 'Test Pipeline') == '1234'\", \"assert get_pipeline_id([{'name': 'Test Pipeline', 'id': '1234'}, {'name': 'Other', 'id': '5678'}], 'Other') == '5678'\", \"assert get_... | {
"split": "train",
"index": 82393,
"acecode_id": "bigcode_python_fns_23641",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a collision detection system for a simple 2D platformer game. In this game, the player's position is represented by a tuple (x, y), and there are multiple platforms defined by their position and dimensions (x, y, width, height). Your task is to ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert collision_detection((50, 210), [Platform(100, 300, 200, 20), Platform(50, 200, 150, 20)]) == Platform(50, 200, 150, 20)\", \"assert collision_detection((150, 200), [Platform(100, 300, 200, 20), Platform(50, 200, 150, 20)]) == Platform(50, 200, 150, 20)\", \"... | {
"split": "train",
"index": 82394,
"acecode_id": "oss_3052",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating input specifications for a data extraction process. Implement a function `is_valid_input(instance_of_property: str, depth: str, language_code: str, named_entity_label: str) -> bool` that checks if the provided inputs meet the following criteria: \... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_input('Q123', '0', 'en', 'location') == True\", \"assert is_valid_input('manual_entry', '5', 'fr', 'feature-film') == True\", \"assert is_valid_input('stopwords', '10', 'de', 'entity_label') == True\", \"assert is_valid_input('Q456', '3', 'es', 'nam... | {
"split": "train",
"index": 82395,
"acecode_id": "bigcode_python_fns_24594",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `complex_sort(list1)` that accepts a list of non-negative integers and returns a new list based on the following conditions: \n\n1. Classify the elements into three separate lists: `even_list`, `odd_list`, and `mixed_list` based on the first and last index ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert complex_sort([]) == []\", \"assert complex_sort([5]) == [5]\", \"assert complex_sort([2, 4, 6]) == [2, 4, 6]\", \"assert complex_sort([10, 2, 4, 8]) == [2, 4, 8, 10]\", \"assert complex_sort([1, 4, 6, 9]) == [4, 6, 1, 9]\", \"assert complex_sort([2, 2, 7]) =... | {
"split": "train",
"index": 82396,
"acecode_id": "evol_8481",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a custom exception class in Python for a specific API. The API, called WxAPI, has a variety of endpoints that accept different data formats. Your goal is to create a custom exception class, `FormatNotAllowed`, which will be raised when a user attemp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert FormatNotAllowed.__doc__ == 'The format provided is not allowed by this endpoint'\", \"assert issubclass(FormatNotAllowed, WxAPIException)\", \"assert isinstance(FormatNotAllowed(), WxAPIException)\", \"assert isinstance(FormatNotAllowed(), Exception)\", \"a... | {
"split": "train",
"index": 82397,
"acecode_id": "oss_4962",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a monetary value with a specified currency unit. Your task is to implement a function `extract_amount(value: str) -> float` that extracts and returns the decimal amount from the given string, assuming the currency unit is always 'STEEM'. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_amount('100.50 STEEM') == 100.50\", \"assert extract_amount('0 STEEM') == 0.0\", \"assert extract_amount('123456.78 STEEM') == 123456.78\", \"assert extract_amount('1.0 STEEM') == 1.0\", \"assert extract_amount('5.678 STEEM') == 5.678\", \"assert ext... | {
"split": "train",
"index": 82398,
"acecode_id": "bigcode_python_fns_13273",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a string that may contain information about a cycle time. Your task is to implement a function `get_cycle_time(string: str) -> str` that extracts the cycle time from the given string based on a specific pattern. The cycle time is defined as a sequence of digits fo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_cycle_time('The process took 200ms to complete') == '200ms'\", \"assert get_cycle_time('Execution time: 350ms') == '350ms'\", \"assert get_cycle_time('Waiting for 1000ms before proceeding') == '1000ms'\", \"assert get_cycle_time('No timing information av... | {
"split": "train",
"index": 82399,
"acecode_id": "bigcode_python_fns_46753",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.