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": "Create a function `create_game_areas()` that initializes and returns a list of dictionaries representing different areas in a game-like environment. Each area should contain a description, a list of available exits, and a list of possible actions. The starting area should be th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_game_areas() == [{'description': 'You are in the starting area.', 'exits': ['Level 1'], 'actions': ['look around', 'move forward']}, {'description': 'You are in Level 1 now.', 'exits': ['Level 2', 'starting area'], 'actions': ['look around', 'move for... | {
"split": "train",
"index": 72400,
"acecode_id": "evol_29153",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `create_variable` that simulates the creation of a variable in a machine learning framework. The function takes in the following parameters: `shape` (a tuple of integers representing the dimensions of the variable), `dtype` (a string repr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_variable((3, 4), 'float32') == {'name': 'Variable', 'shape': (3, 4), 'dtype': 'float32'}\", \"assert create_variable((2, 2), 'int64', 'MyVariable') == {'name': 'MyVariable', 'shape': (2, 2), 'dtype': 'int64'}\", \"assert create_variable((5,), 'float64... | {
"split": "train",
"index": 72401,
"acecode_id": "bigcode_python_fns_30701",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the unique integers from the original list, in the order they first appeared. Write a function `get_unique_numbers(nums: List[int]) -> List[int]` that accomplishes t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_numbers([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert get_unique_numbers([5, 5, 5, 5]) == [5]\", \"assert get_unique_numbers([10, 20, 10, 30, 20]) == [10, 20, 30]\", \"assert get_unique_numbers([]) == []\", \"assert get_unique_numbers([1, 2, 3, 4, ... | {
"split": "train",
"index": 72402,
"acecode_id": "oss_27561",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a response object, which can either be a dictionary or a custom object. The response contains a status indicator and a command. Your function should extract the status and command from the response and return a dictionary with ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_response({'ok': True, 'command': 'run'}, 'output') == {'status': 'successful', 'command': 'run', 'output': 'output'}\", \"assert generate_response({'ok': False}, 'output') == {'status': 'failed', 'command': None, 'output': 'output'}\", \"assert gene... | {
"split": "train",
"index": 72403,
"acecode_id": "bigcode_python_fns_14958",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of mixed elements, which may include integers, floats, and other types. Write a function `collect_scalars(values: List[Union[int, float, Any]]) -> float` that collects all scalar values (integers and floats) from the list and returns the product of these sc... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert collect_scalars([2, 3.5, 'text', True]) == 7.0\", \"assert collect_scalars(['apple', 4.0, 5, None]) == 20.0\", \"assert collect_scalars([1, 2, 3]) == 6.0\", \"assert collect_scalars(['hello', 'world']) == 1.0\", \"assert collect_scalars([]) == 1.0\", \"asser... | {
"split": "train",
"index": 72404,
"acecode_id": "bigcode_python_fns_10779",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary representing a graph where each key is a node name and the value is another dictionary containing the state of that node. The possible states are 'none', 'running', 'fail', and 'done'. Your task is to merge the states of the nodes according to the fol... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_graph_states({'A': {'state': 'none'}, 'B': {'state': 'none'}}) == {'A': {'state': 'none'}, 'B': {'state': 'none'}}\", \"assert merge_graph_states({'A': {'state': 'running'}, 'B': {'state': 'none'}}) == {'A': {'state': 'running'}, 'B': {'state': 'none'}... | {
"split": "train",
"index": 72405,
"acecode_id": "bigcode_python_fns_46358",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function `active_challenges()` that returns a list of current active challenges. Each challenge is represented as a dictionary with the following keys: 'id', 'title', and 'status'. Your function should return a list of dictionaries, each representing an ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert active_challenges([{ 'id': '1', 'title': 'Challenge 1', 'status': 'active' }, { 'id': '2', 'title': 'Challenge 2', 'status': 'inactive' }, { 'id': '3', 'title': 'Challenge 3', 'status': 'active' }]) == [{'id': '1', 'title': 'Challenge 1', 'status': 'active'}... | {
"split": "train",
"index": 72406,
"acecode_id": "bigcode_python_fns_37153",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that validates user registrations for a flash sale event. Each registration consists of a product link and a registration time. Implement the function `validate_registration(product_link: str, registration_time: str) -> Tuple[bool, str]` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_registration('http://example.com/product', '2023-10-01 12:00:00') == (True, 'Registration successful')\", \"assert validate_registration('https://example.com/product', '2023-10-01 12:00:00') == (True, 'Registration successful')\", \"assert validate_... | {
"split": "train",
"index": 72407,
"acecode_id": "oss_51",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `manage_priority_queue(operations: List[Tuple[str, Union[str, Tuple[str, int]]]]) -> List[Union[str, None]]` that processes a list of operations for a priority queue. The operations include: 'insert' which takes a task name (string) and a priority (integer)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_priority_queue([('insert', ('task1', 2)), ('insert', ('task2', 5)), ('remove',)]) == ['task2']\", \"assert manage_priority_queue([('insert', ('task1', 1)), ('insert', ('task2', 1)), ('remove',), ('remove',)]) == ['task1', 'task2']\", \"assert manage_p... | {
"split": "train",
"index": 72408,
"acecode_id": "evol_23079",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that represents the name of a camera. Your task is to implement a function that returns the name of the camera in uppercase letters. If the input string is empty, the function should return an empty string. Write a function `get_camera_name_uppercase(came... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_camera_name_uppercase('Canon EOS 5D') == 'CANON EOS 5D'\", \"assert get_camera_name_uppercase('Nikon D850') == 'NIKON D850'\", \"assert get_camera_name_uppercase('Sony Alpha 7') == 'SONY ALPHA 7'\", \"assert get_camera_name_uppercase('') == ''\", \"asser... | {
"split": "train",
"index": 72409,
"acecode_id": "bigcode_python_fns_24607",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of intervals representing segments on a number line. Your task is to implement a function that returns a list of segments where the number of overlapping intervals is at least 'k'. The function should take an integer 'k' and a list of intervals as input. Ea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert overlapping_segments(2, [[1, 5], [2, 3], [4, 6]]) == [[2, 3], [4, 5]]\", \"assert overlapping_segments(3, [[1, 2], [2, 3], [3, 4], [4, 5]]) == []\", \"assert overlapping_segments(1, [[-1, 0], [0, 1], [1, 2], [2, 3]]) == [[-1, 3]]\", \"assert overlapping_segm... | {
"split": "train",
"index": 72410,
"acecode_id": "bigcode_python_fns_48037",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a string and returns a new string with all occurrences of a specified substring replaced with another substring. The function should handle the case where the substring to be replaced is not found in the input string, in whi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replace_substring('hello world', 'world', 'there') == 'hello there'\", \"assert replace_substring('hello world', 'hello', 'hi') == 'hi world'\", \"assert replace_substring('abcdef', 'gh', 'ij') == 'abcdef'\", \"assert replace_substring('ababab', 'ab', 'cd') ... | {
"split": "train",
"index": 72411,
"acecode_id": "bigcode_python_fns_9179",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves a value from a centralized data store based on a given name and field. The function should take in three parameters: `consistency` (a string that can be either 'strict' or 'relaxed'), `name` (a string representing the uniqu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_data('strict', 'user1', 'age') == {'value': '25', 'error': 'ok'}\", \"assert get_data('strict', 'user2', 'location') == {'value': '', 'error': 'ok'}\", \"assert get_data('strict', 'user4', 'height') == {'value': '', 'error': 'ok'}\", \"assert get_data('s... | {
"split": "train",
"index": 72412,
"acecode_id": "bigcode_python_fns_14149",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with tracking the shopping moments of agents visiting different shops. You need to implement a function `record_shopping_moments()` that initializes a list called `agent_shopping_moment` with a specified number of empty lists, and then appends specified shopping ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert record_shopping_moments(3, [1, 2]) == [[1, 2], [], []]\", \"assert record_shopping_moments(2, [5]) == [[5], []]\", \"assert record_shopping_moments(4, []) == [[], [], [], []]\", \"assert record_shopping_moments(1, [10, 20, 30]) == [[10, 20, 30]]\", \"assert ... | {
"split": "train",
"index": 72413,
"acecode_id": "oss_7654",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python decorator that logs the execution time of a function. The decorator should take into account the function's arguments and return value. Implement the `@log_execution_time` decorator and apply it to the `add` function provided below. The `ad... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_execution_time(add)(3, 5) == 8\", \"assert log_execution_time(add)(0, 0) == 0\", \"assert log_execution_time(add)(-1, 1) == 0\", \"assert log_execution_time(add)(-5, -3) == -8\", \"assert log_execution_time(add)(100, 200) == 300\", \"assert log_execution... | {
"split": "train",
"index": 72414,
"acecode_id": "oss_31977",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing parameters for a testing framework in a specific format. Your task is to implement a function that counts the number of times a specific parameter appears in the string. The function should take two arguments: 'params', a string containing th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_parameters('param1 param2 param1 param3', 'param1') == 2\", \"assert count_parameters('test1 test2 test3', 'test4') == 0\", \"assert count_parameters('a b c a b a', 'a') == 3\", \"assert count_parameters('hello world hello', 'hello') == 2\", \"assert c... | {
"split": "train",
"index": 72415,
"acecode_id": "bigcode_python_fns_22744",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the unique elements from the input list in the order they first appeared. The input list may contain duplicates. Implement the function `get_unique_elements(arr: Lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_elements([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert get_unique_elements([1, 1, 1, 1]) == [1]\", \"assert get_unique_elements([]) == []\", \"assert get_unique_elements([4, 5, 4, 6, 5]) == [4, 5, 6]\", \"assert get_unique_elements([10, 20, 10, 30,... | {
"split": "train",
"index": 72416,
"acecode_id": "oss_14237",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that checks if a given string contains at least one numeric character. The function should return True if there is any digit (0-9) in the string, and False otherwise.\nPlease reason step by step, then write a self-contained Python solution. Give your final prog... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert contains_number('Hello World!') == False\", \"assert contains_number('Hello World2!') == True\", \"assert contains_number('123abc') == True\", \"assert contains_number('abc') == False\", \"assert contains_number('!@#$%^&*()') == False\", \"assert contains_nu... | {
"split": "train",
"index": 72417,
"acecode_id": "evol_529",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a status code as input and returns the corresponding status description based on the given code. The status codes and their descriptions are defined as follows: 'em_analise' corresponds to 'em análise', 'preparando' corr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_status_description('em_analise') == 'em an\\u00e1lise'\", \"assert get_status_description('preparando') == 'preparando envio'\", \"assert get_status_description('despachado') == 'despachado'\", \"assert get_status_description('entregue') == 'entregue'\",... | {
"split": "train",
"index": 72418,
"acecode_id": "oss_21982",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two DNA primer sequences represented as strings, return a tuple containing the following information: 1) the total number of complementary bases, 2) the longest run of complementary bases, 3) the median length of all runs of complementary bases, and 4) a list of integers ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dimerization('ATCG', 'TAGC') == (4, 4, 4.0, [1, 1, 2, 2])\", \"assert dimerization('AATT', 'TTAA') == (4, 4, 4.0, [1, 1, 1, 1])\", \"assert dimerization('AAAA', 'TTTT') == (4, 4, 4.0, [1, 1, 1, 1])\", \"assert dimerization('GGCC', 'CCGG') == (4, 4, 4.0, [2, ... | {
"split": "train",
"index": 72419,
"acecode_id": "bigcode_python_fns_42298",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Create a function in Python that takes in two parameters: a string of numerical values and a list of predefined mathematical operations. The function should perform these operations on the numerical values in the order given and return a list of the resulting values. The operat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert math_operation('1,2,3', ['add 2']) == [3, 4, 5]\", \"assert math_operation('10,20,30', ['subtract 5']) == [5, 15, 25]\", \"assert math_operation('2,4,6', ['multiply by 2']) == [4, 8, 12]\", \"assert math_operation('8,16,24', ['divide by 4']) == [2.0, 4.0, 6.... | {
"split": "train",
"index": 72420,
"acecode_id": "evol_32461",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of integers and determines the maximum difference between the largest and smallest elements in the list. If the list contains less than two elements, the function should return 0. Create a Python function `max... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_difference_in_list([4, 8, 1, 9, 5, 6]) == 8\", \"assert max_difference_in_list([1, 2, 3, 4, 5]) == 4\", \"assert max_difference_in_list([10, 20, 30]) == 20\", \"assert max_difference_in_list([100, 200, 300, 400]) == 300\", \"assert max_difference_in_list... | {
"split": "train",
"index": 72421,
"acecode_id": "oss_21266",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Construct a Python function that takes a sentence as input and returns a dictionary containing each unique word and its corresponding frequency as a fraction of the total number of words in that sentence. The function should be case insensitive, meaning 'this' and 'This' should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert recurrent_rate('Test Test test') == {'test': 1.0}\", \"assert recurrent_rate('') == {}\", \"assert recurrent_rate('SingleWord') == {'singleword': 1.0}\", \"assert recurrent_rate('Word word WORD word') == {'word': 1.0}\", \"assert recurrent_rate('Test test te... | {
"split": "train",
"index": 72422,
"acecode_id": "evol_1587",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a list of node names in a cluster and a command to delete specific nodes from that list. Implement a function `delete_nodes` that takes the following parameters: `node_names` (a list of strings representing the names of the nodes), `delete_list` (a list of strings... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert delete_nodes(['node1', 'node2', 'node3'], ['node2'], True) == ['node1', 'node3']\", \"assert delete_nodes(['node1', 'node2', 'node3'], ['node2'], False) == ['node1', 'node3']\", \"assert delete_nodes(['node1', 'node2', 'node3', 'node2'], ['node2'], True) == ... | {
"split": "train",
"index": 72423,
"acecode_id": "bigcode_python_fns_18834",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating user details for a registration system. Write a function `validate_user_details(email: str, mobile: str) -> bool` that checks if the provided email and mobile number meet the specified constraints. The email must be a string of maximum length 200 ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_user_details('test@example.com', '1234567890') == True\", \"assert validate_user_details('user@domain.com', '9876543210') == True\", \"assert validate_user_details('user@domain.com', '1234a67890') == False\", \"assert validate_user_details('user.com... | {
"split": "train",
"index": 72424,
"acecode_id": "oss_25063",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of pairs representing ice hockey player line combinations and a dictionary containing player IDs as keys and their respective time on ice (TOI) as values. Your task is to implement the function `analyze_top_line(line_combos, toi_data)` that takes in two par... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_top_line([(1, 2)], {1: 30, 2: 25, 3: 5}) == [1, 2]\", \"assert analyze_top_line([(1, 2), (1, 3)], {1: 10, 2: 5, 3: 25}) == [1, 3]\", \"assert analyze_top_line([(1, 2), (3, 4)], {1: 0, 2: 0, 3: 20, 4: 0}) == [3, 4]\", \"assert analyze_top_line([(5, 6)... | {
"split": "train",
"index": 72425,
"acecode_id": "oss_13510",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of various bars in a bar chart. Your task is to implement a function that calculates the maximum area of a rectangle that can be formed under the bar chart. The rectangle must be formed using the bars, and its height is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_rectangle_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_rectangle_area([1, 1, 1, 1]) == 4\", \"assert max_rectangle_area([4, 2, 0, 3, 2, 5]) == 6\", \"assert max_rectangle_area([1, 2, 3, 4, 5]) == 9\", \"assert max_rectangle_area([5, 4, 3, 2, 1]) == 9\"... | {
"split": "train",
"index": 72426,
"acecode_id": "bigcode_python_fns_20884",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a given text and replaces all occurrences of the '&' character with a newline character ('\\n'). The function should take a single string as input and return the modified text with the replacements. Write a function `re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert replaceAndWithNewline('Hello&world&how&are&you') == 'Hello\\\\nworld\\\\nhow\\\\nare\\\\nyou'\", \"assert replaceAndWithNewline('A&B&C&D') == 'A\\\\nB\\\\nC\\\\nD'\", \"assert replaceAndWithNewline('No special characters here.') == 'No special characters her... | {
"split": "train",
"index": 72427,
"acecode_id": "oss_30108",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that detects the most common character used as a separator in a given string. The separators to consider are: comma (','), semicolon (';'), colon (':'), pipe ('|'), and tab ('\\t'). Additionally, if no separators are found but the str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detect_separator('name,age,city') == ','\", \"assert detect_separator('name;age;city') == ';'\", \"assert detect_separator('name:age:city') == ':'\", \"assert detect_separator('name|age|city') == '|'\", \"assert detect_separator('name\\\\tage\\\\city') == '\... | {
"split": "train",
"index": 72428,
"acecode_id": "bigcode_python_fns_39150",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that has been encrypted using a simple padding scheme. Your task is to implement a function that decrypts the string by removing the padding that was added to the end of the string. The padding is represented by the ASCII value of the last character in th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decrypt_string('Hello World!\\\\x04\\\\x04\\\\x04\\\\x04') == 'Hello World!'\", \"assert decrypt_string('Test string padding\\\\x02\\\\x02') == 'Test string padding'\", \"assert decrypt_string('Sample text\\\\x05\\\\x05\\\\x05\\\\x05\\\\x05') == 'Sample text... | {
"split": "train",
"index": 72429,
"acecode_id": "bigcode_python_fns_18259",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of 3D points in space represented as tuples (x, y, z), write a function `calculate_distances(points: List[Tuple[float, float, float]]) -> List[float]` that calculates the Euclidean distance of each point from the origin (0, 0, 0). The function should return a list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_distances([(1, 2, 2)]) == [3.0]\", \"assert calculate_distances([(0, 0, 0)]) == [0.0]\", \"assert calculate_distances([(3, 4, 0)]) == [5.0]\", \"assert calculate_distances([(1, 1, 1)]) == [1.7320508075688772]\", \"assert calculate_distances([(1, 1,... | {
"split": "train",
"index": 72430,
"acecode_id": "bigcode_python_fns_26469",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of URLs and a boolean value indicating whether to enable JavaScript, implement a function that returns a new list of URLs that are prefixed with 'https://' if JavaScript is enabled, or prefixed with 'http://' if JavaScript is disabled. The function should take two ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_urls(['www.example.com', 'http://test.com'], True) == ['https://www.example.com', 'https://http://test.com']\", \"assert update_urls(['www.example.com', 'http://test.com'], False) == ['http://www.example.com', 'http://http://test.com']\", \"assert upd... | {
"split": "train",
"index": 72431,
"acecode_id": "bigcode_python_fns_16165",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are given a string that contains values separated by a specified character (separator). Your task is to implement a function that takes three parameters: a string (line), a separator (character), and two integers (row and column). The function should split the input string ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_identifiers('a,b,c,d,e', ',', 0, 1) == ('a', 'b')\", \"assert get_identifiers('apple|banana|cherry', '|', 1, 2) == ('banana', 'cherry')\", \"assert get_identifiers('one:two:three', ':', 0, 2) == ('one', 'three')\", \"assert get_identifiers('1;2;3;4;5', '... | {
"split": "train",
"index": 72432,
"acecode_id": "oss_34020",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with validating the format of a given URL. The URL can be in one of the following formats: `s3://example.com` or `//example.com`. Your task is to implement a function `validate_url(url: str) -> bool` that checks whether the provided URL matches the expected forma... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_url('s3://example.com') == True\", \"assert validate_url('s3://sub.example.com') == True\", \"assert validate_url('s3://example.org') == True\", \"assert validate_url('s3://example.com/path/to/resource') == False\", \"assert validate_url('http://exa... | {
"split": "train",
"index": 72433,
"acecode_id": "oss_2431",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "You are given a directed graph represented as a dictionary where keys are node identifiers and values are lists of child node identifiers. Write a function `print_tf_graph(graph: Dict[int, List[int]]) -> List[str]` that returns the representation of the graph as a list of strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert print_tf_graph({1: [2, 3], 2: [4], 3: [], 4: []}) == ['1 -> 2, 3', '2 -> 4', '3 -> ', '4 -> ']\", \"assert print_tf_graph({1: [], 2: [], 3: []}) == ['1 -> ', '2 -> ', '3 -> ']\", \"assert print_tf_graph({1: [2], 2: [3], 3: [4], 4: []}) == ['1 -> 2', '2 -> 3'... | {
"split": "train",
"index": 72434,
"acecode_id": "bigcode_python_fns_29109",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings where each string represents a sentence. Your task is to implement a function that takes this list of sentences and returns a list of tuples. Each tuple should contain two elements: the original sentence and its length (the number of characters i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_sentence_lengths(['']) == [('', 0)]\", \"assert calculate_sentence_lengths(['Single']) == [('Single', 6)]\", \"assert calculate_sentence_lengths(['Multiple', 'Sentences', 'Here']) == [('Multiple', 8), ('Sentences', 9), ('Here', 4)]\", \"assert calc... | {
"split": "train",
"index": 72435,
"acecode_id": "bigcode_python_fns_48209",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `remove_duplicates(data: List[int]) -> List[int]` that takes a list of integers and returns a new list containing only the unique integers from the original list, preserving the order of their first appearance. For example, given the input [1, 2, 3, 2, 4, 5... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 3, 2, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert remove_duplicates([1, 1, 1, 1]) == [1]\", \"assert remove_duplicates([]) == []\", \"assert remove_duplicates([5, 5, 5, 5, 5, 5]) == [5]\", \"assert remove_duplicates([10, 20, 10, 30, 20]) =... | {
"split": "train",
"index": 72436,
"acecode_id": "evol_4952",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing employee leave requests based on a company's leave policy. Your program should implement a function called `add_leave_request` that allows users to submit a leave request by providing the employee's name, start date, end date, and leave type (e.g., ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_leave_request('Alice', '2023-10-01', '2023-10-05', 'vacation', {'vacation': 5, 'sick leave': 10}) == 'Leave request added successfully.'\", \"assert add_leave_request('Bob', '2023-10-05', '2023-10-03', 'vacation', {'vacation': 5, 'sick leave': 10}) == 'E... | {
"split": "train",
"index": 72437,
"acecode_id": "oss_5201",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `factorial` that calculates the factorial of a given non-negative integer `n`. The function should take two parameters: `n`, which is the non-negative integer for which the factorial is to be calculated, and `use_iterative`, a boolean that determines... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0, True) == 1\", \"assert factorial(1, True) == 1\", \"assert factorial(2, True) == 2\", \"assert factorial(3, True) == 6\", \"assert factorial(4, True) == 24\", \"assert factorial(5, True) == 120\", \"assert factorial(6, True) == 720\", \"assert f... | {
"split": "train",
"index": 72438,
"acecode_id": "evol_21990",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `sort_even` that takes this list as input and returns a new list where all elements at odd indices remain in their original positions, while the elements at even indices are sorted. If any even-indexed elements are negative, they s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_even([1, 2, 3]) == [1, 2, 3]\", \"assert sort_even([5, 6, 3, 4]) == [3, 6, 5, 4]\", \"assert sort_even([-5, 6, -3, 4]) == [-3, 6, -5, 4]\", \"assert sort_even([2, 3, 1, 4, 5, 6]) == [1, 3, 2, 4, 5, 6]\", \"assert sort_even([-1, 2, -2, 3, -3, 4]) == [-1,... | {
"split": "train",
"index": 72439,
"acecode_id": "evol_1741",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a non-empty list of integers called `nums`, where every integer appears twice, except for one unique integer. Your task is to find this unique integer and its index in the list. If there is no unique integer, raise a ValueError with the message 'Error - No unique ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert findLoneInteger([2,2,1]) == (1, 2)\", \"assert findLoneInteger([1]) == (1, 0)\", \"assert findLoneInteger([-1,-1,0]) == (0, 2)\", \"assert findLoneInteger([3, 3, 4]) == (4, 2)\", \"assert findLoneInteger([10, 10, 20, 20, 30]) == (30, 4)\", \"assert findLoneI... | {
"split": "train",
"index": 72440,
"acecode_id": "evol_34156",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the health management of a character in a game. The function, named `manage_health`, takes two parameters: `initial_health` (a non-negative integer representing the starting health of the character) and `damage` (a non-nega... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_health(100, 20) == 80\", \"assert manage_health(50, 50) == 0\", \"assert manage_health(200, 0) == 200\", \"assert manage_health(0, 10) == 0\", \"assert manage_health(30, 30) == 0\", \"assert manage_health(100, 100) == 0\", \"assert manage_health(150, ... | {
"split": "train",
"index": 72441,
"acecode_id": "oss_1629",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `is_valid_isbn10(num: str) -> bool` that checks if the given string `num` is a valid ISBN-10 number. The string must meet the following criteria: it should be exactly 10 characters long, consist of digits, and may optionally end with an 'X' (representing 10... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_isbn10('0306406152') == True\", \"assert is_valid_isbn10('123456789X') == True\", \"assert is_valid_isbn10('1234567890') == False\", \"assert is_valid_isbn10('X123456789') == False\", \"assert is_valid_isbn10('030640615X') == False\", \"assert is_va... | {
"split": "train",
"index": 72442,
"acecode_id": "evol_15494",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a diamond-shaped matrix of integers, convert the matrix into a single numeric value by flattening the matrix and concatenating its elements in row-major order. Write a function that takes this diamond-shaped matrix as input and returns the resulting integer.\nPlease reaso... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert DSM_to_number([[5],[3,2],[1,4,6],[7,8,9,0],[1,2,3],[4,5],[6]]) == 5321467890123456\", \"assert DSM_to_number([[1],[2,3],[4,5,6],[7,8,9,0],[1,2,3],[4,5],[6]]) == 1234567890123456\", \"assert DSM_to_number([[9],[8,7],[6,5,4],[3,2,1,0],[1,2,3],[4,5],[6]]) == 98... | {
"split": "train",
"index": 72443,
"acecode_id": "evol_30047",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a string containing various types of brackets including parentheses '()', curly braces '{}', and square brackets '[]', write a function `is_balanced_expression(expression: str) -> bool` that determines if the brackets in the string are balanced. An expression is considere... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_balanced_expression('([]{})') == True\", \"assert is_balanced_expression('{[()]}') == True\", \"assert is_balanced_expression('((()))') == True\", \"assert is_balanced_expression('([{}])') == True\", \"assert is_balanced_expression('{[(])}') == False\", \... | {
"split": "train",
"index": 72444,
"acecode_id": "bigcode_python_fns_25534",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing messages, where some adjacent messages may be equal. Your task is to merge adjacent messages that are equal and return a new list containing the merged messages. Merging two equal messages is defined as summing their values. For exa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_adjacent_messages([1, 1, 2, 2, 3]) == [2, 4, 3]\", \"assert merge_adjacent_messages([5, 5, 5, 5]) == [20]\", \"assert merge_adjacent_messages([1, 2, 3]) == [1, 2, 3]\", \"assert merge_adjacent_messages([0, 0, 0, 0]) == [0]\", \"assert merge_adjacent_me... | {
"split": "train",
"index": 72445,
"acecode_id": "bigcode_python_fns_31744",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of edges that represent a graph and a boolean value indicating whether the graph is directed. Implement a function that constructs an adjacency list representation of the graph. Each edge is represented as a tuple (vertex1, vertex2, weight), where 'weight' ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert construct_adj_list([], False) == {}\", \"assert construct_adj_list([('X', 'Y'), ('Y', 'Z')], False) == {'X': [('Y', 1)], 'Y': [('X', 1), ('Z', 1)], 'Z': [('Y', 1)]}\", \"assert construct_adj_list([('A', 'B', 0), ('B', 'C', 0)], False) == {'A': [('B', 0)], 'B... | {
"split": "train",
"index": 72446,
"acecode_id": "bigcode_python_fns_45402",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of layers and extracts specific information based on certain conditions. Each layer is represented by a dictionary containing the following keys: 'name' (string), 'medium' (dictionary), and 'thickness' (fl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_fluid_layers([]) == []\", \"assert extract_fluid_layers([{'name': 'Layer2', 'medium': {'MODEL': 'fluid', 'density': 1.0}, 'thickness': 0.7}]) == ['Layer2']\", \"assert extract_fluid_layers([{'name': 'Layer3', 'medium': {'MODEL': 'fluid', 'density': 0... | {
"split": "train",
"index": 72447,
"acecode_id": "oss_11029",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of stock price data. The input will be a list of dictionaries, where each dictionary contains the following keys: 'Date', 'Open', 'High', 'Low', and 'Close', representing the historical stock prices for different tra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_stock_data([{'Date': '2023-01-01', 'Open': 100, 'High': 105, 'Low': 95, 'Close': 102}, {'Date': '2023-01-02', 'Open': 102, 'High': 108, 'Low': 98, 'Close': 104}]) == [('2023-01-01', 100, 105, 95, 102), ('2023-01-02', 102, 108, 98, 104)]\", \"assert p... | {
"split": "train",
"index": 72448,
"acecode_id": "oss_32746",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given two sorted arrays of integers, `arr1` and `arr2`. Your task is to merge these two arrays into a single sorted array. The new array should be created by interweaving the elements from the two input arrays while maintaining the sorted order. Implement the function `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_sorted_arrays([1, 2, 4], [1, 3, 4]) == [1, 1, 2, 3, 4, 4]\", \"assert merge_sorted_arrays([], []) == []\", \"assert merge_sorted_arrays([], [0]) == [0]\", \"assert merge_sorted_arrays([1, 3, 5], [2, 4, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_sorted... | {
"split": "train",
"index": 72449,
"acecode_id": "evol_30002",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a file path, implement a function that determines whether the specified path is empty or not. The function should return 1 if the path is empty (i.e., the string is either an empty string or consists only of whitespace characters), and return 0 other... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_path_empty('') == 1\", \"assert is_path_empty(' ') == 1\", \"assert is_path_empty('folder/') == 0\", \"assert is_path_empty('folder/file.txt') == 0\", \"assert is_path_empty(' /folder/file.txt ') == 0\", \"assert is_path_empty(' ') == 1\", \"asser... | {
"split": "train",
"index": 72450,
"acecode_id": "bigcode_python_fns_15768",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the flooding of a data packet in a network switch environment. The function should accept the following parameters: an integer representing the input port (inport), a string representing the packet data (packet), a bool... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flood_packet(1, 'Hello World', True, 'buffer1') == 'Flooding packet: Hello World from port: 1 using buffer: buffer1'\", \"assert flood_packet(2, 'Network Packet', False, 'buffer2') == 'Flooding packet: Network Packet from port: 2 without using a buffer'\", \... | {
"split": "train",
"index": 72451,
"acecode_id": "bigcode_python_fns_19798",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `rgb_to_hsv(r: int, g: int, b: int) -> Tuple[float, float, float]` that converts RGB color values to HSV color values. The function should validate that the RGB values are in the range of 0 to 255, inclusive. If the values are outside this range, the functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rgb_to_hsv(255, 0, 0) == (0.0, 1.0, 1.0)\", \"assert rgb_to_hsv(0, 255, 0) == (120.0, 1.0, 1.0)\", \"assert rgb_to_hsv(0, 0, 255) == (240.0, 1.0, 1.0)\", \"assert rgb_to_hsv(255, 255, 0) == (60.0, 1.0, 1.0)\", \"assert rgb_to_hsv(0, 255, 255) == (180.0, 1.0,... | {
"split": "train",
"index": 72452,
"acecode_id": "evol_2250",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings. Your task is to write a Python function that takes this list as input and returns the number of strings that contain the word 'python' (case-insensitive). If the input list is empty, the function should return 0. Write a function named `count_py... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_python_strings(['This string does not contain the keyword', 'another line', 'Python']) == 1\", \"assert count_python_strings(['PYTHON is fun', 'I enjoy coding']) == 1\", \"assert count_python_strings([]) == 0\", \"assert count_python_strings(['nothing ... | {
"split": "train",
"index": 72453,
"acecode_id": "oss_15184",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that computes the Fibonacci number at a given index using a recursive approach. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, F(n) = F(n-1) + F(n-2) for n >= 2. The function should take a single integer parameter n (0-indexed) and return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == 0\", \"assert fibonacci(1) == 1\", \"assert fibonacci(2) == 1\", \"assert fibonacci(3) == 2\", \"assert fibonacci(4) == 3\", \"assert fibonacci(5) == 5\", \"assert fibonacci(6) == 8\", \"assert fibonacci(7) == 13\", \"assert fibonacci(8) == 2... | {
"split": "train",
"index": 72454,
"acecode_id": "evol_20372",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary of jobs with their results and two sets of job names that are allowed to fail and allowed to be skipped, determine if the jobs completed successfully based on the following rules: 1) A job is considered successful if its result is 'success'. 2) Jobs that are ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_job_results({'job1': {'result': 'success'}, 'job2': {'result': 'success'}}, set(), set()) == 0\", \"assert check_job_results({'job1': {'result': 'success'}, 'job2': {'result': 'failed'}}, set(), set()) == 1\", \"assert check_job_results({'job1': {'resu... | {
"split": "train",
"index": 72455,
"acecode_id": "bigcode_python_fns_19889",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a barcode, implement a function that checks if the barcode is valid according to the following rules: a barcode is considered valid if it consists of exactly 12 digits (0-9). The function should return True if the barcode is valid and False otherwise... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_barcode('123456789012') == True\", \"assert is_valid_barcode('12345678') == False\", \"assert is_valid_barcode('abcdefghijk') == False\", \"assert is_valid_barcode('12345678901a') == False\", \"assert is_valid_barcode('1234567890123') == False\", \"... | {
"split": "train",
"index": 72456,
"acecode_id": "bigcode_python_fns_35677",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the Exponential Moving Average (EMA) for a series of closing prices of a coin pair. The EMA is a type of weighted moving average that gives more weight to the most recent prices. Implement the function `calculate_exponential_moving_average(closin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_exponential_moving_average([10], 1) == 10.0\", \"assert calculate_exponential_moving_average([100, 200, 300], 1) == 300.0\", \"assert calculate_exponential_moving_average([1, 2, 3, 4, 5], 5) == 3.0\", \"assert calculate_exponential_moving_average([... | {
"split": "train",
"index": 72457,
"acecode_id": "bigcode_python_fns_23876",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given two floating-point numbers, `estimate` and `exact`, write a function `relative_error(estimate: float, exact: float) -> float` that computes the relative error of the `estimate` compared to the `exact` value, expressed as a percentage. If `exact` is zero, return 0.0 if `es... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert relative_error(10.0, 10.0) == 0.0\", \"assert relative_error(0.0, 0.0) == 0.0\", \"assert relative_error(10.0, 0.0) == float('inf')\", \"assert relative_error(0.0, 10.0) == 100.0\", \"assert relative_error(100.0, 50.0) == 100.0\", \"assert relative_error(50.... | {
"split": "train",
"index": 72458,
"acecode_id": "bigcode_python_fns_32961",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given the dimensions of a matrix defined by a tuple 'size' (rows, columns), an integer 'spacing' that determines the number of rows between each non-zero element, and an integer 'offset' that specifies the number of zero rows at the beginning of the matrix, create a sparse matr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_sparse_matrix((3, 4), 2, 1) == [[0, 0, 0, 0], [1.0, 1.0, 1.0, 1.0], [0, 0, 0, 0]]\", \"assert create_sparse_matrix((1, 1), 1, 0) == [[1.0]]\", \"assert create_sparse_matrix((6, 6), 2, 0) == [[1.0, 1.0, 1.0, 1.0, 1.0, 1.0], [0, 0, 0, 0, 0, 0], [1.0, 1.... | {
"split": "train",
"index": 72459,
"acecode_id": "bigcode_python_fns_33950",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a list of stock transactions where each transaction consists of a stock symbol, a transaction type (either 'buy' or 'sell'), and a quantity of stocks involved. Your task is to implement a function `calculate_profit(transactions)` that computes the total profit ear... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_profit([StockTransaction('AAPL', 'buy', 50), StockTransaction('AAPL', 'sell', 50)]) == 500\", \"assert calculate_profit([StockTransaction('AAPL', 'buy', 100), StockTransaction('GOOG', 'buy', 50), StockTransaction('AAPL', 'sell', 30), StockTransacti... | {
"split": "train",
"index": 72460,
"acecode_id": "oss_14384",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple notification system. The function should take a list of recipient names and a message as parameters. Your task is to implement the function `send_notifications(recipients: List[str], message: str) -> List[str]` tha... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_notifications(['Alice', 'Bob'], 'Hello, this is a test notification.') == ['Message sent to Alice: Hello, this is a test notification.', 'Message sent to Bob: Hello, this is a test notification.']\", \"assert send_notifications(['Charlie'], 'Welcome to ... | {
"split": "train",
"index": 72461,
"acecode_id": "oss_19708",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "In a school, there are a certain number of students in a specific class, and the total number of students in the entire grade is a multiple of the number of students in that class. Write a function `calculate_total_students(class_size: int, multiplier: int) -> int` that takes t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_students(20, 5) == 100\", \"assert calculate_total_students(10, 4) == 40\", \"assert calculate_total_students(30, 3) == 90\", \"assert calculate_total_students(15, 2) == 30\", \"assert calculate_total_students(25, 6) == 150\", \"assert calcul... | {
"split": "train",
"index": 72462,
"acecode_id": "evol_19618",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary representing a note, write a function that determines if the note is marked as a favorite. The dictionary may contain a key 'favorite' which has a boolean value. If the 'favorite' key exists and its value is True, return True. If the 'favorite' key does not e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_favorite({'favorite': True}) == True\", \"assert is_favorite({'favorite': False}) == False\", \"assert is_favorite({'title': 'Meeting Notes', 'favorite': True}) == True\", \"assert is_favorite({'title': 'Shopping List', 'favorite': False}) == False\", \"a... | {
"split": "train",
"index": 72463,
"acecode_id": "bigcode_python_fns_17232",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `freeze_graph(sess: Any, output_file_path: str, output_node_names: List[str]) -> None` that simulates saving a model's session and output node names to a specified file path. The function takes three parameters: `sess`, which is a pla... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert freeze_graph(None, 'model.pb', ['output_node1', 'output_node2']) == None\", \"assert freeze_graph(None, 'saved_model.pb', ['nodeA']) == None\", \"assert freeze_graph(None, 'output/model.pb', ['output1', 'output2', 'output3']) == None\", \"assert freeze_graph... | {
"split": "train",
"index": 72464,
"acecode_id": "bigcode_python_fns_49166",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that arranges a dictionary based on the count of vowels present in each of its keys. The function should take a dictionary as input, where the keys are strings. The output should be a new dictionary with the same key-value pairs but sorted by the number of vowe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert arrange_by_vowels({'a': 1, 'b': 2, 'c': 3}) == {'a': 1, 'b': 2, 'c': 3}\", \"assert arrange_by_vowels({'apple': 1, 'banana': 3, 'grape': 2}) == {'apple': 1, 'grape': 2, 'banana': 3}\", \"assert arrange_by_vowels({'zebra': 2, 'lion': 2, 'tiger': 2}) == {'zebr... | {
"split": "train",
"index": 72465,
"acecode_id": "evol_12435",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file names and a list of correct predictions that represent the expected classification of certain images. Your task is to implement a function `filter_files(file_names: List[str], correct_predictions: List[str]) -> List[str]` that filters out files whos... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_files(['image1.jpg', 'test_image.png', 'sample_image.gif'], ['cat', 'dog']) == ['image1.jpg', 'test_image.png', 'sample_image.gif']\", \"assert filter_files(['file1.txt', 'file2.txt', 'file3.txt'], ['doc']) == ['file1.txt', 'file2.txt', 'file3.txt']\"... | {
"split": "train",
"index": 72466,
"acecode_id": "bigcode_python_fns_39126",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a list of decimal numbers and sorts them using the radix sort algorithm. The function should return a new list with the sorted decimal numbers. Do not use any built-in sorting methods. Your implementation should handle decimals by treating them a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert radix_sort([1.1, 6.6, 5.5, 4.4, 8.8, 2.2]) == [1.1, 2.2, 4.4, 5.5, 6.6, 8.8]\", \"assert radix_sort([3.3, 1.1, 2.2]) == [1.1, 2.2, 3.3]\", \"assert radix_sort([5.5, 5.5, 5.5]) == [5.5, 5.5, 5.5]\", \"assert radix_sort([10.1, 1.0, 11.1]) == [1.0, 10.1, 11.1]\... | {
"split": "train",
"index": 72467,
"acecode_id": "evol_5994",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a non-empty array of decimal digits representing a non-negative integer, implement a function that increments the integer by one. The digits are stored such that the most significant digit is at the head of the list, and each element in the array contains a single digit. ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert plusOne([1, 2, 9]) == [1, 3, 0]\", \"assert plusOne([9, 9, 9]) == [1, 0, 0, 0]\", \"assert plusOne([0]) == [1]\", \"assert plusOne([2, 3, 4]) == [2, 3, 5]\", \"assert plusOne([1, 0, 0]) == [1, 0, 1]\", \"assert plusOne([4, 3, 2, 1]) == [4, 3, 2, 2]\", \"asse... | {
"split": "train",
"index": 72468,
"acecode_id": "evol_5163",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a list of integers as input and returns the difference between the largest and smallest integers in the list. If the list is empty, return 'The list is empty'.\nPlease reason step by step, then write a self-contained Python solution. Give your... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_disparity([]) == 'The list is empty'\", \"assert calculate_disparity([1]) == 0\", \"assert calculate_disparity([1, 2, 3, 4, 5]) == 4\", \"assert calculate_disparity([-1, -2, -3, -4, -5]) == 4\", \"assert calculate_disparity([5, 1, 4, 2, 3]) == 4\",... | {
"split": "train",
"index": 72469,
"acecode_id": "evol_33682",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes two lists of design elements and returns a dictionary representing the optimized design. The optimized design should prioritize elements that are present in both lists, followed by unique elements from each list. Ensure that the function is type-... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert optimized_design(['header', 'footer', 'sidebar'], ['footer', 'navbar', 'sidebar']) == {'common': ['footer', 'sidebar'], 'unique_A': ['header'], 'unique_B': ['navbar']}\", \"assert optimized_design([], ['footer', 'navbar', 'sidebar']) == {'common': [], 'uniqu... | {
"split": "train",
"index": 72470,
"acecode_id": "evol_28176",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a DNA sequence. Your task is to implement a function that extracts all unique substrings (shingles) of length `k` from the DNA sequence. Then, for each unique shingle, you need to compute its position in the DNA sequence. Finally, return a li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_unique_shingles('ACGTACGT', 2) == ['AC', 'CG', 'GT', 'TA']\", \"assert extract_unique_shingles('AAGCTAGC', 2) == ['AA', 'AG', 'GC', 'CT', 'TA']\", \"assert extract_unique_shingles('A', 2) == []\", \"assert extract_unique_shingles('', 3) == []\", \"as... | {
"split": "train",
"index": 72471,
"acecode_id": "bigcode_python_fns_46373",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `custom_decode` that replicates the behavior of decoding byte strings using a specified encoding format and error handling strategy. The function should take three parameters: `data` (bytes), `encoding` (string), and `errors` (string)... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert custom_decode(b'\\\\xff\\\\xfe\\\\x48\\\\x00\\\\x65\\\\x00\\\\x6c\\\\x00\\\\x6c\\\\x00\\\\x6f\\\\x00', 'utf-16', 'strict') == 'Hello'\", \"assert custom_decode(b'\\\\x48\\\\x65\\\\x6c\\\\x6c\\\\x6f', 'latin-1', 'strict') == 'Hello'\", \"assert custom_decode(... | {
"split": "train",
"index": 72472,
"acecode_id": "oss_1515",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of journal entries, where each entry is represented as a dictionary containing a 'title' and an 'id'. Your goal is to create a function that takes a list of journal entries and returns a list of unique journal entries based on their 'id'. I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_journals([{ 'id': 1, 'title': 'Journal A' }, { 'id': 2, 'title': 'Journal B' }, { 'id': 1, 'title': 'Journal C' }]) == [{'id': 1, 'title': 'Journal A'}, {'id': 2, 'title': 'Journal B'}]\", \"assert unique_journals([{ 'id': 1, 'title': 'Journal A' }, {... | {
"split": "train",
"index": 72473,
"acecode_id": "bigcode_python_fns_34794",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates adding a value to a collection. The function should ensure that duplicate values are not added to the collection. Your function should take in two arguments: a list called 'collection' and a value called 'value'. If the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_to_collection([1, 2, 3], 4) == [1, 2, 3, 4]\", \"assert add_to_collection([1, 2, 3], 2) == [1, 2, 3]\", \"assert add_to_collection([], 5) == [5]\", \"assert add_to_collection([10, 20, 30], 10) == [10, 20, 30]\", \"assert add_to_collection([5, 6, 7], 8) =... | {
"split": "train",
"index": 72474,
"acecode_id": "bigcode_python_fns_3769",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a recipe represented as a dictionary. The function should extract specific fields from the dictionary: 'name', 'url', 'ingredients', and 'picture'. If any of these fields are missing, the function should return None. If all... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_recipe_fields({'name': 'Pasta', 'url': 'http://example.com/pasta', 'ingredients': 'pasta, sauce', 'picture': 'http://example.com/pasta.jpg'}) == ['Pasta', 'http://example.com/pasta', 'pasta, sauce', 'http://example.com/pasta.jpg']\", \"assert extract... | {
"split": "train",
"index": 72475,
"acecode_id": "bigcode_python_fns_48193",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_area(shape)` that takes an instance of a shape (either Circle, Rectangle, or Triangle) and returns the area of the shape. Each shape instance will have methods to set necessary dimensions (like radius for Circle, length and width for Rectangle, a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_area(Circle().setRadius(5)) == 78.53981633974483\", \"assert calculate_area(Rectangle().setLength(4).setWidth(5)) == 20\", \"assert calculate_area(Triangle().setBase(4).setHeight(5)) == 10\", \"assert calculate_area(Circle().setRadius(0)) == 0.0\",... | {
"split": "train",
"index": 72476,
"acecode_id": "evol_17795",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple bank account. The function should take an initial balance, a list of deposit amounts, and a list of withdrawal amounts as inputs. It should return the final balance after performing all the deposits and withdra... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert final_balance(100, [50, 25], [30, 10]) == 135\", \"assert final_balance(50, [], []) == 50\", \"assert final_balance(0, [10, 20], [5]) == 25\", \"assert final_balance(10, [5], [20]) == 15\", \"assert final_balance(30, [10, 20], [5, 10]) == 45\", \"assert fina... | {
"split": "train",
"index": 72477,
"acecode_id": "oss_31040",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D board represented as a list of lists, where each element can be either 0 (empty) or 1 (occupied). Your task is to implement a function `update_board(board: List[List[int]], row: int, col: int) -> bool` that updates the board based on the given row and column ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_board([[0, 0], [0, 0]], 0, 0) == True\", \"assert update_board([[1, 0], [0, 0]], 0, 0) == False\", \"assert update_board([[0, 0], [0, 0]], 1, 1) == True\", \"assert update_board([[1, 1], [0, 0]], 1, 0) == True\", \"assert update_board([[0, 1], [0, 0]]... | {
"split": "train",
"index": 72478,
"acecode_id": "bigcode_python_fns_28516",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with modifying a data structure that represents Linux repositories. Each repository has an associated command and an icon representing its distribution. Implement a function `modify_repos` that takes a list of repositories and adds a new field `command` (which sh... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert modify_repos([{'icon': 'centos', 'command': ''}, {'icon': 'epel', 'command': ''}]) == [{'icon': 'centos', 'command': ''}, {'icon': 'epel', 'command': ''}]\", \"assert modify_repos([{'icon': 'fedora', 'command': ''}]) == [{'icon': 'fedora', 'command': ''}]\",... | {
"split": "train",
"index": 72479,
"acecode_id": "oss_32860",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_rectangle_properties(length: float, width: float) -> Tuple[float, float]` that takes the length and width of a rectangle as input and returns a tuple containing the area and the perimeter of the rectangle. If either the length or width is non-pos... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_rectangle_properties(3, 4) == (12, 14)\", \"assert calculate_rectangle_properties(5, 10) == (50, 30)\", \"assert calculate_rectangle_properties(1.5, 2.5) == (3.75, 8.0)\", \"assert calculate_rectangle_properties(7, 3) == (21, 20)\", \"assert calcul... | {
"split": "train",
"index": 72480,
"acecode_id": "evol_16327",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing the widths and a list of integers representing the heights of windows, write a function `get_max_area(widths: List[int], heights: List[int]) -> int` that calculates the maximum area of any rectangle that can be formed using one width and on... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_max_area([2, 3, 5], [4, 6, 8]) == 40\", \"assert get_max_area([1, 2, 3], [1, 2, 3]) == 9\", \"assert get_max_area([], [1, 2, 3]) == 0\", \"assert get_max_area([1, 2, 3], []) == 0\", \"assert get_max_area([0, 5, 10], [0, 5, 10]) == 100\", \"assert get_max... | {
"split": "train",
"index": 72481,
"acecode_id": "bigcode_python_fns_36749",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a query string for retrieving build job logs based on the provided criteria. Write a function `create_build_job_query(user: str, time_frame: int, local: bool) -> str` that constructs a query string based on the following parameters:\n\n- `user`: a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_build_job_query('user123', 24, False) == 'application:dls-release.py AND (message:BUILD) AND username:user123'\", \"assert create_build_job_query('user123', 12, True) == 'application:dls-release.py AND (message:BUILD OR message:LOCAL) AND username:use... | {
"split": "train",
"index": 72482,
"acecode_id": "bigcode_python_fns_37570",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integer values representing the brightness levels of an LED strip, where each value ranges from 0 to 255. Your task is to implement a function `set_brightness(levels: List[int]) -> List[int]` that takes this list as input and returns a new list where eac... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_brightness([50, 130, 200]) == [255, 130, 200]\", \"assert set_brightness([0, 255, 128]) == [255, 255, 255]\", \"assert set_brightness([100, 120, 130]) == [255, 255, 130]\", \"assert set_brightness([128, 127, 126]) == [255, 255, 255]\", \"assert set_brigh... | {
"split": "train",
"index": 72483,
"acecode_id": "bigcode_python_fns_14696",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a CPU task scheduler that can efficiently assign a new task to the CPU core with the least total task duration. The CPU scheduler is represented as a dictionary `cpuLists`, where each key represents a CPU core and its associated value is a dicti... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert assignTask({'0': {'cpus': '0', 'tasks': []}, '1': {'cpus': '1', 'tasks': []}}, 'task1', 5) == 0\", \"assert assignTask({'0': {'cpus': '0', 'tasks': [{'taskId': 'task1', 'taskDuration': 5}]}, '1': {'cpus': '1', 'tasks': []}}, 'task2', 3) == 1\", \"assert assi... | {
"split": "train",
"index": 72484,
"acecode_id": "oss_4799",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, write a function that returns the penultimate prime number found in the array. If there are fewer than two prime numbers in the array, return None.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert penultimate_prime([11, 20, 35, 2, 17, 18, 9, 5, 7]) == 5\", \"assert penultimate_prime([3, 5, 7, 11, 13]) == 11\", \"assert penultimate_prime([4, 6, 8, 10]) == None\", \"assert penultimate_prime([29, 23, 19, 17]) == 19\", \"assert penultimate_prime([1, 2, 3,... | {
"split": "train",
"index": 72485,
"acecode_id": "evol_28327",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple representation of a terminal. Write a function `get_terminal_dimensions()` that returns the height and width of a terminal. The function should return a tuple of two integers representing the height and width, which are both fixed values. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_terminal_dimensions() == (24, 80)\", \"assert type(get_terminal_dimensions()[0]) == int\", \"assert type(get_terminal_dimensions()[1]) == int\", \"assert get_terminal_dimensions()[0] > 0\", \"assert get_terminal_dimensions()[1] > 0\", \"assert get_termin... | {
"split": "train",
"index": 72486,
"acecode_id": "bigcode_python_fns_938",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the horizontal movement of a probe. The probe moves horizontally at a constant speed of -2/320 cm/s. Implement a function that takes a single argument `t` (time in seconds) and returns the horizontal position of the probe after that time has passe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert horizontal_move(0) == 0.0\", \"assert horizontal_move(1) == -0.00625\", \"assert horizontal_move(2) == -0.0125\", \"assert horizontal_move(5) == -0.03125\", \"assert horizontal_move(10) == -0.0625\", \"assert horizontal_move(15) == -0.09375\", \"assert horiz... | {
"split": "train",
"index": 72487,
"acecode_id": "bigcode_python_fns_8458",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the creation of a `StateStore` instance. The function should accept two parameters: `deck_definition` (a dictionary representing the configuration of a deck) and `deck_fixed_labware` (a list of labware items fixed to the de... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_state_store({'name': 'Deck A', 'size': 'large'}, ['Labware 1', 'Labware 2']) == StateStore({'name': 'Deck A', 'size': 'large'}, ['Labware 1', 'Labware 2'])\", \"assert create_state_store({'name': 'Deck B', 'size': 'medium'}, ['Labware 3']) == StateSto... | {
"split": "train",
"index": 72488,
"acecode_id": "bigcode_python_fns_37989",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple template rendering function. Given a string `template` containing placeholders in the format `{{ key }}`, and a dictionary `context` where the keys match the placeholders in the template, implement a function `render_template(template: str,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert render_template('Hello, {{ name }}!', {'name': 'Alice'}) == 'Hello, Alice!'\", \"assert render_template('Your balance is {{ balance }}.', {'balance': '100'}) == 'Your balance is 100.'\", \"assert render_template('Welcome, {{ user }}! You have {{ count }} new... | {
"split": "train",
"index": 72489,
"acecode_id": "bigcode_python_fns_39330",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a function named `get_custom_data_format` that takes a single integer parameter `dfid`, which represents the ID of a registered custom data format. Your task is to implement a function that simulates the behavior of `get_custom_data_format` by returning a string t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_custom_data_format(1) == 'JSON'\", \"assert get_custom_data_format(2) == 'XML'\", \"assert get_custom_data_format(3) == 'CSV'\", \"assert get_custom_data_format(0) == 'UNKNOWN'\", \"assert get_custom_data_format(-1) == 'UNKNOWN'\", \"assert get_custom_da... | {
"split": "train",
"index": 72490,
"acecode_id": "bigcode_python_fns_12215",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of records where each record is represented as a dictionary containing the keys 'case', 'FEATURE_IDX', 'LABEL_IDX', 'GENE_IDX', and 'GENE_NAME_IDX'. Your task is to implement a function `process_data(records: List[Dict[str, str]]) -> Dict[str, List[List[str... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data([]) == {}\", \"assert process_data([{'case': 'A', 'FEATURE_IDX': '1', 'LABEL_IDX': '0', 'GENE_IDX': 'gene1', 'GENE_NAME_IDX': 'gene_name1'}]) == {'A': [['1'], ['0'], ['gene1'], ['gene_name1']]}\", \"assert process_data([{'case': 'A', 'FEATURE_ID... | {
"split": "train",
"index": 72491,
"acecode_id": "oss_2164",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are required to implement a function that takes two non-negative integers as input and returns their sum represented in binary format as a string. The function should ignore leading zeros in the binary representation. Implement the function `add_binary(a: int, b: int) -> st... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_binary(1, 1) == '10'\", \"assert add_binary(0, 1) == '1'\", \"assert add_binary(2, 3) == '101'\", \"assert add_binary(5, 5) == '1010'\", \"assert add_binary(0, 0) == '0'\", \"assert add_binary(7, 8) == '1111'\", \"assert add_binary(15, 1) == '10000'\", \... | {
"split": "train",
"index": 72492,
"acecode_id": "oss_14049",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple function that computes the square of an integer. Write a Python function named `square` that takes an integer `n` as input and returns the square of that integer. Ensure your function handles both positive and negative integers correctly.\n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square(0) == 0\", \"assert square(1) == 1\", \"assert square(-1) == 1\", \"assert square(2) == 4\", \"assert square(-2) == 4\", \"assert square(3) == 9\", \"assert square(-3) == 9\", \"assert square(4) == 16\", \"assert square(-4) == 16\", \"assert square(5)... | {
"split": "train",
"index": 72493,
"acecode_id": "oss_3180",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that computes the sum of a cosine value of a given angle (in radians) and a variable number of additional values. However, the function should only accept numerical inputs (integers or floats) and should raise an error if any of the i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_cosine_sum(0, 1, 2, 3) == 6.0\", \"assert calculate_cosine_sum(0, -1, -2) == -3.0\", \"assert calculate_cosine_sum(0, 0) == 0.0\", \"assert calculate_cosine_sum(0, 1.5, 2.5) == 4.0\", \"assert calculate_cosine_sum(0, 3.14) == 3.14\", \"assert calcu... | {
"split": "train",
"index": 72494,
"acecode_id": "bigcode_python_fns_34147",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of names, categorize them into five distinct classifications according to the initial alphabetic character of each name. The classifications are as follows: A-E, F-J, K-O, P-T, and U-Z. Each name should be converted to uppercase, and the names within each class sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert classify_and_sort(['Xander', 'Yasmine', 'Zara', 'Tom', 'Steve']) == {'A-E': [], 'F-J': [], 'K-O': [], 'P-T': ['TOM', 'STEVE'], 'U-Z': ['ZARA', 'YASMINE', 'XANDER']}\", \"assert classify_and_sort([]) == {'A-E': [], 'F-J': [], 'K-O': [], 'P-T': [], 'U-Z': []}\... | {
"split": "train",
"index": 72495,
"acecode_id": "evol_29749",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that logs the training progress of a machine learning model. The function should take two parameters: the current epoch number (an integer) and the training loss (a float). It should print a log message in the format 'Epoch {epoch}: Loss ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_training_progress(1, 0.5) == True\", \"assert log_training_progress(2, 0.4) == True\", \"assert log_training_progress(4, 0.2) == True\", \"assert log_training_progress(6, 0.15) == True\", \"assert log_training_progress(7, 0.1) == True\", \"assert log_tra... | {
"split": "train",
"index": 72496,
"acecode_id": "oss_13189",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function that determines if a book is overdue based on its due date and the current date. The function should take two parameters: due_date (a string in the format 'YYYY-MM-DD') and current_date (also a string in the format 'YYYY-MM-DD'). The function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_overdue('2023-10-01', '2023-10-02') == True\", \"assert is_overdue('2023-10-01', '2023-09-30') == False\", \"assert is_overdue('2023-10-01', '2023-10-01') == False\", \"assert is_overdue('2023-01-01', '2023-01-02') == True\", \"assert is_overdue('2023-01-... | {
"split": "train",
"index": 72497,
"acecode_id": "evol_32835",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates sending a message to a peer in a network. The function should take in three parameters: a string representing the peer's IP address (`peer_ip`), a dictionary representing the message attributes (`attr`), and a list represen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert send_update('192.168.1.1', {'key': 'value'}, ['192.168.1.0/24']) == {'status': True}\", \"assert send_update('256.256.256.256', {'key': 'value'}, ['192.168.1.0/24']) == {'status': False, 'code': 'failed when send this message out'}\", \"assert send_update('1... | {
"split": "train",
"index": 72498,
"acecode_id": "bigcode_python_fns_33593",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of measuring devices and generates a report based on specific criteria. Each device is represented by a class `MeasuringDevice` which has the following attributes: `id` (a unique identifier for the measuring d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_report([MeasuringDevice(1, 'S'), MeasuringDevice(2, 'T'), MeasuringDevice(3, 'S')]) == [1, 3]\", \"assert generate_report([MeasuringDevice(5, 'T'), MeasuringDevice(6, 'T'), MeasuringDevice(7, 'S'), MeasuringDevice(8, 'S')]) == [7, 8]\", \"assert gen... | {
"split": "train",
"index": 72499,
"acecode_id": "oss_9134",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.