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 that simulates the management of game entities in a simple online game management system. Your function, named `manage_game_entities`, should take three lists as parameters: one for configurations, one for players, and one for timers. Eac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_game_entities([Config('Config1', {'setting1': 'value1'})], [Player('user1', 5)], [SituationTimer(30, 'situation1')]) == {'configs': 1, 'players': 1, 'timers': 1}\", \"assert manage_game_entities([], [], []) == {'configs': 0, 'players': 0, 'timers': 0}...
{ "split": "train", "index": 2500, "acecode_id": "oss_33577", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the shape of an input tensor, compute the output shape of an average pooling layer. The input tensor shape is represented as a sequence of integers, where the first dimension is the batch size (which can be `None`). You are also provided with the parameters for the averag...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_avgpool_output_shape((1, 32, 32, 3), kernel_size=2, stride=2, padding=0, channel_last=True) == (1, 16, 16, 3)\", \"assert compute_avgpool_output_shape((None, 32, 32, 3), kernel_size=2, stride=2, padding=0, channel_last=True) == (None, 16, 16, 3)\", \...
{ "split": "train", "index": 2501, "acecode_id": "bigcode_python_fns_8948", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that takes a two-dimensional list (matrix) as input and returns a list of unique elements along with their locations if they appear only once in the matrix. Each unique element should be represented as a tuple containing the element and a list of its coordi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_unique([[1, 1, 1], [1, 2, 1], [1, 1, 1]]) == [(2, [(1, 1)])]\", \"assert find_unique([[5, 5, 5], [5, 5, 5], [5, 5, 5]]) == []\", \"assert find_unique([[1]]) == [(1, [(0, 0)])]\", \"assert find_unique([[10, 20, 10], [30, 40, 50], [20, 30, 40]]) == [(50, ...
{ "split": "train", "index": 2502, "acecode_id": "evol_29010", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes HTTP error codes and generates a user-friendly error message based on the status code and the resource name that was requested. The function should follow these rules: If the status code is 404, the error message should ind...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_error_message(404, 'UserProfile') == 'UserProfile not found.'\", \"assert format_error_message(500, 'Server') == 'Unknown error. Status code 500.'\", \"assert format_error_message(401, 'Dashboard') == 'Unknown error. Status code 401.'\", \"assert form...
{ "split": "train", "index": 2503, "acecode_id": "bigcode_python_fns_24169", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of user OCIDs (unique identifiers) and returns a list of SMTP usernames corresponding to these user OCIDs. Each user OCID is associated with a specific SMTP username stored in a predefined dictionary. If an OCID does not...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_smtp_usernames(['ocid1', 'ocid2', 'ocid3']) == ['user1@example.com', 'user2@example.com', 'Not Found']\", \"assert get_smtp_usernames(['ocid4', 'ocid5']) == ['user3@example.com', 'Not Found']\", \"assert get_smtp_usernames(['ocid11', 'ocid12']) == ['Not ...
{ "split": "train", "index": 2504, "acecode_id": "bigcode_python_fns_30239", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function `check_parity(number: int) -> str` that takes an integer as input and returns 'Even' if the number is even, and 'Odd' if the number is odd. The function should not take any other inputs or outputs. It is guaranteed that the input will be a valid integer.\nP...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_parity(0) == 'Even'\", \"assert check_parity(1) == 'Odd'\", \"assert check_parity(2) == 'Even'\", \"assert check_parity(3) == 'Odd'\", \"assert check_parity(-1) == 'Odd'\", \"assert check_parity(-2) == 'Even'\", \"assert check_parity(4) == 'Even'\", \"...
{ "split": "train", "index": 2505, "acecode_id": "evol_5100", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a user identifier, an optional environment string, and an optional list of group identifiers. Write a function `transmute(user: str, env: Optional[str], group: Optional[List[str]]) -> Dict[str, Union[str, List[str]]]` that returns a dictionary containing the user,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transmute('user1', 'dev', ['group1', 'group2']) == {'user': 'user1', 'env': 'dev', 'group': ['group1', 'group2']}\", \"assert transmute('user2', None, None) == {'user': 'user2', 'env': None, 'group': None}\", \"assert transmute('user3', 'prod', ['group3']) =...
{ "split": "train", "index": 2506, "acecode_id": "bigcode_python_fns_15147", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a list of integers and returns a new list containing only the even integers from the input list. Your function should maintain the order of the integers as they appear in the input list. Implement the function `filter_ev...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 21, 32, 43, 54]) == [10, 32, 54]\", \"assert filter_even_numbers([0, 1, 2, 3, 4]) == [0, 2, 4]\", \"assert filter_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert fi...
{ "split": "train", "index": 2507, "acecode_id": "oss_20044", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_url(protocol: str, subdomain: str, domain: str, path: str) -> str` that constructs a URL based on the provided protocol, subdomain, domain, and path. The function should handle cases where the protocol or domain is missing, and ensure that the path ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_url('https', 'mypage', 'google', 'search') == 'https://www.mypage.google.com/search'\", \"assert create_url('https', 'mypage', 'google', '') == 'https://www.mypage.google.com/'\", \"assert create_url('https', '', 'google', 'search') == 'https://google...
{ "split": "train", "index": 2508, "acecode_id": "evol_35628", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that simulates the destruction of a specified model. The function should take a single string input representing the name of the model to be destroyed. The function should return a message indicating that the model has been successfully de...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert destroy_model('ModelA') == 'Model ModelA has been destroyed.'\", \"assert destroy_model('ModelB') == 'Model ModelB has been destroyed.'\", \"assert destroy_model('MyModel') == 'Model MyModel has been destroyed.'\", \"assert destroy_model('TestModel') == 'Mod...
{ "split": "train", "index": 2509, "acecode_id": "bigcode_python_fns_41557", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that takes two lists as input. The first list contains a set of integers, and the second list has the same length as the first but contains boolean values. Implement a function that identifies the prime numbers in the first list where the corresponding b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert identify_primes([4, 5, 6, 7, 8], [True, True, True, True, True]) == [(1, 5), (3, 7)]\", \"assert identify_primes([10, 12, 14, 15, 16], [False, False, False, False, False]) == []\", \"assert identify_primes([1, 2, 3, 4, 5], [True, True, True, True, True]) == ...
{ "split": "train", "index": 2510, "acecode_id": "evol_19285", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of table names and a target table name, write a function that checks if the target table name exists in the list of table names. The function should return True if the target table exists and False otherwise. The function signature is: `def check_table_exists(table...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_table_exists(['users', 'orders', 'products'], 'users') == True\", \"assert check_table_exists(['users', 'orders', 'products'], 'customers') == False\", \"assert check_table_exists(['employees', 'departments', 'salaries'], 'departments') == True\", \"as...
{ "split": "train", "index": 2511, "acecode_id": "bigcode_python_fns_49512", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a non-negative integer representing a total number of seconds, write a function that converts this value into hours, minutes, and seconds. The function should return a tuple containing three integers: the first integer represents the number of hours, the second integer re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sec2hms(0) == (0, 0, 0)\", \"assert sec2hms(59) == (0, 0, 59)\", \"assert sec2hms(60) == (0, 1, 0)\", \"assert sec2hms(61) == (0, 1, 1)\", \"assert sec2hms(3600) == (1, 0, 0)\", \"assert sec2hms(3660) == (1, 1, 0)\", \"assert sec2hms(3661) == (1, 1, 1)\", \"...
{ "split": "train", "index": 2512, "acecode_id": "bigcode_python_fns_25874", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers, an integer n, and an integer k. The function should return a new list where for each index in the original list, if the index is divisible by n, the corresponding value in the new list should be the original value multiplied b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert advanced_sort([10, 20, 30, 40, 50], 1, 2) == [100, 80, 60, 40, 20]\", \"assert advanced_sort([1], 1, 10) == [10]\", \"assert advanced_sort([42, 58, 76], 1, 3) == [228, 174, 126]\", \"assert advanced_sort([1, 0, -1], 1, 1) == [-1, 0, 1]\", \"assert advanced_s...
{ "split": "train", "index": 2513, "acecode_id": "evol_28934", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates updating the state of a private link service connection. The function should accept two parameters: a private endpoint (represented as a string) and a connection state (represented as a dictionary). The function should retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_private_link_connection('endpoint1', {'status': 'approved'}) == {'private_endpoint': 'endpoint1', 'connection_state': {'status': 'approved'}}\", \"assert update_private_link_connection('endpoint2', {'status': 'pending'}) == {'private_endpoint': 'endpo...
{ "split": "train", "index": 2514, "acecode_id": "oss_962", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary called `trajectory` that contains a key 'solution_values'. The value associated with this key is a list of lists, where each inner list contains numerical values. Your task is to implement a function that computes the sum of all the numerical values i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_solution_values({'solution_values': [[1, 2, 3], [4, 5, 6], [7, 8, 9]]}) == 45\", \"assert sum_solution_values({'solution_values': [[10, 20], [30]]}) == 60\", \"assert sum_solution_values({'solution_values': [[0, 0, 0], [0]]}) == 0\", \"assert sum_solutio...
{ "split": "train", "index": 2515, "acecode_id": "oss_36496", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with extracting the revision ID from a given revision script string. The revision script is a Python file that contains revision metadata. Your goal is to implement a function that takes a revision script as input and returns the revision ID extracted from it. Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_revision_id(\\\"\\\"\\\"Revision ID: 17346cf564bc\\nRevises: <PASSWORD>\\nCreate Date: 2014-03-07 14:45:27.909631\\n\\n# revision identifiers, used by Alembic.\\nrevision = '17346cf564bc'\\\"\\\"\\\") == '17346cf564bc'\", \"assert extract_revision_id...
{ "split": "train", "index": 2516, "acecode_id": "oss_21695", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers, where each integer represents the scores of various evaluations. Your task is to implement a function that calculates the average score from the list of scores. The average score should be rounded to two decimal places. If the list is empty, re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average([10, 20, 30]) == 20.00\", \"assert calculate_average([1, 2, 3, 4, 5]) == 3.00\", \"assert calculate_average([5, 15]) == 10.00\", \"assert calculate_average([100]) == 100.00\", \"assert calculate_average([]) == 0.00\", \"assert calculate_ave...
{ "split": "train", "index": 2517, "acecode_id": "bigcode_python_fns_24260", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `download_process_hook(event: dict) -> None` that simulates the handling of a file downloading process. The function takes a dictionary `event` as input which contains the following keys: 'filename' (a string representing the name of the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert download_process_hook({'filename': 'episode1.mp4', 'total_bytes': 5000, 'downloaded_bytes': 2500}) == None\", \"assert download_process_hook({'filename': 'episode2.mp4', 'total_bytes_estimate': 10000}) == None\", \"assert download_process_hook({'filename': '...
{ "split": "train", "index": 2518, "acecode_id": "bigcode_python_fns_30370", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a non-negative integer n, write a function that determines whether n can be expressed as the sum of two non-negative integer squares. If it can, return a tuple (a, b) such that n = a^2 + b^2 with a <= b. If it cannot be expressed in this way, raise a ValueError. The funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert two_squares(0) == (0, 0)\", \"assert two_squares(1) == (0, 1)\", \"assert two_squares(2) == (1, 1)\", \"assert two_squares(4) == (0, 2)\", \"assert two_squares(5) == (1, 2)\", \"assert two_squares(8) == (2, 2)\", \"assert two_squares(9) == (0, 3)\", \"assert...
{ "split": "train", "index": 2519, "acecode_id": "bigcode_python_fns_34925", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries where each dictionary represents a task with a unique 'task_id' and other associated properties. Your goal is to implement a function that retrieves the 'task_id' of the first task in the list and returns it. If the list is empty, return -1....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_first_task_id([{'task_id': 1, 'name': 'Task 1'}, {'task_id': 2, 'name': 'Task 2'}]) == 1\", \"assert get_first_task_id([{'task_id': 10, 'name': 'Task 10'}, {'task_id': 20, 'name': 'Task 20'}, {'task_id': 30, 'name': 'Task 30'}]) == 10\", \"assert get_fir...
{ "split": "train", "index": 2520, "acecode_id": "bigcode_python_fns_313", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that generates a dictionary containing a specified number (n) of unique random integers as keys, where each key is an integer between 1 and 100, and the corresponding value is the cube of that key. The function should take an integer n as input and return t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_dictionary(0) == {}\", \"assert generate_dictionary(101) == {}\", \"assert isinstance(generate_dictionary(10), dict) == True\", \"assert len(generate_dictionary(10)) == 10\", \"assert all(1 <= key <= 100 for key in generate_dictionary(10).keys())\",...
{ "split": "train", "index": 2521, "acecode_id": "evol_20791", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Create a function that takes a string denoting a file name and returns 'Yes' if the name is valid; otherwise, 'No'. A file name is deemed valid if it satisfies the following conditions: \n- The name must feature alphanumeric characters, with at least one uppercase and one lower...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert file_name_check('ValidFile.txt') == 'Yes'\", \"assert file_name_check('example.txt') == 'No'\", \"assert file_name_check('FileNameWithTooManyDigits1234.txt') == 'No'\", \"assert file_name_check('FileName..txt') == 'No'\", \"assert file_name_check('Invalid*Fi...
{ "split": "train", "index": 2522, "acecode_id": "evol_34039", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes in two or more lists and returns a sorted list of unique elements that are present in all of the given lists. The function should raise a TypeError if any of the lists are None, and a ValueError if any of the lists contain elements that are not i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shared_elements([1, 2, 3], [2, 3, 4]) == [2, 3]\", \"assert shared_elements([1, 2, 3], [4, 5, 6]) == []\", \"assert shared_elements([1, 2, 2], [2, 3, 3]) == [2]\", \"assert shared_elements([10, 20, 30], [30, 40, 50], [20, 30]) == [30]\", \"assert shared_elem...
{ "split": "train", "index": 2523, "acecode_id": "evol_3786", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a given string and returns the frequency of each word in the string. Your task is to implement the function `word_frequency_counter(text)` that takes a string `text` as input and returns a dictionary where the keys a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert word_frequency_counter('Hello, how are you? Are you doing well?') == {'hello': 1, 'how': 1, 'are': 2, 'you': 2, 'doing': 1, 'well': 1}\", \"assert word_frequency_counter('This is a test. This test is only a test.') == {'this': 2, 'is': 2, 'a': 2, 'test': 3, ...
{ "split": "train", "index": 2524, "acecode_id": "oss_34304", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the total number of invites from a series of invite link counts. Each invite link count is represented by a dictionary containing a 'count' key that holds the number of invites for that link. Implement a function `get_total_invite_count(invite_li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_total_invite_count([{'count': 5}, {'count': 3}, {'count': 2}]) == 10\", \"assert get_total_invite_count([{'count': 0}, {'count': 0}, {'count': 0}]) == 0\", \"assert get_total_invite_count([{'count': 1}]) == 1\", \"assert get_total_invite_count([]) == 0\"...
{ "split": "train", "index": 2525, "acecode_id": "oss_14633", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a dictionary as an input and returns a new dictionary sorted in ascending order based on the numerical values associated with each key. The input dictionary will contain string keys and integer values. Your function should preserve the original k...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_dict({'Alice': 4, 'Bob': 1, 'Charlie': 3}) == {'Bob': 1, 'Alice': 4, 'Charlie': 3}\", \"assert sort_dict({'Zebra': 2, 'Lion': 5, 'Elephant': 3}) == {'Zebra': 2, 'Elephant': 3, 'Lion': 5}\", \"assert sort_dict({'A': 10, 'B': 10, 'C': 10}) == {'A': 10, 'B...
{ "split": "train", "index": 2526, "acecode_id": "evol_6835", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function `create_entity` that takes three distinct attributes, one as an integer, one as a string, and one as a float. The function should return a dictionary representing an entity with these three attributes. The keys of the dictionary should be 'attribute1', 'attrib...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_entity(5, 'hello', 7.2) == {'attribute1': 5, 'attribute2': 'hello', 'attribute3': 7.2}\", \"assert create_entity(0, 'world', 3.14) == {'attribute1': 0, 'attribute2': 'world', 'attribute3': 3.14}\", \"assert create_entity(-1, 'test', 2.718) == {'attrib...
{ "split": "train", "index": 2527, "acecode_id": "evol_34052", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple function that simulates a financial chatbot's response to user queries about their expenses and account balance. The chatbot should respond to two types of queries: '差額' (difference) and '残高' (balance). Given a string `money_msg` repres...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_chatbot_response('\\u5dee\\u984d', 100) == '\\u5148\\u6708\\u3068\\u306e\\u5dee\\u984d\\u306f100\\u5186\\u3060\\u3088'\", \"assert generate_chatbot_response('\\u5dee\\u984d', -50) == '\\u5148\\u6708\\u3068\\u306e\\u5dee\\u984d\\u306f\\u30de\\u30a4\\...
{ "split": "train", "index": 2528, "acecode_id": "oss_16243", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_product_of_three_primes(n)` that returns True if the input number is the product of exactly three prime numbers, otherwise return False. The input number will be a positive integer.\nPlease reason step by step, then write a self-contained Python solutio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_product_of_three_primes(30) == True\", \"assert is_product_of_three_primes(42) == True\", \"assert is_product_of_three_primes(18) == False\", \"assert is_product_of_three_primes(105) == True\", \"assert is_product_of_three_primes(15) == False\", \"assert ...
{ "split": "train", "index": 2529, "acecode_id": "evol_32695", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a two-dimensional list of integers, write a function `find_max_deviation(arr)` that calculates the difference between the maximum and minimum integers present in the entire two-dimensional list. The function should return this difference as an integer.\nPlease reason step...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_deviation([[3, 10, 2], [6, 4, 8, 1]]) == 9\", \"assert find_max_deviation([[1, 2], [3, 4], [5, 6]]) == 5\", \"assert find_max_deviation([[0, 0], [0, 0]]) == 0\", \"assert find_max_deviation([[7]]) == 0\", \"assert find_max_deviation([[10, 20, 30], [...
{ "split": "train", "index": 2530, "acecode_id": "evol_9043", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that determines whether the given input string is more likely to be plain English text or binary data. Your function should take a single string input and return 'Text' if it is determined to be plain English text, and 'Binary' if it is de...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert detect_plaintext_type('Hello, how are you?') == 'Text'\", \"assert detect_plaintext_type('This is a test string.') == 'Text'\", \"assert detect_plaintext_type('Hello World!') == 'Text'\", \"assert detect_plaintext_type('abcdefg') == 'Text'\", \"assert detect...
{ "split": "train", "index": 2531, "acecode_id": "bigcode_python_fns_46969", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes financial data and generates a summary report based on given inputs. The function should take in two parameters: `income_statement` and `stonk_rows`. The `income_statement` parameter is a dictionary containing financial inf...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_financial_summary({'currency': 'USD', 'revenue': 1000000, 'expenses': 600000, 'profit': 400000}, {'AAPL': [150, 155, 148], 'GOOGL': [2200, 2250, 2180], 'MSFT': [250, 255, 248]}) == 'Financial Summary for USD:\\\\nrevenue: 1000000\\\\nexpenses: 60000...
{ "split": "train", "index": 2532, "acecode_id": "oss_18571", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that sorts the list in ascending order and returns the sorted list. Additionally, implement a function that compares two integers and returns the larger one, or 'Both are equal' if they are equal. Write a single function that perfo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_and_compare([52, 44, 92, 38, 17, 59, 5], 10, 5) == ([5, 17, 38, 44, 52, 59, 92], 10)\", \"assert sort_and_compare([3, 1, 4, 1, 5], 6, 6) == ([1, 1, 3, 4, 5], 'Both are equal')\", \"assert sort_and_compare([10, 20, 30, 5], 15, 25) == ([5, 10, 20, 30], 25...
{ "split": "train", "index": 2533, "acecode_id": "evol_14013", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a user logging out of a web application. The function should take no parameters and return a string indicating that the user has successfully logged out. The string should be 'User has logged out'. Implement the function `l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert logout_user() == 'User has logged out'\", \"assert logout_user() == 'User has logged out'\", \"assert logout_user() == 'User has logged out'\", \"assert logout_user() == 'User has logged out'\", \"assert logout_user() == 'User has logged out'\", \"assert log...
{ "split": "train", "index": 2534, "acecode_id": "bigcode_python_fns_14099", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string containing various types of text, write a function `extract_and_count_urls(text: str) -> Dict[str, int]` that extracts all valid HTTP and HTTPS URLs from the text and counts the occurrences of each unique URL scheme (http and https). The function should return a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_and_count_urls('Visit us at http://example.com and https://google.com.') == {'http': 1, 'https': 1}\", \"assert extract_and_count_urls('No URLs here!') == {}\", \"assert extract_and_count_urls('Check this out: http://example.com, https://example.org,...
{ "split": "train", "index": 2535, "acecode_id": "evol_20710", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of directed edges in the form of tuples (u, v), where each tuple represents a directed edge from node u to node v in a directed graph. Your task is to convert this list of edges into a weighted representation where the weight of each edge is the count of ho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_weighted_graph([(1, 2), (2, 3), (1, 2)]) == {(1, 2): 2, (2, 3): 1}\", \"assert convert_to_weighted_graph([(1, 2), (1, 2), (1, 3), (2, 1)]) == {(1, 2): 2, (1, 3): 1, (2, 1): 1}\", \"assert convert_to_weighted_graph([(3, 4), (4, 5), (3, 4), (4, 5), ...
{ "split": "train", "index": 2536, "acecode_id": "bigcode_python_fns_17140", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function 'construct_spiral' that accepts an integer 'n', a pattern ('prime' or 'fibonacci'), and an optional integer 'extra'. The function should generate a list representing the number of components for each curve in a spiral structure with 'n' turns. The spiral st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_spiral(3, 'prime') == [3, 5, 8]\", \"assert construct_spiral(1, 'prime') == [1]\", \"assert construct_spiral(1, 'fibonacci') == [1]\", \"assert construct_spiral(2, 'prime') == [2, 4]\", \"assert construct_spiral(2, 'fibonacci') == [2, 3]\", \"asser...
{ "split": "train", "index": 2537, "acecode_id": "evol_3533", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a set of SQL conditions for validating network test results based on various criteria. The validation rules are as follows: \n1. The TCP state must indicate that a connection is established or in a valid state. The vali...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_sql_conditions('server_to_client') == '(web100_log_entry.snap.State = 1\\\\n\\\\t\\\\tOR (web100_log_entry.snap.State >= 5\\\\n\\\\t\\\\tAND web100_log_entry.snap.State <= 11))\\\\n\\\\tAND blacklist_flags == 0\\\\n\\\\tAND web100_log_entry.snap.Con...
{ "split": "train", "index": 2538, "acecode_id": "bigcode_python_fns_9597", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You need to implement a function that checks if a user has access to the admin dashboard based on their role. The function should take a string representing the user's role and return a message indicating whether the user has access or not. If the role is 'admin', return 'Welco...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_admin_access('admin') == 'Welcome to the admin dashboard'\", \"assert check_admin_access('user') == 'Access Denied: Admin role required'\", \"assert check_admin_access('guest') == 'Access Denied: Admin role required'\", \"assert check_admin_access('edi...
{ "split": "train", "index": 2539, "acecode_id": "oss_31980", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers or a list of lists of integers and an integer delimiter. Your task is to write a function `intersperse(numbers: Union[List[int], List[List[int]]], delimiter: int) -> List[int]` that includes the digit `delimiter` among each pair of adjacent numb...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert intersperse([], 4) == []\", \"assert intersperse([1, 2, 3], 4) == [1, 4, 2, 4, 3]\", \"assert intersperse([10, 20, 30, 40], 5) == [10, 5, 20, 5, 30, 5, 40]\", \"assert intersperse([1], 0) == [1]\", \"assert intersperse([5, 15], 10) == [5, 10, 15]\", \"assert...
{ "split": "train", "index": 2540, "acecode_id": "evol_32118", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `extended_euclidean(a: int, b: int) -> Tuple[int, int, int]` that takes two integers, `a` and `b`, and returns a tuple containing three values: the greatest common divisor (GCD) of `a` and `b`, and two integers `x` and `y` such that ax + by = gcd(a, b).\nPl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extended_euclidean(35, 15) == (5, 1, -2)\", \"assert extended_euclidean(101, 10) == (1, 1, -10)\", \"assert extended_euclidean(0, 5) == (5, 0, 1)\", \"assert extended_euclidean(5, 0) == (5, 1, 0)\", \"assert extended_euclidean(13, 29) == (1, 9, -4)\", \"asse...
{ "split": "train", "index": 2541, "acecode_id": "evol_4724", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of buildings in a row. A building can be seen by an observer if there are no taller buildings to its left. Write a function `visible_buildings(heights: List[int]) -> int` that returns the number of buildings that are vis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert visible_buildings([3, 1, 4, 2, 5]) == 3\", \"assert visible_buildings([1, 2, 3, 4, 5]) == 5\", \"assert visible_buildings([5, 4, 3, 2, 1]) == 1\", \"assert visible_buildings([2, 2, 2, 2, 2]) == 1\", \"assert visible_buildings([0, 1, 0, 2, 1]) == 3\", \"asser...
{ "split": "train", "index": 2542, "acecode_id": "bigcode_python_fns_25050", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function named `get_active_validator_keys`. This function will take a list of validator information, where each validator is represented as a dictionary containing a 'public_key' and 'status'. Your job is to return a list of public keys of val...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_active_validator_keys([{'public_key': 'key1', 'status': 'ACTIVE'}, {'public_key': 'key2', 'status': 'INACTIVE'}]) == ['key1']\", \"assert get_active_validator_keys([{'public_key': 'key1', 'status': 'ACTIVE'}, {'public_key': 'key2', 'status': 'ACTIVE'}]) ...
{ "split": "train", "index": 2543, "acecode_id": "oss_7187", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function that checks if a given string is a palindrome. The function should ignore punctuation marks, spaces, and letter casing. Return True if the string is a palindrome, and False otherwise.\nPlease reason step by step, then write a self-contained Python solution....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert checkPalindrome('A man, a plan, a canal: Panama') == True\", \"assert checkPalindrome('race a car') == False\", \"assert checkPalindrome('') == True\", \"assert checkPalindrome('Able was I ere I saw Elba') == True\", \"assert checkPalindrome('No lemon, no me...
{ "split": "train", "index": 2544, "acecode_id": "evol_3558", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program that processes a list of text inputs, where each input is a multi-line string representing a religious confession or prayer. Your program should implement a single function that analyzes each confession or prayer and produces a list of dic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_confessions([\\\"Strengthen us to love and obey you in newness of life;\\\\nthrough Jesus Christ our Lord.\\\\nAmen\\\"])[0]['longest_word'] == 'Strengthen'\", \"assert process_confessions([\\\"Strengthen us to love and obey you in newness of life;\\...
{ "split": "train", "index": 2545, "acecode_id": "oss_21384", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the average salary for each department from a list of employee records. Each record is represented as a tuple containing the employee's name, department, and salary. Your function should take a list of these tuples as inpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_salaries([('John Doe', 'Engineering', 75000), ('Jane Smith', 'Marketing', 60000), ('Bob Johnson', 'Engineering', 80000), ('Alice Williams', 'HR', 50000)]) == {'Engineering': 77500.0, 'Marketing': 60000.0, 'HR': 50000.0}\", \"assert calculat...
{ "split": "train", "index": 2546, "acecode_id": "oss_16838", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the creation of a sink connector for an InfluxDB database, using a specified topic name. The function should take in a string representing the topic name and return a configuration string detailing the query and topics requ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_influxdb_sink('t1') == '\\\"connect.influx.kcql\\\": \\\"INSERT INTO t1 SELECT * FROM t1 WITHTIMESTAMP sys_time()\\\"; \\\"topics\\\": \\\"t1\\\"'\", \"assert create_influxdb_sink('t2') == '\\\"connect.influx.kcql\\\": \\\"INSERT INTO t2 SELECT * FROM...
{ "split": "train", "index": 2547, "acecode_id": "bigcode_python_fns_32279", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a username. Your task is to implement a function that checks if the provided username exists in a predefined list of usernames. If the username exists, return the username; otherwise, return 'User not found'. The predefined list of usernames ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_username('alice') == 'alice'\", \"assert check_username('bob') == 'bob'\", \"assert check_username('charlie') == 'charlie'\", \"assert check_username('dave') == 'dave'\", \"assert check_username('eve') == 'eve'\", \"assert check_username('frank') == 'U...
{ "split": "train", "index": 2548, "acecode_id": "bigcode_python_fns_1559", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `rate_pin(pin: str) -> str` that takes a string representation of a user's PIN and returns its security rating as either 'strong', 'moderate', or 'weak'. A PIN is rated as 'strong' if it has an odd number of digits greater than 5, at least three non-sequent...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rate_pin('1234567') == 'weak'\", \"assert rate_pin('12345678') == 'weak'\", \"assert rate_pin('11111') == 'weak'\", \"assert rate_pin('12345') == 'weak'\", \"assert rate_pin('1234') == 'weak'\", \"assert rate_pin('2461357') == 'strong'\", \"assert rate_pin('...
{ "split": "train", "index": 2549, "acecode_id": "evol_9221", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a sequence of words based on a provided seed text. The function should take in a `seed_text` string and an integer `length` representing the number of words to generate. The generated text should consist of random words...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_sequence('the', 3) == 'the quick brown' or 'the lazy dog' or 'the quick fox'\", \"assert generate_sequence('quick', 5) == 'quick the brown fox jumps' or 'quick dog over lazy the'\", \"assert generate_sequence('lazy', 4) == 'lazy brown quick dog' or ...
{ "split": "train", "index": 2550, "acecode_id": "oss_18509", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of buildings in a row. Your task is to implement a function that calculates the maximum height of the buildings that can be seen from the left side. A building is considered visible if there are no taller buildings to it...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_visible_height([1, 2, 3, 4, 5]) == 5\", \"assert max_visible_height([5, 4, 3, 2, 1]) == 5\", \"assert max_visible_height([3, 1, 2, 1, 5]) == 5\", \"assert max_visible_height([0, 0, 0, 0]) == 0\", \"assert max_visible_height([1]) == 1\", \"assert max_visi...
{ "split": "train", "index": 2551, "acecode_id": "bigcode_python_fns_20012", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a series of values. Your task is to implement a function that takes this list and returns a new list containing only the unique values from the original list, preserving the order of their first appearance. Implement the function `u...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_values([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_values([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_values([5, 5, 5, 5, 5]) == [5]\", \"assert unique_values([1, 1, 2, 3, 2, 1, 4]) == [1, 2, 3, 4]\", \"assert unique_values...
{ "split": "train", "index": 2552, "acecode_id": "bigcode_python_fns_26039", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that computes the average of a list of numerical signals. Given a list of signals where each signal is represented as a list of floats, your function should return a new list that contains the average value of each corresponding index acr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_signals([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0]]) == [4.0, 5.0, 6.0]\", \"assert average_signals([[1.5, 2.5], [3.5, 4.5]]) == [2.5, 3.5]\", \"assert average_signals([[2.0, 4.0], [6.0, 8.0], [10.0, 12.0]]) == [6.0, 8.0]\", \"assert average_...
{ "split": "train", "index": 2553, "acecode_id": "bigcode_python_fns_4577", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a function that takes a list of integers and returns a new list where each element is doubled. Implement a function `double_elements` that takes a list of integers as input and returns a list of integers with each element doubled. For example, if the input is [1, 2, 3], t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert double_elements([1, 2, 3]) == [2, 4, 6]\", \"assert double_elements([0, 0, 0]) == [0, 0, 0]\", \"assert double_elements([-1, -2, -3]) == [-2, -4, -6]\", \"assert double_elements([5]) == [10]\", \"assert double_elements([]) == []\", \"assert double_elements([...
{ "split": "train", "index": 2554, "acecode_id": "bigcode_python_fns_25626", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of unique integers and identifies the first index where an anomaly occurs, defined as a situation where an element is smaller than its predecessor. The function should return a dictionary containing the index of the anomalous element, the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert detect_anomaly([1, 2, 3]) == {'anomaly_index': -1, 'replace_with': -1, 'total_replacements': 0}\", \"assert detect_anomaly([1]) == {'anomaly_index': -1, 'replace_with': -1, 'total_replacements': 0}\", \"assert detect_anomaly([]) == {'anomaly_index': -1, 'rep...
{ "split": "train", "index": 2555, "acecode_id": "evol_35236", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a URL-encoded payload from a given message and its associated parameters. The function should take the following parameters: message (str), user (str), api_token (str), device (str), title (str), url (str), url_title (str),...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_payload('Hello World', 'user123', 'token456', 'device789', 'Test Title', 'http://example.com', 'Example', '1', '1625097600', 'default') == 'token=token456&user=user123&message=Hello+World&device=device789&title=Test+Title&url=http%3A%2F%2Fexample.co...
{ "split": "train", "index": 2556, "acecode_id": "bigcode_python_fns_11288", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a learning rate scheduler that mimics the behavior of reducing the learning rate when the validation loss does not improve. Create a function that takes the current learning rate, a list of validation losses for each epoch, a patience value, a r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert adjust_learning_rate(0.1, [0.5, 0.5, 0.5, 0.4, 0.4], 3, 0.1, 0.01) == 0.1\", \"assert adjust_learning_rate(0.1, [0.5, 0.5, 0.5, 0.5, 0.5], 3, 0.1, 0.1) == 0.1\", \"assert adjust_learning_rate(0.1, [0.5, 0.5, 0.5, 0.5, 0.4], 3, 0.1, 0.01) == 0.1\", \"assert a...
{ "split": "train", "index": 2557, "acecode_id": "oss_7617", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the movement of a Rook on a chessboard. The Rook can move any number of squares along a row or column but cannot jump over other pieces. Given the starting position of the Rook and a list of positions of other pieces on...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_rook_move('a1', 'a8', ['b1', 'c1', 'd1']) == True\", \"assert can_rook_move('a1', 'a8', ['a2', 'b1', 'd1']) == False\", \"assert can_rook_move('h1', 'h5', []) == True\", \"assert can_rook_move('e5', 'e7', ['e6']) == False\", \"assert can_rook_move('d4', ...
{ "split": "train", "index": 2558, "acecode_id": "bigcode_python_fns_32757", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the waveforms from a set of electrodes over time, along with their corresponding spatial locations (x, y coordinates), write a function that returns a 2D list where each entry contains the spatial coordinates of the electrode and the wavefo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_waveforms([], [], 0) == []\", \"assert transform_waveforms([100], [(0, 0)], 0) == [[0, 0, 100]]\", \"assert transform_waveforms([0], [(0, 0)], 0) == [[0, 0, 0]]\", \"assert transform_waveforms([9], [(0, 0)], 0) == [[0, 0, 9]]\", \"assert transform_...
{ "split": "train", "index": 2559, "acecode_id": "bigcode_python_fns_38766", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Write a function that merges multiple sorted lists into one sorted list in descending order without using any pre-built sort functions like sort(), sorted(), etc. Each list can have different lengths and numerical values. The function should take a variable number of sorted lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_sorted_desc([7, 5, 3], [6, 4, 1], [9, 8, 2]) == [9, 8, 7, 6, 5, 4, 3, 2, 1]\", \"assert merge_sorted_desc([], []) == []\", \"assert merge_sorted_desc([10, 9], [8, 7], [6, 5, 4]) == [10, 9, 8, 7, 6, 5, 4]\", \"assert merge_sorted_desc([1], []) == [1]\",...
{ "split": "train", "index": 2560, "acecode_id": "evol_12784", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Write a python function to find the area of the largest triangle that can be inscribed in a semicircle with a given radius. The semicircle is centered at the origin (0,0) and the radius is a positive integer. The function should return the area of the triangle and the coordinat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert inscribed_triangle_properties(1.0) == (0.5, [(0, 1.0), (-1.0, 0.0), (1.0, 0.0)])\", \"assert inscribed_triangle_properties(2.0) == (2.0, [(0, 2.0), (-2.0, 0.0), (2.0, 0.0)])\", \"assert inscribed_triangle_properties(0.5) == (0.125, [(0, 0.5), (-0.5, 0.0), (0...
{ "split": "train", "index": 2561, "acecode_id": "evol_723", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `format_coordinates` that takes a list of coordinates as input. Each coordinate is represented as a tuple of two integers (x, y). The function should return a string where each coordinate is formatted in the following way: each coordi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_coordinates([(1, 2), (3, 4), (5, 6)]) == '1,2\\\\n3,4\\\\n5,6'\", \"assert format_coordinates([(0, 0)]) == '0,0'\", \"assert format_coordinates([(10, 20), (30, 40)]) == '10,20\\\\n30,40'\", \"assert format_coordinates([]) == ''\", \"assert format_coor...
{ "split": "train", "index": 2562, "acecode_id": "oss_5488", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a Python function to calculate the logarithm of a number x to the base n, where n is any real positive number greater than 1 and x is a positive real number. The function should return the logarithm value if both inputs are valid. If either input is invalid (i.e., n is l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_base_n(2, 8) == 3.0\", \"assert log_base_n(10, 100) == 2.0\", \"assert log_base_n(5, 25) == 2.0\", \"assert log_base_n(3, 27) == 3.0\", \"assert log_base_n(4, 16) == 2.0\", \"assert log_base_n(7, 49) == 2.0\", \"assert log_base_n(1.5, 3.375) == 3.0\", \"...
{ "split": "train", "index": 2563, "acecode_id": "evol_32885", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of strings as input and returns a new list containing only the unique strings from the original list, preserving the order of their first occurrence. Implement the function `unique_strings(strings: List[str]) -> List[str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_strings(['apple', 'banana', 'apple', 'orange', 'banana']) == ['apple', 'banana', 'orange']\", \"assert unique_strings(['a', 'b', 'c', 'a', 'b', 'c']) == ['a', 'b', 'c']\", \"assert unique_strings(['hello', 'world', 'hello']) == ['hello', 'world']\", \...
{ "split": "train", "index": 2564, "acecode_id": "bigcode_python_fns_33843", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary that represents a database configuration for a web application. The dictionary contains the following keys: 'DATABASE_DRIVER', 'DATABASE_USER', 'DATABASE_PASSWORD', 'DATABASE_HOST', 'DATABASE_PORT', and 'DATABASE_DB'. Write a function that takes this ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_db_url({'DATABASE_DRIVER': 'postgresql', 'DATABASE_USER': 'user', 'DATABASE_PASSWORD': 'pass', 'DATABASE_HOST': 'localhost', 'DATABASE_PORT': '5432', 'DATABASE_DB': 'mydb'}) == 'postgresql://user:pass@localhost:5432/mydb'\", \"assert create_db_url({'D...
{ "split": "train", "index": 2565, "acecode_id": "bigcode_python_fns_16535", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that takes two 1D arrays of integers and returns a new array that contains the element-wise multiplication of the two input arrays. If the lengths of the input arrays are not the same, return an empty array.\nPlease reason step by step, then write a self-co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert array_mult([1, 2, 3], [4, 5, 6]) == [4, 10, 18]\", \"assert array_mult([0, 1, 2], [3, 4, 5]) == [0, 4, 10]\", \"assert array_mult([2, 3], [4, 5]) == [8, 15]\", \"assert array_mult([], []) == []\", \"assert array_mult([1], [1]) == [1]\", \"assert array_mult([...
{ "split": "train", "index": 2566, "acecode_id": "evol_10084", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that extracts information from a given text block containing copyright and contact information for a software plugin. The function should parse the text and return a dictionary containing the copyright year, the name of the individ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_plugin_info(\\\"\\\"\\\"copyright : (C) 2020 by Alice Smith\\\\nemail : alice@example.com\\\\n\\\"\\\"\\\") == {'copyright': '2020', 'name': 'Alice Smith', 'email': 'alice@example.com'}\", \"assert extract_plugin_info(\\\"\\...
{ "split": "train", "index": 2567, "acecode_id": "oss_13522", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents a record with various fields. Your task is to implement a function that aggregates the values of a specified key across all the dictionaries in the list. The function should return a dictionary where the key...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert aggregate_values([{'a': 1, 'b': 2}, {'a': 2, 'b': 3}], 'a') == {'a': 3}\", \"assert aggregate_values([{'x': 10}, {'x': 20}, {'y': 30}], 'x') == {'x': 30}\", \"assert aggregate_values([{}, {'key': 5}], 'key') == {'key': 5}\", \"assert aggregate_values([{'foo'...
{ "split": "train", "index": 2568, "acecode_id": "bigcode_python_fns_20318", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of alert types represented as strings. Each alert type consists of the string 'AMARILLA' or 'ROJA'. Your task is to transform each alert type by replacing 'AMARILLA' with 'AMARILLAC' and 'ROJA' with 'ClR'. Write a function `transform_alerts(alerts: List[str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_alerts(['AMARILLA', 'ROJA']) == ['AMARILLAC', 'ClR']\", \"assert transform_alerts(['ROJA', 'AMARILLA', 'ROJA']) == ['ClR', 'AMARILLAC', 'ClR']\", \"assert transform_alerts(['AMARILLA']) == ['AMARILLAC']\", \"assert transform_alerts(['ROJA']) == ['C...
{ "split": "train", "index": 2569, "acecode_id": "oss_11751", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of bounding boxes and anchor boxes, where each bounding box is represented as a list of four integers [x1, y1, x2, y2] (top-left and bottom-right coordinates) and each anchor box is similarly represented, implement a function that returns a binary mask indicatin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert map_bounding_boxes_to_anchors([[0, 0, 1, 1]], [[0, 0, 1, 1]], 0.5) == ( [True], [0] )\", \"assert map_bounding_boxes_to_anchors([[0, 0, 2, 2]], [[3, 3, 4, 4]], 0.5) == ( [False], [-1] )\", \"assert map_bounding_boxes_to_anchors([[0, 0, 2, 2]], [[0, 0, 1, 1],...
{ "split": "train", "index": 2570, "acecode_id": "bigcode_python_fns_31996", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given two strings `src` and `dest`. Your task is to determine if the `dest` string should be updated with the contents of the `src` string based on the following conditions: If `src` is not an empty string, then the `dest` string should be updated if either `dest` is an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert should_update('source.txt', '') == True\", \"assert should_update('', 'destination.txt') == False\", \"assert should_update('', '') == False\", \"assert should_update('abc', 'ab') == True\", \"assert should_update('abc', 'abc') == False\", \"assert should_up...
{ "split": "train", "index": 2571, "acecode_id": "bigcode_python_fns_19400", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `is_pangram(s: str) -> bool` that checks if the string `s` is a pangram. A pangram is a sentence that contains every letter of the alphabet at least once. The function should ignore case and consider only the letters of the English alphabet (a-z).\nPlease reaso...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_pangram('The quick brown fox jumps over the lazy dog') == True\", \"assert is_pangram('Pack my box with five dozen liquor jugs') == True\", \"assert is_pangram('Sphinx of black quartz, judge my vow') == True\", \"assert is_pangram('Lorem ipsum dolor sit a...
{ "split": "train", "index": 2572, "acecode_id": "evol_23822", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns the maximum sum of any contiguous subarray of the list. A subarray is defined as a contiguous part of the array. You may assume the input list is non-empty. The function should return a single integer representing the maxi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_subarray_sum([-2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6\", \"assert max_subarray_sum([1]) == 1\", \"assert max_subarray_sum([-1]) == -1\", \"assert max_s...
{ "split": "train", "index": 2573, "acecode_id": "bigcode_python_fns_2261", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of 3D coordinates representing points in space and a small positive value epsilon. Your task is to implement a function that checks if the first point in the list is preserved as the origin (0, 0, 0) and if the distance between the first point and the secon...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_structure_preservation([(0.0, 0.0, 0.0), (0.0, 0.0, 0.74)], 0.74, [4, -4, 4], 1e-10) == True\", \"assert check_structure_preservation([(0.0, 0.0, 0.0), (0.0, 0.0, 0.7400000001)], 0.74, [4, -4, 4], 1e-10) == True\", \"assert check_structure_preservation...
{ "split": "train", "index": 2574, "acecode_id": "bigcode_python_fns_18933", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of 2D points and a connectivity matrix representing the connections between these points. Write a function `visualize_connections(points, connectivity_matrix)` that takes in two parameters: - `points` (list of tuples): A list of 2D points represented as tup...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert visualize_connections([(1, 1), (2, 2), (3, 3)], [[False, True, False], [True, False, True], [False, True, False]]) == [(0, 1), (1, 2)]\", \"assert visualize_connections([(0, 0), (1, 1), (2, 2)], [[False, False, False], [False, False, False], [False, False, F...
{ "split": "train", "index": 2575, "acecode_id": "oss_2420", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with processing a list of relations represented as tuples. Each tuple contains the following elements: (name, id, description, relation_type, is_static). Your goal is to implement a function `process_relations` that takes a list of these tuples and returns a dict...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_relations([('REL1', 1, 'desc1', 'type1', True), ('REL2', 2, 'desc2', 'type2', False)]) == {'REL1': (1, 'desc1', 'type1')}\", \"assert process_relations([('REL1', 1, 'desc1', 'type1', True), ('REL2', 2, 'desc2', 'type2', True)]) == {'REL1': (1, 'desc1...
{ "split": "train", "index": 2576, "acecode_id": "oss_5503", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a temperature in Celsius, convert it to Fahrenheit using the formula F = (9/5) * C + 32. Write a function that takes a single float parameter representing the temperature in Celsius and returns a string in the format: 'The temperature of [Celsius] °C corresponds to [Fahre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_temperature(0.0) == 'The temperature of 0.0 \\u00b0C corresponds to 32.0 \\u00b0F!'\", \"assert convert_temperature(25.0) == 'The temperature of 25.0 \\u00b0C corresponds to 77.0 \\u00b0F!'\", \"assert convert_temperature(100.0) == 'The temperature o...
{ "split": "train", "index": 2577, "acecode_id": "oss_33865", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of fields and updates the 'element_type' field based on a given object's element type. The function should take in the list of fields, the object's element type, and the candidate element types as input and updat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_element_type_field([{'name': 'element_type', 'value': '', 'type': 'Select', 'choices': []}], 'type1', {'type1': Element('Type 1'), 'type2': Element('Type 2')}) == [{'name': 'element_type', 'value': 'type1', 'type': 'Select', 'choices': [('type1', 'Typ...
{ "split": "train", "index": 2578, "acecode_id": "oss_21601", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks whether a given IP address is a valid IPv4 address. An IPv4 address consists of four decimal numbers separated by dots (.), where each number ranges from 0 to 255. The function should return True if the given string is a valid...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_ipv4('192.168.1.1') == True\", \"assert is_valid_ipv4('255.255.255.255') == True\", \"assert is_valid_ipv4('0.0.0.0') == True\", \"assert is_valid_ipv4('256.100.50.25') == False\", \"assert is_valid_ipv4('192.168.1.256') == False\", \"assert is_vali...
{ "split": "train", "index": 2579, "acecode_id": "bigcode_python_fns_849", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of words, where each word is represented as a string. Your task is to write a function that takes this list of words as input and returns a dictionary containing the frequency of each word in the list. The keys of the dictionary should be the unique words f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert word_frequency(['apple', 'banana', 'apple', 'orange', 'banana', 'apple']) == {'apple': 3, 'banana': 2, 'orange': 1}\", \"assert word_frequency(['dog', 'cat', 'dog', 'fish', 'cat', 'dog']) == {'dog': 3, 'cat': 2, 'fish': 1}\", \"assert word_frequency(['hello'...
{ "split": "train", "index": 2580, "acecode_id": "oss_5139", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `to_uppercase(input_string: str) -> str` that transforms the provided textual sequence into an all capitalized format, ensuring that you refrain from invoking any inherent string-specific procedures for this operation. You are allowed to use basic operations su...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert to_uppercase('this is a string') == 'THIS IS A STRING'\", \"assert to_uppercase('Hello World!') == 'HELLO WORLD!'\", \"assert to_uppercase('python programming') == 'PYTHON PROGRAMMING'\", \"assert to_uppercase('123 abc DEF') == '123 ABC DEF'\", \"assert to_u...
{ "split": "train", "index": 2581, "acecode_id": "evol_26588", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a Uniform Resource Name (URN) as input and returns a string that describes the type of model associated with that URN. The URN will follow the format 'urn:miriam:biomodels.db:<model_id>', where <model_id> is a unique identifier ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert describe_model('urn:miriam:biomodels.db:BIOMD0000000139') == 'Model ID: BIOMD0000000139'\", \"assert describe_model('urn:miriam:biomodels.db:BIOMD0000000140') == 'Model ID: BIOMD0000000140'\", \"assert describe_model('urn:miriam:biomodels.db:BIOMD0000000141'...
{ "split": "train", "index": 2582, "acecode_id": "bigcode_python_fns_22999", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating and generating configuration settings for a type-checking tool. Given a list of modules as strings, your goal is to process this list by filtering out empty and commented entries, categorizing them into strict and core modules based on specific pr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_and_generate(['homeassistant.components.a', 'homeassistant.components.b', 'module1', 'module2'], ['module2']) == 'Configuration generated successfully.'\", \"assert validate_and_generate(['homeassistant.components.a', 'module1', 'homeassistant.compo...
{ "split": "train", "index": 2583, "acecode_id": "bigcode_python_fns_45806", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that returns a list of unique ingredients from a list of sandwiches. Each sandwich is represented as a string where the ingredients are separated by commas. The function should take a list of these sandwich strings as input and return a l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_ingredients(['ham,cheese,tomato', 'cheese,lettuce', 'ham,tomato']) == ['cheese', 'ham', 'lettuce', 'tomato']\", \"assert get_unique_ingredients(['lettuce,tomato', 'tomato,cheese', 'cheese,lettuce']) == ['cheese', 'lettuce', 'tomato']\", \"assert g...
{ "split": "train", "index": 2584, "acecode_id": "bigcode_python_fns_46053", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples, where each tuple contains a full name, a unique identifier, and an amount value. Your task is to implement a function that converts this list into a dictionary. The unique identifiers should be used as the keys, and the corresponding values shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_dict_by_amount([('John', '1', '100'), ('Alice', '2', '200'), ('Bob', '3', '300')]) == {'2': {'name': 'Alice', 'amount': 200}, '3': {'name': 'Bob', 'amount': 300}, '1': {'name': 'John', 'amount': 100}}\", \"assert sort_dict_by_amount([('Anna', '4', '150'...
{ "split": "train", "index": 2585, "acecode_id": "evol_35941", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a configuration string for a virtual LAN (VLAN) based on the given parameters. The function should take the following inputs: a string for the interface type (e.g., 'GigabitEthernet'), a string for the interface ID (e.g., '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_vlan_config('FastEthernet', '1/0', 20, '10.0.0.1', '255.255.255.0', 'interface {interface}\\\\n vlan {vlan}\\\\n ip address {ip} {mask}') == 'interface FastEthernet1/0\\\\n vlan 20\\\\n ip address 10.0.0.1 255.255.255.0'\", \"assert generate_vlan_co...
{ "split": "train", "index": 2586, "acecode_id": "bigcode_python_fns_17950", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to manage steps in a process. Each step is represented by a letter, and each step can have a list of other steps that need to be completed before it can be executed. Your function, `manage_steps`, should take a list of tuples as input...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_steps([('A', []), ('B', ['A']), ('C', ['A'])]) == {'A': [], 'B': ['A'], 'C': ['A']}\", \"assert manage_steps([('A', []), ('B', []), ('C', ['B'])]) == {'A': [], 'B': [], 'C': ['B']}\", \"assert manage_steps([('A', []), ('B', ['C']), ('C', ['A'])]) == {...
{ "split": "train", "index": 2587, "acecode_id": "oss_29074", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks the validity of an organization's details based on a set of criteria. The organization has the following attributes: `name`, `founded_date`, `location`, and `description`. Your function should ensure that the `founded_date` is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_organization([], {'name': 'Org1', 'founded_date': '2020-01-01', 'location': 'USA', 'description': 'A new organization'}) == []\", \"assert validate_organization([{'name': 'Org1', 'founded_date': '2020-01-01', 'location': 'USA', 'description': 'A new...
{ "split": "train", "index": 2588, "acecode_id": "oss_1953", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a nested list of integers, implement a function `flatten_list(nested_list: List[Union[int, List]]) -> List[int]` that takes a nested list and returns a flat list containing all the integers from the nested structure in the order they appear. The input list can contain int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flatten_list([1, [2, [3, 4]], 5]) == [1, 2, 3, 4, 5]\", \"assert flatten_list([[1, 2], [3, [4, 5]]]) == [1, 2, 3, 4, 5]\", \"assert flatten_list([1, 2, 3]) == [1, 2, 3]\", \"assert flatten_list([[[[1]]], 2, 3]) == [1, 2, 3]\", \"assert flatten_list([]) == []...
{ "split": "train", "index": 2589, "acecode_id": "bigcode_python_fns_5167", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string. Additionally, the function should be case-insensitive and should also return the count of strings that have the common prefix. The functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longestCommonPrefix(['flower','Flow','flight'], True) == ('fl', 3)\", \"assert longestCommonPrefix(['dog','racecar','car'], True) == ('', 0)\", \"assert longestCommonPrefix(['flower','Flow','flight'], False) == ('', 0)\", \"assert longestCommonPrefix(['abc12...
{ "split": "train", "index": 2590, "acecode_id": "evol_24868", "num_tests": 16 }
acecode
[ { "role": "user", "content": "The Golomb's self-describing sequence (G(n)) is a unique nondecreasing sequence of natural numbers where n manifests exactly G(n) times within the sequence. Your task is to implement a function that computes G(n) for a given natural number n. The function should return the valu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert G(1) == 1\", \"assert G(2) == 2\", \"assert G(3) == 2\", \"assert G(4) == 3\", \"assert G(5) == 3\", \"assert G(6) == 4\", \"assert G(7) == 4\", \"assert G(8) == 4\", \"assert G(9) == 5\", \"assert G(10) == 5\", \"assert G(11) == 5\", \"assert G(12) == 6\", ...
{ "split": "train", "index": 2591, "acecode_id": "evol_10296", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a binary array where 1s represent filled positions and 0s represent empty positions. Your task is to implement a function `count_clusters(arr: List[int]) -> Tuple[int, List[int]]` that returns the number of clusters of 1s and a list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_clusters([1, 0, 1, 1, 0, 0, 1]) == (3, [1, 2, 1])\", \"assert count_clusters([1, 1, 1, 0, 0, 1]) == (2, [3, 1])\", \"assert count_clusters([0, 0, 0, 0]) == (0, [])\", \"assert count_clusters([1, 1, 1, 1, 1]) == (1, [5])\", \"assert count_clusters([1, 0...
{ "split": "train", "index": 2592, "acecode_id": "bigcode_python_fns_23606", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that assigns cluster labels to a given dataset using a simple k-means clustering algorithm. The function should take a 2D list of numerical data points and the number of clusters as input and return a list of cluster labels ass...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simple_kmeans_clustering([[1.0, 2.0], [1.5, 1.8], [5.0, 8.0], [8.0, 8.0]], 2) == [0, 0, 1, 1]\", \"assert simple_kmeans_clustering([[1.0], [2.0], [3.0], [4.0], [5.0]], 5) == [0, 1, 2, 3, 4]\", \"assert simple_kmeans_clustering([[1.0, 2.0], [3.0, 4.0], [5.0, ...
{ "split": "train", "index": 2593, "acecode_id": "oss_31313", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of posts where each post is represented as a dictionary containing the keys 'id', 'title', 'content', and 'author_id'. Your task is to implement a function `process_posts` that takes in a list of posts and an integer `author_id`. The function should return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_posts([], 101) == []\", \"assert process_posts([{'id': 1, 'title': 'Post 1', 'content': 'Content 1', 'author_id': 101}], 101) == [{'id': 1, 'title': 'Post 1', 'content': 'Content 1', 'author_id': 101}]\", \"assert process_posts([{'id': 1, 'title': 'P...
{ "split": "train", "index": 2594, "acecode_id": "oss_14793", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of crime records, represented as dictionaries. Each dictionary contains the keys 'crime_type' and 'location', representing the type of crime and the location where it occurred. Write a Python function `filter_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_crime_by_type([{'crime_type': 'theft', 'location': 'Park'}, {'crime_type': 'assault', 'location': 'Mall'}, {'crime_type': 'theft', 'location': 'Street'}], 'theft') == ['Park', 'Street']\", \"assert filter_crime_by_type([{'crime_type': 'theft', 'locati...
{ "split": "train", "index": 2595, "acecode_id": "oss_9861", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `create_person_data(name: str, age: int) -> dict` that takes a name and an age as input parameters. The `name` must be a string, and `age` must be an integer within the range from 0 to 120. If the input is invalid, raise a `TypeError` for invalid types or a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_person_data('Alice', 30) == {'name': 'Alice', 'age': 30}\", \"assert create_person_data('Bob', 0) == {'name': 'Bob', 'age': 0}\", \"assert create_person_data('Charlie', 120) == {'name': 'Charlie', 'age': 120}\", \"assert create_person_data('Diana', 25...
{ "split": "train", "index": 2596, "acecode_id": "evol_19119", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with designing a function that generates a simple HTML document structure. The function should take a list of HTML elements, where each element is represented as a dictionary containing a 'tag' (the HTML tag name) and 'content' (the text or nested elements within...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_html([{'tag': 'p', 'content': 'Hello world!'}]) == '<p>Hello world!</p>'\", \"assert generate_html([{'tag': 'h1', 'content': 'Title'}]) == '<h1>Title</h1>'\", \"assert generate_html([{'tag': 'div', 'content': 'Content'}]) == '<div>Content</div>'\", ...
{ "split": "train", "index": 2597, "acecode_id": "evol_28391", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the factorial of a given non-negative integer n. The factorial of n (denoted as n!) is the product of all positive integers less than or equal to n. For example, the factorial of 5 is calculated as 5 x 4 x 3 x 2 x 1 = 120...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(...
{ "split": "train", "index": 2598, "acecode_id": "oss_15240", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that performs an elementwise addition of two lists of integers and returns a new list containing the results. However, if any element in either of the input lists is negative, the corresponding element in the output list should be set...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert elementwise_addition([1, 2, 3], [4, 5, 6]) == [5, 7, 9]\", \"assert elementwise_addition([-1, 2, 3], [4, 5, 6]) == [-1, 7, 9]\", \"assert elementwise_addition([1, -2, 3], [4, 5, 6]) == [5, -1, 9]\", \"assert elementwise_addition([1, 2], [3, 4]) == [4, 6]\", ...
{ "split": "train", "index": 2599, "acecode_id": "bigcode_python_fns_30476", "num_tests": 16 }