data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "Given two strings, `a` and `b`, write a function `longestCommonSubstring(a, b)` that returns the length of the longest common substring between the two strings. A substring is defined as a contiguous sequence of characters within a string. For example, the longest common substr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longestCommonSubstring('abcdxyz', 'xyzabcd') == 4\", \"assert longestCommonSubstring('zxabcdezy', 'yzabcdezx') == 6\", \"assert longestCommonSubstring('abcde', 'fghij') == 0\", \"assert longestCommonSubstring('hello', 'yell') == 3\", \"assert longestCommonSu...
{ "split": "train", "index": 2000, "acecode_id": "oss_23775", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of integers and returns a dictionary containing the count of even and odd numbers in the list. Write a function `count_even_odd` that takes the following input parameter: - `numbers`: A list of integers. The f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_even_odd([1, 2, 3, 4, 5]) == {'even': 2, 'odd': 3}\", \"assert count_even_odd([0, -1, -2, -3]) == {'even': 2, 'odd': 2}\", \"assert count_even_odd([]) == {'even': 0, 'odd': 0}\", \"assert count_even_odd([2, 4, 6, 8]) == {'even': 4, 'odd': 0}\", \"asser...
{ "split": "train", "index": 2001, "acecode_id": "oss_27231", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 9x9 Sudoku board represented as a 2D list, where empty cells are denoted by 0, implement a function that checks if the Sudoku board is valid. A valid Sudoku board must satisfy the following conditions: Each row must contain the digits 1-9 without repetition, each column...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_sudoku([[5, 3, 0, 0, 7, 0, 0, 0, 0], [6, 0, 0, 1, 9, 5, 0, 0, 0], [0, 9, 8, 0, 0, 0, 0, 6, 0], [8, 0, 0, 0, 6, 0, 0, 0, 3], [4, 0, 0, 8, 0, 3, 0, 0, 1], [7, 0, 0, 0, 2, 0, 0, 0, 6], [0, 6, 0, 0, 0, 0, 2, 8, 0], [0, 0, 4, 0, 1, 9, 0, 0, 5], [0, 0, 0,...
{ "split": "train", "index": 2002, "acecode_id": "bigcode_python_fns_267", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a URL routing system for a web application. Your job is to create a function that takes a URL as input and returns the name of the view function that matches the given URL based on predefined URL patterns. The URL patterns are defined using regu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert match_url('/appleupdate/12345') == 'appleupdate'\", \"assert match_url('/raw/98765') == 'raw'\", \"assert match_url('/submit/report') == 'submit'\", \"assert match_url('/warranty/67890') == 'warranty'\", \"assert match_url('/ip') == 'lookup_ip'\", \"assert m...
{ "split": "train", "index": 2003, "acecode_id": "oss_24592", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the number of work hours an employee has completed on weekdays and weekends, write a function `calculate_work_score(weekday_hours: int, weekend_hours: int) -> float` that converts these hours into a standardized score. The function should assume a normative work week of 4...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_work_score(40, 0) == 40.0\", \"assert calculate_work_score(35, 5) == 45.0\", \"assert calculate_work_score(0, 0) == 0.0\", \"assert calculate_work_score(40, 40) == 120.0\", \"assert calculate_work_score(30, 10) == 50.0\", \"assert calculate_work_sc...
{ "split": "train", "index": 2004, "acecode_id": "evol_31632", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers and returns a new list containing the integers sorted in ascending order. The input list should remain unchanged. For example, given the input [97, 34, 23, 85, 54, 12], the output should be [12, 23, 34, 54, 85, 97].\nPlease rea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_array([97, 34, 23, 85, 54, 12]) == [12, 23, 34, 54, 85, 97]\", \"assert sort_array([-5, -1, -15, 0, 5, 10]) == [-15, -5, -1, 0, 5, 10]\", \"assert sort_array([1]) == [1]\", \"assert sort_array([3, 2, 1]) == [1, 2, 3]\", \"assert sort_array([10, 9, 8, 7,...
{ "split": "train", "index": 2005, "acecode_id": "evol_21387", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the restarting of a workflow based on provided input arguments. The function should accept any number of positional and keyword arguments and should return a dictionary where the keys are the argument names (for keyword arg...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert restart() == {}\", \"assert restart(1, 2, 3) == {0: 1, 1: 2, 2: 3}\", \"assert restart(a=1, b=2) == {'a': 1, 'b': 2}\", \"assert restart(5) == {0: 5}\", \"assert restart(x=10, y=20, z=30) == {'x': 10, 'y': 20, 'z': 30}\", \"assert restart(1, a=2, b=3) == {0:...
{ "split": "train", "index": 2006, "acecode_id": "bigcode_python_fns_49958", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a base cost, a discount percentage, and a tax percentage, implement a function that calculates the net price of a product. The net price should be calculated by first applying the discount to the base cost, and then applying the tax on the discounted price. The function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_net_price(100, 10, 5) == 94.5\", \"assert calculate_net_price(150, 0, 15) == 172.5\", \"assert calculate_net_price(0, 10, 5) == 0.0\", \"assert calculate_net_price(100, -10, 5) == None\", \"assert calculate_net_price(-100, 10, 5) == None\", \"asser...
{ "split": "train", "index": 2007, "acecode_id": "evol_11571", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are required to implement a function that takes a list of integers as input and returns the sum of all even numbers in that list. If there are no even numbers, the function should return 0. Please write a function named `sum_of_evens` that accomplishes this task.\nPlease re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 21, 32, 43]) == 42\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([1, 3, 5]) == 0\", \"assert sum_of_evens([2, 4, 6]) == 12\", \"assert sum_of_evens([-2, -4, -6]) == -12\", \"assert...
{ "split": "train", "index": 2008, "acecode_id": "evol_26981", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves the external ID from a given task representation. The task is represented as a dictionary with a single key, 'external_id', which holds a string value. Implement a function `get_external_id(task: dict) -> str` that returns ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_external_id({'external_id': '12345'}) == '12345'\", \"assert get_external_id({'external_id': 'abc'}) == 'abc'\", \"assert get_external_id({'external_id': ''}) == ''\", \"assert get_external_id({'id': '12345'}) == ''\", \"assert get_external_id({}) == ''\...
{ "split": "train", "index": 2009, "acecode_id": "oss_26413", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a version string for a software project based on the provided parameters. The function should take the following parameters: `version` (a string representing the short version), `full_version` (a string representing the ful...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_version_string('2.0.0', '2.0.0', 'def456', 'v2.0.0', '5', 'Second release', True) == \\\"# coding=utf-8\\\\n# THIS FILE IS GENERATED FROM PYPINT SETUP.PY\\\\nshort_version = '2.0.0'\\\\nversion = '2.0.0'\\\\nfull_version = '2.0.0'\\\\ngit_revision =...
{ "split": "train", "index": 2010, "acecode_id": "bigcode_python_fns_37577", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with constructing a full URL for an API given a specific endpoint. The base URL for the API is defined as 'https://api.example.com' and the API extension is '/v1'. Write a function `generate_api_url(endpoint: str) -> str` that takes an endpoint as input and retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_api_url('users') == 'https://api.example.com/v1/users'\", \"assert generate_api_url('products') == 'https://api.example.com/v1/products'\", \"assert generate_api_url('orders') == 'https://api.example.com/v1/orders'\", \"assert generate_api_url('cate...
{ "split": "train", "index": 2011, "acecode_id": "bigcode_python_fns_35609", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, implement a function that removes all occurrences of non-alphabetic characters from it. The function should maintain the order of the remaining alphabetic characters intact. You need to implement the function `remove_non_alpha(s: str) -> str` where `s` is the in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_non_alpha('Hello World! 123') == 'HelloWorld'\", \"assert remove_non_alpha('Python3.8 is fun!') == 'Pythonisfun'\", \"assert remove_non_alpha('No special characters here.') == 'Nospecialcharactershere'\", \"assert remove_non_alpha('1234567890') == ''\...
{ "split": "train", "index": 2012, "acecode_id": "evol_29773", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_economic_article(article: str) -> bool` that determines if a given article is written in an economic context. The function should return True if the article is related to economics and False otherwise. Consider an article to be economic if it contains a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_economic_article('This article discusses the effects of inflation on the economy.') == True\", \"assert is_economic_article('Recent advancements in technology are fascinating.') == False\", \"assert is_economic_article('The market trends suggest a rise in...
{ "split": "train", "index": 2013, "acecode_id": "evol_26195", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `validate_entity(array: List[int], entity: int) -> bool` that checks if a specified integer `entity` exists within a given list of integers `array`. The function should return `True` if the entity is found in the array, and `False` otherwise.\nPlease reason...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_entity([1, 2, 5, 7], 5) == True\", \"assert validate_entity([1, 2, 5, 7], 3) == False\", \"assert validate_entity([10, 20, 30], 20) == True\", \"assert validate_entity([10, 20, 30], 25) == False\", \"assert validate_entity([], 1) == False\", \"asser...
{ "split": "train", "index": 2014, "acecode_id": "evol_16878", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats date and time information based on specific format specifiers. Your function should take a format specifier and a date/time string as input and produce the corresponding formatted output. The format specifiers and their meani...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_date_time('%c', 'Mon Dec 31 17:41:00 2018') == 'Mon Dec 31 17:41:00 2018'\", \"assert format_date_time('%x', 'Mon Dec 31 17:41:00 2018') == '12/31/18'\", \"assert format_date_time('%x', 'Tue Jan 01 00:00:00 2020') == '01/01/20'\", \"assert format_date...
{ "split": "train", "index": 2015, "acecode_id": "oss_22302", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given an object 'config' that contains two attributes: 'portal_schema' (a string or None) and 'rds_config' (a dictionary with connection parameters). Your task is to implement a function 'connect_to_portal(config)' that returns a connection string based on the 'portal_s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert connect_to_portal({'portal_schema': 'my_schema', 'rds_config': {'host': 'localhost', 'port': 5432}}) == 'Connecting to localhost:5432/my_schema'\", \"assert connect_to_portal({'portal_schema': None, 'rds_config': {'host': 'localhost', 'port': 5432}}) == 'No ...
{ "split": "train", "index": 2016, "acecode_id": "bigcode_python_fns_31442", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing recruitment reports in a specific format. Write a function `process_recruitment_report` that takes two arguments: a list of strings representing the lines of a recruitment report and a string representing the user. The function should perform the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_recruitment_report(['Title 1', 'Content line 1', 'Content line 2'], 'User1') == {'user': 'User1', 'report_title': 'Title 1', 'report_content': 'Content line 1\\\\nContent line 2'}\", \"assert process_recruitment_report(['Annual Report', 'This year we...
{ "split": "train", "index": 2017, "acecode_id": "oss_26551", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a node's status. The function should take in a node name, a status string, and a result object. If the status is 'OK', the function should return a formatted string containing the node's name and the configuration da...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_status('Node1', 'OK', Result('{\\\"key1\\\": \\\"value1\\\", \\\"key2\\\": \\\"value2\\\"}')) == 'Node1: {\\\"key1\\\": \\\"value1\\\", \\\"key2\\\": \\\"value2\\\"}'\", \"assert process_status('Node2', 'ERROR', Result(None)) == 'Termination: No data...
{ "split": "train", "index": 2018, "acecode_id": "oss_36492", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of dictionaries representing cards in a card game. Each dictionary contains information about a card, including its content and a picture URL. Your task is to implement the function `modify_card_pictures(cards)` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modify_card_pictures([{'id': 1, 'content': {'name': 'Card1', 'pic': 'https://example.com/card1.jpg'}}]) == [{'id': 1, 'content': {'name': 'Card1', 'pic': 'https://example.com/card1.jpg@64w_36h_1c.jpg'}}]\", \"assert modify_card_pictures([{'id': 1, 'content':...
{ "split": "train", "index": 2019, "acecode_id": "oss_12600", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of intervals, where each interval is represented as a pair of integers `[start, end]`. The intervals are sorted based on their start values. Your task is to merge overlapping intervals and return a new list of non-overlapping intervals after merging. Write ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_intervals([[1,3],[2,6],[8,10],[15,18]]) == [[1,6],[8,10],[15,18]]\", \"assert merge_intervals([[1,4],[4,5]]) == [[1,5]]\", \"assert merge_intervals([[1,2],[3,4],[5,6]]) == [[1,2],[3,4],[5,6]]\", \"assert merge_intervals([[1,5],[2,3],[4,6]]) == [[1,6]]\...
{ "split": "train", "index": 2020, "acecode_id": "oss_34107", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function `configure_system(global_conf: Dict[str, Any], local_conf: Dict[str, Any]) -> Dict[str, Any]` that takes in two dictionaries: `global_conf`, which contains global configuration settings, and `local_conf`, which contains local configuration...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert configure_system({}, {'execution_server': 'proxy'}) == {'execution_server': 'proxy', 'devices': '/srv/node', 'mc_timeout': 5, 'mc_pipe': 'vertigo_pipe', 'metadata_visibility': True, 'mc_dir': '/home/docker_device/vertigo/scopes', 'cache_dir': '/home/docker_d...
{ "split": "train", "index": 2021, "acecode_id": "bigcode_python_fns_1774", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of file names and a target file name, write a function `file_exists_in_list(file_list: List[str], target_file: str) -> bool` that checks if the target file exists in the list of file names. The function should return `True` if the target file is found in the list, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert file_exists_in_list(['file1.txt', 'file2.txt', 'file3.txt'], 'file2.txt') == True\", \"assert file_exists_in_list(['file1.txt', 'file2.txt', 'file3.txt'], 'file4.txt') == False\", \"assert file_exists_in_list(['file1.txt', 'file1.txt', 'file2.txt'], 'file1.t...
{ "split": "train", "index": 2022, "acecode_id": "bigcode_python_fns_41155", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of motifs from a genome, which can include 'CG', 'CHG', 'CHH', and 'CWG'. Your task is to implement a function that receives a list of selected motifs and determines if the selection is valid. A valid selection must include at least one motif and cannot inc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_motif_selection(['CG']) == True\", \"assert is_valid_motif_selection(['CHG']) == True\", \"assert is_valid_motif_selection(['CHH']) == True\", \"assert is_valid_motif_selection(['CWG']) == True\", \"assert is_valid_motif_selection(['CG', 'CHG']) == ...
{ "split": "train", "index": 2023, "acecode_id": "bigcode_python_fns_35605", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `character_frequency(input_str)` that takes a single parameter `input_str`. This function should return a dictionary containing the frequency of each character in the given string. If the input is not a string, the function should return an empty dictionary...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert character_frequency('') == {}\", \"assert character_frequency('aaaa') == {'a': 4}\", \"assert character_frequency('abcABC') == {'a': 1, 'b': 1, 'c': 1, 'A': 1, 'B': 1, 'C': 1}\", \"assert character_frequency('112233') == {'1': 2, '2': 2, '3': 2}\", \"assert ...
{ "split": "train", "index": 2024, "acecode_id": "evol_21941", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `find_average(nums: List[int]) -> float` that calculates and returns the average of the integers in the list. If the list is empty, return 0.0. The average is defined as the sum of the integers divided by the count of integers in the l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_average([1, 2, 3, 4, 5]) == 3.0\", \"assert find_average([-1, -2, -3, -4, -5]) == -3.0\", \"assert find_average([0, 0, 0, 0]) == 0.0\", \"assert find_average([10, 20, 30]) == 20.0\", \"assert find_average([1]) == 1.0\", \"assert find_average([]) == 0.0\...
{ "split": "train", "index": 2025, "acecode_id": "bigcode_python_fns_42218", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of integers and returns a specific result based on the sum of the even numbers in the list. The function should take in a list of integers and perform the following steps: 1. Calculate the sum of all the even num...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_numbers([0, 2, 4, 6, 8, 10]) == 60\", \"assert process_numbers([1, 3, 5, 7]) == 0\", \"assert process_numbers([5, 10, 15, 20]) == 60\", \"assert process_numbers([1, 1, 1, 1]) == 0\", \"assert process_numbers([]) == 0\", \"assert process_numbers([2, 3...
{ "split": "train", "index": 2026, "acecode_id": "oss_37143", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function that accepts three lists: List 1 containing strings, List 2 containing integers, and List 3 containing strings that represent colors. The function should check if all three lists have the same length. If they do, merge their elements into a single list of t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_lists(['apple', 'banana'], [10, 20], ['red', 'yellow']) == ([('apple', 10, 'red'), ('banana', 20, 'yellow')], [50, 120])\", \"assert merge_lists(['blue', 'green', 'yellow'], [1, 2, 3], ['light', 'dark', 'bright']) == ([('blue', 1, 'light'), ('green', 2...
{ "split": "train", "index": 2027, "acecode_id": "evol_25151", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with managing weather data in a system. You need to implement a function that processes the current weather information. If the weather information is not available, the function should return a specific signal value. Otherwise, the function should return the wea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_weather_data(None) == -1\", \"assert manage_weather_data('Sunny, 25\\u00b0C') == 'Sunny, 25\\u00b0C'\", \"assert manage_weather_data('Rainy, 18\\u00b0C') == 'Rainy, 18\\u00b0C'\", \"assert manage_weather_data('Cloudy, 20\\u00b0C') == 'Cloudy, 20\\u00b...
{ "split": "train", "index": 2028, "acecode_id": "oss_28189", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `feedback(score)` that returns a feedback message based on the value of `score`. If the score is 90 or above, return 'Excellent!'. If the score is between 70 and 89 (inclusive), return 'Good job!'. If the score is below 70, return 'You need to improve'.\nPl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert feedback(95) == 'Excellent!'\", \"assert feedback(90) == 'Excellent!'\", \"assert feedback(89) == 'Good job!'\", \"assert feedback(85) == 'Good job!'\", \"assert feedback(70) == 'Good job!'\", \"assert feedback(69) == 'You need to improve'\", \"assert feedba...
{ "split": "train", "index": 2029, "acecode_id": "evol_6231", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple product management system for a small retail store. Given a list of product details, your function should return a summary of the inventory, including the total number of products, the total value of all products i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert product_summary([{ 'name': 'Oranges', 'price': 1.0, 'quantity': 0 }, { 'name': 'Grapes', 'price': 2.5, 'quantity': 5 }]) == {'total_products': 2, 'total_value': 12.5, 'product_names': ['Oranges', 'Grapes']}\", \"assert product_summary([]) == {'total_products...
{ "split": "train", "index": 2030, "acecode_id": "oss_29533", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function `find_first_divisible_by_5(numbers)` that takes a list of integers and returns the first integer in the list that is divisible by 5. If the list contains any non-integer values, raise a `NonIntegerError` with the value of the non-integer input. If no intege...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_first_divisible_by_5([1, 3, 4, 5, 6]) == 5\", \"assert find_first_divisible_by_5([1, 3, 4, 6]) == None\", \"assert find_first_divisible_by_5([10, 20, 30]) == 10\", \"assert find_first_divisible_by_5([1, 2, 3, 4]) == None\", \"assert find_first_divisible...
{ "split": "train", "index": 2031, "acecode_id": "evol_5966", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of numbers and returns a new list containing only the positive numbers from the original list, sorted in ascending order. You need to discard any non-positive numbers (zero and negative numbers). The input list may contain integers and flo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_positive_and_sort([-1, 2, -4, 5, 6]) == [2, 5, 6]\", \"assert get_positive_and_sort([5, 3, -5, 2, -3, 3, 9, 0, 123, 1, -10]) == [1, 2, 3, 3, 5, 9, 123]\", \"assert get_positive_and_sort([-10, -5, -1, 0]) == []\", \"assert get_positive_and_sort([0, 0, 0])...
{ "split": "train", "index": 2032, "acecode_id": "evol_35366", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that takes a string of multiple words, corrects any minor typos involving adjacent swapped characters within each word, reverses the string, and then checks for anagram matches between the original and reversed words. The function should return a list of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_and_check_anagram('hello olleh') == [{'original': 'hello', 'reversed': 'olleh', 'corrected': 'hello', 'is_anagram': True}, {'original': 'olleh', 'reversed': 'hello', 'corrected': 'olleh', 'is_anagram': True}]\", \"assert reverse_and_check_anagram('ra...
{ "split": "train", "index": 2033, "acecode_id": "evol_24852", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given two lists: `labels` and `predictions`, each containing integers of the same length. Your task is to implement a function that counts the number of correctly ordered pairs of indices (i, j) such that: 1) `labels[i] > labels[j]` and 2) `predictions[i] > predictions[...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_correctly_ordered_pairs([3, 1, 2], [2, 3, 1]) == 1\", \"assert count_correctly_ordered_pairs([1, 2, 3], [3, 2, 1]) == 0\", \"assert count_correctly_ordered_pairs([1, 1, 1], [1, 1, 1]) == 0\", \"assert count_correctly_ordered_pairs([10, 20, 10], [5, 15,...
{ "split": "train", "index": 2034, "acecode_id": "bigcode_python_fns_20591", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of filenames, where each filename consists of 5 digits. Your task is to implement a function that extracts all valid filenames (those that match the pattern of exactly 5 digits), sorts them in ascending order, and returns them as a list of strings. Write a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_sorted_filenames(['11111', '22222', '33333', '4444', '555555']) == ['11111', '22222', '33333']\", \"assert get_sorted_filenames(['12345', '54321', 'abcde', '1234', '67890']) == ['12345', '54321', '67890']\", \"assert get_sorted_filenames(['00000', '11111...
{ "split": "train", "index": 2035, "acecode_id": "bigcode_python_fns_40593", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a string s composed only of lowercase English alphabets without any special characters, examine its validity. A valid string satisfies these conditions: 1. It has a minimum length of 6. 2. Every six consecutive characters must be distinct. 3. All unique characters must oc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert isValidString('a') == False\", \"assert isValidString('aa') == False\", \"assert isValidString('abcdef') == False\", \"assert isValidString('adbbdda') == False\", \"assert isValidString('abcxyz') == False\", \"assert isValidString('abcdeef') == False\", \"as...
{ "split": "train", "index": 2036, "acecode_id": "evol_5590", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a learning rate scheduler. The function should take an integer `step` that represents the current training step and a string `scheduler_type` which can be one of three options: 'LambdaLR', 'StepLR', or 'ReduceLROnPlateau'. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert learning_rate_scheduler(10, 'LambdaLR') == 1.0\", \"assert learning_rate_scheduler(15, 'LambdaLR') == 1.0\", \"assert learning_rate_scheduler(20, 'LambdaLR') == 0.1\", \"assert learning_rate_scheduler(25, 'LambdaLR') == 0.1\", \"assert learning_rate_schedule...
{ "split": "train", "index": 2037, "acecode_id": "bigcode_python_fns_6757", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes daily testing reports for a specific disease at a testing site. Given a list of test results, you need to compute the total number of tests conducted and the number of positive results for a particular site, disease, an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_daily_report(1, '2023-10-01', 101, ['POS', 'NEG', 'POS']) == {'tests_total': 3, 'tests_positive': 2}\", \"assert update_daily_report(2, '2023-10-01', 102, ['NEG', 'NEG', 'NEG']) == {'tests_total': 3, 'tests_positive': 0}\", \"assert update_daily_repor...
{ "split": "train", "index": 2038, "acecode_id": "bigcode_python_fns_23794", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with checking the validity of a filename based on certain criteria. A valid filename must meet the following conditions: it must start with an alphabetical character (either uppercase or lowercase), it can contain alphanumeric characters, underscores, and hyphens...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_filename('my_file-1') == True\", \"assert is_valid_filename('valid_filename_2023') == True\", \"assert is_valid_filename('invalid/filename') == False\", \"assert is_valid_filename('123_invalid_start.txt') == False\", \"assert is_valid_filename('too_...
{ "split": "train", "index": 2039, "acecode_id": "bigcode_python_fns_18192", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a string input representing a feature name and returns a valid feature handle. A valid feature handle is defined as a string that starts with 'feat_' followed by the lowercase version of the feature name (with spaces replaced b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_feature_handle('New Feature') == 'feat_new_feature'\", \"assert generate_feature_handle('Another Example') == 'feat_another_example'\", \"assert generate_feature_handle('SingleWord') == 'feat_singleword'\", \"assert generate_feature_handle('') == 'f...
{ "split": "train", "index": 2040, "acecode_id": "bigcode_python_fns_34020", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that dynamically imports a specified module and calls a specific function from that module with provided arguments. Write a function `import_and_call_function(module_name, function_name, *args, **kwargs)` that does the following: \n- Tak...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert import_and_call_function('type', 'non_existent_function') is None\", \"assert import_and_call_function('non_existent_module', 'some_function') is None\", \"assert import_and_call_function('compound.compound', 'missing_function') is None\", \"assert import_an...
{ "split": "train", "index": 2041, "acecode_id": "oss_8883", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function `open_file(file_name: str) -> str` that attempts to open a file with the given `file_name` and read its contents. If the file does not exist or any other I/O error occurs during the reading process, the function should handle the exception and return an emp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert open_file('non_existent_file.txt') == ''\", \"assert open_file('empty_file.txt') == ''\", \"assert open_file('binary_file.bin') == ''\", \"assert open_file('/path/to/protected_file.txt') == ''\", \"assert open_file('non_readable_file.txt') == ''\"]}" }
{ "split": "train", "index": 2042, "acecode_id": "evol_34955", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Write a function `bidirectional_transform(input_str: str) -> Tuple[str, Dict[str, str]]` that takes an alphanumeric string and transforms all punctuation symbols in the string into asterisks (*). The function should return a tuple containing the transformed string and a diction...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bidirectional_transform('No punctuation here') == ('No punctuation here', {})\", \"assert bidirectional_transform('What are you doing?') == ('What are you doing*', {'*': '?'})\", \"assert bidirectional_transform('') == ('', {})\", \"assert bidirectional_tran...
{ "split": "train", "index": 2043, "acecode_id": "evol_30902", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `func_dispatcher(intent: Callable[[Any], None]) -> Callable[[Callable, Any], None]`. This function should return another function called `performer`, which takes two parameters: `dispatcher` (a callable) and `box` (any type). When `perfor...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert func_dispatcher(lambda x: x + 1)(None, 5) == None\", \"assert func_dispatcher(lambda x: x * 2)(None, 3) == None\", \"assert func_dispatcher(lambda x: print(x))(None, 'Hello') == None\", \"assert func_dispatcher(lambda x: x.upper())(None, 'hello') == None\", ...
{ "split": "train", "index": 2044, "acecode_id": "bigcode_python_fns_24637", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that logs messages in different languages based on a specified language code. Implement a function `log_message(message: str, language_code: str) -> str` that takes a message and a language code as input. The function should return the lo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_message('An error occurred', 'en') == 'An error occurred'\", \"assert log_message('\\u30a8\\u30e9\\u30fc\\u304c\\u767a\\u751f\\u3057\\u307e\\u3057\\u305f', 'ja') == '\\u30a8\\u30e9\\u30fc\\u304c\\u767a\\u751f\\u3057\\u307e\\u3057\\u305f'\", \"assert log_...
{ "split": "train", "index": 2045, "acecode_id": "oss_37588", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_palindrome(string: str) -> bool` that determines whether a given string is a palindrome. A palindrome is a string that reads the same forward and backward. You are not allowed to use any intrinsic, premade functions or approaches to check for palindrome...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('racecar') == True\", \"assert is_palindrome('HELLO') == False\", \"assert is_palindrome('12321') == True\", \"assert is_palindrome('A man a plan a canal Panama') == False\", \"assert is_palindrome('level') == True\", \"assert is_palindrome('wo...
{ "split": "train", "index": 2046, "acecode_id": "evol_29616", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `auth_status(request: str) -> int` that takes a string input `request` representing an authentication request. The function should return an integer based on the authentication status. The mapping of the response is as follows: 1 for ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert auth_status('valid_auth') == 1\", \"assert auth_status('invalid_auth') == 2\", \"assert auth_status('unauthorized_auth') == 3\", \"assert auth_status('valid_auth') == 1\", \"assert auth_status('invalid_auth') == 2\", \"assert auth_status('unauthorized_auth')...
{ "split": "train", "index": 2047, "acecode_id": "bigcode_python_fns_26336", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of animal names represented as strings. Your task is to implement a function that counts how many times a specific animal appears in the list, regardless of its case (uppercase or lowercase). Write a function `count_animal(animal_list: List[str], animal: st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_animal(['cat', 'cat', 'dog', 'Cat'], 'cat') == 3\", \"assert count_animal(['dog', 'dog', 'dog', 'dog'], 'cat') == 0\", \"assert count_animal(['CAT', 'cat', 'Cat', 'cAt'], 'cat') == 4\", \"assert count_animal(['lion', 'tiger', 'bear'], 'bear') == 1\", \...
{ "split": "train", "index": 2048, "acecode_id": "bigcode_python_fns_10354", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple banking transaction system. Your goal is to implement a function `process_transactions(transactions)` that takes a list of transactions and outputs the final balance of a bank account after processing those transactions. Each transaction ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_transactions([('deposit', 100), ('withdraw', 50), ('deposit', 200)]) == 250\", \"assert process_transactions([('withdraw', 50), ('withdraw', 50)]) == 0\", \"assert process_transactions([('deposit', 100), ('deposit', 50), ('withdraw', 30)]) == 120\", ...
{ "split": "train", "index": 2049, "acecode_id": "oss_5132", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the performance of a computer system based on its hardware specifications. Implement a function named `calculate_performance` that takes three parameters: `cpu_speed` (a float representing the CPU speed in GHz), `memory_si...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_performance(3.0, 16.0, 1.0) == 48.0\", \"assert calculate_performance(2.5, 8.0, 0.5) == 40.0\", \"assert calculate_performance(4.0, 32.0, 4.0) == 32.0\", \"assert calculate_performance(0.0, 10.0, 2.0) == 0.0\", \"assert calculate_performance(2.0, 0...
{ "split": "train", "index": 2050, "acecode_id": "oss_28289", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a non-negative integer n, write a function that calculates the nth triangular number. A triangular number or triangle number counts objects arranged in an equilateral triangle, and it can be calculated using the formula: T(n) = n * (n + 1) / 2. Implement a function `calc_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calc_triangular_number(0) == 0\", \"assert calc_triangular_number(1) == 1\", \"assert calc_triangular_number(2) == 3\", \"assert calc_triangular_number(3) == 6\", \"assert calc_triangular_number(4) == 10\", \"assert calc_triangular_number(5) == 15\", \"asser...
{ "split": "train", "index": 2051, "acecode_id": "bigcode_python_fns_13527", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing participants' responses to a survey regarding their handedness. Each integer in the list corresponds to the following: 1 for 'left', 2 for 'right', and 3 for 'ambidextrous'. Write a function `convert_responses(responses)` that takes...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_responses([1, 2, 3]) == ['left', 'right', 'ambidextrous']\", \"assert convert_responses([2, 1, 3]) == ['right', 'left', 'ambidextrous']\", \"assert convert_responses([3, 3, 1]) == ['ambidextrous', 'ambidextrous', 'left']\", \"assert convert_responses...
{ "split": "train", "index": 2052, "acecode_id": "oss_8100", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `add_values(x, y)` that takes two parameters and returns their sum. The function should handle various types of inputs, including integers, strings that can be converted to integers, null values, floating point numbers, and boolean values. If the inputs can...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_values(1, 2) == 3\", \"assert add_values('3', '4') == 7\", \"assert add_values(2.5, 3.5) == 5\", \"assert add_values(True, False) == 1\", \"assert add_values('10', 5) == 15\", \"assert add_values('0', '0') == 0\", \"assert add_values(-1, -1) == -2\", \"a...
{ "split": "train", "index": 2053, "acecode_id": "evol_30962", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function `get_gateway_resource(name: str, client_id: str, vdc_href: str) -> str` that retrieves a gateway resource based on the provided gateway name and context information. The function should emulate the behavior of a simplified gateway retrieva...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_gateway_resource('gateway1', 'client123', 'vdc/abc') == \\\"Gateway 'gateway1' for client 'client123' at VDC 'vdc/abc'\\\"\", \"assert get_gateway_resource('myGateway', 'client456', 'vdc/xyz') == \\\"Gateway 'myGateway' for client 'client456' at VDC 'vdc...
{ "split": "train", "index": 2054, "acecode_id": "bigcode_python_fns_36438", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a program that accepts a list of numbers and returns both the sum and product of all elements within the list. The program should also be able to handle situations where the list contains negative numbers and zero.\nPlease reason step by step, then write a self-contained...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_and_product([1, 2, 3]) == (6, 6)\", \"assert sum_and_product([-1, -2, -3]) == (-6, -6)\", \"assert sum_and_product([0, 1, 2, 3]) == (6, 0)\", \"assert sum_and_product([1, -1, 2]) == (2, -2)\", \"assert sum_and_product([5, 0, -1]) == (4, 0)\", \"assert su...
{ "split": "train", "index": 2055, "acecode_id": "evol_25284", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a form of data that needs to be validated based on specific criteria. The validation rules are as follows: the string must contain only alphanumeric characters (letters and numbers), and its length must be between 5 and 20 characters inclusiv...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_form_data('valid123') == True\", \"assert validate_form_data('12345') == True\", \"assert validate_form_data('a1b2c3d4e5f6g7h8i9j0') == True\", \"assert validate_form_data('short') == True\", \"assert validate_form_data('a') == False\", \"assert val...
{ "split": "train", "index": 2056, "acecode_id": "bigcode_python_fns_15015", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `fetch_satellite_image(latitude: float, longitude: float) -> str` that takes a latitude and a longitude as input and returns a URL string for a satellite image of Earth at those coordinates. The URL should be formatted as 'https://api.nasa.gov/planetary/earth/i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fetch_satellite_image(40.71, -74.00) == 'https://api.nasa.gov/planetary/earth/imagery?lon=-74.0&lat=40.71'\", \"assert fetch_satellite_image(34.05, -118.25) == 'https://api.nasa.gov/planetary/earth/imagery?lon=-118.25&lat=34.05'\", \"assert fetch_satellite_i...
{ "split": "train", "index": 2057, "acecode_id": "evol_34696", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that reads a specific part name from a given string input. The input string is formatted in a way that the part name is specified after the prefix '*Part, name='. Your function should extract this part name. If the part name is not presen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_part_name('*Part, name=Steel') == 'Steel'\", \"assert extract_part_name('*Part, name=Aluminum') == 'Aluminum'\", \"assert extract_part_name('*Part, name=Plastic') == 'Plastic'\", \"assert extract_part_name('*Part, name=Concrete') == 'Concrete'\", \"a...
{ "split": "train", "index": 2058, "acecode_id": "bigcode_python_fns_31213", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a string representing an EMR (Electronic Medical Record) version and returns its string representation. The input will be a single string parameter 'version' which denotes the version of the EMR. Your function should return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_emr_display_name('v1.0') == 'v1.0'\", \"assert get_emr_display_name('v2.3.1') == 'v2.3.1'\", \"assert get_emr_display_name('v3.0') == 'v3.0'\", \"assert get_emr_display_name('v4.5.6') == 'v4.5.6'\", \"assert get_emr_display_name('v5.2') == 'v5.2'\", \"as...
{ "split": "train", "index": 2059, "acecode_id": "oss_15322", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a family organization structure for a game. Write a function `setup_family(dompc: str, family: str, create_liege: bool, create_vassals: bool, character: str, srank: str, region: str, liege: str, num_vassals: int) -> Tuple[str, Optional[str], List[st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert setup_family('dompc1', 'House Stark', True, True, 'character1', 'srank1', 'region1', None, 2) == ('House Stark', 'Liege of House Stark', ['Vassal 1 of House Stark', 'Vassal 2 of House Stark'])\", \"assert setup_family('dompc2', 'House Lannister', False, True...
{ "split": "train", "index": 2060, "acecode_id": "bigcode_python_fns_29930", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the daily stock prices of a company. Write a function `max_profit` that returns the maximum profit that can be obtained by buying and selling the stock at most once. If it is not possible to make any profit, return 0. The function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_profit([7, 1, 5, 3, 6, 4]) == 5\", \"assert max_profit([7, 6, 4, 3, 1]) == 0\", \"assert max_profit([2, 1, 2, 1, 2]) == 1\", \"assert max_profit([1, 2, 3, 4, 5]) == 4\", \"assert max_profit([5]) == 0\", \"assert max_profit([3, 2, 1]) == 0\", \"assert max...
{ "split": "train", "index": 2061, "acecode_id": "oss_1277", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `schedule_remove_tasklet()` that simulates the removal of a tasklet from a scheduler. The function takes no parameters and does not return any value. You should assume that there is a global list of tasklets that you can manipulate. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert schedule_remove_tasklet() == None\", \"assert schedule_remove_tasklet() == None\", \"assert schedule_remove_tasklet() == None\", \"assert schedule_remove_tasklet() == None\", \"assert schedule_remove_tasklet() == None\", \"assert schedule_remove_tasklet() ==...
{ "split": "train", "index": 2062, "acecode_id": "bigcode_python_fns_23782", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the status of different simulators. Each integer can have one of two values: 0 or 1. A value of 1 indicates that the simulator is running, while a value of 0 indicates that it is shut down. Write a function `shutdown_all_simulators(...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shutdown_all_simulators([1, 1, 1, 1]) == [0, 0, 0, 0]\", \"assert shutdown_all_simulators([0, 0, 0, 0]) == [0, 0, 0, 0]\", \"assert shutdown_all_simulators([1, 0, 1, 0]) == [0, 0, 0, 0]\", \"assert shutdown_all_simulators([1]) == [0]\", \"assert shutdown_all...
{ "split": "train", "index": 2063, "acecode_id": "bigcode_python_fns_36523", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing a collection of downloaded assets from a cloud storage service. Implement a function `process_assets` that takes a dictionary of assets as input. Each asset contains various properties, including an 'asset_type'. Your function should check the 'as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_assets({'asset_id1': {'added_props': {'s3Location': 's3://bucket_name/path', 'asset_type': 'analytic'}, 'other_props': 'other_data'}}) == 'Performed specific analytic operation on assets'\", \"assert process_assets({'asset_id1': {'added_props': {'s3L...
{ "split": "train", "index": 2064, "acecode_id": "oss_23017", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Design a function `character_count` that accepts a string as an argument and returns the count of characters in the string. The count should include alphanumeric characters as well as special characters but exclude whitespaces. If the input is not a string, the function should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert character_count('another example') == 14\", \"assert character_count('1234567890') == 10\", \"assert character_count('') == 0\", \"assert character_count(' ') == 0\", \"assert character_count('!@#$%^&*()') == 10\", \"assert character_count('abc 123') == 6\...
{ "split": "train", "index": 2065, "acecode_id": "evol_2955", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a puzzle input. Your task is to calculate the sum of the products of adjacent pairs of integers in the list. If the last integer is reached, the \"next\" integer will be the first integer in the list. Write a function to compute thi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_adjacent_products([2, 3, 4, 5]) == 48\", \"assert sum_of_adjacent_products([1, 2]) == 4\", \"assert sum_of_adjacent_products([0, 1, 2]) == 2\", \"assert sum_of_adjacent_products([5, 5, 5]) == 75\", \"assert sum_of_adjacent_products([1, 1, 1, 1]) == 4\...
{ "split": "train", "index": 2066, "acecode_id": "oss_15465", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the deletion of a system outage by its ID. The function should take an integer `outage_id` as input and return a string message indicating whether the outage was successfully deleted or if it does not exist. The function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_outage(1) == 'Successfully deleted outage 1'\", \"assert delete_outage(50) == 'Successfully deleted outage 50'\", \"assert delete_outage(100) == 'Successfully deleted outage 100'\", \"assert delete_outage(101) == 'Outage 101 does not exist'\", \"asser...
{ "split": "train", "index": 2067, "acecode_id": "bigcode_python_fns_39847", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of outcomes representing the probability distribution of a random variable, implement a function that calculates the entropy of the distribution. The entropy of a discrete random variable X with a probability distribution P is defined as H(X) = -Σ p(x) log2(p(x)), ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_entropy([0.5, 0.5]) == 1.0\", \"assert calculate_entropy([0.25, 0.25, 0.25, 0.25]) == 2.0\", \"assert calculate_entropy([1.0]) == 0.0\", \"assert calculate_entropy([0.2, 0.2, 0.2, 0.2, 0.2]) == 2.321928094887362\", \"assert calculate_entropy([0.0, ...
{ "split": "train", "index": 2068, "acecode_id": "bigcode_python_fns_40135", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a string `input_str`, write a function called `reverse_string` that takes `input_str` as input and returns the reversed version of the string. However, you are not allowed to use any built-in string reversal functions or slicing operations. Implement the string reversal a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_string('hello') == 'olleh'\", \"assert reverse_string('Python') == 'nohtyP'\", \"assert reverse_string('abcdef') == 'fedcba'\", \"assert reverse_string('12345') == '54321'\", \"assert reverse_string('') == ''\", \"assert reverse_string('a') == 'a'\",...
{ "split": "train", "index": 2069, "acecode_id": "oss_11802", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that checks if a given email address is valid based on the following criteria: 1. The email must contain an '@' symbol. 2. The email must contain a '.'. 3. The email must have at least 6 characters in total. 4. The local-part (the part before '@') must o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_email('johnsmith@example.com') == True\", \"assert is_valid_email('j_smith@domain.co') == True\", \"assert is_valid_email('valid-email123@sub.domain.com') == True\", \"assert is_valid_email('user-name@domain.org') == True\", \"assert is_valid_email(...
{ "split": "train", "index": 2070, "acecode_id": "evol_736", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `dataset_A` and `dataset_B`, and an integer `num_samples`, implement a function `sample_training_data` that returns two subsets of training data. Each subset should contain `num_samples` randomly selected elements from its respective dataset. The se...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sample_training_data([1, 2, 3], [4, 5, 6], 5) == ([], [])\", \"assert sample_training_data([1, 2, 3, 4], [], 2) == ([1, 2], [])\", \"assert sample_training_data([1, 2], [3], 0) == ([], [])\", \"assert sample_training_data([], [], 1) == ([], [])\", \"assert s...
{ "split": "train", "index": 2071, "acecode_id": "oss_3790", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines if a user can like a specific comment. The function should take in two inputs: a list of existing likes represented as tuples, where each tuple contains a user ID and a comment ID, and a new like represented as a tuple wit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_like_comment([(1, 101), (2, 102)], (3, 101)) == True\", \"assert can_like_comment([(1, 101), (2, 102)], (1, 101)) == False\", \"assert can_like_comment([(1, 101)], (2, 101)) == True\", \"assert can_like_comment([], (1, 101)) == True\", \"assert can_like_...
{ "split": "train", "index": 2072, "acecode_id": "oss_29780", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two floating-point numbers x and z, and two floating-point numbers cosangle and sinangle representing the cosine and sine of an angle respectively, implement a function that rotates the point (x, z) around the y-axis in a 3D space. The function should return the new coord...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotate_point(0.0, 0.0, 1.0, 0.0) == (0.0, 0.0)\", \"assert rotate_point(3.0, 4.0, 0.0, 1.0) == (4.0, -3.0)\", \"assert rotate_point(5.0, 5.0, 1.0, 0.0) == (5.0, 5.0)\", \"assert rotate_point(1.0, 0.0, 0.0, 1.0) == (0.0, -1.0)\", \"assert rotate_point(-2.0, 2...
{ "split": "train", "index": 2073, "acecode_id": "bigcode_python_fns_48477", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Write a function that takes a URL as input and returns a dictionary containing the HTTP response headers of the website. If the URL is invalid or the request fails, return an empty dictionary.\nPlease reason step by step, then write a self-contained Python solution. Give your f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_headers('http://www.nonexistentwebsite.xyz') == {}\", \"assert get_headers('http://invalid-url') == {}\", \"assert get_headers('http://localhost:8000') == {}\", \"assert get_headers('http://example.invalid') == {}\", \"assert get_headers('ftp://example.c...
{ "split": "train", "index": 2074, "acecode_id": "evol_6134", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a dictionary that represents an account's performance data. The dictionary contains a key 'return' which itself is a dictionary with two keys: 'investment' and 'total_amount'. Your task is to implement a function `get_invested_and_worth(account_data: dict) -> dict...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_invested_and_worth({'return': {'investment': 1000.0, 'total_amount': 1200.5}}) == {'invested': 1000.0, 'worth': 1200.5}\", \"assert get_invested_and_worth({'return': {'investment': 0.0, 'total_amount': 0.0}}) == {'invested': 0.0, 'worth': 0.0}\", \"asser...
{ "split": "train", "index": 2075, "acecode_id": "bigcode_python_fns_11409", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates port scanning on a target host. The function should take in a target host as a string and a list of ports. For each port in the list, it should print whether the port is 'open' or 'closed'. Assume that ports 80, 443, and 22...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_port_scan('example.com', [80, 443, 22]) == None\", \"assert simulate_port_scan('test.com', [1, 2, 3]) == None\", \"assert simulate_port_scan('localhost', [80, 8080]) == None\", \"assert simulate_port_scan('192.168.1.1', [22, 25, 80]) == None\", \"as...
{ "split": "train", "index": 2076, "acecode_id": "oss_144", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a tuple representing RGB color values of a pixel in the format (R, G, B) where R, G, and B are integers between 0 and 255 (inclusive). Your task is to implement a function `predict_season(color: Tuple[int, int, int]) -> str` that predicts the season based on the R...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict_season((255, 255, 255)) == 'Season Prediction: Winter'\", \"assert predict_season((200, 100, 50)) == 'Season Prediction: Fall'\", \"assert predict_season((50, 200, 100)) == 'Season Prediction: Spring-Summer'\", \"assert predict_season((50, 100, 200))...
{ "split": "train", "index": 2077, "acecode_id": "bigcode_python_fns_5515", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of integers and a comparison function, implement a function that calculates the median of the list. The median is the middle value when the list is sorted. If the list has an even number of elements, the median is the average of the two middle numbers. The comparis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert median([1, 3, 2], lambda x, y: x - y) == 2\", \"assert median([1, 2, 3, 4], lambda x, y: x - y) == 2.5\", \"assert median([5, 3, 1, 4, 2], lambda x, y: x - y) == 3\", \"assert median([7, 8, 9, 10, 11, 12], lambda x, y: x - y) == 9.5\", \"assert median([1], l...
{ "split": "train", "index": 2078, "acecode_id": "evol_33472", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a confusion matrix represented as a 2D list of integers, where each row corresponds to the true classes and each column corresponds to the predicted classes. Your task is to implement a function `calculate_metrics(c_matrix: List[List[int]]) -> Dict[str, Tuple[floa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_metrics([[0, 0], [0, 0]]) == {'class_0': (0, 0, 0), 'class_1': (0, 0, 0)}\", \"assert calculate_metrics([[1, 0], [0, 1]]) == {'class_0': (1.0, 1.0, 1.0), 'class_1': (1.0, 1.0, 1.0)}\", \"assert calculate_metrics([[0, 1, 0], [0, 0, 1], [1, 0, 0]]) =...
{ "split": "train", "index": 2079, "acecode_id": "oss_4215", "num_tests": 8 }
acecode
[ { "role": "user", "content": "In a geometric series, where each term is represented by the formula $a \\cdot r^{n-1}$, where both $a$ and $r$ are positive integers, and $r$ is greater than 1, write a function `max_k` that computes the maximum number of distinct terms Bill can choose from the series such tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_k() >= 4\", \"assert max_k() <= 8\", \"assert max_k() != 3\", \"assert max_k() != 6\", \"assert max_k() != 7\", \"assert max_k() != 9\", \"assert max_k() > 0\", \"assert max_k() <= 16\", \"assert max_k() % 5 != 0\", \"assert max_k() - max_k() // 2 == 2\"...
{ "split": "train", "index": 2080, "acecode_id": "evol_22408", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a four-dimensional array, write a recursive function that collects all elements in this nested array along with their depth level. The base level (the outermost brackets) is considered level 1. Your function should return a list of tuples where each tuple contains an elem...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_elements([[[[1]]]]) == [(1, 4)]\", \"assert print_elements([[[[1, 2], [3, 4]]]]) == [(1, 4), (2, 4), (3, 4), (4, 4)]\", \"assert print_elements([[[[1, 2]], [[3, 4]]]]) == [(1, 4), (2, 4), (3, 4), (4, 4)]\", \"assert print_elements([[[[1, 2, 3], [4, 5]]...
{ "split": "train", "index": 2081, "acecode_id": "evol_20263", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a regular expression pattern and a string. Your task is to create a function that finds all occurrences of the pattern in the string and returns them as a list. If there are no matches, return an empty list. The function should be defined as `find_matches(pattern:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_matches('a', 'abcabc') == ['a', 'a']\", \"assert find_matches('bc', 'abcabc') == ['bc', 'bc']\", \"assert find_matches('z', 'abcabc') == []\", \"assert find_matches('^a', 'abcabc') == ['a']\", \"assert find_matches('c$', 'abcabc') == ['c']\", \"assert f...
{ "split": "train", "index": 2082, "acecode_id": "bigcode_python_fns_35484", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a number representing a duration and a unit of time, write a function that calculates the corresponding date from a fixed epoch date (January 1, 1970). The function should take two parameters: an integer 'date' representing the duration and a string 'unit' representing th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert date_since_epoch(0, 'day') == '1970-01-01'\", \"assert date_since_epoch(1, 'day') == '1970-01-02'\", \"assert date_since_epoch(365, 'day') == '1971-01-01'\", \"assert date_since_epoch(1, 'year') == '1971-01-01'\", \"assert date_since_epoch(1, 'week') == '197...
{ "split": "train", "index": 2083, "acecode_id": "bigcode_python_fns_34467", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns a new list containing only the even integers from the original list, in the order they appeared. If there are no even integers, return an empty list.\nPlease reason step by step, then write a self-contained Python solution...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert even_integers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert even_integers([10, 15, 20, 25]) == [10, 20]\", \"assert even_integers([1, 3, 5, 7, 9]) == []\", \"assert even_integers([2, 4, 6, 8]) == [2, 4, 6, 8]\", \"assert even_integers([-1, -2, -3, -4]) == [-2, -4]\...
{ "split": "train", "index": 2084, "acecode_id": "bigcode_python_fns_2911", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function that simulates the behavior of a component in an electrical circuit. The function is called `calculate_part_stress_lambda_b(insulation_id, voltage, temperature)`. This function should raise a KeyError if the provided `insulation_id` does not correspond ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_part_stress_lambda_b(2, 200, 30) == 3000.0\", \"assert calculate_part_stress_lambda_b(3, 150, 20) == 1000.0\", \"assert calculate_part_stress_lambda_b(1, 50, 10) == 500.0\", \"assert calculate_part_stress_lambda_b(2, 75, 15) == 562.5\", \"assert ca...
{ "split": "train", "index": 2085, "acecode_id": "bigcode_python_fns_6437", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that computes the scalar multiplication of two vectors. The function should take two lists of integers, vector1 and vector2, and return the scalar product. If the vectors are of different lengths, return an error message 'Error: Vectors must be of the same ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert scalar_multiplication([1, 2, 3], [4, 5, 6]) == 32\", \"assert scalar_multiplication([0, 0, 0], [1, 2, 3]) == 0\", \"assert scalar_multiplication([-1, -2, -3], [4, 5, 6]) == -32\", \"assert scalar_multiplication([1, 2], [3, 4]) == 11\", \"assert scalar_multip...
{ "split": "train", "index": 2086, "acecode_id": "evol_31487", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string consisting of words separated by spaces. Each word consists of lowercase letters only. Write a function that counts the number of distinct words in the given string. A word is considered distinct if it appears at least once in the string. The function sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_distinct_words('apple banana apple orange') == 3\", \"assert count_distinct_words('hello world hello') == 2\", \"assert count_distinct_words('cat dog cat mouse') == 3\", \"assert count_distinct_words('python code python code') == 2\", \"assert count_di...
{ "split": "train", "index": 2087, "acecode_id": "bigcode_python_fns_21019", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `get_sublist` that takes two parameters: `start` (the starting index) and `size` (the number of elements to return). The function should return a sublist of the input list starting from the index specified by `start` and containing `si...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_sublist([1, 2, 3, 4, 5], 0, 3) == [1, 2, 3]\", \"assert get_sublist([1, 2, 3, 4, 5], 2, 2) == [3, 4]\", \"assert get_sublist([1, 2, 3, 4, 5], 4, 1) == [5]\", \"assert get_sublist([1, 2, 3, 4, 5], 5, 1) == []\", \"assert get_sublist([1, 2, 3, 4, 5], 2, 10...
{ "split": "train", "index": 2088, "acecode_id": "bigcode_python_fns_18", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that calculates the frequency of each word in a given text string. The function should be case-insensitive and ignore punctuation marks. Your function should return a dictionary where the keys are the unique words from the text and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert word_frequency('The quick brown fox jumps over the lazy dog!') == {'the': 2, 'quick': 1, 'brown': 1, 'fox': 1, 'jumps': 1, 'over': 1, 'lazy': 1, 'dog': 1}\", \"assert word_frequency('Hello, world! Hello.') == {'hello': 2, 'world': 1}\", \"assert word_frequen...
{ "split": "train", "index": 2089, "acecode_id": "oss_9205", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates a username and password for a login system. The function should take two parameters: a username and a password. The username must be at least 3 characters long and contain only alphanumeric characters. The password must...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_login('user1', 'Password1!') == True\", \"assert validate_login('us', 'Password1!') == False\", \"assert validate_login('user1', 'pass') == False\", \"assert validate_login('user1', 'password') == False\", \"assert validate_login('user1', 'PASSWORD1...
{ "split": "train", "index": 2090, "acecode_id": "bigcode_python_fns_17306", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a filename, write a function that returns the complete path to that file located in a directory named 'data'. The base path to the 'data' directory is '/home/user/data/'. The function should concatenate this base path with the provided filename and r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_complete_path('file.txt') == '/home/user/data/file.txt'\", \"assert get_complete_path('document.pdf') == '/home/user/data/document.pdf'\", \"assert get_complete_path('image.png') == '/home/user/data/image.png'\", \"assert get_complete_path('notes.txt') =...
{ "split": "train", "index": 2091, "acecode_id": "bigcode_python_fns_32854", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the root of a binary tree, return the length of the diameter of the tree, where the diameter is defined as the length of the longest path between any two nodes in the tree. This path may or may not pass through the root. The length of a path is represented by the sum of t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert diameterOfBinaryTree([1], []) == 1\", \"assert diameterOfBinaryTree([1, 2, 3], [(1, 2, 5), (1, 3, 10)]) == 16\", \"assert diameterOfBinaryTree([1, 2, 3, 4], [(1, 2, 4), (2, 3, 5), (3, 4, 6)]) == 16\", \"assert diameterOfBinaryTree([1], []) == 1\", \"assert d...
{ "split": "train", "index": 2092, "acecode_id": "evol_21882", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates searching for TV shows based on their title or release year. You need to implement a function called `search_tv_shows` that takes in two parameters: a `title` (string) and a `year` (integer). The function should return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_tv_shows('Action', 2020) == ['Action Show 1', 'Action Show 2']\", \"assert search_tv_shows('Action Show 2', 2020) == ['Action Show 1', 'Action Show 2']\", \"assert search_tv_shows('Action', 2019) == ['Action Show 1', 'Action Show 2']\", \"assert searc...
{ "split": "train", "index": 2093, "acecode_id": "oss_24550", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates a subreddit name based on certain criteria. The function should take a subreddit name as input and return a boolean value indicating whether the subreddit name is valid or not. The validation criteria are as follows: 1....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_subreddit('r/python') == True\", \"assert validate_subreddit('r/abc') == True\", \"assert validate_subreddit('r/a') == False\", \"assert validate_subreddit('r/verylongsubredditname') == False\", \"assert validate_subreddit('python') == True\", \"ass...
{ "split": "train", "index": 2094, "acecode_id": "oss_13344", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a file management system. The function should take the following parameters: a string `file_path` representing the path of a file, a string `new_path` representing the new path to which the file should be moved, and a boole...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert file_management('test-file.txt', '/dev/test-file.txt', True) == 'File moved to /dev/test-file.txt'\", \"assert file_management('test-file.txt', '/dev/test-file.txt', False) == 'Move failed; the file remains at test-file.txt'\", \"assert file_management('my_f...
{ "split": "train", "index": 2095, "acecode_id": "bigcode_python_fns_13478", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an integer `available_memory` representing the total available memory in bytes. Your task is to create a list of command-line arguments to be used for running a system command with specific memory constraints. The function should return a list of strings that incl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_command_args(1024) == ['command', '--uid', '1000', '--gid', '1000', '-p', 'MemoryLimit=512B']\", \"assert get_command_args(2048) == ['command', '--uid', '1000', '--gid', '1000', '-p', 'MemoryLimit=1024B']\", \"assert get_command_args(0) == []\", \"assert...
{ "split": "train", "index": 2096, "acecode_id": "bigcode_python_fns_5678", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a caching mechanism using Python decorators. Your goal is to create a `TTLCache` decorator that caches the return value of a function for a specified time-to-live (TTL) period. The decorator should take a single argument representing the TTL in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert TTLCache(5)(lambda: 'Hello')() == 'Hello'\", \"assert TTLCache(5)(lambda: 3 + 2)() == 5\", \"assert TTLCache(2)(lambda x: x * 2)(10) == 20\", \"assert TTLCache(1)(lambda: 'World')() == 'World'\", \"assert TTLCache(3)(lambda x: x)(5) == 5\", \"assert TTLCache...
{ "split": "train", "index": 2097, "acecode_id": "oss_34574", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a structured representation of a dashboard for displaying counts of patients, studies, and images. The function should return a dictionary containing three keys: 'patients', 'studies', and 'images'. Each key should map to a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_dashboard_data(0, 0, 0) == {'patients': {'count': 0, 'label': 'patients'}, 'studies': {'count': 0, 'label': 'studies'}, 'images': {'count': 0, 'label': 'images'}}\", \"assert generate_dashboard_data(5, 10, 15) == {'patients': {'count': 5, 'label': '...
{ "split": "train", "index": 2098, "acecode_id": "bigcode_python_fns_32917", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `mkgmtime(utc_tuple)` that takes a time tuple in UTC format and returns the corresponding time in seconds since the Epoch (January 1, 1970, 00:00:00 UTC). The input `utc_tuple` will have the format returned by `gmtime()`, which is a tuple with the following...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert mkgmtime((2023, 10, 1, 0, 0, 0, 0, 274, 0)) == 1696118400\", \"assert mkgmtime((1970, 1, 1, 0, 0, 0, 3, 1, 0)) == 0\", \"assert mkgmtime((2000, 1, 1, 0, 0, 0, 6, 1, 0)) == 946684800\", \"assert mkgmtime((1999, 12, 31, 23, 59, 59, 5, 365, 0)) == 946684799\", ...
{ "split": "train", "index": 2099, "acecode_id": "evol_34437", "num_tests": 13 }