data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if certain constraints on a memory management system are satisfied. Specifically, you need to implement a function `check_constraints(max_memory, max_parents, max_chains, memory_usage, parent_count, chain_count)` that take...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_constraints(1000, 5, 3, 1200, 3, 2) == (True, False, False)\", \"assert check_constraints(1000, 5, 3, 800, 6, 2) == (False, True, False)\", \"assert check_constraints(500, 2, 1, 600, 1, 1) == (True, False, False)\", \"assert check_constraints(100, 2, 3...
{ "split": "train", "index": 71600, "acecode_id": "oss_1396", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to create a function that calculates the area and perimeter of two geometric shapes: a rectangle and a circle. The function will take the type of shape and its dimensions as parameters. If the shape is a rectangle, it will receive the length and width. If the shape is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_shape_properties('rectangle', [4, 5]) == (20, 18)\", \"assert calculate_shape_properties('circle', [3]) == (28.274333882308138, 18.84955592153876)\", \"assert calculate_shape_properties('rectangle', [10, 2]) == (20, 24)\", \"assert calculate_shape_...
{ "split": "train", "index": 71601, "acecode_id": "oss_6767", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that accepts a string containing a mix of characters (including uppercase and lowercase letters, numerals, and special symbols) and returns a dictionary showing the characters with the highest occurrence (treating letters as case-insensitive) along with the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert advanced_histogram('A B c 1 @') == {'a': 1, 'b': 1, 'c': 1, '1': 1, '@': 1}\", \"assert advanced_histogram('A b C a B 1 2 2') == {'a': 2, 'b': 2, '2': 2}\", \"assert advanced_histogram('B B B b A ! ! ! !') == {'b': 4, '!': 4}\", \"assert advanced_histogram('...
{ "split": "train", "index": 71602, "acecode_id": "evol_9666", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a string of text, write a function that analyzes the text to determine the frequency of each unique word. A word is defined as a sequence of non-whitespace characters. The function should ignore the case of the letters and remove any punctuation marks from the text. The o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert word_frequency('Hello world! Hello again.') == {'hello': 2, 'world': 1, 'again': 1}\", \"assert word_frequency('Python is great; python is fun.') == {'python': 2, 'is': 2, 'great': 1, 'fun': 1}\", \"assert word_frequency('This is a test. This is only a test....
{ "split": "train", "index": 71603, "acecode_id": "oss_26117", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that determines whether cleanup operations should be performed on generated files based on a command-line style input. Your function should accept a boolean parameter `no_cleanup` that indicates whether the cleanup should be skipped. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert should_cleanup(False) == True\", \"assert should_cleanup(True) == False\", \"assert should_cleanup(False) == True\", \"assert should_cleanup(True) == False\", \"assert should_cleanup(False) == True\", \"assert should_cleanup(True) == False\", \"assert should...
{ "split": "train", "index": 71604, "acecode_id": "oss_15915", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `get_additional_dependencies(dependencies: List[str]) -> List[str]` that takes a list of package dependencies as input and returns a list of additional dependencies that may be required based on the provided list. Each package may hav...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_additional_dependencies(['pkgB']) == ['pkgD']\", \"assert get_additional_dependencies(['pkgC']) == []\", \"assert get_additional_dependencies(['pkgD']) == []\", \"assert get_additional_dependencies(['pkgB', 'pkgD']) == ['pkgD']\", \"assert get_additional...
{ "split": "train", "index": 71605, "acecode_id": "bigcode_python_fns_48980", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function `is_prime(num)` that determines whether a given integer `num` is a prime number or not. The function should return `True` if the number is prime and `False` otherwise. A prime number is defined as a natural number greater than 1 that cannot be formed by mul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"assert is_prime(7) == True\", \"assert is_prime(8) == False\", \"assert is_prime(9) == False\", \"asser...
{ "split": "train", "index": 71606, "acecode_id": "evol_22178", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a string as input and returns the number of unique characters in that string. A unique character is defined as a character that appears exactly once in the string. For example, in the string 'hello', the unique character is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_characters('aabbcc') == 0\", \"assert count_unique_characters('') == 0\", \"assert count_unique_characters('abcdef') == 6\", \"assert count_unique_characters('aabbccddeeff') == 0\", \"assert count_unique_characters('swiss') == 2\", \"assert coun...
{ "split": "train", "index": 71607, "acecode_id": "bigcode_python_fns_5517", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given three integers a, b, and c. Your task is to determine whether there exist any integer solutions (x, y) to the equation ax + by = c. If solutions exist, return a tuple containing the integers x0 and y0, which are one particular solution, as well as a' and b', the c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert linear_diophantine(1, 1, 2) == (2, 0, 1, 1)\", \"assert linear_diophantine(0, 1, 0) == (0, 0, 0, 1)\", \"assert linear_diophantine(1, 0, 3) == (3, 0, 1, 0)\", \"assert linear_diophantine(5, 10, 15) == (3, 0, 1, 2)\", \"assert linear_diophantine(1, 1, 1) == (...
{ "split": "train", "index": 71608, "acecode_id": "bigcode_python_fns_45931", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a string containing details about a person. The input string has the format 'Name: <name>, Image URL: <img_url>, Telephone: <telefone>, Email: <email>'. Your goal is to extract the specified details and return them a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_detail('Name: John Doe, Image URL: http://example.com/john.jpg, Telephone: 123-456-7890, Email: john@example.com') == {'nome': 'John Doe', 'img_url': 'http://example.com/john.jpg', 'telefone': '123-456-7890', 'email': 'john@example.com'}\", \"assert pa...
{ "split": "train", "index": 71609, "acecode_id": "oss_25424", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings, implement a function that returns a dictionary where the keys are the input strings and the values are the first and last characters of each string. If a string has only one character, the dictionary value should contain that character as both the first...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert values_from_list(['hello', 'world', 'python', 'a']) == {'hello': 'ho', 'world': 'wd', 'python': 'pn', 'a': 'aa'}\", \"assert values_from_list(['single']) == {'single': 'se'}\", \"assert values_from_list(['a', 'b', 'c']) == {'a': 'aa', 'b': 'bb', 'c': 'cc'}\"...
{ "split": "train", "index": 71610, "acecode_id": "oss_27108", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a sorted rotated array of unique elements, implement a function that returns the minimum element of this array, its index in the rotated array, and the number of rotations the array has undergone. The array is guaranteed to have at least one element. The function signatur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_min_and_index([3,4,5,1,2]) == (1, 3, 3)\", \"assert find_min_and_index([4,5,6,7,0,1,2]) == (0, 4, 4)\", \"assert find_min_and_index([5,6,7,8,9,1,2,3,4]) == (1, 5, 5)\", \"assert find_min_and_index([1,2,3,4,5]) == (1, 0, 0)\", \"assert find_min_and_index...
{ "split": "train", "index": 71611, "acecode_id": "evol_15633", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given the coefficients of a quadratic function represented as f(x) = ax^2 + bx + c, implement a function that calculates the derivative of the function with respect to x. The function should return the derivative in the format 'Derivative of f(x): mx + n' where m is the coeffic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert derivative(1, 5, 3) == 'Derivative of f(x): 2x + 5'\", \"assert derivative(2, 4, 1) == 'Derivative of f(x): 4x + 4'\", \"assert derivative(0, 3, 2) == 'Derivative of f(x): 0x + 3'\", \"assert derivative(-1, 2, 5) == 'Derivative of f(x): -2x + 2'\", \"assert ...
{ "split": "train", "index": 71612, "acecode_id": "evol_11692", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `classify_fruit(chromatic_attribute: int, exterior_texture: int) -> str` that classifies a fruit as either 'mango' or 'apple' based on its chromatic attributes and exterior texture characteristics. The function should use a simple decision tree approach bas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_fruit(4, 6) == 'mango'\", \"assert classify_fruit(5, 7) == 'mango'\", \"assert classify_fruit(3, 6) == 'apple'\", \"assert classify_fruit(2, 5) == 'apple'\", \"assert classify_fruit(3, 5) == 'apple'\", \"assert classify_fruit(4, 5) == 'apple'\", \"a...
{ "split": "train", "index": 71613, "acecode_id": "evol_30569", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates SQL index creation statements for a given table and a list of columns. Write a Python function `generate_index_creation_statements` that takes the following parameters: - `table_name` (string): The name of the table...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_index_creation_statements('employees', ['name', 'age']) == ['CREATE INDEX IF NOT EXISTS `ix_employees_name` ON employees (name)', 'CREATE INDEX IF NOT EXISTS `ix_employees_age` ON employees (age)']\", \"assert generate_index_creation_statements('pro...
{ "split": "train", "index": 71614, "acecode_id": "oss_21306", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple name chooser. Implement a function `choose_name(base: str, used_names: List[str]) -> str` that generates a new name based on a given base name by appending a number to it. The function should ensure that the generated name is not already pr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert choose_name('foo', ['foo', 'foo-1']) == 'foo-2'\", \"assert choose_name('bar', ['bar', 'bar-1', 'bar-2']) == 'bar-3'\", \"assert choose_name('test', ['test-1', 'test-2', 'test']) == 'test-3'\", \"assert choose_name('name', []) == 'name'\", \"assert choose_na...
{ "split": "train", "index": 71615, "acecode_id": "bigcode_python_fns_3210", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that checks if a given string has balanced parentheses, square brackets, curly braces, and angle brackets. The function should return True if all pairs of symbols are properly nested and balanced, and False otherwise. For example, '(){}[]<>', '{[()]}', and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_nested_and_balanced('(hello)<world>[{!}]') == True\", \"assert is_nested_and_balanced('()[<{]>}') == False\", \"assert is_nested_and_balanced('<<>>') == True\", \"assert is_nested_and_balanced('[') == False\", \"assert is_nested_and_balanced(']') == False...
{ "split": "train", "index": 71616, "acecode_id": "evol_2887", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function to sort a list of integers using the Quick Sort algorithm. Quick Sort is a comparison-based sorting algorithm that uses a divide-and-conquer strategy. The algorithm works by selecting a 'pivot' element from the list and partiti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert quicksort([3, 6, 8, 10, 1, 2, 1]) == [1, 1, 2, 3, 6, 8, 10]\", \"assert quicksort([]) == []\", \"assert quicksort([5]) == [5]\", \"assert quicksort([5, 5, 5]) == [5, 5, 5]\", \"assert quicksort([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert quicksort([5, 4,...
{ "split": "train", "index": 71617, "acecode_id": "oss_19301", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a series of shell commands, each separated by newline characters. Each command may have a timestamp and is formatted in the style of a terminal output. Write a function `extract_command_list(content: str) -> List[str]` that extracts all the c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_command_list(' 9597 5.1.2020 11:23 git status\\\\n 9598 5.1.2020 11:23 cd .idea\\\\n 9599 5.1.2020 11:23 ls') == ['git status', 'cd .idea', 'ls']\", \"assert extract_command_list(' 9600 5.1.2020 11:23 ..\\\\n 9601 5.1.2020 11:23 rm -rf .ide...
{ "split": "train", "index": 71618, "acecode_id": "bigcode_python_fns_5279", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function called `polySpinEdge` that simulates a polyhedral spin operation on an edge in a 3D model. The function should accept multiple parameters that configure the spin operation, including boolean flags for features like caching, construction h...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert polySpinEdge(caching=True, constructionHistory=True, frozen=False, name='spin1', nodeState=1, offset=5, reverse=True, edgeIndex=3) == {'caching': True, 'constructionHistory': True, 'frozen': False, 'name': 'spin1', 'nodeState': 1, 'offset': 5, 'reverse': Tru...
{ "split": "train", "index": 71619, "acecode_id": "bigcode_python_fns_15758", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates an SSH command as a list of strings. The function should take in a dictionary representing SSH configuration and a command string. The SSH configuration dictionary may contain the following keys: 'host' (a string representi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_ssh_command({'host': 'example.com'}, 'ls') == ['ssh', 'user@example.com', 'ls']\", \"assert generate_ssh_command({'host': 'localhost'}, 'pwd') == ['ssh', 'user@localhost', 'pwd']\", \"assert generate_ssh_command({'host': '192.168.1.1'}, 'whoami') ==...
{ "split": "train", "index": 71620, "acecode_id": "bigcode_python_fns_38103", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes molecular data and returns a dictionary containing specific data related to molecular fragments and their connections. The function should take in the following parameters: \n- `frag_remapped` (list): A list representin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_data(['A', 'B', 'C', 'D'], 0, 2, ['W', 'X', 'Y', 'Z'], 1, 3, [(1, 2), (2, 3)], [(3, 4), (4, 5)], 'connected') == {'p_coords': [(1, 2), (2, 3)], 'p_types': ['A', 'B'], 'r_coords': [(3, 4), (4, 5)], 'r_types': ['X', 'Y'], 'conn': 'connected'}\", \"asse...
{ "split": "train", "index": 71621, "acecode_id": "oss_32321", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a custom exception object. The function, `process_exception`, takes an exception object as an argument. The exception object can either be an instance of `CustomException`, which contains attributes `type`, `msg`, and optio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_exception(CustomException('TypeError', 'An error occurred', 'Traceback info')) == 'TypeError: An error occurred (Traceback info)'\", \"assert process_exception(CustomException('ValueError', 'Invalid value', None)) == 'ValueError: Invalid value (<Unkn...
{ "split": "train", "index": 71622, "acecode_id": "bigcode_python_fns_27100", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of system log messages, write a function `analyze_logs(logs: List[str]) -> Dict[str, int]` that analyzes the logs and returns a dictionary containing the count of occurrences of each unique log message. The input `logs` will be a list of strings, where each string ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_logs(['Error: Disk not found', 'Warning: High memory usage', 'Error: Disk not found']) == {'Error: Disk not found': 2, 'Warning: High memory usage': 1}\", \"assert analyze_logs(['Info: System booted', 'Info: System booted', 'Info: System booted']) ==...
{ "split": "train", "index": 71623, "acecode_id": "evol_29038", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that performs string expansion based on a given context and key-value pairs. The function takes in an input string `expanded`, a context object `context`, and a default value `default`. The input string `expanded` contains placeholder...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert string_expansion('Hello ${Params.name}', Context(Descriptor(Parameters={'name': 'Alice'}), params={}), 'UNKNOWN') == 'Hello Alice'\", \"assert string_expansion('Value: ${Params.value}', Context(Descriptor(Parameters={'value': '42'}), params={}), 'UNKNOWN') =...
{ "split": "train", "index": 71624, "acecode_id": "oss_23044", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the magnitude-scaling relationship for Probabilistic Seismic Hazard Analysis (PSHA) test cases based on a given magnitude value. The function should take a single argument, 'magnitude', which represents the earthquake ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_hazard_value(4.0) == 4.8\", \"assert calculate_hazard_value(5.0) == 6.0\", \"assert calculate_hazard_value(5.5) == 8.25\", \"assert calculate_hazard_value(6.0) == 9.0\", \"assert calculate_hazard_value(7.0) == 10.5\", \"assert calculate_hazard_valu...
{ "split": "train", "index": 71625, "acecode_id": "oss_34637", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that finds the maximum length of a contiguous subarray with an equal number of 0s and 1s in a binary array. The input will be a list of integers containing only 0s and 1s. Your goal is to return the length of the longest contiguous su...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert findMaxLength([0, 1, 0, 0, 1, 1, 0]) == 6\", \"assert findMaxLength([0, 1, 1, 0, 1, 1, 1, 0]) == 4\", \"assert findMaxLength([0, 0, 1, 1]) == 4\", \"assert findMaxLength([1, 1, 0, 0, 1, 0, 1]) == 6\", \"assert findMaxLength([0, 1, 0, 1, 0, 1]) == 6\", \"asse...
{ "split": "train", "index": 71626, "acecode_id": "oss_7559", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries where each dictionary represents a row in an HTML table, write a function that generates an HTML string representation of the table. The function should take the list of dictionaries as input and return a string containing the HTML code for the tabl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_html_table([]) == ''\", \"assert generate_html_table([{'Name': 'Alice', 'Age': 25}]) == '<table>\\\\n<tr>\\\\n<th>Name</th>\\\\n<th>Age</th>\\\\n</tr>\\\\n<tr>\\\\n<td>Alice</td>\\\\n<td>25</td>\\\\n</tr>\\\\n</table>'\", \"assert generate_html_tabl...
{ "split": "train", "index": 71627, "acecode_id": "oss_8890", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a Python function `create_sql_query` that generates a SQL query string for a specified table. The function should take the following parameters: a string `table` (the name of the main table), an optional string `secondary_table` (the name of a secondary table for a join o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_sql_query('employee_records') == 'SELECT * FROM employee_records'\", \"assert create_sql_query('employee_records', 'department_records') == 'SELECT * FROM employee_records JOIN department_records ON employee_records.department_id = department_records....
{ "split": "train", "index": 71628, "acecode_id": "evol_35693", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the double of a given integer input. Implement a function named `double_value` that takes a single integer parameter `input_number` and returns its double. The function should be defined as follows: `def double_value(input...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert double_value(0) == 0\", \"assert double_value(1) == 2\", \"assert double_value(-1) == -2\", \"assert double_value(5) == 10\", \"assert double_value(10) == 20\", \"assert double_value(-10) == -20\", \"assert double_value(100) == 200\", \"assert double_value(-...
{ "split": "train", "index": 71629, "acecode_id": "oss_7840", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that merges multiple instances of the same file change along with their reasons into a single instance. The function should take a list of ChangedFile objects, each containing a file name and a list of reasons for the change. If the s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_file_changes([ChangedFile('file1.txt', ['added', 'modified']), ChangedFile('file2.txt', ['deleted']), ChangedFile('file1.txt', ['renamed', 'permissions changed'])]) == [ChangedFile('file1.txt', ['added', 'modified', 'renamed', 'permissions changed']), ...
{ "split": "train", "index": 71630, "acecode_id": "oss_36893", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to publish messages to a messaging platform. The function `publish_message(topic: str, message: str)` should take a `topic` and a `message` as input. If the `topic` parameter is set to 'TOPICS_ALL', the message should be considered pu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert publish_message('topic1', 'Hello, topic 1!') == 'Message published successfully to topic1'\", \"assert publish_message('TOPICS_ALL', 'Hello, all topics!') == 'Message published successfully to all topics'\", \"assert publish_message('topic2', 'Hello, topic 2...
{ "split": "train", "index": 71631, "acecode_id": "oss_22448", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function that takes a list of integers as input and returns a new list containing only the unique integers from the original list, maintaining the order of their first occurrence. The function should be named `get_unique_integers` and should not modify the in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_integers([1, 2, 2, 3, 4]) == [1, 2, 3, 4]\", \"assert get_unique_integers([5, 5, 5, 5, 5]) == [5]\", \"assert get_unique_integers([]) == []\", \"assert get_unique_integers([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert get_unique_integers([1, 2, ...
{ "split": "train", "index": 71632, "acecode_id": "evol_14462", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a given machine can be reached on the network by simulating a ping command. The function should take two parameters: a string 'machine' representing the hostname or IP address of the machine, and a list of strings 'excl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_machine_reachable('192.168.1.1', ['192.168.1.2']) == True\", \"assert is_machine_reachable('192.168.1.2', ['192.168.1.2']) == False\", \"assert is_machine_reachable('hostname.local', ['hostname.local']) == False\", \"assert is_machine_reachable('hostname....
{ "split": "train", "index": 71633, "acecode_id": "bigcode_python_fns_37966", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that resets a simple in-memory database represented as a dictionary. The function should take a dictionary representing the database and clear all its entries. Additionally, the function should return the number of entries that were remov...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reset_database({'user1': 'data1', 'user2': 'data2'}) == 2\", \"assert reset_database({'a': 1, 'b': 2, 'c': 3}) == 3\", \"assert reset_database({}) == 0\", \"assert reset_database({'key1': 'value1'}) == 1\", \"assert reset_database({'name': 'Alice', 'age': 30...
{ "split": "train", "index": 71634, "acecode_id": "bigcode_python_fns_26005", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates writing data to a temporary file in memory and returns the name of that temporary file. The function should take a string of data and a mode (default is 'w' for writing) as input. The function should return the name of the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_temp_file('Hello, World!', 'w') != create_temp_file('Hello, World!', 'w')\", \"assert create_temp_file('Data A', 'w') != create_temp_file('Data B', 'w')\", \"assert create_temp_file('Test', 'r') != create_temp_file('Test', 'r')\", \"assert create_temp...
{ "split": "train", "index": 71635, "acecode_id": "bigcode_python_fns_35265", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a list of strings, a substring, and an optional parameter indicating whether the search should be case sensitive. The function should return a list of all strings in the list that contain the substring. If there are no matches, return a custom messag...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_substrings(['hello', 'world', 'apple'], 'o') == ['hello', 'world']\", \"assert find_substrings(['hello', 'WORLD', 'apple'], 'o', case_sensitive=False) == ['hello', 'WORLD']\", \"assert find_substrings(['hello', 'WORLD', 'apple'], 'O', case_sensitive=Tru...
{ "split": "train", "index": 71636, "acecode_id": "evol_22112", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `answer`, write a function `only_letters` that checks if the string consists only of lowercase letters (a-z) and digits (0-9). The function should return `True` if the string contains only these characters; otherwise, it should return `False`. The input string ma...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert only_letters('abc123') == True\", \"assert only_letters('abc') == True\", \"assert only_letters('123') == True\", \"assert only_letters('') == True\", \"assert only_letters('abc!') == False\", \"assert only_letters('abc ABC') == False\", \"assert only_letter...
{ "split": "train", "index": 71637, "acecode_id": "bigcode_python_fns_6327", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages email name IDs. The function should allow setting and retrieving the name ID of an email. Implement a function called `manage_email_nameid` that accepts two parameters: `action` (a string which can be either 'set' or 'get') a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_email_nameid('set', 'user@example.com') == 'Name ID set successfully'\", \"assert manage_email_nameid('set', 'admin@example.com') == 'Name ID set successfully'\", \"assert manage_email_nameid('set', 'test@example.com') == 'Name ID set successfully'\",...
{ "split": "train", "index": 71638, "acecode_id": "oss_34250", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of DNA sequences represented as strings. Your task is to write a function that takes this list of sequences and returns a new list containing only the unique sequences in the order they first appeared in the input list. The function should ignore case when ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_sequences(['A', 'C', 'A', 'G', 'T', 'C', 'G', 'A']) == ['A', 'C', 'G', 'T']\", \"assert get_unique_sequences(['a', 'c', 'g', 't', 'g', 'C']) == ['a', 'c', 'g', 't']\", \"assert get_unique_sequences(['ATGC', 'atgc', 'ATG', 'CGTA']) == ['ATGC', 'ATG...
{ "split": "train", "index": 71639, "acecode_id": "bigcode_python_fns_31637", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a floating point Unix timestamp, write a function `format_date(unix_timestamp)` that returns a standardized date format in the string format '%Y-%m-%d %H:%M:%S %Z'. The function should compute the local date and time based on the provided Unix timestamp, including the UTC...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_date(0) == '1970-01-01 00:00:00 UTC'\", \"assert format_date(1640995200) == '2022-01-01 00:00:00 UTC'\", \"assert format_date(1577836800) == '2020-01-01 00:00:00 UTC'\", \"assert format_date(1630454400) == '2021-09-01 00:00:00 UTC'\", \"assert format_...
{ "split": "train", "index": 71640, "acecode_id": "bigcode_python_fns_9541", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates user account management for a network device. Implement a function `manage_users` that takes a list of commands and returns the final state of user accounts. Each command can be one of the following: 'create username passwo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_users(['create user1 pass1 10 True']) == {'user1': {'password': 'pass1', 'privilege_level': 10, 'encrypted': True}}\", \"assert manage_users(['create user1 pass1 10 True', 'update user1 pass2 True']) == {'user1': {'password': 'pass2', 'privilege_level...
{ "split": "train", "index": 71641, "acecode_id": "oss_8419", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a binary tree represented as a dictionary, implement a function `count_terminal_nodes(tree)` that returns the count of terminal nodes (leaf nodes) in the tree. A terminal node is defined as a node that does not have any 'left' or 'right' attributes. The tree is structured...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_terminal_nodes({'data': 10, 'left': {'data': 20, 'left': {'data': 40}, 'right': {'data': 50}}, 'right': {'data': 30, 'left': {'data': 60}}}) == 3\", \"assert count_terminal_nodes({'data': 1, 'left': {'data': 2}, 'right': {'data': 3}}) == 2\", \"assert ...
{ "split": "train", "index": 71642, "acecode_id": "evol_8482", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a Python function that calculates the average of a list of integers and checks if this average falls within a specified inclusive range defined by a lower limit and an upper limit. The function should return True if the average is within the range, and False otherwise. Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_in_interval([1, 2, 4, 10], 3, 7) == True\", \"assert average_in_interval([2, 3, 4], 2, 4) == True\", \"assert average_in_interval([1, 1, 1], 1, 1) == True\", \"assert average_in_interval([0, 0, 0], 0, 0) == True\", \"assert average_in_interval([-1, 0...
{ "split": "train", "index": 71643, "acecode_id": "evol_8734", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a string 'bucket_prefix' and a string 'path', write a function 's3_bucket_for' that returns a new string representing an S3 bucket name. The bucket name should be formatted as '<bucket_prefix>-<suffix>', where '<suffix>' is determined by the last component of the 'path' s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert s3_bucket_for('mybucket', 'folder1/folder2/file.txt') == 'mybucket-file.txt'\", \"assert s3_bucket_for('mybucket', 'folder1/folder2/') == 'mybucket-default'\", \"assert s3_bucket_for('mybucket', '') == 'mybucket-default'\", \"assert s3_bucket_for('testprefix...
{ "split": "train", "index": 71644, "acecode_id": "bigcode_python_fns_22864", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tickets purchased by a user at a conference. Each ticket is represented as a dictionary containing the ticket ID, fare type, fare code, and a boolean indicating if the ticket is complete. Your task is to implement a function `user_tickets(tickets: List[D...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert user_tickets([{'id': 1, 'fare_type': 'VIP', 'fare_code': 'V123', 'complete': True}, {'id': 2, 'fare_type': 'Regular', 'fare_code': 'R456', 'complete': False}]) == [(1, 'VIP', 'V123', True), (2, 'Regular', 'R456', False)]\", \"assert user_tickets([{'id': 3, '...
{ "split": "train", "index": 71645, "acecode_id": "bigcode_python_fns_17357", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You have a collection of boxes, each represented by a list containing their status (open or closed), the number of candies they contain, the keys they provide to open other boxes, and the boxes they contain. Given the initial boxes you have access to, determine the maximum numb...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxCandies([0,1,1], [1,2,3], [[1],[],[]], [[1],[],[]], [1]) == 2\", \"assert maxCandies([0,0,0,0], [1,2,3,4], [[1],[2],[3],[]], [[],[],[],[]], [0]) == 0\", \"assert maxCandies([1], [5], [[]], [[]], [0]) == 5\", \"assert maxCandies([1,1,0], [4,5,6], [[],[],[0...
{ "split": "train", "index": 71646, "acecode_id": "evol_3871", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Write a function `find_pattern(text: str) -> bool` that takes a string as input and returns True if the string contains a sequence of characters of arbitrary length that ends with the consecutive letters 'oo'. Otherwise, return False.\nPlease reason step by step, then write a s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_pattern('hello') == False\", \"assert find_pattern('helloo') == True\", \"assert find_pattern('foobaroo') == True\", \"assert find_pattern('noo') == True\", \"assert find_pattern('test') == False\", \"assert find_pattern('testoo') == True\", \"assert fi...
{ "split": "train", "index": 71647, "acecode_id": "evol_1944", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that verifies if a given input string is a valid hexadecimal number. A valid hexadecimal number can consist of digits 0-9 and letters A-F (case insensitive). The function should return the original string if it is valid; otherwise, it...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_hexadecimal(None) == None\", \"assert verify_hexadecimal('1A3F') == '1A3F'\", \"assert verify_hexadecimal('abcde') == 'abcde'\", \"assert verify_hexadecimal('A1B2C3') == 'A1B2C3'\", \"assert verify_hexadecimal('123') == '123'\", \"assert verify_hexade...
{ "split": "train", "index": 71648, "acecode_id": "bigcode_python_fns_29670", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that simulates the daily import process for a system that handles genres and recordings. The function should take a list of genres and an integer representing the number of days to simulate the import process. For each day, if the day is l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_import(['classical'], 3) == ['Housekeeping for day 1', 'Housekeeping for day 2', 'Importing recordings for day 3']\", \"assert simulate_import(['metal', 'blues'], 0) == []\", \"assert simulate_import(['hip-hop'], 1) == ['Importing recordings for day...
{ "split": "train", "index": 71649, "acecode_id": "bigcode_python_fns_15686", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that modifies a given image URL by replacing the '_normal.jpg' suffix with a new suffix that includes the specified icon size. The icon size can be one of the following values: 24, 48, 73, 200, 400, or 512. Your function should take in th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modify_image_url(1, 'http://example.com/image_normal.jpg') == 'http://example.com/image_200x200.jpg'\", \"assert modify_image_url(2, 'http://example.com/image_200x200.jpg') == 'http://example.com/image_200x200.jpg'\", \"assert modify_image_url(3, 'http://exa...
{ "split": "train", "index": 71650, "acecode_id": "bigcode_python_fns_28421", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a recursive function `print_sequence(n)` that takes a non-negative integer `n` as its argument and returns a list of integers from 0 to `n` inclusive. If the input is negative, the function should return an empty list. Make sure to use recursion to generate the sequen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_sequence(6) == [0, 1, 2, 3, 4, 5, 6]\", \"assert print_sequence(0) == [0]\", \"assert print_sequence(1) == [0, 1]\", \"assert print_sequence(5) == [0, 1, 2, 3, 4, 5]\", \"assert print_sequence(10) == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\", \"assert print...
{ "split": "train", "index": 71651, "acecode_id": "evol_15550", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_average_loss(outputs: List[Dict[str, float]]) -> float` that takes a list of dictionaries where each dictionary contains a key 'val_loss' with a float value representing the validation loss from different validation steps. The function should ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_loss([{'val_loss': 1.0}, {'val_loss': 2.0}]) == 1.5\", \"assert calculate_average_loss([{'val_loss': 0.0}, {'val_loss': 0.0}]) == 0.0\", \"assert calculate_average_loss([{'val_loss': 5.0}, {'val_loss': 5.0}, {'val_loss': 5.0}, {'val_loss': ...
{ "split": "train", "index": 71652, "acecode_id": "evol_11718", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that normalizes a given list of numbers using the min-max normalization technique. Min-max normalization scales the values in the input list to a specific range, typically between 0 and 1. The formula for min-max normalization is: \n\...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_max_normalization([1, 2, 3, 4, 5]) == [0.0, 0.25, 0.5, 0.75, 1.0]\", \"assert min_max_normalization([10, 20, 30, 40, 50]) == [0.0, 0.25, 0.5, 0.75, 1.0]\", \"assert min_max_normalization([5, 15, 25]) == [0.0, 0.5, 1.0]\", \"assert min_max_normalization([...
{ "split": "train", "index": 71653, "acecode_id": "oss_18512", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Create a function to truncate a text to a specified character length. If the text exceeds the given length, the function should return the truncated text followed by an ellipsis ('...'). If the text is shorter than or equal to the specified length, return the text as is. Implem...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert truncate_text('Hello, World!', 5) == 'Hello...'\", \"assert truncate_text('Short text.', 20) == 'Short text.'\", \"assert truncate_text('Python is great for coding.', 30) == 'Python is great for coding.'\", \"assert truncate_text('Another example of truncati...
{ "split": "train", "index": 71654, "acecode_id": "evol_21026", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Write a function `find_max(list_of_tuples)` that takes a list of tuples as input, where each tuple contains three numeric parameters. The function should return a list containing the maximum value found in each respective tuple.\nPlease reason step by step, then write a self-co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max([(1, 2, 3), (4, 5, 6), (7, 8, 9)]) == [3, 6, 9]\", \"assert find_max([(10, 5, 3), (0, -1, -2), (2, 2, 2)]) == [10, 0, 2]\", \"assert find_max([(1, 1, 1), (1, 1, 1), (1, 1, 1)]) == [1, 1, 1]\", \"assert find_max([(100, 200, 300), (50, 75, 25), (0, 0,...
{ "split": "train", "index": 71655, "acecode_id": "evol_17800", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves a list of forum topics along with the names of the users who created each topic from a simplified dataset. Given two lists, one containing the forum topics and another containing user information, the function should return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_forum_topics_with_users([('Topic 1', 1), ('Topic 2', 2), ('Topic 3', 1)], [(1, 'Alice'), (2, 'Bob')]) == [{'title': 'Topic 1', 'created_by': 'Alice'}, {'title': 'Topic 2', 'created_by': 'Bob'}, {'title': 'Topic 3', 'created_by': 'Alice'}]\", \"assert get...
{ "split": "train", "index": 71656, "acecode_id": "oss_35342", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of bounding boxes represented as 2D coordinates and a rectangular area, write a function that filters out the bounding boxes whose center points are not located within the given rectangular area. The bounding boxes are represented as a list of lists, where each box...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_bounding_boxes([[1, 1, 4, 4], [5, 5, 10, 10], [0, 0, 2, 2]], [2, 2, 6, 6]) == [True, False, False]\", \"assert filter_bounding_boxes([[2, 2, 4, 4], [3, 3, 5, 5]], [1, 1, 5, 5]) == [True, True]\", \"assert filter_bounding_boxes([[0, 0, 1, 1]], [0, 0, 1...
{ "split": "train", "index": 71657, "acecode_id": "bigcode_python_fns_37641", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with calculating various metrics for a virtual machine based on its resource usage data over a specified time period. Given a list of dictionaries, each representing resource usage metrics for a virtual machine at different timestamps, implement a function `calcu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_vm_metrics([{'cpu': 10, 'disk_read': 100, 'disk_write': 200, 'network_in': 300, 'network_out': 400}, {'cpu': 20, 'disk_read': 150, 'disk_write': 250, 'network_in': 350, 'network_out': 450}]) == (15.0, 10, 20, 125.0, 225.0, 325.0, 425.0)\", \"assert...
{ "split": "train", "index": 71658, "acecode_id": "bigcode_python_fns_18531", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function `get_device_info(ip_address: str, serial_number: str, hostname: str) -> dict`. The function takes three parameters: a string `ip_address` representing the IP address of a device, a string `serial_number` representing the device's serial number, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_device_info('192.168.1.1', 'ABC123', 'device.local') == {'serial_number': 'ABC123', 'title': 'device'}\", \"assert get_device_info('10.0.0.2', 'XYZ789', 'printer.office') == {'serial_number': 'XYZ789', 'title': 'printer'}\", \"assert get_device_info('172...
{ "split": "train", "index": 71659, "acecode_id": "bigcode_python_fns_8739", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `median_stack()` that simulates a stack data structure with the ability to push and pop numerical values (integers and floats) and retrieve the median value. The stack should maintain the median value efficiently as items are added or removed. The function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert median_stack.push(5) == None\", \"assert median_stack.push(3) == None\", \"assert median_stack.push(8) == None\", \"assert median_stack.push(2) == None\", \"assert median_stack.push(4) == None\", \"assert median_stack.push(6) == None\", \"assert median_stack...
{ "split": "train", "index": 71660, "acecode_id": "evol_13051", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates creating a subscription object. The function `create_subscription` should accept the following parameters: `user`, `plan`, `start_date`, and `end_date`. The function should return a dictionary representing the subscription ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_subscription('user1', 'planA', '2023-01-01', '2023-12-31') == {'user': 'user1', 'plan': 'planA', 'start_date': '2023-01-01', 'end_date': '2023-12-31'}\", \"assert create_subscription('user2', 'planB', '2023-02-15', '2024-02-14') == {'user': 'user2', '...
{ "split": "train", "index": 71661, "acecode_id": "oss_5114", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function `calculate_average(numbers)` that takes a list of numbers as input and returns the average of those numbers. The input list `numbers` may contain integers or floating-point numbers. If the input list is empty, the function should return 0. The average sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average([1, 2, 3, 4, 5]) == 3.0\", \"assert calculate_average([-1, -2, -3, -4, -5]) == -3.0\", \"assert calculate_average([1.5, 2.5, 3.5, 4.5, 5.5]) == 3.5\", \"assert calculate_average([]) == 0\", \"assert calculate_average([10, 20, 30]) == 20.0\"...
{ "split": "train", "index": 71662, "acecode_id": "oss_28826", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of blog post IDs and reorders them according to a specified new order. The function should return a new list that reflects this order. The input will be a list of integers representing the original order of blog post...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reorder_posts([1, 2, 3, 4], [3, 1, 4, 2]) == [3, 1, 4, 2]\", \"assert reorder_posts([10, 20, 30], [20, 10, 30]) == [20, 10, 30]\", \"assert reorder_posts([5, 15, 25], [25, 5, 15]) == [25, 5, 15]\", \"assert reorder_posts([7], [7]) == [7]\", \"assert reorder_...
{ "split": "train", "index": 71663, "acecode_id": "evol_12902", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function called `greet_user` that takes a single argument, `username`, which is a string. The function should return a personalized welcome message in the format 'Welcome, {username}!', where {username} is replaced with the value of the input para...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert greet_user('Alice') == 'Welcome, Alice!'\", \"assert greet_user('Bob') == 'Welcome, Bob!'\", \"assert greet_user('Charlie') == 'Welcome, Charlie!'\", \"assert greet_user('David') == 'Welcome, David!'\", \"assert greet_user('Eve') == 'Welcome, Eve!'\", \"asse...
{ "split": "train", "index": 71664, "acecode_id": "oss_10549", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of version strings, implement a function that returns the highest version string based on semantic versioning rules. Each version string is in the format 'X.Y.Z' where X, Y, and Z are non-negative integers. If the input list is empty, return an empty string. The fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert highest_version(['1.0.0', '1.2.0', '1.1.5']) == '1.2.0'\", \"assert highest_version(['2.0.1', '2.0.0', '2.0.1']) == '2.0.1'\", \"assert highest_version(['0.1.1', '0.1.0', '0.1.1']) == '0.1.1'\", \"assert highest_version(['3.1.4', '3.1.5', '3.1.3']) == '3.1.5...
{ "split": "train", "index": 71665, "acecode_id": "bigcode_python_fns_24817", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing a path in a directed graph, where each integer is a node and the edges between nodes are defined by a corresponding list of tuples, write a function `path_length` that computes the total length of the path. Each node has a specified length,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert path_length([1], {1: 5}) == 5\", \"assert path_length([], {1: 5}) == 0\", \"assert path_length([1, 2], {1: 5, 2: 3}) == 8\", \"assert path_length([2, 3, 4], {2: 7, 3: 2, 4: 6}) == 15\", \"assert path_length([1, 1, 2], {1: 5, 2: 3}) == 13\", \"assert path_len...
{ "split": "train", "index": 71666, "acecode_id": "bigcode_python_fns_22509", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a circular double-ended queue (deque) that supports the following operations: `insertFront(value)`: Adds an item at the front of the deque. Returns true if the operation is successful. `insertLast(value)`: Adds an item at the rear of the deque. Returns true if the operat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert my_deque.getMiddle() == -1\", \"assert my_deque.insertLast(10) == True\", \"assert my_deque.insertLast(20) == True\", \"assert my_deque.insertFront(5) == True\", \"assert my_deque.insertFront(3) == True\", \"assert my_deque.insertLast(30) == True\", \"assert...
{ "split": "train", "index": 71667, "acecode_id": "evol_35268", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a string that may contain trailing commas, write a function `remove_trailing_commas` that removes all trailing commas from the end of the string. The function should return the modified string. For example, if the input is ',hello,,,', the output should be ',hello'.\nPlea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_trailing_commas(',fred,,') == ',fred'\", \"assert remove_trailing_commas('hello,') == 'hello'\", \"assert remove_trailing_commas(',hello,,,') == ',hello'\", \"assert remove_trailing_commas('abc,,,') == 'abc'\", \"assert remove_trailing_commas('') == '...
{ "split": "train", "index": 71668, "acecode_id": "bigcode_python_fns_43652", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers and returns a new list of tuples, where each tuple contains a unique integer from the input list and its occurrence count. The returned list should maintain the original order of the unique integers as they appeared in the inpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_duplicates([5, 3, 5, 6, 3, 7]) == [(5, 2), (3, 2), (6, 1), (7, 1)]\", \"assert count_duplicates([1, 2, 1, 3, 2, 1]) == [(1, 3), (2, 2), (3, 1)]\", \"assert count_duplicates([10, 20, 10, 30, 40, 20]) == [(10, 2), (20, 2), (30, 1), (40, 1)]\", \"assert c...
{ "split": "train", "index": 71669, "acecode_id": "evol_11178", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function called `extract_words` that takes a string input `sentence` and returns a list of all isolated words in the sentence. A word is defined as a sequence of characters that does not contain any spaces. The function should ignore punctuation and consider only alpha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_words('I am learning to code.') == ['I', 'am', 'learning', 'to', 'code']\", \"assert extract_words('Hello, world! This is a test.') == ['Hello', 'world', 'This', 'is', 'a', 'test']\", \"assert extract_words('Python is fun.') == ['Python', 'is', 'fun'...
{ "split": "train", "index": 71670, "acecode_id": "evol_28626", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given two sets of unsorted floating-point numbers, implement a function that sorts each set individually in ascending order and then blends and sorts both sets in a specific pattern (i.e., one number from the first set, one number from the second set, and so on). If one set is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert blend_and_sort([1.1, 2.2], [3.3, 4.4, 5.5]) == [1.1, 3.3, 2.2, 4.4, 5.5]\", \"assert blend_and_sort([], [1.5, 2.5]) == [1.5, 2.5]\", \"assert blend_and_sort([1.5, 2.5], []) == [1.5, 2.5]\", \"assert blend_and_sort([3.3, 2.2, 1.1], [6.6, 5.5, 4.4]) == [1.1, 4...
{ "split": "train", "index": 71671, "acecode_id": "evol_1713", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `is_divisible_by_5_and_8(x)` that checks if the given input `x` is evenly divisible by both integers 5 and 8. The input can be a numerical value or a string representation of a number. If the input is a string, convert it to a number before performing the d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_divisible_by_5_and_8(40) == True\", \"assert is_divisible_by_5_and_8('40') == True\", \"assert is_divisible_by_5_and_8(0) == True\", \"assert is_divisible_by_5_and_8('0') == True\", \"assert is_divisible_by_5_and_8(25) == False\", \"assert is_divisible_by...
{ "split": "train", "index": 71672, "acecode_id": "evol_27736", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that determines if a file rename operation should proceed based on a dictionary input. Implement the function `get_pending_file_rename(patched_return: dict) -> bool` that takes a dictionary `patched_return` as input. The function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_pending_file_rename({'success': True, 'vdata': 'some value'}) == True\", \"assert get_pending_file_rename({'success': False, 'vdata': 'another value'}) == True\", \"assert get_pending_file_rename({'success': True}) == False\", \"assert get_pending_file_r...
{ "split": "train", "index": 71673, "acecode_id": "oss_9465", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of release times `releaseTimes` and a string `keysPressed`, where `releaseTimes[i]` represents the time the `i-th` key was released and `keysPressed[i]` represents the key that was pressed at that time. The first key is pressed at time 0. Your task is to im...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert slowestKey([9,29,49,50], 'cbcd') == 'c'\", \"assert slowestKey([12,23,36,46,62], 'spuda') == 'a'\", \"assert slowestKey([1,2,3,4,5], 'abcde') == 'e'\", \"assert slowestKey([2,5,10,15], 'abcd') == 'd'\", \"assert slowestKey([5,10,15,20,30], 'zzzz') == 'z'\", ...
{ "split": "train", "index": 71674, "acecode_id": "evol_13710", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary that represents a timeline of actions taken in a system. The dictionary contains a key 'timeline' which is a list of dictionaries, where each dictionary represents an action with keys including 'time' (an integer) and other fields that can vary (e.g.,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_timeline_actions({'timeline': [{'time': 100, 'user_id': 'A', 'action_type': 'login'}, {'time': 150, 'user_id': 'B', 'action_type': 'logout'}, {'time': 120, 'user_id': 'A', 'action_type': 'upload'}]}, {'time': (100, 150)}) == [{'time': 100, 'user_id': ...
{ "split": "train", "index": 71675, "acecode_id": "bigcode_python_fns_41868", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Develop a Python function that computes the Lowest Common Multiple (LCM) for a list of integers. The function should accept a list of integers, which can include both positive and negative values, and compute the LCM. Additionally, the function must validate the input to ensure...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_lcm([4, 5, 6]) == 60\", \"assert compute_lcm([-4, 5, 6]) == 60\", \"assert compute_lcm([0, 5, 6]) == 0\", \"assert compute_lcm([1, 2, 3, 4]) == 12\", \"assert compute_lcm([10, 20, 30]) == 60\", \"assert compute_lcm([-2, -3, -4]) == 12\", \"assert com...
{ "split": "train", "index": 71676, "acecode_id": "evol_36143", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves statistics based on provided keys and their types. The function should accept a key, a key type, a start time, an end time, and a list of variable names. If the key is not provided, the function should return a dictionary c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_statistic(None, 'page', '2023-01-01', '2023-01-31', ['views', 'clicks']) == {'page1': {'views': 100, 'clicks': 10}, 'page2': {'views': 200, 'clicks': 20}}\", \"assert get_statistic('page1', 'page', '2023-01-01', '2023-01-31', ['views', 'clicks']) == {'vi...
{ "split": "train", "index": 71677, "acecode_id": "bigcode_python_fns_34348", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a log file path and an optional number of training epochs. Create a function `parse_log_input(log_file: str, n_epochs: int = 5) -> Tuple[str, int]` that returns a tuple containing the log file path and the number of epochs. If the number of epochs is not provided,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_log_input('logs.csv') == ('logs.csv', 5)\", \"assert parse_log_input('data/logs.csv', 10) == ('data/logs.csv', 10)\", \"assert parse_log_input('test.log', 0) == ('test.log', 0)\", \"assert parse_log_input('output/logs.txt', 15) == ('output/logs.txt', 1...
{ "split": "train", "index": 71678, "acecode_id": "bigcode_python_fns_33394", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns a new list containing the squares of each number in the original list. The output list should maintain the same order as the input list. The function should be named `square_elements`. Your function should take a single pa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert square_elements([1, 2, 3]) == [1, 4, 9]\", \"assert square_elements([-1, 0, 1]) == [1, 0, 1]\", \"assert square_elements([0, -2, 2]) == [0, 4, 4]\", \"assert square_elements([]) == []\", \"assert square_elements([10, 20, -30]) == [100, 400, 900]\", \"assert ...
{ "split": "train", "index": 71679, "acecode_id": "bigcode_python_fns_33677", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of dates represented as strings in the format 'YYYY-MM-DD', write a function that takes this list as input and returns the most recent date in the list. If the list is empty, return an empty string. The dates are guaranteed to be valid. Implement the function `get_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_most_recent_date(['2023-10-01', '2023-09-15', '2023-10-05']) == '2023-10-05'\", \"assert get_most_recent_date(['2023-01-01', '2022-12-31', '2023-01-02']) == '2023-01-02'\", \"assert get_most_recent_date(['2022-05-17', '2022-05-18', '2022-05-19']) == '202...
{ "split": "train", "index": 71680, "acecode_id": "bigcode_python_fns_26443", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of test names and a statistics dictionary, implement a function `print_stat(test_list: List[str], stat_dict: Dict[str, Dict[str, Dict[int, Dict[str, float]]]]) -> List[Tuple[str, float, float, float]]` that returns a list of tuples. Each tuple should contain the te...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_stat(['test1', 'test2'], {'test1': {'MRE': {'average': 0.5}, 'SDR': {20: {'average': 0.2}}, 'SCR': 0.3}, 'test2': {'MRE': {'average': 0.6}, 'SDR': {20: {'average': 0.4}}, 'SCR': 0.5}}) == [('test1', 0.5, 0.2, 0.3), ('test2', 0.6, 0.4, 0.5)]\", \"assert...
{ "split": "train", "index": 71681, "acecode_id": "bigcode_python_fns_28308", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a threshold value for jitter, implement a function `check_jitter_and_format_label(jitH: int, jitW: int, jitter_threshold: int, theta: int) -> str` that checks whether the jitter values `jitH` and `jitW` exceed the specified `jitter_threshold`. If either `jitH` or `jitW` i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_jitter_and_format_label(3, 4, 5, 10) == 'Label_10'\", \"assert check_jitter_and_format_label(6, 7, 5, 20) == 'Label_20'\", \"assert check_jitter_and_format_label(5, 5, 5, 0) == 'Label_0'\", \"assert check_jitter_and_format_label(0, 10, 2, 5) == 'Label_...
{ "split": "train", "index": 71682, "acecode_id": "oss_3057", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a base class for tasks in a task management system. Implement a class called `BaseTask` that has a method `on_start` which should be called whenever the task starts executing. This method should accept any number of positional and keyword arguments....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert BaseTask().run() == 'Task is running'\", \"assert BaseTask().run(1, 2, 3) == 'Task is running'\", \"assert BaseTask().run(a=1, b=2) == 'Task is running'\", \"assert BaseTask().run(5, a=10, b=20) == 'Task is running'\", \"assert BaseTask().run('test', keyword...
{ "split": "train", "index": 71683, "acecode_id": "evol_17039", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a list of strings and returns the same list with its elements in reversed order. The input list may contain any strings including empty strings.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a si...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert invert_list(['apple', 'banana', 'cherry']) == ['cherry', 'banana', 'apple']\", \"assert invert_list(['pear', 'peach', 'plum']) == ['plum', 'peach', 'pear']\", \"assert invert_list(['one', 'two', 'three', 'four']) == ['four', 'three', 'two', 'one']\", \"asser...
{ "split": "train", "index": 71684, "acecode_id": "evol_7345", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of floating-point numbers, `y_true` and `y_pred`, representing the true values and predicted values respectively. You are also given a floating-point number `epsilon` and a threshold value `threshold`. Your task is to implement a function that calculates...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ratio_error_acc([1.0, 2.0], [2.0, 1.0], 0.1, 2.0) == 1.0\", \"assert ratio_error_acc([0.0, 0.0], [0.0, 0.0], 0.1, 0.5) == 0.0\", \"assert ratio_error_acc([5.0, 10.0, 15.0], [5.0, 10.0, 15.0], 0.1, 2.0) == 1.0\", \"assert ratio_error_acc([3.0, 6.0], [1.0, 2.0...
{ "split": "train", "index": 71685, "acecode_id": "bigcode_python_fns_12921", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a JSON formatted data string representing staff members in various departments. This JSON object follows the format: '{ \"staff\": [{\"name\": \"<name>\", \"age\": <age>, \"position\": \"<position>\", \"department\": \"<department>\"}, ...] }'. Your task is to imp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_age('{ \\\"staff\\\": [{\\\"name\\\": \\\"John\\\", \\\"age\\\": 20, \\\"position\\\": \\\"Junior Developer\\\", \\\"department\\\": \\\"IT\\\"}, {\\\"name\\\": \\\"Mark\\\", \\\"age\\\": 35, \\\"position\\\": \\\"Senior Developer\\\", \\\"department...
{ "split": "train", "index": 71686, "acecode_id": "evol_1849", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a string representing a Docker image in the format 'repository:tag'. Your task is to extract and return the tag part of the image. If the image does not contain a tag (i.e., it is in the format 'repository'), return 'latest' as the default tag. Write a function th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_tag('ubuntu:20.04') == '20.04'\", \"assert extract_tag('nginx:latest') == 'latest'\", \"assert extract_tag('myapp') == 'latest'\", \"assert extract_tag('alpine:3.12.0') == '3.12.0'\", \"assert extract_tag('python:3.9') == '3.9'\", \"assert extract_ta...
{ "split": "train", "index": 71687, "acecode_id": "bigcode_python_fns_12981", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing the A* algorithm to find the shortest path in a weighted graph. The graph is represented as an adjacency list where each edge has a non-negative cost. You are given two nodes: the start node and the goal node. Your task is to implement the funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert aStar({1: [(2, 1), (3, 4)], 2: [(3, 2)], 3: []}, 1, 3) == [1, 2, 3]\", \"assert aStar({1: [(2, 2), (3, 1)], 2: [(4, 3)], 3: [(4, 2)], 4: []}, 1, 4) == [1, 3, 4]\", \"assert aStar({1: [(2, 1)], 2: [(3, 1)], 3: [(4, 1)], 4: []}, 1, 4) == [1, 2, 3, 4]\", \"asse...
{ "split": "train", "index": 71688, "acecode_id": "oss_14768", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function called `retorno` that takes a list of functions as input and returns a new function. This returned function, when called, will execute each function in the input list in reverse order. The output of the last executed function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retorno([lambda x: x + 1])(5) == 6\", \"assert retorno([lambda x: x - 4, lambda x: x + 10])(5) == 11\", \"assert retorno([lambda x: x // 2, lambda x: x * 5])(10) == 25\", \"assert retorno([lambda x: x + 5, lambda x: x / 2])(10) == 10.0\", \"assert retorno([l...
{ "split": "train", "index": 71689, "acecode_id": "oss_21491", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function `are_anagrams(str1: str, str2: str) -> bool` that determines whether two given strings are anagrams of each other. Two strings are considered anagrams if they contain the same characters in the same frequency, regardless of the order. The function should re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_anagrams('listen', 'silent') == True\", \"assert are_anagrams('triangle', 'integral') == True\", \"assert are_anagrams('apple', 'papel') == True\", \"assert are_anagrams('rat', 'car') == False\", \"assert are_anagrams('hello', 'billion') == False\", \"as...
{ "split": "train", "index": 71690, "acecode_id": "evol_6362", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `generate_level(level_number: int) -> Tuple[List[Tuple[int, int]], List[Tuple[int, int]]]` that generates a unique set of obstacles and enemies for a Mario game level. The function should return two lists: one for obstacles and one for enemies. Each obstacl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_level(2)[0]) == 10\", \"assert len(generate_level(2)[1]) == 4\", \"assert all(0 <= x <= 100 for x, _ in generate_level(3)[0])\", \"assert all(0 <= x <= 100 for x, _ in generate_level(3)[1])\", \"assert generate_level(0) == ([], [])\", \"assert l...
{ "split": "train", "index": 71691, "acecode_id": "evol_17242", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that converts a given integer into its English word representation. The function should handle numbers from 0 to 999,999,999 (inclusive) and return the corresponding string representation. For example, the number 123 should return 'one hundred twenty three'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert num_to_word(0) == 'zero'\", \"assert num_to_word(1) == 'one'\", \"assert num_to_word(10) == 'ten'\", \"assert num_to_word(11) == 'eleven'\", \"assert num_to_word(15) == 'fifteen'\", \"assert num_to_word(20) == 'twenty'\", \"assert num_to_word(21) == 'twenty ...
{ "split": "train", "index": 71692, "acecode_id": "evol_28045", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates an HTTP request. The function should take an endpoint (string), an HTTP method (string, default is 'get'), an optional data payload (dictionary, default is None), and a timeout (integer, default is 15 seconds). The func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_request('http://example.com', 'get') == {'status_code': 200, 'data': {'message': 'Success'}}\", \"assert simulate_request('http://example.com', 'post', {'key': 'value'}) == {'status_code': 201, 'data': {'message': 'Created'}}\", \"assert simulate_re...
{ "split": "train", "index": 71693, "acecode_id": "bigcode_python_fns_8692", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Construct a function that receives two positive integers, n and m, and outputs a list of Prime numbers within this range, inclusive of both n and m. The function should be optimized to check divisibility only up to the square root of each number to determine if it is prime. For...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert primes_in_range(10, 20) == [11, 13, 17, 19]\", \"assert primes_in_range(2, 2) == [2]\", \"assert primes_in_range(15, 15) == []\", \"assert primes_in_range(25, 30) == [29]\", \"assert primes_in_range(1, 10) == [2, 3, 5, 7]\", \"assert primes_in_range(30, 40) ...
{ "split": "train", "index": 71694, "acecode_id": "evol_33004", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that counts how many files in a given list contain a specific filter string and have a specific file extension. The function should take the following parameters: a list of file names (strings), a filter string (string), and a file extens...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_matching_files(['Report.txt', 'summary_report.TXT', 'data.csv', 'report.docx'], 'report', '.txt') == 2\", \"assert count_matching_files(['testfile.txt', 'example.txt', 'sample.txt'], 'test', '.txt') == 1\", \"assert count_matching_files(['image.jpg', '...
{ "split": "train", "index": 71695, "acecode_id": "bigcode_python_fns_40407", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that retrieves the corresponding name of an Experimental Factor Ontology (EFO) term given its ID and vice versa. Your function should accept two parameters: an EFO ID and an EFO term name. If the provided EFO ID is valid, the f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_efo_info('0004515') == 'muscle measurement'\", \"assert get_efo_info('0004516') == 'body weight'\", \"assert get_efo_info('0004517') == 'blood pressure'\", \"assert get_efo_info('0004518') == None\", \"assert get_efo_info('muscle measurement') == '000451...
{ "split": "train", "index": 71696, "acecode_id": "oss_17846", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a list containing both strings and integers. The function should identify the strings in the list, convert those strings to uppercase without using any built-in Python method or function for uppercase conversion, and replace the original strings in t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_list(['hello', 123, 'world', 456]) == ['HELLO', 123, 'WORLD', 456]\", \"assert convert_list(['python', 'is', 'fun', 42]) == ['PYTHON', 'IS', 'FUN', 42]\", \"assert convert_list([1, 2, 3, 'test']) == [1, 2, 3, 'TEST']\", \"assert convert_list(['a', 'b...
{ "split": "train", "index": 71697, "acecode_id": "evol_9229", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function `get_customer_info(name: str, age: int, email: str) -> str` that takes in a customer's name, age, and email address. The function should return a string formatted as 'Name: {name}, Age: {age}, Email: {email}'.\nPlease reason step by step, then write a self-con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_customer_info('Alice Smith', 28, 'alice.smith@example.com') == 'Name: Alice Smith, Age: 28, Email: alice.smith@example.com'\", \"assert get_customer_info('Bob Johnson', 35, 'bob.johnson@example.com') == 'Name: Bob Johnson, Age: 35, Email: bob.johnson@exa...
{ "split": "train", "index": 71698, "acecode_id": "evol_31757", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function that needs to handle various potential errors when executing a specified operation. Your task is to implement a function called `execute_safe_operation` that takes three parameters: a function `operation`, and two arguments `arg1` and `arg2`. The functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_safe_operation(pow, 2, 3) == 8\", \"assert execute_safe_operation(pow, 2, 'a') == None\", \"assert execute_safe_operation(int, '1', 0) == 1\", \"assert execute_safe_operation(int, 'a', 0) == None\", \"assert execute_safe_operation(list, 123, 0) == No...
{ "split": "train", "index": 71699, "acecode_id": "bigcode_python_fns_17829", "num_tests": 10 }