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": "Implement a function `get_client_info(full_name: str, address: str, contact_number: str, email: str) -> Dict[str, str]` that takes in a client's full legal name, permanent residential address, verified contact number, and registered email address. The function should return a d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_client_info('Alice Smith', '456 Elm St', '9876543210', 'alicesmith@example.com') == {'Full Name': 'Alice Smith', 'Address': '456 Elm St', 'Contact Number': '9876543210', 'Email': 'alicesmith@example.com'}\", \"assert get_client_info('Bob Johnson', '789 M... | {
"split": "train",
"index": 72000,
"acecode_id": "evol_11681",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that saves a message from a user if it is not a duplicate. The function should take a dictionary as input with the following keys: 'sender', 'destination', 'message', 'stamp', 'markdown', 'encoding', 'encryption', 'hashing', 'hash', '... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert save_message({'sender': 'user1', 'destination': 'user2', 'message': 'Hello', 'stamp': '2023-10-01T12:00:00', 'markdown': False, 'encoding': 'UTF-8', 'encryption': False, 'hashing': 'SHA256', 'hash': 'abc123', 'decryptionKey': None, 'file': None, 'filename': ... | {
"split": "train",
"index": 72001,
"acecode_id": "bigcode_python_fns_21953",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Design a function called `validate_nested_element` that checks for the presence of a specific element in a list, including any nested lists, regardless of their nesting depth. The function should return a triplet: the first element being a boolean indicating whether the primary... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_nested_element([1, 2, [3, 4], 5], 3) == (False, 1, 1)\", \"assert validate_nested_element([[1, 2], [3, 4], [5, 3]], 3) == (False, 2, 2)\", \"assert validate_nested_element([[1, [2, 3]], [3, [4, 5]]], 3) == (False, 2, 2)\", \"assert validate_nested_e... | {
"split": "train",
"index": 72002,
"acecode_id": "evol_31905",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list of numbers representing a matrix. Your task is to implement a function that calculates the sum of each row in the matrix and returns a list of these sums. The function should take the following input: a 2D list 'matrix', where each inner list represents ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert row_sums([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [6, 15, 24]\", \"assert row_sums([[0, 0, 0], [0, 0, 0]]) == [0, 0]\", \"assert row_sums([[1], [2], [3]]) == [1, 2, 3]\", \"assert row_sums([[5, 5], [5, 5], [5]]) == [10, 10, 5]\", \"assert row_sums([[], [], []])... | {
"split": "train",
"index": 72003,
"acecode_id": "oss_29133",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary where the keys are integers and the values are boolean values indicating whether the key is a prime number (True) or not (False), write a function that returns a new dictionary containing only the keys that are prime numbers. The keys in the output dictionary... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_prime({2: True, 3: True, 4: False, 5: True}) == {2: 2, 3: 3, 5: 5}\", \"assert get_prime({1: False, 4: False, 6: False}) == {}\", \"assert get_prime({7: True, 10: False, 11: True}) == {7: 7, 11: 11}\", \"assert get_prime({12: False, 13: True, 14: False})... | {
"split": "train",
"index": 72004,
"acecode_id": "bigcode_python_fns_22879",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the temperatures for each day. Your task is to write a function that returns a list of integers where each integer represents the number of days you would have to wait until a warmer temperature. If there is no future day for which ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dailyTemperatures([73, 74, 75, 71, 69, 72, 76, 73]) == [1, 1, 4, 2, 1, 1, 0, 0]\", \"assert dailyTemperatures([30, 40, 50, 60]) == [1, 1, 1, 0]\", \"assert dailyTemperatures([30, 60, 90]) == [1, 1, 0]\", \"assert dailyTemperatures([50, 40, 30, 20]) == [0, 0,... | {
"split": "train",
"index": 72005,
"acecode_id": "bigcode_python_fns_21213",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers 'nums' and an integer 'target', write a function that returns the indices of the two numbers in 'nums' that add up to 'target'. You may assume that each input will have exactly one solution, and you may not use the same element twice. The function sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert two_sum([2, 7, 11, 15], 9) == [0, 1]\", \"assert two_sum([3, 2, 4], 6) == [1, 2]\", \"assert two_sum([3, 3], 6) == [0, 1]\", \"assert two_sum([-1, -2, -3, -4, -5], -8) == [2, 4]\", \"assert two_sum([0, 4, 3, 0], 0) == [0, 3]\", \"assert two_sum([10, 15, 3, 7... | {
"split": "train",
"index": 72006,
"acecode_id": "bigcode_python_fns_34778",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes an abstract syntax tree (AST) and performs a specific transformation on it. The function should take the following inputs: \n- `src_ast`: The abstract syntax tree represented as a string. \n- `fname`: The name of the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_ast('sample_ast', 'sample_function', {'global_vars': {'i': 1}}) == 'unrolled_ast'\", \"assert process_ast('sample_ast', 'sample_function', {'global_vars': {'i': 4}}) == 'unrolled_ast'\", \"assert process_ast('sample_ast', 'sample_function', {'global_... | {
"split": "train",
"index": 72007,
"acecode_id": "oss_22947",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Determine if a given integer is a perfect number. A perfect number is a positive integer that is equal to the sum of its proper positive divisors, excluding itself. Implement a function `is_perfect(n: int) -> bool` that returns `True` if the number is perfect, and `False` other... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_perfect(6) == True\", \"assert is_perfect(28) == True\", \"assert is_perfect(496) == True\", \"assert is_perfect(8128) == True\", \"assert is_perfect(12) == False\", \"assert is_perfect(20) == False\", \"assert is_perfect(1) == False\", \"assert is_perfec... | {
"split": "train",
"index": 72008,
"acecode_id": "evol_25069",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of answers submitted to a question-and-answer platform. Each answer can be submitted either anonymously or with an author's name. Your function should take a list of dictionaries representing answers and return a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_answers([{'answer': 'This is an answer', 'anonimously': False}, {'answer': 'Another answer', 'anonimously': True}]) == [{'answer': 'This is an answer', 'author': 'author_name'}, {'answer': 'Another answer', 'author': None}]\", \"assert process_answer... | {
"split": "train",
"index": 72009,
"acecode_id": "oss_20663",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to monitor web traffic and generate alerts when the traffic exceeds a certain threshold. Your goal is to implement a function `check_alert(window_size: int, alert_threshold: int, hits: List[int]) -> bool` that checks if an alert shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_alert(3, 5, [1, 2, 3]) == False\", \"assert check_alert(5, 10, [10, 20, 30, 40, 50]) == True\", \"assert check_alert(3, 10, [1, 2, 3, 4, 5]) == False\", \"assert check_alert(4, 7, [10, 5, 7, 2]) == False\", \"assert check_alert(5, 5, [10, 10, 10, 0, 0]... | {
"split": "train",
"index": 72010,
"acecode_id": "oss_33278",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `manage_server` that simulates server management operations without a database. Your function should take the following parameters: \n- `group_id`: an integer representing the ID of the group to which the server belongs (0 indicates n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_server(1, 'Server1', '192.168.1.1', 8080, 'admin', 'pass', 'Test server') == 'Server added.'\", \"assert manage_server(2, 'Server2', '192.168.1.2', 8081, 'admin', 'pass', 'Another server') == 'Server added.'\", \"assert manage_server(3, 'Server3', '19... | {
"split": "train",
"index": 72011,
"acecode_id": "oss_16520",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `create_user` that accepts three parameters: `name` (string), `email` (string), and `password` (string). The function should return a user dictionary containing these parameters as keys. The user dictionary should be formatted as follows: `{'name': name, 'e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_user('Alice Smith', 'alice@smith.com', 'securepassword') == {'name': 'Alice Smith', 'email': 'alice@smith.com', 'password': 'securepassword'}\", \"assert create_user('Bob Johnson', 'bob@johnson.com', '123456') == {'name': 'Bob Johnson', 'email': 'bob@... | {
"split": "train",
"index": 72012,
"acecode_id": "evol_18371",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the Denary Logarithm of a given positive real number. The Denary Logarithm is defined as the power to which the base (10) must be raised to obtain the number. Write a function named `denary_logarithm` that takes a sing... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert denary_logarithm(1) == 0.0\", \"assert abs(denary_logarithm(10) - 1.0) < 1e-9\", \"assert abs(denary_logarithm(100) - 2.0) < 1e-9\", \"assert abs(denary_logarithm(1000) - 3.0) < 1e-9\", \"assert abs(denary_logarithm(0.1) + 1.0) < 1e-9\", \"assert abs(denary_... | {
"split": "train",
"index": 72013,
"acecode_id": "oss_11701",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks the availability of a media resource by its URL and determines if its content has changed. Implement the function `check_media(url: str, previous_hash: str) -> int` where: \n\n- `url`: A string representing the complete URL to... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_media('http://example.com/media2', 'previous_hash_value') == 1\", \"assert check_media('http://example.com/media3', 'previous_hash_value') == 2\", \"assert check_media('http://example.com/media6', 'another_previous_hash') == 2\", \"assert check_media('... | {
"split": "train",
"index": 72014,
"acecode_id": "bigcode_python_fns_24546",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `is_even` that takes an integer `n` as input and returns `True` if `n` is an even number, and `False` if `n` is an odd number.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python cod... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_even(0) == True\", \"assert is_even(1) == False\", \"assert is_even(2) == True\", \"assert is_even(3) == False\", \"assert is_even(4) == True\", \"assert is_even(5) == False\", \"assert is_even(10) == True\", \"assert is_even(-2) == True\", \"assert is_ev... | {
"split": "train",
"index": 72015,
"acecode_id": "evol_16560",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes a DNA sequence represented as a string consisting of the characters 'A', 'T', 'C', and 'G'. Your function should reverse the sequence and replace each character with its DNA complement according to the base pairing rules: 'A' wi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_complement_dna_sequence('ATCG') == 'CGAT'\", \"assert reverse_complement_dna_sequence('A') == 'T'\", \"assert reverse_complement_dna_sequence('T') == 'A'\", \"assert reverse_complement_dna_sequence('C') == 'G'\", \"assert reverse_complement_dna_seque... | {
"split": "train",
"index": 72016,
"acecode_id": "evol_28581",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to simulate saving a database entry. The function should take a string input representing the entry and a boolean flag indicating whether to simulate a delay before saving. If the flag is true, the function should wait for 0.2 seconds... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert save_entry('Transaction record', False) == 'Entry saved: Transaction record'\", \"assert save_entry('Error report', False) == 'Entry saved: Error report'\", \"assert save_entry('Configuration settings', False) == 'Entry saved: Configuration settings'\", \"as... | {
"split": "train",
"index": 72017,
"acecode_id": "oss_8675",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `autodelegate(prefix: str, arg: str) -> str` that simulates a method delegation system based on URL paths. The function should take a prefix string and an argument string representing the method name and the optional path segments. The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert autodelegate('GET_', 'password/change') == 'GET_password(/change)'\", \"assert autodelegate('GET_', 'privacy') == 'GET_privacy()'\", \"assert autodelegate('POST_', 'create') == 'POST_create()'\", \"assert autodelegate('DELETE_', 'remove/item') == 'DELETE_rem... | {
"split": "train",
"index": 72018,
"acecode_id": "bigcode_python_fns_34412",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a configuration dictionary that contains settings for various components of a system. Each component is represented as a dictionary within the main configuration dictionary. Your task is to implement a function that extracts and returns a list of tuples, where eac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_component_info({'session': {'key': 'draughtcraft', 'type': 'cookie', '__force_dict__': True}, 'resource_cache': {'key': 'resources_to_compile', '__force_dict__': True}, 'email_service': {'api_key': '{{ postmark_api_key }}'}}) == [('draughtcraft', 'co... | {
"split": "train",
"index": 72019,
"acecode_id": "oss_8138",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Write a function that generates a list of the first n perfect cubes. Additionally, implement a function that checks if a given number is a perfect cube. The function should return True if the number is a perfect cube, and False otherwise. The input for the function should be a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_cube(1) == True\", \"assert check_cube(8) == True\", \"assert check_cube(27) == True\", \"assert check_cube(64) == True\", \"assert check_cube(125) == True\", \"assert check_cube(216) == True\", \"assert check_cube(343) == True\", \"assert check_cube(5... | {
"split": "train",
"index": 72020,
"acecode_id": "evol_16756",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `normalize_array(arr)` that takes a 2D list of integers `arr` representing an array and normalizes the values so that they range between 0 and 1. The function should handle the following edge cases: if all values in the array are zero, it should return the arra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_array([[0, 0], [0, 0]]) == [[0, 0], [0, 0]]\", \"assert normalize_array([[1, 1], [1, 1]]) == [[1, 1], [1, 1]]\", \"assert normalize_array([[0, 50], [100, 0]]) == [[0.0, 0.5], [1.0, 0.0]]\", \"assert normalize_array([[100, 0], [50, 75]]) == [[1.0, 0... | {
"split": "train",
"index": 72021,
"acecode_id": "evol_31660",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates reading data from a chemical input file. The function will take a string input representing the contents of a chemical file and will return a list of lines, where each line corresponds to a line in the input string. Assume ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert read_chemical_file('H2O\\\\nNaCl\\\\nC6H12O6') == ['H2O', 'NaCl', 'C6H12O6']\", \"assert read_chemical_file('\\\\nH2O\\\\n\\\\n') == ['H2O']\", \"assert read_chemical_file(' H2O \\\\n NaCl \\\\n C6H12O6 ') == ['H2O', 'NaCl', 'C6H12O6']\", \"assert read... | {
"split": "train",
"index": 72022,
"acecode_id": "bigcode_python_fns_38502",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that simulates the parsing of command-line arguments for a video processing application. The function should accept the following parameters: `face_detector` (a string that can be either 'NFD' for Normal Face Detector or 'HFD' for High-... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_arguments('NFD', True, 4, False, 32, 16) == {'face_detector': 'NFD', 'write_tb_data': True, 'num_preprocess_threads': 4, 'prev_frame_init': False, 'patch_size': 32, 'batch_size': 16}\", \"assert parse_arguments('HFD', False, 8, True, 64, 32) == {'face_... | {
"split": "train",
"index": 72023,
"acecode_id": "oss_7628",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks the case of all keys in a given dictionary. The function should return 'None', 'Lower', 'Upper', or 'Number' depending on whether all keys are lowercase, uppercase, or start with a number, respectively. If the dictionary i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_dict_case({'a': 1, 'b': 2}) == 'Lower'\", \"assert check_dict_case({'A': 1, 'B': 2}) == 'Upper'\", \"assert check_dict_case({'1key': 1, '2key': 2}) == 'Number'\", \"assert check_dict_case({'key1': 1, 'key2': 2}) == 'Lower'\", \"assert check_dict_case({... | {
"split": "train",
"index": 72024,
"acecode_id": "evol_14007",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that removes all instances of a specific type of server from a list of servers. Each server is represented by a dictionary with a 'type' key that indicates the server's type. Your function should take a list of servers and a string re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_servers_of_type([{'type': 'PROXY_SERVER'}, {'type': 'WEB_SERVER'}, {'type': 'PROXY_SERVER'}], 'PROXY_SERVER') == [{'type': 'WEB_SERVER'}]\", \"assert remove_servers_of_type([{'type': 'DATABASE_SERVER'}, {'type': 'PROXY_SERVER'}, {'type': 'CACHE_SERVER... | {
"split": "train",
"index": 72025,
"acecode_id": "bigcode_python_fns_17116",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n, write a function that returns the sum of all even Fibonacci numbers that are less than or equal to n. The Fibonacci sequence starts with 0 and 1, and each subsequent number is the sum of the two preceding ones. Your function should handle cases where n is le... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_even_fibonacci(10) == 10\", \"assert sum_even_fibonacci(15) == 10\", \"assert sum_even_fibonacci(2) == 2\", \"assert sum_even_fibonacci(1) == 0\", \"assert sum_even_fibonacci(34) == 44\", \"assert sum_even_fibonacci(0) == 0\", \"assert sum_even_fibonacci... | {
"split": "train",
"index": 72026,
"acecode_id": "bigcode_python_fns_37146",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called 'isPalindrome' that checks if a given string is a palindrome. A string is considered a palindrome if it reads the same backward as forward. The function should take a single string parameter and return True if it is a palindrome, and False otherwise.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isPalindrome('') == True\", \"assert isPalindrome('a') == True\", \"assert isPalindrome('ab') == False\", \"assert isPalindrome('aba') == True\", \"assert isPalindrome('abba') == True\", \"assert isPalindrome('abcba') == True\", \"assert isPalindrome('abcdef... | {
"split": "train",
"index": 72027,
"acecode_id": "evol_26691",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a priority queue for managing speeches based on their priorities in a communication system. The speeches are represented by an integer priority where higher values indicate higher priority. Your function should take a l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_speeches([(3, 'Emergency broadcast'), (1, 'General announcement')]) == ['Emergency broadcast', 'General announcement']\", \"assert process_speeches([(2, 'Fire drill'), (2, 'Team meeting'), (1, 'General notice')]) == ['Fire drill', 'Team meeting', 'Ge... | {
"split": "train",
"index": 72028,
"acecode_id": "oss_16761",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that calculates the total price of an order based on the quantities of products ordered. The function should take a list of order details where each detail contains a product ID and the quantity ordered. You will also be provided with a dictiona... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_price([{ 'product_id': 1, 'quantity': 1 }], { 1: 15.0 }) == 15.0\", \"assert calculate_total_price([{ 'product_id': 2, 'quantity': 3 }], { 2: 20.0 }) == 60.0\", \"assert calculate_total_price([{ 'product_id': 3, 'quantity': 5 }], { 3: 8.0 }) ... | {
"split": "train",
"index": 72029,
"acecode_id": "evol_21381",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a Bloom filter data structure that supports adding items and checking for item existence. The Bloom filter should provide methods to add a string to the filter and to check if a string is possibly in the filter. Additionally, implement a method to estimate the false p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bloom_filter(['apple', 'banana', 'grape'], ['apple', 'orange', 'banana']) == ([True, False, True], 0.0)\", \"assert bloom_filter(['cat', 'dog', 'mouse'], ['dog', 'rabbit', 'cat']) == ([True, False, True], 0.0)\", \"assert bloom_filter(['red', 'blue', 'green'... | {
"split": "train",
"index": 72030,
"acecode_id": "evol_34721",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the release of a lock file based on its status. The function should accept a boolean parameter, `is_locked`, which indicates whether a lock file is currently locked (True) or not (False). If `is_locked` is True, the fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert release_lock(True) == 'Lock released'\", \"assert release_lock(False) == 'No lock to release'\", \"assert release_lock(True) == 'Lock released'\", \"assert release_lock(False) == 'No lock to release'\", \"assert release_lock(True) == 'Lock released'\", \"ass... | {
"split": "train",
"index": 72031,
"acecode_id": "bigcode_python_fns_5352",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that converts a binary number (represented as a string) into its equivalent decimal integer. The binary number will only contain '0's and '1's. For example, the binary string '1100' should return the decimal integer 12.\nPlease reason step by step, then wri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert binary_to_decimal('0') == 0\", \"assert binary_to_decimal('1') == 1\", \"assert binary_to_decimal('10') == 2\", \"assert binary_to_decimal('11') == 3\", \"assert binary_to_decimal('100') == 4\", \"assert binary_to_decimal('101') == 5\", \"assert binary_to_de... | {
"split": "train",
"index": 72032,
"acecode_id": "evol_29042",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to control a 16x8 LED matrix display. The function should take a list of 16 integers as input, where each integer represents the state of a row in the LED matrix. Each integer in the list is expected to be in the range of 0 to 255, wh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_led_matrix([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) is None\", \"assert update_led_matrix([255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]) is None\", \"assert update_led_matrix([128, 64, 32, 16, 8, 4, 2, 1, 25... | {
"split": "train",
"index": 72033,
"acecode_id": "oss_10279",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given two integers n and m, write a program to check if they are both Mersenne prime numbers. If they are, return their greatest common divisor (GCD). You must implement the GCD computation without using any built-in functions for GCD. If either number is not a Mersenne prime, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solve(3, 7) == 1\", \"assert solve(31, 127) == 1\", \"assert solve(15, 3) == -1\", \"assert solve(2, 3) == -1\", \"assert solve(7, 7) == 7\", \"assert solve(31, 31) == 31\", \"assert solve(3, 3) == 3\", \"assert solve(63, 31) == -1\", \"assert solve(127, 3) ... | {
"split": "train",
"index": 72034,
"acecode_id": "evol_7208",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary `item` that contains various key-value pairs, write a function `ident_keys` that returns a list of keys that are present in the `item` dictionary. The function should also accept a configuration dictionary `cfg` which can be used to filter the keys based on s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ident_keys({'name': 'John', 'age': 30}, {}) == ['name', 'age']\", \"assert ident_keys({'a': 1, 'b': 2, 'c': 3}, {}) == ['a', 'b', 'c']\", \"assert ident_keys({}, {}) == []\", \"assert ident_keys({'key1': 'value1', 'key2': 'value2'}, {}) == ['key1', 'key2']\"... | {
"split": "train",
"index": 72035,
"acecode_id": "bigcode_python_fns_22210",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a floating-point number as input and returns the number rounded to exactly four decimal places. Ensure that the function correctly handles both positive and negative numbers, as well as numbers that are already at four decimal places.\nPlease rea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert round_four_decimal_places(3.1415926535) == 3.1416\", \"assert round_four_decimal_places(-2.7182818284) == -2.7183\", \"assert round_four_decimal_places(1.0000) == 1.0\", \"assert round_four_decimal_places(0.123456) == 0.1235\", \"assert round_four_decimal_pl... | {
"split": "train",
"index": 72036,
"acecode_id": "evol_11113",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that calculates the minimum number of moves required to make all elements in the array equal. In one move, you can choose any element and increase or decrease its value by 1. The function should return an integer representing the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert minimumMoves([1, 2, 3]) == 2\", \"assert minimumMoves([1, 1, 1]) == 0\", \"assert minimumMoves([1, 2, 2, 3]) == 2\", \"assert minimumMoves([5, 5, 5, 5]) == 0\", \"assert minimumMoves([1, 2, 3, 4, 5]) == 6\", \"assert minimumMoves([10, 20, 30]) == 20\", \"ass... | {
"split": "train",
"index": 72037,
"acecode_id": "evol_4293",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "A pizza store sells four types of pizzas: Small, Medium, Large, and Extra Large. The respective weights of these pizzas are 0.5 kilograms, 0.75 kilograms, 1 kilogram, and 1.5 kilograms. Write a function that, given a weight in kilograms, returns the quantity of each type of piz... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert order_pizza(0.5) == {'extra_large': 0, 'large': 0, 'medium': 0, 'small': 1}\", \"assert order_pizza(1) == {'extra_large': 0, 'large': 1, 'medium': 0, 'small': 0}\", \"assert order_pizza(1.5) == {'extra_large': 1, 'large': 0, 'medium': 0, 'small': 0}\", \"ass... | {
"split": "train",
"index": 72038,
"acecode_id": "evol_11080",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of preference lists where each preference list contains the hats that each person likes. Each person can choose one hat from their preference list. Your task is to implement a function `numberWays(hats)` that returns the number of ways to assign hats to peo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert numberWays([[1,2,3,4],[1,2,3,4],[1,2,3,4],[1,2,3,4]]) == 24\", \"assert numberWays([[1],[2],[3],[4],[5],[6],[7],[8],[9],[10]]) == 1\", \"assert numberWays([[1],[1],[1]]) == 0\", \"assert numberWays([[1,2],[3,4],[5,6]]) == 8\", \"assert numberWays([[1,2],[1,3... | {
"split": "train",
"index": 72039,
"acecode_id": "evol_28749",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a message cache system in Python. Your task is to write a single function `message_cache_operations(operations: List[Tuple[str, Any]]) -> List[Any]` that performs a series of operations on a message cache. The operations will be provided as a li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert message_cache_operations([('add', 'Hello'), ('add', 'World'), ('get',)]) == [['Hello', 'World']]\", \"assert message_cache_operations([('add', 'Message 1'), ('get',), ('clear',), ('get',)]) == [['Message 1'], []]\", \"assert message_cache_operations([('add',... | {
"split": "train",
"index": 72040,
"acecode_id": "oss_13002",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing HTTP request headers. Write a function `validate_auth_header_has_signature(request_headers: Dict[str, str]) -> None` that checks if the 'Authorization' header contains a valid signature. A valid signature is defined as having exactly one ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_auth_header_has_signature({'Authorization': 'Bearer token:signature'}) is None\", \"assert validate_auth_header_has_signature({'Authorization': 'Basic user:password'}) is None\", \"assert validate_auth_header_has_signature({'Authorization': 'Token a... | {
"split": "train",
"index": 72041,
"acecode_id": "bigcode_python_fns_41589",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns the maximum product of any two distinct integers from the list. The function should handle cases where there are negative integers as well. If the list has fewer than two integers, the function sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_product_of_two([1, 2, 3, 4]) == 12\", \"assert max_product_of_two([-1, 2, 3, 4]) == 12\", \"assert max_product_of_two([0, 2, 3, 4]) == 12\", \"assert max_product_of_two([1]) == 0\", \"assert max_product_of_two([]) == 0\", \"assert max_product_of_two([-1,... | {
"split": "train",
"index": 72042,
"acecode_id": "oss_21496",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a configuration dictionary and returns a formatted string based on the provided configuration values. The configuration dictionary contains three keys: `CONF_DELTA`, `CONF_NAME`, and `CONF_COUNTRY`. The values associ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_config({'CONF_DELTA': 90, 'CONF_NAME': 'Alice', 'CONF_COUNTRY': 'France'}) == 'Alice will be traveling to France'\", \"assert format_config({'CONF_DELTA': 45, 'CONF_NAME': 'Bob', 'CONF_COUNTRY': 'Germany'}) == 'Bob is currently in Germany'\", \"assert... | {
"split": "train",
"index": 72043,
"acecode_id": "oss_4848",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of barcodes, a list of gene counts corresponding to each barcode, and the number of unique molecular identifiers (UMIs) for each gene in the barcodes. Your task is to implement a function that generates a summary dataframe that includes the total number of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_summary(['BC1', 'BC2'], [[1, 2, 0], [3, 0, 4]], [10, 20]) == [{'Barcode': 'BC1', 'Reads': 10, 'Genes': 2, 'UMI': 3}, {'Barcode': 'BC2', 'Reads': 20, 'Genes': 2, 'UMI': 7}]\", \"assert generate_summary(['BC1'], [[0, 0, 0]], [0]) == [{'Barcode': 'BC1'... | {
"split": "train",
"index": 72044,
"acecode_id": "bigcode_python_fns_47626",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the utilization of lithium metal at the electrode interface of a lithium-ion battery. Implement a function `calculate_utilization_rhs` that calculates the right-hand side (rhs) of a differential equation based on the given parameters. The function... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_utilization_rhs('Negative', {'Lithium metal interface utilisation variable': 0.8, 'Lithium metal total interfacial current density': 2.5}, type('Param', (object,), {'beta_utilisation_n': 0.5})) == 1.0\", \"assert calculate_utilization_rhs('Negative... | {
"split": "train",
"index": 72045,
"acecode_id": "oss_22305",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Develop a function that removes all occurrences of specified characters from a given string. The characters to be removed can be provided in various forms: as a single string, a list of characters, or a combination of both. The function should preserve the original text's forma... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_chars('Hello, World!', 'o') == 'Hell, Wrld!'\", \"assert remove_chars('abc123', '123') == 'abc'\", \"assert remove_chars('Python3.8', '3.8') == 'Python'\", \"assert remove_chars('Goodbye!', 'G!') == 'oodbye'\", \"assert remove_chars('abcde', '') == 'a... | {
"split": "train",
"index": 72046,
"acecode_id": "evol_29602",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two strings, determine if they are anagrams of each other. An anagram is a word or phrase formed by rearranging the letters of a different word or phrase, using all the original letters exactly once. Ignore spaces and letter casing when evaluating the anagrams. Implement ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_anagram('listen', 'silent') == True\", \"assert is_anagram('triangle', 'integral') == True\", \"assert is_anagram('apple', 'pale') == False\", \"assert is_anagram('Dormitory', 'Dirty room') == True\", \"assert is_anagram('The eyes', 'They see') == True\",... | {
"split": "train",
"index": 72047,
"acecode_id": "evol_15133",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that replaces all occurrences of the integer zero with a special value representing 'undefined'. The function should return a new list containing the modified values. The special value can be any value you choose to represent undefined... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_zeros([1, 0, 2, 0, 3]) == [1, None, 2, None, 3]\", \"assert replace_zeros([0, 0, 0]) == [None, None, None]\", \"assert replace_zeros([1, 2, 3]) == [1, 2, 3]\", \"assert replace_zeros([]) == []\", \"assert replace_zeros([0, 1, 0, 2, 0]) == [None, 1, N... | {
"split": "train",
"index": 72048,
"acecode_id": "bigcode_python_fns_16416",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries where each dictionary represents a person with keys 'first_name', 'last_name', and 'age'. Write a function `sort_people(people: List[Dict[str, Union[str, int]]]) -> List[Dict[str, Union[str, int]]]` that sorts this list first by 'age' in des... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_people([{ 'first_name': 'Alice', 'last_name': 'Smith' }, { 'first_name': 'Bob', 'last_name': 'Johnson', 'age': 25 }]) == [{'first_name': 'Bob', 'last_name': 'Johnson', 'age': 25}]\", \"assert sort_people([{ 'first_name': 'Alice', 'last_name': 'Smith', '... | {
"split": "train",
"index": 72049,
"acecode_id": "evol_22137",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings representing literary texts, implement a function `select_random_text(texts: List[str]) -> str` that returns a random text from the list. If the list is empty, the function should return an empty string. Please ensure that your implementation handles the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_random_text(['Text A', 'Text B', 'Text C']) in ['Text A', 'Text B', 'Text C']\", \"assert select_random_text(['Hello', 'World']) in ['Hello', 'World']\", \"assert select_random_text(['One', 'Two', 'Three']) in ['One', 'Two', 'Three']\", \"assert selec... | {
"split": "train",
"index": 72050,
"acecode_id": "evol_33839",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that verifies whether a user is a member of a project and handles file uploads for a specific volume. Given the following inputs: a user, a project ID, a volume ID, and a file (represented as a string), the function should check if th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_upload(True, True, 1, 1, 'data.txt') == 'Upload Successful'\", \"assert handle_upload(True, False, 1, 1, 'data.txt') == 'Permission Denied'\", \"assert handle_upload(False, True, 1, 1, 'data.txt') == 'Permission Denied'\", \"assert handle_upload(False... | {
"split": "train",
"index": 72051,
"acecode_id": "bigcode_python_fns_7463",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes settings for a video processing tool based on given parameters. The function should accept several optional parameters: `dataDir` (a string representing the directory containing video files), `diveNamePattern` (a string rep... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_video_settings('videos', 'DivePattern', True, False, False) == {'dataDir': 'videos', 'diveNamePattern': 'DivePattern', 'skipConcat': True, 'skipHLS': False, 'deleteConcatFile': False}\", \"assert process_video_settings('path/to/videos') == {'dataDir'... | {
"split": "train",
"index": 72052,
"acecode_id": "oss_32839",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Write a function `unique_random_numbers(n: int) -> List[int]` that returns a list of 7 unique random numbers between 1 and 20. The sum of these numbers must be divisible by the specified integer `n` (where 2 <= n <= 10). If it is not possible to find such a combination, return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_random_numbers(2) != []\", \"assert unique_random_numbers(3) != []\", \"assert unique_random_numbers(4) != []\", \"assert unique_random_numbers(5) != []\", \"assert unique_random_numbers(6) != []\", \"assert unique_random_numbers(7) != []\", \"assert ... | {
"split": "train",
"index": 72053,
"acecode_id": "evol_10251",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function named `simulate_setup` that simulates the behavior of the `setuptools.setup` function. This function should take the following parameters: \n- `name` (string): The name of the package. \n- `version` (string): The version of the pac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_setup('test_package', '0.1', 'A test package', 'Alice', 'alice@example.com', ['test_package'], ['requests']) == {'name': 'test_package', 'version': '0.1', 'description': 'A test package', 'author': 'Alice', 'author_email': 'alice@example.com', 'pack... | {
"split": "train",
"index": 72054,
"acecode_id": "oss_6067",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a given string is composed of a valid hexadecimal number (base 16, using digits 0-9 and letters A-F, case insensitive) followed directly by a lowercase vowel from the set {'a', 'e', 'i', 'o', 'u'}. The function should return True if the strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_hex_and_vowel_match('1A') == False\", \"assert is_hex_and_vowel_match('F') == False\", \"assert is_hex_and_vowel_match('123u') == True\", \"assert is_hex_and_vowel_match('0e') == True\", \"assert is_hex_and_vowel_match('ABCi') == True\", \"assert is_hex_a... | {
"split": "train",
"index": 72055,
"acecode_id": "evol_29509",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a string `outfile` and a string `identifier`, write a function `generate_output_name(outfile: str, identifier: str) -> str` that returns a new string by concatenating `outfile` and `identifier`. The `identifier` should be added directly to the end of `outfile`. The functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_output_name('result', '2023') == 'result2023'\", \"assert generate_output_name('result-', '2023') == 'result-2023'\", \"assert generate_output_name('output_', 'data') == 'output_data'\", \"assert generate_output_name('final-report', 'v1') == 'final-... | {
"split": "train",
"index": 72056,
"acecode_id": "bigcode_python_fns_2844",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `processor` that will accept either a string representing a template or a string representing a format name. The function should return a string indicating which option was successfully processed. If both parameters are provided, the func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert processor(template='{{ Inline: {{ variable }}') == 'Template processed: {{ Inline: {{ variable }}'\", \"assert processor(format_name='json') == 'Format processed: json'\", \"assert processor(template='/path/to/template.jinja') == 'Template processed: /path/t... | {
"split": "train",
"index": 72057,
"acecode_id": "bigcode_python_fns_19661",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of configurations, where each configuration may contain a condition and an associated action to execute if the condition is true. Your task is to implement a function `execute_actions(confs: List[Dict[str, Union[str, Callable]]], remain: bool = False, all_c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert execute_actions([{'condition': lambda: True, 'action': lambda: 'Action 1'}, {'condition': lambda: False, 'action': lambda: 'Action 2'}]) == 'Action 1'\", \"assert execute_actions([{'condition': lambda: False, 'action': lambda: 'Action 1'}, {'condition': lamb... | {
"split": "train",
"index": 72058,
"acecode_id": "bigcode_python_fns_19280",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `sources` that can contain file paths separated by commas. Your task is to create a function `expand_sources(sources: str) -> List[str]` that processes this input and returns a list of individual file paths. The function should handle the following cases:... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert expand_sources(None) == []\", \"assert expand_sources('file1.txt, file2.txt') == ['file1.txt', 'file2.txt']\", \"assert expand_sources(' file1.txt, file2.txt ') == ['file1.txt', 'file2.txt']\", \"assert expand_sources('file1.txt') == ['file1.txt']\", \"a... | {
"split": "train",
"index": 72059,
"acecode_id": "bigcode_python_fns_9775",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes two integers as input and returns their sum. The function should be named `calculate_sum` and should accept two parameters, `a` and `b`. Ensure that the function does not use any external libraries and directly returns the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_sum(10, 15) == 25\", \"assert calculate_sum(0, 0) == 0\", \"assert calculate_sum(-5, 5) == 0\", \"assert calculate_sum(-10, -5) == -15\", \"assert calculate_sum(100, 200) == 300\", \"assert calculate_sum(-100, 100) == 0\", \"assert calculate_sum(1,... | {
"split": "train",
"index": 72060,
"acecode_id": "evol_22173",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a collection of usernames. Write a function `get_most_recent_username(usernames: List[str]) -> str` that takes a list of usernames and returns the most recent username added to the collection. The most recent username is defined as the last element ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_most_recent_username(['user1', 'user2', 'user3']) == 'user3'\", \"assert get_most_recent_username(['alice', 'bob', 'charlie']) == 'charlie'\", \"assert get_most_recent_username(['userA']) == 'userA'\", \"assert get_most_recent_username([]) == ''\", \"ass... | {
"split": "train",
"index": 72061,
"acecode_id": "oss_22544",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of wavelengths in Angstroms and their corresponding flux values. Your task is to normalize the flux values based on a specific reference wavelength of 1450 Angstroms. The normalization should be done by dividing each flux value by the median flux of the val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_flux([1440, 1450, 1460], [1.0, 2.0, 3.0]) == [0.5, 1.0, 1.5]\", \"assert normalize_flux([1450], [10.0]) == [1.0]\", \"assert normalize_flux([1500, 1600, 1700], [2.0, 4.0, 6.0]) == [0.0, 0.0, 0.0]\", \"assert normalize_flux([1430, 1450, 1470], [10.0... | {
"split": "train",
"index": 72062,
"acecode_id": "bigcode_python_fns_26094",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given a nested data structure that can contain integers, strings, booleans, lists, and dictionaries, implement a function that extracts all occurrences of a specific key within nested dictionaries. The key to search for is provided as a parameter. The function should return a l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_values({'a': 1, 'b': {'c': 2, 'd': {'e': 3, 'key': 5}}}, 'key') == [5]\", \"assert extract_values({'a': 1, 'b': {'c': 2, 'key': 4, 'd': 3}}, 'key') == [4]\", \"assert extract_values([{'key': 1}, {'key': 2}, {'other_key': 3}], 'key') == [1, 2]\", \"as... | {
"split": "train",
"index": 72063,
"acecode_id": "bigcode_python_fns_8536",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of dictionaries representing data model identifiers and a context dictionary that includes a release date. Your function should ensure that each dictionary has all required fields filled in based on default values specif... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fulfil_defaults([{'filetype': 'apStar'}], {'ds': '2023-01-01', 'next_ds': '2023-01-02'}) == [{'filetype': 'apStar', 'release': '2023-01-01', 'apstar': 'stars', 'apred': 'daily', 'telescope': 'apo25m', 'healpix': '100'}]\", \"assert fulfil_defaults([{'filetyp... | {
"split": "train",
"index": 72064,
"acecode_id": "bigcode_python_fns_11959",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with converting a string representation of a 3x3 matrix into a matrix object. The input string will consist of 9 floating-point numbers separated by commas, representing the elements of the matrix in row-major order. Write a function `strToMat3(dbstr: str) -> Lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert strToMat3('1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0') == [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0]]\", \"assert strToMat3('0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0') == [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]\", \"assert strToMat3('-1.0,-2.0,-3.0,... | {
"split": "train",
"index": 72065,
"acecode_id": "bigcode_python_fns_21092",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a configuration function for a network interface in a simulated embedded system. The function should take specific parameters to set up the Ethernet interface and its associated properties. Your task is to implement a function named `configure_netwo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert configure_network_interface(0x12345678, '192.168.1.10', 25000000) == {'eth_phy': 'LiteEthPHY configured with MAC: 305419896', 'mac_address': 305419896, 'ip_address': '192.168.1.10', 'clock_frequency': 25000000}\", \"assert configure_network_interface(0xABCD1... | {
"split": "train",
"index": 72066,
"acecode_id": "oss_13904",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and a delimiter, implement a function `intersperse(numbers: List[int], delimiter: int, even_positions_only: bool = False, prime_positions: bool = False) -> List[int]` that returns a new list where the delimiter is inserted between elements based on the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert intersperse([1, 2, 3, 4], 0, False, False) == [1, 2, 3, 4]\", \"assert intersperse([1, 2, 3, 4], 0, True, True) == [1, 0, 2, 0, 3, 0, 4]\", \"assert intersperse([], 0, True, True) == []\", \"assert intersperse([10, 20, 30], 5, False, False) == [10, 20, 30]\"... | {
"split": "train",
"index": 72067,
"acecode_id": "evol_18533",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing card metadata in the format of 'Serial Number: <serial_number>, Card Nickname: <nickname>, Type: <type>, Status: <status>, Products: <products>'. Each card is separated by a newline character. Your task is to implement a function `pa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_cards('Serial Number: 20001, Card Nickname: , Type: , Status: , Products: Product1\\\\nSerial Number: 20002, Card Nickname: Card D, Type: Regular, Status: Active, Products: Product2') == [{'serial_number': '20001', 'nickname': '', 'type': '', 'status':... | {
"split": "train",
"index": 72068,
"acecode_id": "bigcode_python_fns_30453",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a string representing an input image file name and returns the corresponding output image file name. The output image file name should be the same as the input image file name, but with the prefix 'out_' added. For example,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_output_image_name('image.jpg') == 'out_image.jpg'\", \"assert get_output_image_name('photo.png') == 'out_photo.png'\", \"assert get_output_image_name('document.pdf') == 'out_document.pdf'\", \"assert get_output_image_name('picture.bmp') == 'out_picture.b... | {
"split": "train",
"index": 72069,
"acecode_id": "oss_13038",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a registration form data dictionary for a user. Your goal is to implement a function named `create_registration_data` that takes the following parameters: `username`, `password`, and `email`. The function should return a di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_registration_data('user123', 'pass123', 'user@example.com') == {'username': 'user123', 'password': 'pass123', 'email': 'user@example.com'}\", \"assert create_registration_data('us', 'pass123', 'user@example.com') == None\", \"assert create_registratio... | {
"split": "train",
"index": 72070,
"acecode_id": "oss_18386",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that extracts view names from a given list of URL pattern definitions. Each URL pattern is represented as a dictionary containing a 'pattern' key (indicating the URL pattern) and a 'name' key (indicating the corresponding view name). Your... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_view_names([{'pattern': 'styles/save/<str:layer_name>/<str:style_name>', 'name': 'APP_NAME.save_style'}]) == {'APP_NAME.save_style': 'styles/save/<str:layer_name>/<str:style_name>'}\", \"assert extract_view_names([{'pattern': '^proxy/geoserver/rest/(... | {
"split": "train",
"index": 72071,
"acecode_id": "oss_8484",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `reconnect(force: bool) -> dict` that simulates the behavior of reconnecting to a network device. The function should return a dictionary with the following keys: 'out', 'result', and 'comment'. The 'result' key should always be True,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reconnect(False) == {'out': None, 'result': True, 'comment': 'Already alive.'}\", \"assert reconnect(True) == {'out': None, 'result': True, 'comment': 'Connection restarted!'}\", \"assert reconnect(False) == {'out': None, 'result': True, 'comment': 'Already ... | {
"split": "train",
"index": 72072,
"acecode_id": "bigcode_python_fns_45050",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `is_valid_query_result(query_result)` that checks the validity of a query result for a database. The function should take a single parameter, `query_result`, which can be any iterable data structure (like a list or tuple). The functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_query_result([(1, 'John', 25), (2, 'Alice', 30)]) == True\", \"assert is_valid_query_result([(1, 'Mike', 20), (2, 'Sarah', 28)]) == True\", \"assert is_valid_query_result([(1, 'Alice', 30)]) == True\", \"assert is_valid_query_result([(1, 'Bob', 22),... | {
"split": "train",
"index": 72073,
"acecode_id": "oss_31242",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a Python function `analyze_number(num: int) -> str` that takes an integer input `num` and returns a string. The string should indicate whether the number is 'Even', 'Odd', or 'Zero', and if the number is 'Prime' or 'Not Prime'. The output format should be: '<Even/Odd/Zer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_number(0) == 'Zero Not Prime'\", \"assert analyze_number(1) == 'Odd Not Prime'\", \"assert analyze_number(2) == 'Even Prime'\", \"assert analyze_number(3) == 'Odd Prime'\", \"assert analyze_number(4) == 'Even Not Prime'\", \"assert analyze_number(5) ... | {
"split": "train",
"index": 72074,
"acecode_id": "evol_5188",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_maximum(numbers: List[int]) -> int` that returns the maximum integer from the list. If the list is empty, return None. The input list can contain both positive and negative integers. Your task is to implement this function withou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_maximum([1, 2, 3, 4, 5]) == 5\", \"assert find_maximum([-1, -2, -3, -4, -5]) == -1\", \"assert find_maximum([0, 0, 0]) == 0\", \"assert find_maximum([5]) == 5\", \"assert find_maximum([-10, 0, 10]) == 10\", \"assert find_maximum([3, 5, 2, 8, 1]) == 8\",... | {
"split": "train",
"index": 72075,
"acecode_id": "bigcode_python_fns_46866",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer n (the number of nodes) and a float p (the probability for edge creation), implement a function that generates a random directed graph represented as an adjacency list. The graph should follow the Erdős-Rényi model, where each possible edge between the nodes is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_random_graph(0, 0.5) == {}\", \"assert generate_random_graph(1, 0.5) == {0: []}\", \"assert generate_random_graph(2, 0.0) == {}\", \"assert generate_random_graph(2, 1.0) == {}\", \"assert generate_random_graph(4, 0.0) == {}\", \"assert generate_rand... | {
"split": "train",
"index": 72076,
"acecode_id": "bigcode_python_fns_20252",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that converts a given string into 'weird case' format. In this format, every even-indexed character in each word is converted to uppercase, while every odd-indexed character is converted to lowercase. The function should return the mo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert to_weird_case('This is a Test') == 'ThIs Is A TeSt'\", \"assert to_weird_case('hello world') == 'HeLlO WoRlD'\", \"assert to_weird_case('Python coding') == 'PyThOn CoDiNg'\", \"assert to_weird_case('a b c') == 'A B C'\", \"assert to_weird_case('') == ''\", \... | {
"split": "train",
"index": 72077,
"acecode_id": "oss_23886",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that checks if a given string is a valid email address and returns a dictionary containing the validity of the email, the number of characters before the '@' symbol, the domain name, and the number of characters in the domain name. An email is considered valid... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_email('example@gmail.com') == {'validity': True, 'user_character_count': 7, 'domain': 'gmail', 'domain_character_count': 5}\", \"assert validate_email('user@domain.co.uk') == {'validity': True, 'user_character_count': 4, 'domain': 'domain', 'domain_... | {
"split": "train",
"index": 72078,
"acecode_id": "evol_33054",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `current_path`, implement a function `ensure_valid_path(current_path: str) -> bool` that checks if the `current_path` contains any of the restricted paths specified in a predefined list `NO_AUTO_REFRESH`. The function should return `True` if the `current_path` do... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ensure_valid_path('/home/user/documents') == True\", \"assert ensure_valid_path('/home/admin') == False\", \"assert ensure_valid_path('/settings/home') == False\", \"assert ensure_valid_path('/user/config') == False\", \"assert ensure_valid_path('/public/fil... | {
"split": "train",
"index": 72079,
"acecode_id": "bigcode_python_fns_48089",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a Python function that computes the total volume of a list of geometric shapes, where each shape is represented by a dictionary containing 'radius', 'height', and 'shape' as keys. The 'shape' key can either be 'cylinder' or 'cone'. Your function should return the total v... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_volume([{'shape': 'cylinder', 'radius': 3, 'height': 5}]) == 141.3716694115407\", \"assert total_volume([{'shape': 'cylinder', 'radius': 0, 'height': 5}]) == 0.0\", \"assert total_volume([{'shape': 'cone', 'radius': 0, 'height': 5}]) == 0.0\", \"assert... | {
"split": "train",
"index": 72080,
"acecode_id": "evol_4120",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a command-line interface for controlling an ARM (Advanced RISC Machine) device. The function should take a string input representing the user's choice and return a message based on the input. The valid choices are: '1' for ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert control_arm('1') == 'Starting the ARM.'\", \"assert control_arm('2') == 'Stopping the ARM.'\", \"assert control_arm('3') == 'Invalid input, please enter 1 to start or 2 to stop the ARM.'\", \"assert control_arm('') == 'Invalid input, please enter 1 to start ... | {
"split": "train",
"index": 72081,
"acecode_id": "oss_32755",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the total duration of a list of video files in seconds. Write a Python function `calculate_total_duration(video_durations: List[float]) -> float` that takes a list of video durations (in seconds) as input and returns the total duration of all the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_duration([]) == 0.0\", \"assert calculate_total_duration([10.5]) == 10.5\", \"assert calculate_total_duration([10.5, 5.0]) == 15.5\", \"assert calculate_total_duration([1.0, 2.0, 3.0]) == 6.0\", \"assert calculate_total_duration([0.0, 0.0]) =... | {
"split": "train",
"index": 72082,
"acecode_id": "oss_37274",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a user authentication system. The function, `authenticate_user`, should take three parameters: `username`, `password`, and `user_data`, where `user_data` is a dictionary containing username-password pairs. The function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert authenticate_user('user1', 'pass1', {'user1': 'pass1', 'user2': 'pass2'}) == 'TOKEN-user1'\", \"assert authenticate_user('user2', 'pass2', {'user1': 'pass1', 'user2': 'pass2'}) == 'TOKEN-user2'\", \"assert authenticate_user('user1', 'wrongpass', {'user1': 'p... | {
"split": "train",
"index": 72083,
"acecode_id": "oss_8865",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a logging function for a subscription system. The function `subscribe_to_channel(sub_id: int, channel: str, callback: str, **kwargs) -> List[str]` should log messages based on the provided subscription details. The function takes a subscription ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert subscribe_to_channel(1, 'channel1', 'callback1') == ['Offline Transport: Subscribing to messages on channel1']\", \"assert subscribe_to_channel(2, 'channel2', 'callback2', retroactive=True) == ['Offline Transport: Subscribing to messages on channel2']\", \"a... | {
"split": "train",
"index": 72084,
"acecode_id": "bigcode_python_fns_24532",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `memoized_fibonacci(n: int) -> int` that calculates the n-th Fibonacci number using a memoization technique to cache previously computed results. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and F(n) = F(n - 1) + F(n - 2) for n >= 2. Yo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert memoized_fibonacci(0) == 0\", \"assert memoized_fibonacci(1) == 1\", \"assert memoized_fibonacci(2) == 1\", \"assert memoized_fibonacci(3) == 2\", \"assert memoized_fibonacci(4) == 3\", \"assert memoized_fibonacci(5) == 5\", \"assert memoized_fibonacci(6) ==... | {
"split": "train",
"index": 72085,
"acecode_id": "evol_5474",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates the source of a given URL. The function should determine if the URL belongs to a specific source and return the source name if it matches a predefined pattern. The source patterns are stored in a dictionary called `s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert input_url_source_check('http://ncode.syosetu.com/n1234ab/') == 'syosetu'\", \"assert input_url_source_check('https://ncode.syosetu.com/n5678cd/') == 'syosetu'\", \"assert input_url_source_check('http://ncode.syosetu.com/n9999zz/') == 'syosetu'\", \"assert in... | {
"split": "train",
"index": 72086,
"acecode_id": "oss_5523",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, each representing a file name of stimuli in the format 'category_imageName.bmp'. Your task is to write a function that processes this list and returns two lists: one containing the categories of the stimuli and another containing the names of th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_stimuli_info(['animal_cat.bmp', 'vehicle_car.bmp']) == (['animal', 'vehicle'], ['cat', 'car'])\", \"assert extract_stimuli_info(['plant_tree.bmp']) == (['plant'], ['tree'])\", \"assert extract_stimuli_info(['fruit_apple.bmp', 'fruit_banana.bmp', 'fru... | {
"split": "train",
"index": 72087,
"acecode_id": "oss_26684",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string s composed of the letters 'a', 'b', and 'c', determine if it is possible to construct the string by repeatedly inserting the substring 'abc' into an initially empty string. Implement a function that returns true if the string is valid according to these rules, an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isValid('aabcbc') == True\", \"assert isValid('abcabcababcc') == True\", \"assert isValid('abccba') == False\", \"assert isValid('cababc') == False\", \"assert isValid('abc') == True\", \"assert isValid('ab') == False\", \"assert isValid('a') == False\", \"a... | {
"split": "train",
"index": 72088,
"acecode_id": "evol_18023",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the deletion of an item from a simple list-based data storage system. You will be given a list of unique identifiers, and a specific identifier that you need to remove from that list. Your function should return a new l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_item([1, 2, 3, 4], 3) == [1, 2, 4]\", \"assert delete_item([1, 2, 3, 4], 1) == [2, 3, 4]\", \"assert delete_item([1, 2, 3, 4], 4) == [1, 2, 3]\", \"assert delete_item([1, 1, 1, 1], 1) == []\", \"assert delete_item([], 1) == []\", \"assert delete_item(... | {
"split": "train",
"index": 72089,
"acecode_id": "oss_17477",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a Python function that checks if the sum of all integers in a given list is within a specified range defined by two numbers, and that the list contains an even number of elements. The function should return True if both conditions are met, and False otherwise. For exampl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_within_bounds([1, 2, 4, 10], 15, 25) == True\", \"assert sum_within_bounds([1, 5, 10], 5, 15) == False\", \"assert sum_within_bounds([2, 2, 2, 2], 5, 10) == True\", \"assert sum_within_bounds([3, 3, 3], 5, 10) == False\", \"assert sum_within_bounds([1, 1... | {
"split": "train",
"index": 72090,
"acecode_id": "evol_15950",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of choices, where each choice is represented as a dictionary with two keys: 'text' and 'correct'. The 'text' key contains a string representing the choice text, and the 'correct' key is a boolean indicating whether this choice is the correct answer. Your ta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_answer_dict([{'text': 'Choice 1', 'correct': False}, {'text': 'Choice 2', 'correct': True}, {'text': 'Choice 3', 'correct': True}]) == ({'choice0': 'Choice 1', 'choice1': 'Choice 2', 'choice2': 'Choice 3'}, '[1, 2]')\", \"assert create_answer_dict([{'... | {
"split": "train",
"index": 72091,
"acecode_id": "bigcode_python_fns_43560",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes in a year and a month as inputs and returns a tuple containing the first and last day of that month in the format YYYY-MM-DD. The function should handle any valid year and month inputs. For example, if the input is year = 2020 and month = 2, the outp... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert month_date_range(2020, 1) == ('2020-01-01', '2020-01-31')\", \"assert month_date_range(2020, 2) == ('2020-02-01', '2020-02-29')\", \"assert month_date_range(2021, 2) == ('2021-02-01', '2021-02-28')\", \"assert month_date_range(2020, 3) == ('2020-03-01', '202... | {
"split": "train",
"index": 72092,
"acecode_id": "evol_11560",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a formatted message containing a list of available commands for a bot. The function should take a string input that represents the bot's name and return a message string that includes the bot's name, followed by the availab... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_bot_message('MyBot') == '*MyBot*\\\\n\\\\n*Available commands:*\\\\n\\\\n/start - starts the bot\\\\n/help - shows help information'\", \"assert generate_bot_message('ChatAssistant') == '*ChatAssistant*\\\\n\\\\n*Available commands:*\\\\n\\\\n/start... | {
"split": "train",
"index": 72093,
"acecode_id": "bigcode_python_fns_18494",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the ages of a group of people. Write a function `average_age(ages: List[int]) -> float` that calculates the average age of the group. The average age should be computed as the sum of all ages divided by the number of people, rounded... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_age([25, 30, 35]) == 30.0\", \"assert average_age([18]) == 18.0\", \"assert average_age([10, 20, 30, 40, 50]) == 30.0\", \"assert average_age([0, 0, 0, 0]) == 0.0\", \"assert average_age([5, 10, 15, 20, 25, 30, 35, 40, 45, 50]) == 27.5\", \"assert av... | {
"split": "train",
"index": 72094,
"acecode_id": "bigcode_python_fns_24554",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that updates an integer value to a new integer value. The function should take two parameters: the current integer value and a new integer value. The function should return the new integer value after the update. Implement a function named... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_value(5, 10) == 10\", \"assert update_value(-1, 0) == 0\", \"assert update_value(100, 200) == 200\", \"assert update_value(0, -5) == -5\", \"assert update_value(42, 42) == 42\", \"assert update_value(7, 14) == 14\", \"assert update_value(1, 2) == 2\",... | {
"split": "train",
"index": 72095,
"acecode_id": "bigcode_python_fns_31153",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary where the keys are letter identifiers (strings) and the values are the text of the letters (strings). Your task is to implement a function that converts this dictionary into a list of dictionaries, where each dictionary contains the letter identifier ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_letters_dict({'letter1': 'Hello World', 'letter2': 'Python is great'}) == [{'id': 'letter1', 'tokens': ['Hello', 'World']}, {'id': 'letter2', 'tokens': ['Python', 'is', 'great']}]\", \"assert convert_letters_dict({'letter1': 'A B C', 'letter2': '1 2 ... | {
"split": "train",
"index": 72096,
"acecode_id": "bigcode_python_fns_11886",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of media titles and their corresponding types (Movie, LimitedSeries, Podcast, TVShow) and returns a string in CSV format. Each media title and type should be separated by a comma, and each entry should be on a new line. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert media_to_csv([('Inception', 'Movie'), ('The Office', 'TVShow'), ('Breaking Bad', 'LimitedSeries'), ('Podcast A', 'Podcast')]) == 'Inception,Movie\\\\nThe Office,TVShow\\\\nBreaking Bad,LimitedSeries\\\\nPodcast A,Podcast'\", \"assert media_to_csv([('Avatar',... | {
"split": "train",
"index": 72097,
"acecode_id": "bigcode_python_fns_16641",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of floating-point numbers, each representing a voltage value that needs to be adjusted. Your task is to implement a function `adjust_voltages(voltage_list: List[float], min_voltages: List[float], max_voltages: List[float]) -> bool` that checks if each volta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert adjust_voltages([1.5, 2.0, 3.5], [1.0, 1.5, 3.0], [2.0, 2.5, 4.0]) == True\", \"assert adjust_voltages([0.5, 2.5, 3.5], [1.0, 1.5, 3.0], [2.0, 2.5, 4.0]) == False\", \"assert adjust_voltages([1.0, 2.0, 3.0], [1.0, 1.5, 2.5], [2.0, 3.0, 4.0]) == True\", \"ass... | {
"split": "train",
"index": 72098,
"acecode_id": "bigcode_python_fns_20123",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom exception hierarchy for a PDF processing application. Your goal is to create a set of custom exception classes that handle different types of errors occurring during the PDF processing workflow. Specifically, you need to define a base e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert issubclass(JobError, PdfRelayException)\", \"assert issubclass(EngineError, PdfRelayException)\", \"assert issubclass(MetadataError, PdfRelayException)\", \"assert PdfRelayException.__name__ == 'PdfRelayException'\", \"assert JobError.__name__ == 'JobError'\... | {
"split": "train",
"index": 72099,
"acecode_id": "oss_10476",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.