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 creating a function `get_current_version_from_file` that simulates reading the current version of a software application from a file. The function should take a string `file_path` as input, which represents the path to the version file. The function should r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_current_version_from_file('/path/to/temp') == ('1.0.0', '/path/to/temp/version')\", \"assert get_current_version_from_file('/another/path') == ('1.0.0', '/another/path/version')\", \"assert get_current_version_from_file('/yet/another/path') == ('1.0.0', ... | {
"split": "train",
"index": 78500,
"acecode_id": "oss_18137",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that checks if a given string is a palindrome. A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization). Your function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('A man a plan a canal Panama') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('No lemon no melon') == True\", \"assert is_palindrome('Hello World') == False\", \"assert is_palindrome('Was it a car or a cat I saw?... | {
"split": "train",
"index": 78501,
"acecode_id": "oss_633",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a Python function that prepends a specified character to a given string until the string reaches a specified minimum length. If the string is already equal to or longer than the minimum length, return the string unchanged. The function should take three parameters: a str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert prepend_char('test', 8, '*') == '****test'\", \"assert prepend_char('hello world', 10, '#') == 'hello world'\", \"assert prepend_char('', 5, 'x') == 'xxxxx'\", \"assert prepend_char('short', 5, '-') == 'short'\", \"assert prepend_char('abc', 6, ' ') == ' a... | {
"split": "train",
"index": 78502,
"acecode_id": "evol_8326",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given two lists, one containing country names and the other containing their respective populations, write a function `create_dict(countries, populace)` that returns a dictionary where the keys are the country names and the values are their populations. The function should hand... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_dict(['USA', 'Canada'], [331, 37.59]) == {'USA': 331, 'Canada': 37.59}\", \"assert create_dict(['India', 'China', 'Japan'], [1393, 1444216107, 126010]) == {'India': 1393, 'China': 1444216107, 'Japan': 126010}\", \"assert create_dict(['Spain', 'France'... | {
"split": "train",
"index": 78503,
"acecode_id": "evol_21061",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts a list of whole numbers and fractional numbers using a unique alternating selection method. The function should return the list in the following order: start with the smallest number, then the largest of the remaining numbers, followed by the nex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert strange_sort_list([1, 2, 3, 4]) == [1, 4, 2, 3]\", \"assert strange_sort_list([5, 5, 5, 5]) == [5, 5, 5, 5]\", \"assert strange_sort_list([]) == []\", \"assert strange_sort_list([-2, 1.5, 3.5, -1]) == [-2, 3.5, -1, 1.5]\", \"assert strange_sort_list([0.1, -0... | {
"split": "train",
"index": 78504,
"acecode_id": "evol_21422",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that simulates the execution of a command and calculates the time taken to run it. The command is represented as a list of strings, where the first element is the command name and the subsequent elements are its arguments. Your function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert command_runtime(['sleep']) == 5.0\", \"assert command_runtime(['sleep', '10']) == 5.0\", \"assert command_runtime(['echo', 'Hello']) == 0.5\", \"assert command_runtime(['ls']) == 1.0\", \"assert command_runtime(['ls', '-l']) == 1.0\", \"assert command_runtim... | {
"split": "train",
"index": 78505,
"acecode_id": "bigcode_python_fns_18948",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that returns a tuple containing the first index where a specified value is found in a list, the last index where this value is found, and the frequency of this value in the list. If the value is not present, the function should return (-1, -1, 0). The function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_val_indices_freq(['apple', 'banana', 'cherry', 'apple'], 'apple') == (0, 3, 2)\", \"assert find_val_indices_freq(['apple', 'banana', 'cherry', 'apple'], 'banana') == (1, 1, 1)\", \"assert find_val_indices_freq(['apple', 'banana', 'cherry', 'apple'], 'ch... | {
"split": "train",
"index": 78506,
"acecode_id": "evol_2810",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representation of a chemical reaction in SMILES format. Your task is to write a function that removes all atom mapping from this reaction SMILES string. The function should take one parameter, `rxn_smi`, which is the reaction SMILES string, and return a n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_mapping('CC(=O)O.C(=O)O>>CC(=O)O') == 'CC(=O)O.C(=O)O>>CC(=O)O'\", \"assert remove_mapping('C1=CC=CC=C1>>C1=CC=CC=C1') == 'C1=CC=CC=C1>>C1=CC=CC=C1'\", \"assert remove_mapping('C1(C)C2=C(C1)C(=C(C2=O)C)C(=C)C(=C)C') == 'C1(C)C2=C(C1)C(=C(C2=O)C)C(=C)C... | {
"split": "train",
"index": 78507,
"acecode_id": "bigcode_python_fns_28945",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of file paths and generates a list of dictionaries. Each dictionary should contain two key-value pairs: the 'file_path' from the input list and a 'hashtag' that combines a given document hashtag with the index of the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_list_dict(['file1.zip', 'file2.rar', 'file3.7z'], 'doc123') == [{'file_path': 'file1.zip', 'hashtag': 'doc123_001'}, {'file_path': 'file2.rar', 'hashtag': 'doc123_002'}, {'file_path': 'file3.7z', 'hashtag': 'doc123_003'}]\", \"assert get_list_dict([], 'd... | {
"split": "train",
"index": 78508,
"acecode_id": "oss_994",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, write a function that counts the number of occurrences of a specified string within that list. The function should take two parameters: the list of strings and the string to count. Implement the function `count_occurrences(array: List[str], item: str) -... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_occurrences(['Apple', 'Banana', 'Orange', 'Orange', 'Banana'], 'Orange') == 2\", \"assert count_occurrences(['Apple', 'Banana', 'Orange', 'Orange', 'Banana'], 'Banana') == 2\", \"assert count_occurrences(['Apple', 'Banana', 'Orange', 'Orange', 'Banana'... | {
"split": "train",
"index": 78509,
"acecode_id": "evol_13018",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a sparse vector represented by a list of integers. A sparse vector is a vector in which most of the elements are zero. Your task is to implement a function that returns the dot product of two sparse vectors. The dot product is calculated by multiplying correspondi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dot_product([1, 0, 0, 2], [0, 3, 0, 4]) == 8\", \"assert dot_product([0, 0, 0], [0, 0, 0]) == 0\", \"assert dot_product([1, 2, 3], [4, 5, 6]) == 32\", \"assert dot_product([0, 2, 0], [0, 0, 3]) == 0\", \"assert dot_product([2, 0, 3], [1, 0, 0]) == 2\", \"ass... | {
"split": "train",
"index": 78510,
"acecode_id": "evol_2998",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating an echo function that takes a string message as input and returns the same message as output. Implement the `echo` function that accepts a single parameter `message` (a string) and returns the same string. Your function should ensure that the respon... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert echo('Hello, world!') == 'Hello, world!'\", \"assert echo('') == ''\", \"assert echo('Python is great!') == 'Python is great!'\", \"assert echo(' Leading and trailing spaces ') == ' Leading and trailing spaces '\", \"assert echo('12345') == '12345'\"... | {
"split": "train",
"index": 78511,
"acecode_id": "oss_17398",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a staircase with 'n' steps. You can reach the top of the staircase by taking either 1 or 2 steps at a time. Your task is to implement a function `countWays` that takes an integer `n` as input and returns the total number of distinct ways to reach the top of the st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert countWays(0) == 1\", \"assert countWays(1) == 1\", \"assert countWays(2) == 2\", \"assert countWays(3) == 3\", \"assert countWays(4) == 5\", \"assert countWays(5) == 8\", \"assert countWays(6) == 13\", \"assert countWays(7) == 21\", \"assert countWays(8) == ... | {
"split": "train",
"index": 78512,
"acecode_id": "oss_1567",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `below_zero(operations: List[Tuple[str, Union[int, str]]], case_insensitive: bool = False) -> bool` that processes a list of bank account operations consisting of 'Deposit' or 'Withdrawal' along with respective amounts, which can be integers or strings. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert below_zero([('Deposit', '1'), ('Deposit', 2), ('Deposit', 3)]) == False\", \"assert below_zero([('Deposit', '1'), ('Withdrawal', '1')]) == True\", \"assert below_zero([('Deposit', '10'), ('Withdrawal', '5'), ('Withdrawal', '5')]) == True\", \"assert below_ze... | {
"split": "train",
"index": 78513,
"acecode_id": "evol_9739",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a list of dictionaries representing user roles and returns a new list of dictionaries with only the user IDs and role IDs. Each dictionary in the input list has the keys 'id', 'userId', and 'roleId'. Your function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_user_roles([{'id': 1, 'userId': 101, 'roleId': 201}, {'id': 2, 'userId': 102, 'roleId': 202}]) == [{'userId': 101, 'roleId': 201}, {'userId': 102, 'roleId': 202}]\", \"assert filter_user_roles([{'id': 3, 'userId': 103, 'roleId': 203}]) == [{'userId': ... | {
"split": "train",
"index": 78514,
"acecode_id": "oss_24323",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string that represents a scene graph location in the format 'node:output_name:other_info:output_name', implement a function that extracts the output name from the string. The function should return the output name if it exists, otherwise return None. The input string wi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_output_name('node:output1:info1:output_name') == 'output_name'\", \"assert extract_output_name('node:output2:info2:output_name') == 'output_name'\", \"assert extract_output_name('node:outputX:info3:output_name') == 'output_name'\", \"assert extract_o... | {
"split": "train",
"index": 78515,
"acecode_id": "bigcode_python_fns_46498",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function in Python that takes a list of integers as input and returns the highest value among the most frequent integers in the list. If there are multiple integers with the same maximum frequency, return the highest integer among them. The list may contain negative int... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert most_frequent([3, 9, 5, 6, 3, 9, 5, -3, -3]) == 9\", \"assert most_frequent([-1, -2, -1, -3, -2, -1]) == -1\", \"assert most_frequent([1, 2, 3, 4, 5, 5, 4, 4, 5]) == 5\", \"assert most_frequent([0, 0, 0, 1, 1, 2, 2]) == 0\", \"assert most_frequent([-4, -4, -... | {
"split": "train",
"index": 78516,
"acecode_id": "evol_26138",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing zone names. Your task is to implement a function that filters out any empty strings and any strings that start with the '#' character. The function should return a new list that contains only the valid zone names. Write a function `f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_zones(['Zone1', 'Zone2', '#Zone3', '']) == ['Zone1', 'Zone2']\", \"assert filter_zones(['#Comment', 'ZoneA', 'ZoneB', '']) == ['ZoneA', 'ZoneB']\", \"assert filter_zones(['#Zone1', '#Zone2', '#Zone3']) == []\", \"assert filter_zones(['Zone1', 'Zone2',... | {
"split": "train",
"index": 78517,
"acecode_id": "bigcode_python_fns_42688",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates fetching weather forecast information for a given location. Write a function `get_weather_forecast(location: str) -> str` that takes a string parameter `location` representing the name of a city and returns a mock weather f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_weather_forecast('New York') in ['New York: {}\\u00b0C, Sunny'.format(temp) for temp in range(0, 101)] + ['New York: {}\\u00b0C, Cloudy'.format(temp) for temp in range(0, 101)] + ['New York: {}\\u00b0C, Rainy'.format(temp) for temp in range(0, 101)] + ['... | {
"split": "train",
"index": 78518,
"acecode_id": "oss_28599",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a record represented as a dictionary and a field specification. Your task is to implement a function that extracts and returns the value associated with the field specification from the record. The field specification can either be an integer index, a string repre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_field({'name': 'Alice', 'age': 30}, 0) == 'Alice'\", \"assert evaluate_field({'name': 'Alice', 'age': 30}, 'age') == '30'\", \"assert evaluate_field({'name': 'Alice', 'age': 30}, lambda r: r['age'] + 5) == '35'\", \"assert evaluate_field({'id': 101,... | {
"split": "train",
"index": 78519,
"acecode_id": "bigcode_python_fns_31249",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a nested collection (which can be a list or a tuple) and an element, implement a function `count_element(collection, element)` that determines whether all nested collections contain the specified element, the number of collections that contain it, the total count of the e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_element([[1, 2], [3, 4]], 5) == (False, 0, 0, 0)\", \"assert count_element([[1, 2], [1, 2]], 1) == (True, 2, 2, 1)\", \"assert count_element([1, 2, 3], 6) == (False, 0, 0, 0)\", \"assert count_element([{'a': 1}, {'b': 2}], 1) == (False, 0, 0, 0)\", \"a... | {
"split": "train",
"index": 78520,
"acecode_id": "evol_4818",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibonacci(n: int) -> int` that returns the nth Fibonacci number. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n-1) + F(n-2) for n > 1. Your function should handle cases where n is less than 0 by returning -1.\nPlease reaso... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2... | {
"split": "train",
"index": 78521,
"acecode_id": "evol_8286",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a dictionary of credentials based on provided input parameters. The function should take three parameters: a client_id (string), a consumer_secret (string), and a data dictionary (which contains the keys 'access_token', 'ex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert new_credentials('client123', 'secret456', {'access_token': 'token1', 'expires_in': 3600, 'token_type': 'Bearer', 'refresh_token': 'refresh1', 'userid': 1}) == {'access_token': 'token1', 'token_expiry': 1680003600, 'token_type': 'Bearer', 'refresh_token': 're... | {
"split": "train",
"index": 78522,
"acecode_id": "bigcode_python_fns_36693",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the setup of a colorbar axis for a plot based on specified parameters. The function should take the following parameters: `loc` (a string indicating the location of the colorbar), `width` (a float representing the width... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert setup_colorbar_axis('right', 0.05, 0.1, True, False, 'formatter', 'Colorbar Label') == {'loc': 'right', 'width': 0.05, 'pad': 0.1, 'minorticks_on': True, 'opposite_side_ticks': False, 'tick_formatter': 'formatter', 'label': 'Colorbar Label'}\", \"assert setu... | {
"split": "train",
"index": 78523,
"acecode_id": "oss_34925",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that logs a shutdown reason for a service and simulates the action of calling a shutdown-requesting program. The function should take two parameters: a string representing the path to the program, and a string representing the reason ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_shutdown('/usr/bin/shutdown_program', 'Maintenance required') == 'Shutting down service. Reason: Maintenance required. Called program: /usr/bin/shutdown_program'\", \"assert log_shutdown('/usr/local/bin/stop_service', 'Configuration error') == 'Shutting ... | {
"split": "train",
"index": 78524,
"acecode_id": "bigcode_python_fns_1749",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple counter. The function should accept three parameters: an initial value, an increment amount, and a decrement amount. The function should calculate the final value after applying the increment and decrement oper... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_counter(3, 5, 2) == 'value= 6'\", \"assert simulate_counter(0, 1, 1) == 'value= 0'\", \"assert simulate_counter(10, 2, 5) == 'value= 7'\", \"assert simulate_counter(5, 10, 3) == 'value= 12'\", \"assert simulate_counter(-1, 5, 1) == 'value= 3'\", \"a... | {
"split": "train",
"index": 78525,
"acecode_id": "oss_33088",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that determines if the list contains any duplicates. The function should return True if there are duplicates in the list, and False otherwise. Please implement the function `contains_duplicates(nums: List[in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contains_duplicates([1, 2, 3, 1]) == True\", \"assert contains_duplicates([1, 2, 3, 4]) == False\", \"assert contains_duplicates([5, 6, 7, 8, 5]) == True\", \"assert contains_duplicates([]) == False\", \"assert contains_duplicates([10]) == False\", \"assert ... | {
"split": "train",
"index": 78526,
"acecode_id": "bigcode_python_fns_34083",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `remove_empty_directory(path: str) -> bool` that takes a string `path` as input, which represents a directory path. The function should simulate the behavior of removing the directory if it exists and is empty. If the directory does n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_empty_directory('/empty_dir') == True\", \"assert remove_empty_directory('/non_empty_dir') == False\", \"assert remove_empty_directory('/non_existent_dir') == False\", \"assert remove_empty_directory('/yet_another_non_empty_dir') == False\", \"assert ... | {
"split": "train",
"index": 78527,
"acecode_id": "bigcode_python_fns_2221",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a string `doc_text` representing a document. Your task is to implement a function `split_into_sentences(doc_text: str) -> List[str]` that splits the document into its constituent sentences. Each sentence is defined as a sequence of characters ending with a period ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_into_sentences('Hello world. This is a test! Is it working?') == ['Hello world.', 'This is a test!', 'Is it working?']\", \"assert split_into_sentences('No punctuation here') == ['No punctuation here']\", \"assert split_into_sentences('') == []\", \"as... | {
"split": "train",
"index": 78528,
"acecode_id": "bigcode_python_fns_32014",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a request object, implement a function `get_site_id(request)` that returns the `param` attribute of the request if it exists. If the `param` attribute does not exist, return `None`. The request object is a dictionary that may or may not contain a key named 'param'.\nPleas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_site_id({'param': 'site_1'}) == 'site_1'\", \"assert get_site_id({'param': 'site_2'}) == 'site_2'\", \"assert get_site_id({'other_key': 'value'}) == None\", \"assert get_site_id({'param': None}) == None\", \"assert get_site_id({}) == None\", \"assert get... | {
"split": "train",
"index": 78529,
"acecode_id": "bigcode_python_fns_4172",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `calculate_skewness(data: List[int]) -> float` that calculates the skewness of the data. The skewness is a measure of the asymmetry of the probability distribution of a real-valued random variable. The formula for skewness can be defin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_skewness([1, 2, 3]) == 0.0\", \"assert calculate_skewness([1, 1, 1]) == 0.0\", \"assert calculate_skewness([1, 2, 3, 4, 5]) == 0.0\", \"assert calculate_skewness([1, 2, 3, 4, 10]) > 0.0\", \"assert calculate_skewness([10, 20, 30, 40, 50]) == 0.0\",... | {
"split": "train",
"index": 78530,
"acecode_id": "bigcode_python_fns_37019",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with sanitizing a given dictionary that contains a nested dictionary under the key 'tags'. Your goal is to implement a function `sanitize(target)`, which takes a dictionary `target` as input. The function should replace all occurrences of the substring 'pgpg' in ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sanitize({'tags': {'type': 'pgpg and pswp'}}) == {'tags': {'type': 'paging_ and swap_'}}\", \"assert sanitize({'tags': {'type': 'pgpg'}}) == {'tags': {'type': 'paging_'}}\", \"assert sanitize({'tags': {'type': 'pswp'}}) == {'tags': {'type': 'swap_'}}\", \"as... | {
"split": "train",
"index": 78531,
"acecode_id": "oss_10583",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers or floating point numbers representing deposits (positive values) and withdrawals (negative values) from a bank account, implement a function named 'below_zero' that determines if the account balance ever goes below zero. The function should take two ar... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert below_zero([5, 10, -7]) == False\", \"assert below_zero([-5]) == True\", \"assert below_zero([10, -2, -9]) == True\", \"assert below_zero([1.5, 2.5, -4.1], True) == True\", \"assert below_zero([100, -50, -100]) == True\", \"assert below_zero([10, -10]) == Fa... | {
"split": "train",
"index": 78532,
"acecode_id": "evol_12621",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `list1` and `list2`. Your task is to implement a function that merges these two lists into a single list, ensuring that the merged list is sorted in ascending order. The function should return this sorted merged list. If both lists are empty... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sorted_lists([], []) == []\", \"assert merge_sorted_lists([1, 3, 5], []) == [1, 3, 5]\", \"assert merge_sorted_lists([], [2, 4, 6]) == [2, 4, 6]\", \"assert merge_sorted_lists([1, 2, 3], [4, 5, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_sorted_lists([... | {
"split": "train",
"index": 78533,
"acecode_id": "oss_245",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates logging messages at different levels (DEBUG, INFO, WARNING, ERROR). The function should accept a list of tuples, where each tuple contains a string message and a log level. Your function should return a string that represen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert capture_logs([('Task started', 'DEBUG'), ('User logged in', 'INFO'), ('Disk space low', 'WARNING'), ('Critical error occurred', 'ERROR')]) == 'DEBUG: Task started\\\\nINFO: User logged in\\\\nWARNING: Disk space low\\\\nERROR: Critical error occurred'\", \"a... | {
"split": "train",
"index": 78534,
"acecode_id": "bigcode_python_fns_35142",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `insert_element_after` that takes a linked list, a value to insert, and a target value. The function should insert the new value immediately after the first occurrence of the target value in the linked list. If the target value is not found, do nothing. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert_element_after([], 5, 3) == []\", \"assert insert_element_after([1, 2, 3], 4, 2) == [1, 2, 4, 3]\", \"assert insert_element_after([1, 2, 3], 0, 5) == [1, 2, 3]\", \"assert insert_element_after([5, 6, 7], 8, 6) == [5, 6, 8, 7]\", \"assert insert_element... | {
"split": "train",
"index": 78535,
"acecode_id": "evol_28349",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and converts the first letter of each word to uppercase. Any letters that are not in the first position of the word should be converted to lowercase. The function should correctly handle special characters and numbers, which sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert title_case('hello world') == 'Hello World'\", \"assert title_case('hi there! how are YOU?') == 'Hi There! How Are You?'\", \"assert title_case('123abc testing') == '123abc Testing'\", \"assert title_case('a b c') == 'A B C'\", \"assert title_case('') == ''\"... | {
"split": "train",
"index": 78536,
"acecode_id": "evol_31708",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a data model for a document management system. Define a function `create_document_model(title: str, content: str, attachment_id: int, table_id: int) -> dict` that constructs a document model with the following fields: `title`, `content`, `attachment... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_document_model('Sample Title', 'Sample Content', 1, 1) == {'title': 'Sample Title', 'content': 'Sample Content', 'attachment_id': 1, 'table_id': 1}\", \"assert create_document_model('Document 1', 'Content of document 1', 2, 3) == {'title': 'Document 1... | {
"split": "train",
"index": 78537,
"acecode_id": "oss_7520",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a string, write a function that checks if it is a palindrome. If it is not a palindrome, return the minimum number of alphanumeric characters that need to be added to the end of the string to make it a palindrome. The characters added should be the minimum necessary to ac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_palindrome('a') == 0\", \"assert make_palindrome('racecar') == 0\", \"assert make_palindrome('abc') == 2\", \"assert make_palindrome('madam') == 0\", \"assert make_palindrome('Python') == 5\", \"assert make_palindrome('') == 0\", \"assert make_palindrom... | {
"split": "train",
"index": 78538,
"acecode_id": "evol_30410",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that calculates the average of a list of numbers. The function should take a list of numbers as input and return the average of those numbers. If the list is empty, the function should return 0.0. Note that you can assume that all the num... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average([1, 2, 3, 4, 5]) == 3.0\", \"assert calculate_average([-1, -2, -3, -4, -5]) == -3.0\", \"assert calculate_average([0, 0, 0, 0]) == 0.0\", \"assert calculate_average([10]) == 10.0\", \"assert calculate_average([]) == 0.0\", \"assert calculat... | {
"split": "train",
"index": 78539,
"acecode_id": "oss_15847",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines whether a given string variable, `input_string`, represents a truthy value for the environment variable `NO_COLOR`. The function should return `True` if `input_string` is any of the following values: '1', 'true', 't', ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_no_color('1') == True\", \"assert check_no_color('true') == True\", \"assert check_no_color('t') == True\", \"assert check_no_color('y') == True\", \"assert check_no_color('yes') == True\", \"assert check_no_color('False') == False\", \"assert check_no... | {
"split": "train",
"index": 78540,
"acecode_id": "oss_32450",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates the uniqueness of a topic's name and URL fragment when creating a new topic. Write a function `validate_new_topic(committer_id: str, topic_name: str, url_fragment: str, existing_topics: List[Tuple[str, str]]) -> None` that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_new_topic('committer_1', 'Unique Topic', 'unique-url', []) is None\", \"assert validate_new_topic('committer_1', 'Distinct Topic', 'distinct-url', [('Topic A', 'url-a'), ('Topic B', 'url-b')]) is None\", \"assert validate_new_topic('committer_1', 'N... | {
"split": "train",
"index": 78541,
"acecode_id": "bigcode_python_fns_11355",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the movement of a bullet in a 2D game. The bullet's position is defined by its coordinates (bulletX, bulletY). Your function should move the bullet upwards and to the right on the screen by updating its coordinates. Spe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bulletMovement(0, 0) == (1, -1)\", \"assert bulletMovement(5, 10) == (6, 9)\", \"assert bulletMovement(2, 3) == (3, 2)\", \"assert bulletMovement(-1, -1) == (0, -2)\", \"assert bulletMovement(10, 10) == (11, 9)\", \"assert bulletMovement(100, 200) == (101, 1... | {
"split": "train",
"index": 78542,
"acecode_id": "oss_14988",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes two strings as input: an input filename and an output filename. The function should return a dictionary containing these filenames with the keys 'infile' and 'outfile' respectively. The filenames should be stored as values ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_file_names('input.txt', 'output.txt') == {'infile': 'input.txt', 'outfile': 'output.txt'}\", \"assert set_file_names('data.csv', 'results.csv') == {'infile': 'data.csv', 'outfile': 'results.csv'}\", \"assert set_file_names('image.png', 'new_image.png') =... | {
"split": "train",
"index": 78543,
"acecode_id": "oss_13103",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function to parse and process log messages from a geospatial data processing application. The log messages are formatted using color codes and contain information about inserting layers into a schema, executing SQL commands, and performing ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_log_messages(['- inserting \\\\x1b[35mlayer_name\\\\x1b[39m into \\\\x1b[34mschema_name\\\\x1b[39m as \\\\x1b[36mgeometry_type\\\\x1b[39m']) == {'insertions': ['inserting layer_name into schema_name as geometry_type'], 'sql_commands': [], 'geospatial_o... | {
"split": "train",
"index": 78544,
"acecode_id": "oss_333",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Implement a function `insert_bst(root: Optional[Node], key: int) -> Node` that inserts a new key into a Binary Search Tree (BST). If the tree is empty, the new key should become the root of the tree. The function should return the root of the tree after insertion. The `Node` cl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert_bst(Node(5), 3).left.val == 3\", \"assert insert_bst(Node(5), 7).right.val == 7\", \"assert insert_bst(Node(5), 5).val == 5\", \"assert insert_bst(insert_bst(Node(5), 3), 4).left.right.val == 4\", \"assert insert_bst(insert_bst(Node(5), 7), 6).right.l... | {
"split": "train",
"index": 78545,
"acecode_id": "evol_17139",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to analyze timestamped data from a system that collects values and timeouts. The function should accept two dictionaries: one containing timestamped values and another containing timestamped timeouts. The function should perform the f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze({'ts1': 10, 'ts2': 20}, {'ts2': 25, 'ts3': 30}) == {'missing_values_timeouts': ['ts1'], 'missing_timeouts_values': ['ts3'], 'time_difference': {'ts2': 5}}\", \"assert analyze({'ts1': 5}, {'ts1': 10}) == {'missing_values_timeouts': [], 'missing_timeou... | {
"split": "train",
"index": 78546,
"acecode_id": "oss_7732",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of event dictionaries, where each event contains details about a user's actions. Each event has the following keys: `uid` (string), `state` (string), `time` (timestamp), and `event` (string). Your task is to implement a function `clean_profile(profile: List... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert clean_profile([{'uid': 'user1', 'state': 'active', 'time': 1, 'event': 'advance'}, {'uid': 'user1', 'state': 'CANCELLED', 'time': 2, 'event': 'advance'}, {'uid': 'user1', 'state': 'inactive', 'time': 3, 'event': 'advance'}], 'session1', ['active', 'inactive'... | {
"split": "train",
"index": 78547,
"acecode_id": "bigcode_python_fns_13986",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary represents metadata of a site. Each dictionary contains the following keys: 'node_name_long', 'id', 'lat', 'lng', 'height_above_ground', 'height_above_sea', 'deployed', and 'node_folder_id'. Your task is to implement a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_metadata([{'node_name_long': 'Site A', 'id': 1, 'lat': 34.123456, 'lng': -118.123456, 'height_above_ground': float('nan'), 'height_above_sea': 100.0, 'deployed': '2021-01-01', 'node_folder_id': 10}]) == {'sitea': {'long_name': 'Site A', 'id': 1, 'latit... | {
"split": "train",
"index": 78548,
"acecode_id": "bigcode_python_fns_98",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents the contents of a file. Your task is to implement a function that reads the content of the string in chunks and returns the concatenated result. Additionally, you need to track the reading progress using a progress indicator. Implement a f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert read_content('Hello, world!', 5) == 'Hello, world!'\", \"assert read_content('This is a test.', 4) == 'This is a test.'\", \"assert read_content('Python is fun!', 6) == 'Python is fun!'\", \"assert read_content('Data structures and algorithms.', 10) == 'Data... | {
"split": "train",
"index": 78549,
"acecode_id": "oss_34783",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of product IDs, implement a function that returns a list of names of products that were successfully deleted. A product can only be deleted if its ID exists. The function should take a list of product IDs as input, and simulate the deletion of these products from a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_products(['1', '2', '6']) == ['Apple', 'Banana']\", \"assert delete_products(['3', '4']) == ['Cherry', 'Date']\", \"assert delete_products(['5', '6', '7']) == ['Elderberry']\", \"assert delete_products(['1', '3', '5']) == ['Apple', 'Cherry', 'Elderber... | {
"split": "train",
"index": 78550,
"acecode_id": "bigcode_python_fns_6147",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given technology name is valid and if a development module uses PHP. A valid technology name is a non-empty string that contains only alphabetic characters. A development module is valid if it has a non-empty name and the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_technology_and_module('Python', 'WebModule', False) == True\", \"assert is_valid_technology_and_module('Java', 'API', True) == True\", \"assert is_valid_technology_and_module('', 'Module', False) == False\", \"assert is_valid_technology_and_module('... | {
"split": "train",
"index": 78551,
"acecode_id": "oss_35824",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function to sort it in descending order without using the built-in sort function. The list may contain both positive and negative numbers. You should return a new list that contains the sorted integers.\nPlease reason step by step, then wri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([2, -7, 3, 4, -9, 1]) == [4, 3, 2, 1, -7, -9]\", \"assert bubble_sort([10, 5, 0, -1, -5]) == [10, 5, 0, -1, -5]\", \"assert bubble_sort([1, 2, 3]) == [3, 2, 1]\", \"assert bubble_sort([-1, -2, -3]) == [-1, -2, -3]\", \"assert bubble_sort([0]) == ... | {
"split": "train",
"index": 78552,
"acecode_id": "evol_21316",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the process of taking off a drone to a specified altitude. The function `simulate_takeoff(target_altitude, initial_altitude)` takes two parameters: an integer `target_altitude` representing the desired altitude in meter... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_takeoff(100, 50) == 'Taking off to target altitude of 100 meters'\", \"assert simulate_takeoff(100, 100) == 'Already at or above target altitude of 100 meters'\", \"assert simulate_takeoff(200, 150) == 'Taking off to target altitude of 200 meters'\"... | {
"split": "train",
"index": 78553,
"acecode_id": "bigcode_python_fns_6635",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that filters out all numbers that are greater than a specified threshold. Your function should take two parameters: a list of integers `numbers` and an integer `threshold`. The function should return a new list containing only the elem... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_numbers([1, 5, 3, 7], 4) == [1, 3]\", \"assert filter_numbers([-1, 0, 1, 2], 0) == [-1, 0]\", \"assert filter_numbers([5, 5, 5, 5], 5) == [5, 5, 5, 5]\", \"assert filter_numbers([], 5) == []\", \"assert filter_numbers([100, 200, 300], 150) == [100]\",... | {
"split": "train",
"index": 78554,
"acecode_id": "bigcode_python_fns_23442",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function named `bubble_sort` that takes a list of integers, which may include duplicates and negative numbers, and returns a new list that contains the same integers sorted in non-decreasing order using the Bubble Sort algorithm. The function should handle large arr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([3, 5, -1, 0, 9, 3, -2]) == [-2, -1, 0, 3, 3, 5, 9]\", \"assert bubble_sort([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert bubble_sort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert bubble_sort([2, 3, 2, 1, 3, 1]) == [1, 1, 2, 2, 3, 3]\", \"ass... | {
"split": "train",
"index": 78555,
"acecode_id": "evol_30084",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the batting averages of players in a baseball team for a specific season. Your task is to categorize each player into two groups based on their batting average: 'high' for averages greater than or equal to the average of the top 50%... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert categorize_batting_averages([300, 250, 275, 325, 400]) == {'high': [300, 325, 400], 'low': [250, 275]}\", \"assert categorize_batting_averages([200, 300, 400, 250, 350]) == {'high': [300, 400, 350], 'low': [200, 250]}\", \"assert categorize_batting_averages(... | {
"split": "train",
"index": 78556,
"acecode_id": "bigcode_python_fns_20976",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a 4D array that represents a grid of data in the form of (time, pressure, y, x), write a function that calculates the vorticity at each point in the grid using the provided horizontal velocity components 'u' and 'v', and the grid spacing 'dx' and 'dy'. The vorticity can b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_vorticity([[[[1.0, 2.0], [3.0, 4.0]]]], [[[[5.0, 6.0], [7.0, 8.0]]]], 0.1, 0.1) == [[[[0.0, 0.0], [0.0, 0.0]]]]\", \"assert calculate_vorticity([[[[1.0, 2.0], [3.0, 4.0]]]], [[[[1.0, 1.0], [1.0, 1.0]]]], 0.1, 0.1) == [[[[0.0, 0.0], [0.0, 0.0]]]]\",... | {
"split": "train",
"index": 78557,
"acecode_id": "bigcode_python_fns_43462",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `calculate_softmax(scores: List[int]) -> List[float]` that computes the softmax probabilities of the given scores. The softmax function is defined as follows: for a given score `s_i`, the softmax probability is calculated using the for... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_softmax([0, 0, 0]) == [0.3333333333333333, 0.3333333333333333, 0.3333333333333333]\", \"assert calculate_softmax([4, 4, 4, 4]) == [0.25, 0.25, 0.25, 0.25]\", \"assert calculate_softmax([5]) == [1.0]\", \"assert calculate_softmax([2, 2]) == [0.5, 0.... | {
"split": "train",
"index": 78558,
"acecode_id": "bigcode_python_fns_36652",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a given list of sequences and returns a modified list based on certain criteria. Each sequence is represented as a list of integers. The function should perform the following operations on each sequence: \n\n1. If the l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_sequences([[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]], {'early_stop': 5, 'max_seq_len': 10}) == [[1, 2, 3, 4]]\", \"assert process_sequences([[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]], {'early_stop': 11, 'max_seq_len': 5}) == [[1, 2, 3, 4, 5]]\", \"assert process_seque... | {
"split": "train",
"index": 78559,
"acecode_id": "oss_35939",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `division_properties(*nums)` that takes a variable number of positive integers and returns a dictionary. For each integer, the dictionary should include the following properties: a boolean indicating if the number of its divisors is even, a list of its divi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert division_properties(6) == {6: (True, [1, 2, 3, 6], 12, 3, 6, 1)}\", \"assert division_properties(28) == {28: (True, [1, 2, 4, 7, 14, 28], 56, 7, 28, 1)}\", \"assert division_properties(1) == {1: (False, [1], 1, None, 1, 1)}\", \"assert division_properties(12... | {
"split": "train",
"index": 78560,
"acecode_id": "evol_8193",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a string `package_name`, implement a function that checks if the string is a valid package name according to the following rules: A valid package name must start with a letter (a-z, A-Z) or an underscore (_), and can only contain letters, digits (0-9), and underscores. If... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_package_name('this_is_a_good_package_name') == True\", \"assert validate_package_name('valid_package_123') == True\", \"assert validate_package_name('_valid123') == True\", \"assert validate_package_name('anotherValidName') == True\", \"assert valid... | {
"split": "train",
"index": 78561,
"acecode_id": "bigcode_python_fns_28880",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a file name in a directory. You need to implement a function that searches for all annotations in the files that match a given regular expression. The function should return a list of matching annotations. You will i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert grep_annotations(['file1.py', 'file2.py'], 'nonexistent', 'code') == []\", \"assert grep_annotations(['empty_file.py'], 'something', 'code') == []\", \"assert grep_annotations(['mixed_file.py'], 'data', 'tests') == []\", \"assert grep_annotations([], 'def', ... | {
"split": "train",
"index": 78562,
"acecode_id": "bigcode_python_fns_46400",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples where each tuple represents a point in a 2D space (x, y). Your task is to compute the covariance matrix for these points. The covariance matrix is a 2x2 matrix that measures the directional relationship between the points. Implement a function `co... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_covariance_matrix([(1, 1), (1, 1), (1, 1)]) == [[0.0, 0.0], [0.0, 0.0]]\", \"assert compute_covariance_matrix([(10, 20), (30, 40)]) == [[100.0, 100.0], [100.0, 100.0]]\", \"assert compute_covariance_matrix([(0, 0), (0, 0)]) == [[0.0, 0.0], [0.0, 0.0]... | {
"split": "train",
"index": 78563,
"acecode_id": "bigcode_python_fns_28983",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Given a search query string, implement a function `query_search(query: str) -> List[str]` that returns a list of the top 20 search results for the given query. The function should simulate the search process and return a fixed list of dummy results for testing purposes. Each re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert query_search('Python programming') == ['Result 1 for Python programming', 'Result 2 for Python programming', 'Result 3 for Python programming', 'Result 4 for Python programming', 'Result 5 for Python programming', 'Result 6 for Python programming', 'Result 7... | {
"split": "train",
"index": 78564,
"acecode_id": "evol_1281",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a two-dimensional matrix of integers and a target integer, implement a function that returns a list of tuples, each containing the row and column indices of all instances where the target is found in the matrix. If the target does not exist in the matrix, return an empty ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_target([[1, 2, 3], [4, 5, 6]], 5) == [(1, 1)]\", \"assert find_target([[1, 2, 3], [4, 5, 6]], 10) == []\", \"assert find_target([[1, 1, 1], [1, 1, 1]], 1) == [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2)]\", \"assert find_target([[0, 0, 0], [0, 0, 0]]... | {
"split": "train",
"index": 78565,
"acecode_id": "evol_4853",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_primes(n)` that takes an integer n as input and returns a list of all prime numbers from 1 to n (inclusive). A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Your functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_primes(1) == []\", \"assert generate_primes(2) == [2]\", \"assert generate_primes(3) == [2, 3]\", \"assert generate_primes(4) == [2, 3]\", \"assert generate_primes(5) == [2, 3, 5]\", \"assert generate_primes(10) == [2, 3, 5, 7]\", \"assert generate_... | {
"split": "train",
"index": 78566,
"acecode_id": "evol_12148",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a URL routing system for a web application. Your goal is to create a function that takes a URL path and a list of URL patterns, each associated with a corresponding view function. Write a function `get_view_function(url_path, url_patterns)` that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_view_function('home/', [('home/', 'views.home'), ('about/', 'views.about')]) == 'views.home'\", \"assert get_view_function('about/', [('home/', 'views.home'), ('about/', 'views.about')]) == 'views.about'\", \"assert get_view_function('contact/', [('home/... | {
"split": "train",
"index": 78567,
"acecode_id": "oss_22666",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given two lists of 3D coordinates, `initial_positions` and `trajectory_target_positions`, each represented as a list of lists where each inner list contains three integers (representing the x, y, and z coordinates of a particle), write a function `get_average_distances(initial_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_average_distances([[0, 0, 0], [3, 4, 0]], [[[3, 0, 0], [0, 4, 0]]]) == [3.0, 3.0]\", \"assert get_average_distances([[0, 0, 0], [0, 0, 0]], [[[0, 0, 0], [0, 0, 0]]]) == [0.0, 0.0]\", \"assert get_average_distances([[1, 2, 3], [4, 5, 6]], [[[1, 2, 3], [4,... | {
"split": "train",
"index": 78568,
"acecode_id": "bigcode_python_fns_47967",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a vending machine that can consume items using different methods. Your task is to implement a function `consume_item(consume_less: str, item: str) -> str` that takes in two parameters: `consume_less`, which can either be 'gpu' or 'other', and `ite... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert consume_item('gpu', 'soda') == 'Consuming soda using GPU'\", \"assert consume_item('other', 'chips') == 'Consuming chips using alternative method'\", \"assert consume_item('gpu', 'water') == 'Consuming water using GPU'\", \"assert consume_item('other', 'cand... | {
"split": "train",
"index": 78569,
"acecode_id": "oss_20345",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple server configuration function. Write a function `make_simple_server` that takes the following parameters: `service`, `handler`, `host`, and `port`. The function should ensure that if both `host` and `port` are provided, it returns a diction... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert make_simple_server('MyService', 'MyHandler') == {'service': 'MyService', 'handler': 'MyHandler', 'host': 'localhost', 'port': 9090}\", \"assert make_simple_server('MyService', 'MyHandler', '0.0.0.0', 8080) == {'service': 'MyService', 'handler': 'MyHandler', ... | {
"split": "train",
"index": 78570,
"acecode_id": "bigcode_python_fns_23774",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a logging system for a Python application. The application requires a logging configuration that can handle different log levels and output to both the console and a file. Your task is to create a function called `setup_logging(config: dict) -> ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert setup_logging({ 'version': 1, 'formatters': { 'verbose': { 'format': '%(asctime)s - %(name)s - %(levelname)s - %(message)s' } }, 'handlers': { 'console': { 'class': 'logging.StreamHandler', 'formatter': 'verbose' } }, 'loggers': { 'test_logger': { 'handlers'... | {
"split": "train",
"index": 78571,
"acecode_id": "oss_12688",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that takes this list and returns a new list containing only the unique integers from the original list, in the order they first appeared. Implement the function `unique_integers(arr: List[int]) -> List[int]`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_integers([5, 5, 5, 5]) == [5]\", \"assert unique_integers([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert unique_integers([]) == []\", \"assert unique_integers([10, 20, 10, 30, 20]) ==... | {
"split": "train",
"index": 78572,
"acecode_id": "bigcode_python_fns_4532",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the combined variance of multiple numerical arrays. Your function should take a list of numerical arrays as input and return the combined variance calculated using the formula: combined_variance = (1 / n) * sum(variance of each array), where n is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_combined_variance([[1], [1], [1]]) == 0.0\", \"assert calculate_combined_variance([[1, 1, 1], [2, 2, 2], [3, 3, 3]]) == 0.0\", \"assert calculate_combined_variance([[1, 2], [2, 3]]) == 0.25\", \"assert calculate_combined_variance([[0, 0, 0], [0, 0,... | {
"split": "train",
"index": 78573,
"acecode_id": "oss_1079",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Write a function that identifies the most frequent letter in a given string, ignoring whitespace and treating uppercase and lowercase letters as the same. The function should return a tuple containing the most frequent letter and its frequency. If there are multiple letters wit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert most_frequent_letter('Hello World!') == ('l', 3)\", \"assert most_frequent_letter('aabbcc') == ('a', 2)\", \"assert most_frequent_letter('abcABC') == ('a', 2)\", \"assert most_frequent_letter(' ') == ()\", \"assert most_frequent_letter('Mississippi') == ('i... | {
"split": "train",
"index": 78574,
"acecode_id": "evol_27683",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes two inputs: a string representing a field name and a dictionary containing field metadata. The metadata dictionary will contain a key 'type' that indicates the type of field to be created. Your function should return a stri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_field('name', {'type': 'string'}) == 'StringField'\", \"assert create_field('name', {'type': 'boolean'}) == 'BooleanField'\", \"assert create_field('name', {'type': 'short'}) == 'ShortField'\", \"assert create_field('name', {'type': 'integer'}) == 'In... | {
"split": "train",
"index": 78575,
"acecode_id": "bigcode_python_fns_34822",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a game called \"Bulls and Cows.\" In this game, the computer generates a random 4-digit number, and the player tries to guess the number. For each guess, the computer provides feedback in the form of \"bulls\" and \"cows.\" A \"bull\" indicates ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bulls_and_cows(\\\"5678\\\", \\\"5678\\\") == [0, 4]\", \"assert bulls_and_cows(\\\"0000\\\", \\\"0000\\\") == [0, 4]\", \"assert bulls_and_cows(\\\"1234\\\", \\\"5678\\\") == [0, 0]\", \"assert bulls_and_cows(\\\"1234\\\", \\\"1243\\\") == [2, 2]\", \"asser... | {
"split": "train",
"index": 78576,
"acecode_id": "oss_29470",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves the version of a database from two possible methods. Given a string `last_version`, the function should first try to get the version using the `_get_gxy_alembic_db_version` method. If that method returns None, it should the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_database_version('alembic_version') == 'alembic_version'\", \"assert get_database_version('wrong_version') == 'alembic_version'\", \"assert get_database_version('alembic_version') == 'alembic_version'\", \"assert get_database_version('alembic_version') =... | {
"split": "train",
"index": 78577,
"acecode_id": "oss_10197",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the unique elements from the input list in the order they first appeared. Your function should remove any duplicate values while preserving the order of the first oc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 3, 2, 1]) == [1, 2, 3]\", \"assert remove_duplicates([4, 5, 6, 5, 4, 4]) == [4, 5, 6]\", \"assert remove_duplicates([10, 20, 10, 30, 20]) == [10, 20, 30]\", \"assert remove_duplicates([]) == []\", \"assert remove_duplicates([1, 1, 1,... | {
"split": "train",
"index": 78578,
"acecode_id": "oss_583",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `hyperbolic_tangent(x: float) -> float` that calculates the hyperbolic tangent of a given real number x. The hyperbolic tangent of x is defined as `tanh(x) = sinh(x) / cosh(x)`, where `sinh(x)` is the hyperbolic sine and `cosh(x)` is the hyperbolic cosine. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert hyperbolic_tangent(0) == 0.0\", \"assert hyperbolic_tangent(1) == 0.761594\", \"assert hyperbolic_tangent(-1) == -0.761594\", \"assert hyperbolic_tangent(2) == 0.964028\", \"assert hyperbolic_tangent(-2) == -0.964028\", \"assert hyperbolic_tangent(100) == 1.... | {
"split": "train",
"index": 78579,
"acecode_id": "bigcode_python_fns_16830",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents a serialized engine. Your task is to implement a function that checks if the serialized engine string is valid. A serialized engine is considered valid if it starts with 'ENG_' and ends with '_END'. Implement the function `is_valid_engine(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_engine('ENG_12345_END') == True\", \"assert is_valid_engine('ENG_ABC_END') == True\", \"assert is_valid_engine('ENG_12345') == False\", \"assert is_valid_engine('12345_END') == False\", \"assert is_valid_engine('ENG_12345_END_EXTRA') == False\", \"a... | {
"split": "train",
"index": 78580,
"acecode_id": "bigcode_python_fns_17618",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function `mystery_function` that returns the integer value 1. The function should not take any parameters and should return the value directly. Your goal is to implement the function correctly so that it adheres to this requirement.\nPlease reason ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mystery_function() == 1\", \"assert mystery_function() == 1\", \"assert mystery_function() == 1\", \"assert mystery_function() == 1\", \"assert mystery_function() == 1\", \"assert mystery_function() == 1\", \"assert mystery_function() == 1\", \"assert myster... | {
"split": "train",
"index": 78581,
"acecode_id": "oss_8051",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, A and B, write a function `merge_collections(A, B)` that merges the two lists, removes any duplicate integers, and returns a new list containing the unique integers sorted in ascending order. The input lists will always contain at least one integer.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_collections([2, 4, 5, 6], [1, 2, 3, 4]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_collections([1, 2, 3], [4, 5, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_collections([1, 1, 1], [2, 2, 2]) == [1, 2]\", \"assert merge_collections([7, 8, 9], [1, 2, 3]) ==... | {
"split": "train",
"index": 78582,
"acecode_id": "evol_4859",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, create a function that takes the list as input and returns two lists: the first list should contain all elements except the last one, and the second list should contain all elements except the first one, each element appearing at the same index as the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_batches([1, 2, 3, 4, 5]) == ([1, 2, 3, 4], [2, 3, 4, 5])\", \"assert get_batches([10, 20]) == ([10], [20])\", \"assert get_batches([1]) == ([], [])\", \"assert get_batches([]) == ([], [])\", \"assert get_batches([5, 3, 2, 8]) == ([5, 3, 2], [3, 2, 8])\",... | {
"split": "train",
"index": 78583,
"acecode_id": "bigcode_python_fns_1073",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates saving data in a compressed format. The function should take a filename (string) and a list of data points (list of integers) as input, and return a dictionary where the keys are the data points and the values are the l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compress_data('data1.npz', [1, 2, 3]) == {1: 1, 2: 1, 3: 1}\", \"assert compress_data('data2.npz', [10, 20, 30]) == {10: 2, 20: 2, 30: 2}\", \"assert compress_data('data3.npz', [100, 200, 300]) == {100: 3, 200: 3, 300: 3}\", \"assert compress_data('data4.npz... | {
"split": "train",
"index": 78584,
"acecode_id": "bigcode_python_fns_36534",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if a given date is valid for a specific pipeline. A date is considered valid if it does not fall on a weekend (Saturday or Sunday) and is in the future compared to the current date. Your function should take two parameters: a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_date('2023-10-16', 'pipeline1') == True\", \"assert is_valid_date('2023-10-14', 'pipeline1') == False\", \"assert is_valid_date('2023-10-15', 'pipeline1') == False\", \"assert is_valid_date('2023-10-20', 'pipeline1') == True\", \"assert is_valid_dat... | {
"split": "train",
"index": 78585,
"acecode_id": "bigcode_python_fns_21763",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that removes consecutive duplicate characters from a given string. The function should take a string as input and return a new string with the consecutive duplicate characters eliminated. For example, the input 'aaabbbccc' should return 'abc'.\nPlease reaso... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_repeated_characters('Thiiiis iss a strinng wiiiith maaaany repeeeated chaaaracters') == 'This is a string with many repeated characters'\", \"assert remove_repeated_characters('aaaa') == 'a'\", \"assert remove_repeated_characters('abc') == 'abc'\", \"... | {
"split": "train",
"index": 78586,
"acecode_id": "evol_14438",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `available_steps()` that returns the number of steps available in a capacitor bank that can be switched ON. The function does not take any parameters and returns an integer value representing the available steps. Your implementation s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert available_steps() == 10\", \"assert available_steps() == 10\", \"assert available_steps() == 10\", \"assert available_steps() == 10\", \"assert available_steps() == 10\", \"assert available_steps() == 10\", \"assert available_steps() == 10\", \"assert availa... | {
"split": "train",
"index": 78587,
"acecode_id": "bigcode_python_fns_30952",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that calculates the bounds of a given area based on the input parameters. The function should take four arguments: `width`, `height`, `margin`, and `action_metadata`. The `width` and `height` represent the dimensions of the are... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bounds(800, 600, 2, ActionMetaData.NoMetaData) == (0, 798, 598)\", \"assert bounds(1000, 1000, 100, ActionMetaData.NoMetaData) == (0, 900, 900)\", \"assert bounds(500, 500, 50, ActionMetaData.NoMetaData) == (0, 450, 450)\", \"assert bounds(0, 0, 0, ActionMet... | {
"split": "train",
"index": 78588,
"acecode_id": "oss_19730",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a frame number and a timecodes specification. Your task is to write a function `get_timestamp(frame_number: int, timecodes: Tuple[Union[List[float], Tuple[int, int]], str]) -> int` that returns the corresponding timestamp in nanoseconds. The function takes two par... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_timestamp(0, ([0.0, 0.033, 0.066], 'vfr')) == 0\", \"assert get_timestamp(1, ([0.0, 0.033, 0.066], 'vfr')) == 33000000\", \"assert get_timestamp(2, ([0.0, 0.033, 0.066], 'vfr')) == 66000000\", \"assert get_timestamp(0, ((24, 1), 'cfr')) == 0\", \"assert ... | {
"split": "train",
"index": 78589,
"acecode_id": "bigcode_python_fns_9489",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string message and returns the message reversed. The function should ignore any non-alphabetic characters and preserve the order of the alphabetic characters. For example, if the input message is 'Hello, World!', the output s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_message('Hello, World!') == 'dlroWolleH'\", \"assert reverse_message('Python 3.9!') == 'nohtyP'\", \"assert reverse_message('12345') == ''\", \"assert reverse_message('') == ''\", \"assert reverse_message('Racecar') == 'racecaR'\", \"assert reverse_m... | {
"split": "train",
"index": 78590,
"acecode_id": "bigcode_python_fns_3849",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a stack data structure that supports the following operations: 1. `push(val)`: Add an element `val` to the top of the stack. 2. `pop()`: Remove the element at the top of the stack and return its value. 3. `maximum()`: Return the maximum value in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_stack_operations([('push', 1), ('push', 2), ('push', 3), ('maximum', None), ('pop', None), ('maximum', None)]) == [3, 2]\", \"assert max_stack_operations([('push', 10), ('push', 20), ('push', 10), ('maximum', None), ('pop', None), ('maximum', None)]) == ... | {
"split": "train",
"index": 78591,
"acecode_id": "oss_4994",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a simple report from a list of organisms and their corresponding scores. The function should take a list of tuples, where each tuple contains the name of the organism (a string) and its score (an integer). Your goal is to r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert top_organisms([('A', 10), ('B', 20), ('C', 15)]) == ['B', 'C', 'A']\", \"assert top_organisms([('A', 5), ('B', 5), ('C', 5)]) == ['A', 'B', 'C']\", \"assert top_organisms([('A', 100), ('B', 200), ('C', 150), ('D', 200)]) == ['B', 'D', 'C']\", \"assert top_or... | {
"split": "train",
"index": 78592,
"acecode_id": "bigcode_python_fns_47160",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes two markers for a swarm visualization in a 3D space. The first marker should represent a green sphere located at the origin (0, 0, 0) and the second marker should represent a green arrow also located at the origin. The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert init_swarm_markers()[0]['type'] == 2\", \"assert init_swarm_markers()[1]['type'] == 0\", \"assert init_swarm_markers()[0]['id'] == 2\", \"assert init_swarm_markers()[1]['id'] == 3\", \"assert init_swarm_markers()[0]['color']['g'] == 1\", \"assert init_swarm_... | {
"split": "train",
"index": 78593,
"acecode_id": "bigcode_python_fns_40730",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates unlocking a file. The function should take an integer representing a file descriptor (fd) and return a tuple. The first element of the tuple should be a boolean indicating whether the unlocking was successful or not. Th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unlock_file(0) == (True, 0)\", \"assert unlock_file(2) == (True, 0)\", \"assert unlock_file(4) == (True, 0)\", \"assert unlock_file(6) == (True, 0)\", \"assert unlock_file(8) == (True, 0)\", \"assert unlock_file(10) == (True, 0)\", \"assert unlock_file(1) ==... | {
"split": "train",
"index": 78594,
"acecode_id": "bigcode_python_fns_29483",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_perfect_square_of_two_primes(b)` that returns True if and only if the input number `b` is a perfect square of the product of two distinct prime numbers, otherwise, it should return False. The input parameter `b` will be in the range of 1 to 500. For exa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_perfect_square_of_two_primes(1) == False\", \"assert is_perfect_square_of_two_primes(4) == False\", \"assert is_perfect_square_of_two_primes(9) == False\", \"assert is_perfect_square_of_two_primes(25) == False\", \"assert is_perfect_square_of_two_primes(4... | {
"split": "train",
"index": 78595,
"acecode_id": "evol_22334",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that converts a given object to its ISO 8601 format representation. The function should first check if the object has an `isoformat` method, and if so, use it to return the ISO 8601 representation. If the object does not have a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_iso8601(datetime.datetime(2022, 12, 31, 12, 30)) == '2022-12-31T12:30:00'\", \"assert to_iso8601(datetime.date(2022, 12, 31)) == '2022-12-31'\", \"assert to_iso8601(datetime.time(12, 30)) == '12:30:00'\", \"assert to_iso8601(123) == '123'\", \"assert to_i... | {
"split": "train",
"index": 78596,
"acecode_id": "oss_2834",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary where each key is a string representing a configuration option, and each value is a tuple of possible values for that configuration, write a function `generate_combinations(configs: Dict[str, Tuple[int]]) -> List[Dict[str, int]]` that generates all possible c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_combinations({'X': (1,), 'Y': (2,)}) == [{'X': 1, 'Y': 2}]\", \"assert generate_combinations({'A': (1, 2, 3)}) == [{'A': 1}, {'A': 2}, {'A': 3}]\", \"assert generate_combinations({'OnlyKey': (100,)}) == [{'OnlyKey': 100}]\", \"assert generate_combin... | {
"split": "train",
"index": 78597,
"acecode_id": "bigcode_python_fns_45477",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of student names along with their corresponding scores. Your task is to write a function that accepts this list of strings, where each string contains a student's name followed by a space and their score. The function should calculate the average score for ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average(['Alice 85', 'Bob 90', 'Cathy 78', 'David 92']) == ['Alice 85.0', 'Bob 90.0', 'Cathy 78.0', 'David 92.0']\", \"assert calculate_average(['John 95', 'Jane 88', 'Doe 76']) == ['John 95.0', 'Jane 88.0', 'Doe 76.0']\", \"assert calculate_averag... | {
"split": "train",
"index": 78598,
"acecode_id": "oss_1919",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a binary tree where each node has an integer value, write a function that identifies and returns a list of all the lonely nodes in the tree. A node is considered 'lonely' if it is the only child of its parent, meaning it has no siblings. Implement a function `find_lonely_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_lonely_nodes(TreeNode(1, None, TreeNode(3))) == [3]\", \"assert find_lonely_nodes(TreeNode(1)) == []\", \"assert find_lonely_nodes(TreeNode(1, None, TreeNode(2, None, TreeNode(3)))) == [2, 3]\", \"assert find_lonely_nodes(TreeNode(1, TreeNode(2, None, T... | {
"split": "train",
"index": 78599,
"acecode_id": "oss_2940",
"num_tests": 8
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.