data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "Implement a Python function that removes duplicates from a given iterable while maintaining the original order of the unique elements. The function should be able to handle strings with case sensitivity and embedded lists. Your implementation should not use built-in Python func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 2, 3]) == [1, 2, 3]\", \"assert remove_duplicates(['a', 'b', 'a', 'c']) == ['a', 'b', 'c']\", \"assert remove_duplicates(['A', 'b', 'A', 'C']) == ['A', 'b', 'C']\", \"assert remove_duplicates([[1], [2], [1], [3]]) == [[1], [2], [3]]\...
{ "split": "train", "index": 66700, "acecode_id": "evol_17198", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of durations `dT` representing the time taken for a series of tasks, and a list of additional times `T` indicating the required time after each task. Your task is to implement a function `get_movement_endtime(dT: List[float], T: List[float]) -> float` that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_movement_endtime([1.0, 2.0, 3.0], [1.0, 1.0, 1.0]) == 6.0\", \"assert get_movement_endtime([0.5, 1.5, 2.5], [1.0, 1.0, 1.0]) == 5.0\", \"assert get_movement_endtime([1.0, 2.0], [0.0, 0.0]) == 3.0\", \"assert get_movement_endtime([0.0, 0.0, 0.0], [0.0, 0....
{ "split": "train", "index": 66701, "acecode_id": "bigcode_python_fns_41723", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function that takes three parameters: a student's name (string), age (integer), and academic discipline (string). This function should return a formatted string containing the student's details including their name, age, and discipline. Ensure that the output clearl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert student_details('John Smith', 17, 'Computer Science') == \\\"Student's Name: John Smith\\\\nStudent's Age: 17\\\\nStudent's Discipline: Computer Science\\\"\", \"assert student_details('Alice Johnson', 21, 'Mathematics') == \\\"Student's Name: Alice Johnson\...
{ "split": "train", "index": 66702, "acecode_id": "evol_2381", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the number of training iterations required for multiple models to complete their training process. Your task is to implement a function that calculates the total training iterations by summing up the iterations for all models. Write...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_training_iterations([5, 10, 15]) == 30\", \"assert total_training_iterations([1, 2, 3]) == 6\", \"assert total_training_iterations([0, 0, 0]) == 0\", \"assert total_training_iterations([10]) == 10\", \"assert total_training_iterations([1, 1, 1, 1, 1]) ...
{ "split": "train", "index": 66703, "acecode_id": "bigcode_python_fns_47592", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string s representing a task status, write a function `get_task_status(task_id: str, task_status: str, task_result: Any) -> Dict[str, Any]` that returns a dictionary containing the task ID, its status, and the result. The dictionary should have three keys: 'task_id', 't...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_task_status('123', 'completed', 42) == {'task_id': '123', 'task_status': 'completed', 'task_result': 42}\", \"assert get_task_status('456', 'pending', None) == {'task_id': '456', 'task_status': 'pending', 'task_result': None}\", \"assert get_task_status(...
{ "split": "train", "index": 66704, "acecode_id": "bigcode_python_fns_10729", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of timestamps in ascending order, represented as datetime objects. Your task is to implement a function `estimate_dt(time_array)` that estimates the median time step between consecutive timestamps in the list. If the list contains fewer than 2 timestamps, r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert estimate_dt([datetime(2021, 1, 1, 1, 0, 0), datetime(2021, 1, 1, 1, 0, 10)]) == timedelta(seconds=10)\", \"assert estimate_dt([datetime(2021, 1, 1, 1, 0, 0), datetime(2021, 1, 1, 1, 0, 5), datetime(2021, 1, 1, 1, 0, 10)]) == timedelta(seconds=5)\", \"assert ...
{ "split": "train", "index": 66705, "acecode_id": "bigcode_python_fns_4763", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given an integer array 'frames' representing the indices of video frames to be processed. Your task is to create a function 'process_frames(frames: List[int]) -> List[str]' that simulates the processing of each frame by applying a rectangle and adding text indicating th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_frames([1, 2, 3]) == ['Frame 1 processed with rectangle at (100, 100) and dimensions (50, 50)', 'Frame 2 processed with rectangle at (100, 100) and dimensions (50, 50)', 'Frame 3 processed with rectangle at (100, 100) and dimensions (50, 50)']\", \"a...
{ "split": "train", "index": 66706, "acecode_id": "oss_28615", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `update_profile` that takes in four parameters: `token` (string), `leaderboard` (boolean), `show_username` (boolean), and `username` (string). The function should compile these parameters into a dictionary where the keys are 'authorizatio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_profile('abc123', True, False, 'user1') == {'authorization': 'Bearer abc123', 'show_leaderboard': True, 'show_username': False, 'username': 'user1'}\", \"assert update_profile('xyz789', None, None, 'user2') == {'authorization': 'Bearer xyz789', 'usern...
{ "split": "train", "index": 66707, "acecode_id": "bigcode_python_fns_4627", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary that represents a pipeline configuration for a natural language processing (NLP) task. Implement a function `get_pipeline_type(pipeline_dict: Dict[str, Any]) -> str` that takes in this dictionary and returns the type of pipeline based on the value of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_pipeline_type({'type': 'text_classification'}) == 'text_classification'\", \"assert get_pipeline_type({'type': 'named_entity_recognition'}) == 'named_entity_recognition'\", \"assert get_pipeline_type({'type': 'text_generation'}) == 'text_generation'\", \...
{ "split": "train", "index": 66708, "acecode_id": "bigcode_python_fns_47822", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to determine the highest priority release channel of a software application based on the provided options. The release channels include 'stable', 'beta', and 'dev'. The function `VerifyReleaseChannel(options)` takes a dictionary `opti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert VerifyReleaseChannel({'stable': True, 'beta': False, 'dev': True}) == 'stable'\", \"assert VerifyReleaseChannel({'stable': False, 'beta': True, 'dev': False}) == 'beta'\", \"assert VerifyReleaseChannel({'stable': False, 'beta': False, 'dev': True}) == 'dev'\...
{ "split": "train", "index": 66709, "acecode_id": "oss_8617", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a nested list of strings, implement a function that recursively flattens the list and returns a list of unique strings. The input list may contain nested sublists, and your function should ensure that only unique strings are included in the final flattened list. Write a f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flatten_unique_strings(['A', 'B', 'A', ['C', 'D', 'B']]) == ['A', 'B', 'C', 'D']\", \"assert flatten_unique_strings([['a', 'b', 'c'], 'a', 'b', ['d', 'e', ['b', 'c']]]) == ['a', 'b', 'c', 'd', 'e']\", \"assert flatten_unique_strings([]) == []\", \"assert fla...
{ "split": "train", "index": 66710, "acecode_id": "oss_32310", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a command-line argument parser. The function should accept a list of strings representing command-line arguments and determine if a specific argument '--local' is present in the list. If '--local' is present, the function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_local_mode(['--local']) == True\", \"assert is_local_mode(['--local', '--verbose']) == True\", \"assert is_local_mode(['--verbose', '--local']) == True\", \"assert is_local_mode(['--mode', '--local', '--test']) == True\", \"assert is_local_mode(['--test',...
{ "split": "train", "index": 66711, "acecode_id": "bigcode_python_fns_33817", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the behavior of a simple music player mode changer. The function should take a list of commands as input. The commands can be one of the following: 'set normal', 'set shuffle', 'set repeat', or 'get mode'. The function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert final_music_player_mode(['set normal', 'get mode']) == 'normal'\", \"assert final_music_player_mode(['set shuffle', 'get mode']) == 'shuffle'\", \"assert final_music_player_mode(['set repeat', 'get mode']) == 'repeat'\", \"assert final_music_player_mode(['se...
{ "split": "train", "index": 66712, "acecode_id": "oss_31279", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that converts an English question sentence into its Pig Latin version. The transformation rules are as follows: If a word starts with a vowel, append 'way' to the end of the word. If a word starts with a consonant, move the first consonant to the end of the wor...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pig_latin_translator('How are you today?') == 'owHay areway ouyay odaytay?'\", \"assert pig_latin_translator('Can you help me?') == 'anCay ouyay elphay emay?'\", \"assert pig_latin_translator('Are you coming?') == 'Areway ouyay omingcay?'\", \"assert pig_lat...
{ "split": "train", "index": 66713, "acecode_id": "evol_12772", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a validation check for a collaboration system involving creative works and agents. Your function, `validate_contributor_contribution(subject, related)`, should take two collaboration identifiers (which can be any hashable type, such as strings o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_contributor_contribution(1, 2) is None\", \"assert validate_contributor_contribution('collab1', 'collab2') is None\", \"assert validate_contributor_contribution('abc', 'def') is None\", \"assert validate_contributor_contribution(100, 200) is None\",...
{ "split": "train", "index": 66714, "acecode_id": "oss_23364", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple data structure to manage tasks in a task management system. Each task should have a name and an author. The author's name should default to 'Anonymous' if not provided. Your goal is to implement a function named 'create_task' that takes in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_task('Task 1', 'John Doe') == {'name': 'Task 1', 'author': 'John Doe'}\", \"assert create_task('Task 2') == {'name': 'Task 2', 'author': 'Anonymous'}\", \"assert create_task('Task 3', 'Jane Smith') == {'name': 'Task 3', 'author': 'Jane Smith'}\", \"as...
{ "split": "train", "index": 66715, "acecode_id": "oss_3849", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary containing chemical elements and their corresponding atomic numbers. Your task is to implement a function that takes the dictionary and a list of chemical symbols as input and returns a list of corresponding atomic numbers. If a symbol is not present ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_atomic_numbers({\\\"H\\\": 1, \\\"He\\\": 2}, [\\\"H\\\", \\\"He\\\"]) == [1, 2]\", \"assert get_atomic_numbers({\\\"O\\\": 8, \\\"C\\\": 6}, [\\\"O\\\", \\\"C\\\", \\\"N\\\"]) == [8, 6]\", \"assert get_atomic_numbers({\\\"H\\\": 1, \\\"Li\\\": 3, \\\"Be...
{ "split": "train", "index": 66716, "acecode_id": "oss_13880", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `add_variables(x, y)` that takes two string inputs `x` and `y`. The function should check if both variables contain only integer values. If either variable does not contain a valid integer, the function should raise a `ValueError` with the message 'The vari...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_variables('5', '2') == 7\", \"assert add_variables('10', '15') == 25\", \"assert add_variables('0', '0') == 0\", \"assert add_variables('100', '200') == 300\", \"assert add_variables('3', '4') == 7\", \"assert add_variables('50', '50') == 100\", \"assert...
{ "split": "train", "index": 66717, "acecode_id": "evol_1305", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a container type (like a list or a tuple), write a function `parse_container_args` that returns the appropriate type for the elements contained within. The function should handle the following cases: if the container is empty, return `str`; if the container has a single t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_container_args(List[int]) == int\", \"assert parse_container_args(Tuple[str]) == str\", \"assert parse_container_args(Tuple[int, ...]) == int\", \"assert parse_container_args(Tuple[str, int]) == (str, int)\", \"assert parse_container_args(List[str]) ==...
{ "split": "train", "index": 66718, "acecode_id": "bigcode_python_fns_17666", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of shapes and a list of test data points. Your task is to create a function that validates each test data point against the provided shapes. Each shape defines a valid structure for a data point. The validation should return a boolean indicating whether eac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_shapes(['circle', 'triangle', 'square'], ['circleA', 'Atrianglem', 'rectangle']) == [True, True, False]\", \"assert validate_shapes(['a', 'b', 'c'], ['abc', 'def', 'ghij']) == [True, False, False]\", \"assert validate_shapes(['cat', 'dog'], ['doghou...
{ "split": "train", "index": 66719, "acecode_id": "bigcode_python_fns_43212", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers and another list containing indices of the first list. You need to implement a function that rearranges the original list based on the provided indices and returns the new list sorted in descending order. If the length of the indices list is les...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rearrange_and_reverse([1, 2, 3], [0, 1]) == [3, 2, 1]\", \"assert rearrange_and_reverse([1, 2, 3, 4], [0, 1, 2, 3]) == [4, 3, 2, 1]\", \"assert rearrange_and_reverse([0, 0, 0], [2, 1]) == [0, 0, 0]\", \"assert rearrange_and_reverse([100, 200, 300], [1, 0]) =...
{ "split": "train", "index": 66720, "acecode_id": "evol_21322", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function `create_constant_string(value: str) -> str` that takes a string as input and returns a constant object that behaves like a string. The returned object should not allow reassignment of its value. You can assume that the string will only be assigned once duri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_constant_string('Alice').__str__() == 'Alice'\", \"assert create_constant_string('Hello').__str__() == 'Hello'\", \"assert create_constant_string('Python').__str__() == 'Python'\", \"assert create_constant_string('Test').__str__() == 'Test'\", \"asser...
{ "split": "train", "index": 66721, "acecode_id": "evol_14026", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function to check the time difference between the last two submissions of a user in a coding contest platform. The function should take a list of submission records, where each record is represented as a dictionary containing 'username', 'c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_submit_frequency('contest1', 'user1', [{'username': 'user1', 'contest_id': 'contest1', 'submittime': '2023-10-01T10:00:00'}]) == None\", \"assert check_submit_frequency('contest1', 'user1', [{'username': 'user1', 'contest_id': 'contest1', 'submittime':...
{ "split": "train", "index": 66722, "acecode_id": "oss_25833", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You need to implement a function that processes a task record and generates a structured layout in a specific format. The function should take a dictionary representing a task record and return a formatted string that includes the task's name, description, due date, author, ass...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_task_layout({'id': 1, 'name': 'task', 'description': 'description', 'date_due': '2023-10-01', 'modified_by': 'author1', 'pe_id': 'person1', 'status': 'active'}) == 'Task: task, Description: description, Due: 2023-10-01, Author: author1, Assigned To:...
{ "split": "train", "index": 66723, "acecode_id": "bigcode_python_fns_36502", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that calculates the time difference between the current time and a given future time. The function should take a future time in the format 'YYYY-MM-DD HH:MM:SS' and return the time difference in the format 'X days, Y hours, Z minut...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_time_difference('2023-10-15 09:30:00') == '0 days, 1 hours, 0 minutes, 0 seconds'\", \"assert calculate_time_difference('2023-10-16 08:30:00') == '1 days, 0 hours, 0 minutes, 0 seconds'\", \"assert calculate_time_difference('2023-10-20 12:45:30') =...
{ "split": "train", "index": 66724, "acecode_id": "oss_5852", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `get_device_count_by_interface` that returns the number of devices of a specific interface type. The function takes two parameters: an integer `interface_type` representing the type of interface and an optional integer `number_of_devices`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_device_count_by_interface(1, 100) == 75\", \"assert get_device_count_by_interface(2, 100) == 50\", \"assert get_device_count_by_interface(1, 50) == 50\", \"assert get_device_count_by_interface(3, 100) == 0\", \"assert get_device_count_by_interface(2, 0) ...
{ "split": "train", "index": 66725, "acecode_id": "bigcode_python_fns_48531", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves a policy based on its unique identifier (uid) from a simulated policy database. The function should accept a uid and a list of policies, where each policy is represented as a dictionary with keys 'uid', 'holder_name', 'star...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_policy(1, [{'uid': 1, 'holder_name': 'Alice', 'start_date': '2021-01-01', 'end_date': '2022-01-01'}, {'uid': 2, 'holder_name': 'Bob', 'start_date': '2021-02-01', 'end_date': '2022-02-01'}]) == {'uid': 1, 'holder_name': 'Alice', 'start_date': '2021-01-01'...
{ "split": "train", "index": 66726, "acecode_id": "oss_13342", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function `check_dict_case(dct)` that checks if all keys in the given dictionary are either entirely in lowercase or entirely in uppercase. Additionally, the function should verify that all keys exclusively contain letters (i.e., no numbers or special characters). If the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_dict_case({'a': 'apple', 'b': 'banana'}) == True\", \"assert check_dict_case({'A': 'Apple', 'B': 'Banana'}) == True\", \"assert check_dict_case({'a': 'apple', 'B': 'Banana'}) == False\", \"assert check_dict_case({'1': 'one', '2': 'two'}) == False\", \"...
{ "split": "train", "index": 66727, "acecode_id": "evol_5119", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, write a function that returns the pair of integers that have the highest product. If there are multiple pairs with the same highest product, return the first one found in the array. The function should return the pair as a list. If the array has fewe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_prod_pair([1, 5, 2, -7, 3]) == [5, 3]\", \"assert max_prod_pair([0, 2, 3, 0]) == [2, 3]\", \"assert max_prod_pair([9, 1, -1, 2, -3]) == [9, 2]\", \"assert max_prod_pair([2]) == None\", \"assert max_prod_pair([2, 3]) == [2, 3]\", \"assert max_prod_pair([5...
{ "split": "train", "index": 66728, "acecode_id": "evol_4972", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function that processes a list of text inputs and applies a simple entity detection algorithm. The function should take in a list of strings (the corpus) and a threshold value. For each string in the corpus, the function should check if the leng...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_corpus(['hello', 'world', 'this is a long sentence'], 10) == ['SHORT: hello', 'SHORT: world', 'LONG: this is a long sentence']\", \"assert process_corpus(['short', 'tiny'], 5) == ['SHORT: short', 'SHORT: tiny']\", \"assert process_corpus(['a', 'bb', ...
{ "split": "train", "index": 66729, "acecode_id": "bigcode_python_fns_41", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the characteristics of a character in a role-playing game. The function should take two inputs: `purpose` which can either be a string representing the character's purpose or an instance of a class `Purpose` that contai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert character_attributes('Warrior', ['Brave', TraitReference('Skilled')]) == {'purposeReference': 'Warrior', 'appliedTraits': ['Brave', 'Skilled']}\", \"assert character_attributes(Purpose('Mage'), ['Clever', TraitReference('Wise')]) == {'purposeReference': 'Mag...
{ "split": "train", "index": 66730, "acecode_id": "oss_26314", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the retrieval of project data for a specific group in a system. The function should take two parameters: a configuration dictionary that contains a maximum number of projects and a group ID. The function should return a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_projects_in_group({'maxProject': 5}, 1) == [1, 2, 3, 4, 5]\", \"assert get_projects_in_group({'maxProject': 10}, 1) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\", \"assert get_projects_in_group({'maxProject': 0}, 1) == []\", \"assert get_projects_in_group({'maxPr...
{ "split": "train", "index": 66731, "acecode_id": "bigcode_python_fns_16173", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that filters a list of messages based on specific criteria. The function should take in a list of strings called `messages` and return a new list containing only the unique messages that are non-empty and contain at least one alphabetical...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_messages(['Hello', 'World', 'Hello']) == ['Hello', 'World']\", \"assert filter_messages(['123', '456', '789']) == []\", \"assert filter_messages(['', ' ', '']) == []\", \"assert filter_messages(['Hello1', '123abc', 'Foo!', 'Bar']) == ['Hello1', '123...
{ "split": "train", "index": 66732, "acecode_id": "bigcode_python_fns_42069", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that creates a PackedMatrix object based on provided matrix data, the number of input neurons (Ni), and the number of output neurons (Ne). The function should take three parameters: a 2D list 'matrix' representing the mapping m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_packed_matrix([[1, 2], [3, 4]], 2, 2).matrix == [[1, 2], [3, 4]]\", \"assert create_packed_matrix([[1]], 1, 1).Ne == 1\", \"assert create_packed_matrix([[1, 0], [0, 1]], 2, 2).Ni == 2\", \"assert create_packed_matrix([[1, 2, 3], [4, 5, 6]], 3, 2).matr...
{ "split": "train", "index": 66733, "acecode_id": "oss_2139", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers and returns the product of all the integers in the list. If the list is empty, return 1.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block." } ]
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert product([]) == 1\", \"assert product([1]) == 1\", \"assert product([2]) == 2\", \"assert product([1, 2, 3]) == 6\", \"assert product([4, 5]) == 20\", \"assert product([-1, -2, -3]) == -6\", \"assert product([0, 1, 2]) == 0\", \"assert product([1, 0]) == 0\",...
{ "split": "train", "index": 66734, "acecode_id": "evol_10369", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing user responses in a survey system. Implement a function `handle_question(responses: List[str], choice: str) -> Tuple[List[str], bool]` that takes in a list of responses and a user's choice as input. The function should append the choice to the respo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_question([], 'yes') == (['yes'], False)\", \"assert handle_question(['yes'], 'no') == (['yes', 'no'], False)\", \"assert handle_question(['yes', 'no'], 'maybe') == (['yes', 'no', 'maybe'], False)\", \"assert handle_question(['yes', 'no', 'maybe'], 'ye...
{ "split": "train", "index": 66735, "acecode_id": "bigcode_python_fns_3861", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a Python function that removes all duplicate elements from a list while preserving the order of the first occurrence of each unique element. The function should return a new list containing only the unique elements in the order they first appeared. For example, given the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates([2, 4, 2, 8, 4, 8, 2]) == [2, 4, 8]\", \"assert remove_duplicates([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert remove_duplicates([5, 5, 5, 5, 5]) == [5]\", \"assert remove_duplicates([]) == []\", \"assert remove_duplicates([10, 20, 10, 30, ...
{ "split": "train", "index": 66736, "acecode_id": "evol_25161", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `binary_search(arr, target)` that performs a binary search on a sorted list `arr` to find the index of `target`. If `target` is found, return its index; otherwise, return 'Not Found'. The input list `arr` will always be sorted in ascending order.\nPlease re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_search([1, 3, 5, 7, 9], 5) == 2\", \"assert binary_search([1, 3, 5, 7, 9], 1) == 0\", \"assert binary_search([1, 3, 5, 7, 9], 9) == 4\", \"assert binary_search([1, 3, 5, 7, 9], 10) == 'Not Found'\", \"assert binary_search([2, 5, 8, 12, 16, 23, 38, 56,...
{ "split": "train", "index": 66737, "acecode_id": "evol_31924", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the behavior of a robot in a virtual environment based on its sensor readings. The robot's behavior is governed by the following rules: 1. If the front distance sensor detects an obstacle within 5 centimeters (value < 0.05), the robot should spin ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulateRobotBehavior(0.04, 90, False) == ['spin']\", \"assert simulateRobotBehavior(0.06, 75, False) == ['spin', 'move forward']\", \"assert simulateRobotBehavior(0.06, 85, True) == ['report T']\", \"assert simulateRobotBehavior(0.05, 70, False) == ['spin',...
{ "split": "train", "index": 66738, "acecode_id": "oss_11355", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of particle data, where each particle is represented as a dictionary containing its properties such as 'id', 'mass', 'width', and 'name'. Your task is to create a function that takes this list of particle data and returns a dictionary where the keys are the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert organize_particles([{'id': '1', 'mass': [0.511, 0.001, 0.001], 'width': [0.000, 0.000, 0.000], 'name': 'electron', 'charge': '+'}]) == {'electron+': {'id': '1', 'mass': [0.511, 0.001, 0.001], 'width': [0.000, 0.000, 0.000], 'name': 'electron', 'charge': '+'}...
{ "split": "train", "index": 66739, "acecode_id": "bigcode_python_fns_27424", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of a game. Write a function `highest_score(scores: List[int]) -> int` that takes in a list of integers `scores` and returns the highest score achieved in the game. If the list is empty, the function should return 0.\nPlea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert highest_score([10, 5, 8, 12, 7]) == 12\", \"assert highest_score([3, 2, 5, 1, 4]) == 5\", \"assert highest_score([]) == 0\", \"assert highest_score([1, 1, 1, 1]) == 1\", \"assert highest_score([-1, -5, -3]) == -1\", \"assert highest_score([100, 200, 300]) ==...
{ "split": "train", "index": 66740, "acecode_id": "oss_18904", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats a command line string for a build tool. The function should take two inputs: a dictionary of build options and a string of additional options. The function should return a single formatted string that lists the build options ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_command({'opt1': 1, 'opt2': 0}, '--verbose') == 'build_tool opt1=1 opt2=0 --verbose'\", \"assert format_command({'a': 5, 'b': 10}, '--quiet') == 'build_tool a=5 b=10 --quiet'\", \"assert format_command({}, '--help') == 'build_tool --help'\", \"assert ...
{ "split": "train", "index": 66741, "acecode_id": "bigcode_python_fns_23663", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing a signal, write a function `neighbourhood_peaks(signal: List[int], n: int) -> int` that computes the number of peaks in the signal based on a defined neighbourhood. A peak is defined as a value that is greater than its neighbors within the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert neighbourhood_peaks([1, 3, 2, 5, 4], 1) == 2\", \"assert neighbourhood_peaks([1, 2, 3, 4, 5], 1) == 0\", \"assert neighbourhood_peaks([5, 4, 3, 2, 1], 1) == 0\", \"assert neighbourhood_peaks([2, 1, 3, 1, 2], 1) == 1\", \"assert neighbourhood_peaks([10, 20, 1...
{ "split": "train", "index": 66742, "acecode_id": "bigcode_python_fns_44319", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves inbox tasks based on specific filtering criteria for a project management system. Implement a function called `retrieve_inbox_tasks` that takes the following parameters:\n- `source` (string): The source of the inbox tasks.\...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retrieve_inbox_tasks('email', '2023-09-01', '2023-09-30', '123') == [{'source': 'email', 'date': '2023-09-15', 'entity_id': '123', 'task_description': 'Review the design'}]\", \"assert retrieve_inbox_tasks('chat', '2023-10-01', '2023-10-31', '456') == [{'sou...
{ "split": "train", "index": 66743, "acecode_id": "oss_27122", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a string representing a sequence of Pokémon names separated by commas. Write a function that takes this string and returns a list of unique Pokémon names in sorted order. The Pokémon names are case-insensitive. For example, if the input is 'Pikachu, Bulbasaur, Eev...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_sorted_pokemon_names('Pikachu, Bulbasaur, Eevee, Pikachu') == ['Bulbasaur', 'Eevee', 'Pikachu']\", \"assert unique_sorted_pokemon_names('Snorlax, Charmander, Bulbasaur') == ['Bulbasaur', 'Charmander', 'Snorlax']\", \"assert unique_sorted_pokemon_names...
{ "split": "train", "index": 66744, "acecode_id": "bigcode_python_fns_30456", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that filters a list of items based on their published status. Each item is represented as a dictionary with a 'title' key (a string) and a 'publish' key (a boolean). Write a function `filter_published_items(items)` that takes a list o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_published_items([{'title': 'Item 1', 'publish': True}, {'title': 'Item 2', 'publish': False}, {'title': 'Item 3', 'publish': True}]) == ['Item 1', 'Item 3']\", \"assert filter_published_items([{'title': 'Item A', 'publish': False}, {'title': 'Item B',...
{ "split": "train", "index": 66745, "acecode_id": "oss_34368", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, your task is to write a function that finds the maximum sum of any contiguous subsequence within the list. A contiguous subsequence is defined as a sequence of numbers that appear consecutively in the list. If the list is empty, the function should ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_contiguous_sum([1, -3, 4, -2, -1, 6]) == 7\", \"assert max_contiguous_sum([-2, -3, -1]) == -1\", \"assert max_contiguous_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_contiguous_sum([1, 2, 3, 4, 5]) == 15\", \"assert max_contiguous_sum([-1, -2, -3, -4, -5]...
{ "split": "train", "index": 66746, "acecode_id": "oss_24414", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing file paths. Each path contains the name of a file and its directory structure. Your task is to implement a function that returns the total number of unique file names in the list of paths. A file name is considered unique if it appea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_files(['dir1/file1.txt', 'dir1/file2.txt', 'dir1/file3.txt']) == 3\", \"assert count_unique_files(['dir1/file1.txt', 'dir1/file1.txt', 'dir2/file2.txt']) == 1\", \"assert count_unique_files(['file1.txt', 'file2.txt', 'file3.txt']) == 3\", \"asse...
{ "split": "train", "index": 66747, "acecode_id": "bigcode_python_fns_44962", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the IDs of addons. Each addon has a current preview which may or may not have associated colors. Your task is to implement a function `extract_colors(ids: List[int]) -> List[int]` that simulates the extraction of colors for addons t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_colors([1, 2, 3]) == [1, 2, 3]\", \"assert extract_colors([5, 10, 15]) == [5, 10, 15]\", \"assert extract_colors([0]) == [0]\", \"assert extract_colors([]) == []\", \"assert extract_colors([100, 200, 300]) == [100, 200, 300]\", \"assert extract_color...
{ "split": "train", "index": 66748, "acecode_id": "bigcode_python_fns_12944", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the sum of all even numbers in a given list. The function should take in a single parameter: a list of integers. Your goal is to implement the function `sum_of_evens` that returns the sum of all even integers found in the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 15, 20, 25]) == 30\", \"assert sum_of_evens([-2, -4, -6]) == -12\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([0, 1, 2, 3]) == 2\", \"assert sum_of_evens([2, 4, 6, 8]) =...
{ "split": "train", "index": 66749, "acecode_id": "oss_17925", "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 the squares of each integer from the input list. The input list can contain both positive and negative integers. The output list should maintain the same order as the inp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert square_integers([-2, 0, 3]) == [4, 0, 9]\", \"assert square_integers([1, 2, 3]) == [1, 4, 9]\", \"assert square_integers([-1, -2, -3]) == [1, 4, 9]\", \"assert square_integers([0, 0, 0]) == [0, 0, 0]\", \"assert square_integers([5]) == [25]\", \"assert squar...
{ "split": "train", "index": 66750, "acecode_id": "bigcode_python_fns_38261", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the process of voting on arguments in a discussion forum. The function should take in a user ID, an argument ID, and a boolean value indicating whether the user is supporting the argument. The function should update the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert vote_on_argument(1, 101, True) == 'Vote registered'\", \"assert vote_on_argument(1, 101, False) == 'Vote registered'\", \"assert vote_on_argument(1, 102, True) == 'Vote registered'\", \"assert vote_on_argument(2, 101, True) == 'Vote registered'\", \"assert v...
{ "split": "train", "index": 66751, "acecode_id": "bigcode_python_fns_25413", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that parses a given string representing the content of a configuration file and extracts the database URI used by the Neomodel OGM. The configuration string is in a simple key-value format, where each line contains a key and its co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_neo4j_uri('# Configuration file for Neomodel OGM\\\\nNEO4J_URI=bolt://localhost:7687\\\\nUSERNAME=neo4j\\\\nPASSWORD=secret') == 'bolt://localhost:7687'\", \"assert extract_neo4j_uri('NEO4J_URI=') == ''\", \"assert extract_neo4j_uri('USERNAME=neo4j\\...
{ "split": "train", "index": 66752, "acecode_id": "oss_13501", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer user ID, implement a function that returns the associated username as a string. If the user ID does not correspond to any existing username, the function should return None. The function should be named `uid_to_name` and take a single integer parameter `uid`. D...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert uid_to_name(1) == 'alice'\", \"assert uid_to_name(2) == 'bob'\", \"assert uid_to_name(5) == None\", \"assert uid_to_name(8) == None\", \"assert uid_to_name(-1) == None\", \"assert uid_to_name(11) == None\", \"assert uid_to_name(13) == None\", \"assert uid_to...
{ "split": "train", "index": 66753, "acecode_id": "bigcode_python_fns_44263", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `process_list` that returns a new list where each element is the square of the corresponding element in the input list.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_list([1, 4, 6, 8]) == [1, 16, 36, 64]\", \"assert process_list([0, 2, 3]) == [0, 4, 9]\", \"assert process_list([-1, -2, -3]) == [1, 4, 9]\", \"assert process_list([5]) == [25]\", \"assert process_list([]) == []\", \"assert process_list([10, 20, 30])...
{ "split": "train", "index": 66754, "acecode_id": "evol_20265", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a leader election process in a distributed system. Implement a function `get_new_leader(current_leader: str, failed_leader: str, candidates: List[str]) -> str` that determines the new leader after the current leader fails. The function should take...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_new_leader('LeaderA', 'LeaderA', ['LeaderB', 'LeaderC']) == 'LeaderB'\", \"assert get_new_leader('LeaderA', 'LeaderA', ['LeaderA', 'LeaderA', 'LeaderA']) == 'None'\", \"assert get_new_leader('LeaderA', 'LeaderC', ['LeaderA', 'LeaderB', 'LeaderC']) == 'Le...
{ "split": "train", "index": 66755, "acecode_id": "bigcode_python_fns_3540", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing user preferences in a web application. Write a function `get_user_language` that takes in an object `user` and returns the preferred language of the user. The `user` object may have an attribute `language` that stores the user's preferred language. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_user_language({'language': 'fr'}) == 'fr'\", \"assert get_user_language({'language': 'es'}) == 'es'\", \"assert get_user_language({}) == 'en'\", \"assert get_user_language({'language': 'de'}) == 'de'\", \"assert get_user_language({'language': 'zh'}) == '...
{ "split": "train", "index": 66756, "acecode_id": "oss_17644", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary contains information about an object with various attributes. Your task is to implement a function that takes three parameters: a list of dictionaries `data`, a string `key`, and a string `value`. The function should r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_values([{'name': 'Alice', 'age': 30}, {'name': 'Bob', 'age': 25}, {'name': 'Alice', 'age': 22}], 'name', 'Alice') == ['Alice', 'Alice']\", \"assert filter_values([{'name': 'Eve', 'age': 35}, {'name': 'Alice', 'age': 30}, {'name': 'Bob', 'age': 25}], '...
{ "split": "train", "index": 66757, "acecode_id": "bigcode_python_fns_29841", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that returns a user's ID. The function should take no parameters and return a dictionary containing a single key-value pair. The key should be 'userid' and the value should be a hardcoded integer representing the user ID. Your function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_user_id() == {'userid': 1}\", \"assert get_user_id() == {'userid': 1}\", \"assert get_user_id() == {'userid': 1}\", \"assert get_user_id() == {'userid': 1}\", \"assert get_user_id() == {'userid': 1}\", \"assert get_user_id() == {'userid': 1}\", \"assert ...
{ "split": "train", "index": 66758, "acecode_id": "oss_29592", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a custom admin interface for managing grades of students in a school. The school has multiple classes, and each class has a set of grades for different subjects. The grades are stored in a model called `NotasAulas`, which has the following fields: `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_admin_interface() == {'list_display': ['student', 'subject', 'grade'], 'list_filter': ['student', 'subject'], 'search_fields': ['student__name', 'subject__name'], 'list_per_page': 20}\", \"assert create_admin_interface()['list_display'] == ['student',...
{ "split": "train", "index": 66759, "acecode_id": "oss_34940", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates dealing cards from a standard deck of playing cards. The deck consists of 52 unique cards, each represented by a combination of a suit (Hearts, Diamonds, Clubs, Spades) and a value (2 through 10, Jack, Queen, King, Ace)...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert deal_cards(1) == ['2 of Hearts']\", \"assert deal_cards(2) == ['2 of Hearts', '3 of Hearts']\", \"assert deal_cards(5) == ['2 of Hearts', '3 of Hearts', '4 of Hearts', '5 of Hearts', '6 of Hearts']\", \"assert deal_cards(10) == ['2 of Hearts', '3 of Hearts',...
{ "split": "train", "index": 66760, "acecode_id": "oss_19733", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `filter_and_sort_numbers(nums: List[int]) -> List[int]` that filters out all numbers greater than or equal to a specific threshold (let's say 10) and sorts the remaining numbers in descending order. The function should return the sorte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_and_sort_numbers([1, 2, 3, 10, 11]) == [3, 2, 1]\", \"assert filter_and_sort_numbers([20, 30, 40]) == []\", \"assert filter_and_sort_numbers([5, 9, 7, 2, 0]) == [9, 7, 5, 2, 0]\", \"assert filter_and_sort_numbers([10, 15, 9, 8, 2]) == [9, 8, 2]\", \"a...
{ "split": "train", "index": 66761, "acecode_id": "bigcode_python_fns_21577", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function `animal_talk(animal_type: str) -> str` that takes a string representing the type of animal ('Dog' or 'Cat') and returns the sound that the animal makes. If the input is 'Dog', the function should return 'Woof! Woof!'. If the input is 'Cat', the function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert animal_talk('Dog') == 'Woof! Woof!'\", \"assert animal_talk('Cat') == 'Meow! Meow!'\", \"assert animal_talk('Bird') == 'Unknown animal'\", \"assert animal_talk('') == 'Unknown animal'\", \"assert animal_talk('Dog ') == 'Unknown animal'\", \"assert animal_tal...
{ "split": "train", "index": 66762, "acecode_id": "evol_30740", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing altitudes in kilometers. Your task is to implement a function that computes a new list containing only the altitudes that are greater than or equal to a specified threshold altitude. The input list should remain unchanged. Write a f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_high_altitudes([86, 100, 150, 200], 100) == [100, 150, 200]\", \"assert filter_high_altitudes([1000, 900, 800, 700], 850) == [900, 1000]\", \"assert filter_high_altitudes([50, 60, 70], 80) == []\", \"assert filter_high_altitudes([0, 1, 2, 3, 4, 5], 3)...
{ "split": "train", "index": 66763, "acecode_id": "bigcode_python_fns_37257", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of edges representing a graph, where each edge is defined by a pair of nodes. Your task is to calculate the lengths of all edges in the graph based on given coordinates for each node. The length of an edge is defined as the Euclidean distance between the tw...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_edge_lengths([(0, 1)], [(0.0, 0.0), (3.0, 4.0)]) == [5.0]\", \"assert calculate_edge_lengths([(0, 1), (1, 2)], [(0.0, 0.0), (3.0, 4.0), (6.0, 8.0)]) == [5.0, 5.0]\", \"assert calculate_edge_lengths([(0, 1)], [(0.0, 0.0), (0.0, 0.0)]) == [0.0]\", \"...
{ "split": "train", "index": 66764, "acecode_id": "bigcode_python_fns_7282", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given two IP addresses, `victim_ip` and `gate_ip`, and one MAC address `mac_address`. Write a function `trick_them(victim_ip: str, gate_ip: str, mac_address: str) -> List[str]` that simulates the process of sending ARP packets to make the victim believe that the attacke...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert trick_them('192.168.1.2', '192.168.1.1', '00:11:22:33:44:55') == ['ARP(op=2, pdst=192.168.1.2, psrc=192.168.1.1, hwdst=00:11:22:33:44:55)', 'ARP(op=2, pdst=192.168.1.1, psrc=192.168.1.2, hwdst=00:11:22:33:44:55)']\", \"assert trick_them('10.0.0.5', '10.0.0.1...
{ "split": "train", "index": 66765, "acecode_id": "bigcode_python_fns_24942", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function to calculate the Fibonacci number for both positive and negative integers using memoization for optimization. The function should be able to handle large numbers efficiently. Given an integer n, return the nth Fibonacci number, where the Fibonacci se...
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": 66766, "acecode_id": "evol_14169", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the process of generating a bootstrap command for initializing a Ceph cluster. The function should accept a configuration dictionary containing options for the bootstrap process, including the image to use (defaulting t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_bootstrap_command({'image': 'ceph/ceph:v15', 'options': ['--mon-ip', '192.168.1.1']}) == 'cephadm bootstrap ceph/ceph:v15 --mon-ip 192.168.1.1'\", \"assert generate_bootstrap_command({'image': 'ceph/ceph:v14', 'options': []}) == 'cephadm bootstrap c...
{ "split": "train", "index": 66767, "acecode_id": "oss_19432", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of file paths, each represented as strings, and a list of video file extensions. Your task is to create a new list that contains only the file paths that end with one of the specified video file extensions. Write a function `filter_video_files(file_paths: L...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_video_files(['video1.mp4', 'video2.avi', 'document.pdf', 'image.png'], ['.mp4', '.avi']) == ['video1.mp4', 'video2.avi']\", \"assert filter_video_files(['file1.MXF', 'file2.mov', 'file3.mp4', 'file4.AVI'], ['.mxf', '.mov', '.mp4', '.avi']) == ['file1....
{ "split": "train", "index": 66768, "acecode_id": "bigcode_python_fns_67", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a 2D array as input and returns the transposed array. The function should be able to handle non-square arrays and arrays with mixed data types. Additionally, the function should raise an error for non-array inputs. Your function should correctly tran...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transpose([[1, 2, 5], ['a', 'b', 'c'], [True, False, None]]) == [[1, 'a', True], [2, 'b', False], [5, 'c', None]]\", \"assert transpose([[1, 2], [3, 4], [5, 6]]) == [[1, 3, 5], [2, 4, 6]]\", \"assert transpose([['row1', 'row2'], ['col1', 'col2']]) == [['row1...
{ "split": "train", "index": 66769, "acecode_id": "evol_2354", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that counts the occurrences of a specific keyword in a given string that represents Python code. The function should take two parameters: a string 'code' which contains the contents of a Python file, and a string 'keyword' which is the ke...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_keyword('def hello():\\\\n pass\\\\ndef world():\\\\n pass', 'def') == 2\", \"assert count_keyword('class Test:\\\\n def method():\\\\n return True', 'def') == 1\", \"assert count_keyword('print(\\\"Hello World\\\")', 'def') == 0\", \"a...
{ "split": "train", "index": 66770, "acecode_id": "oss_6047", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a K-ary tree, your task is to implement a function `level_order_traversal(tree)` that performs a level order traversal of the tree and returns a list of strings where each string represents the values of the nodes at that level, separated by spaces. The K-ary tree is defi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert level_order_traversal(KTree(Node(1))) == ['1']\", \"assert level_order_traversal(KTree(Node(1, [Node(2), Node(3)]))) == ['1', '2 3']\", \"assert level_order_traversal(KTree(Node(1, [Node(2), Node(3, [Node(4), Node(5)])]))) == ['1', '2 3', '4 5']\", \"assert ...
{ "split": "train", "index": 66771, "acecode_id": "bigcode_python_fns_44562", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of file paths and extracts specific information from each path. The function should extract the repository name, the file type, and the loss functions imported from each file. The file paths are formatted as f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_info(['RepoA/type1_loss1.py', 'RepoA/type2_loss2,loss3.py']) == {'RepoA': ('type2', ['loss2', 'loss3'])}\", \"assert extract_info(['RepoB/typeA_lossX.py', 'RepoB/typeB_lossY.py']) == {'RepoB': ('typeB', ['lossY'])}\", \"assert extract_info(['RepoJ/ty...
{ "split": "train", "index": 66772, "acecode_id": "oss_23494", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called 'HOURGLASS' that takes an integer 'x' and a list of integers 'shorten_factors'. The function should modify the input value 'x' by iteratively dividing it by each factor in 'shorten_factors' if 'x' is divisible by that factor. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert HOURGLASS(30, [3, 5, 2]) == 1\", \"assert HOURGLASS(60, [2, 3, 5]) == 1\", \"assert HOURGLASS(50, [5, 10]) == 1\", \"assert HOURGLASS(18, [3, 2]) == 1\", \"assert HOURGLASS(81, [3, 9]) == 1\", \"assert HOURGLASS(1, [2, 3]) == 1\", \"assert HOURGLASS(64, [4, ...
{ "split": "train", "index": 66773, "acecode_id": "oss_11264", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple bank account using a function. The bank account starts with an initial balance of 0 and an initial transaction count of 0. You need to implement a function `bank_account_operations(operations: List[Tuple[str, float]]) -> Tuple[float, int]...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_account_operations([('deposit', 100.0)]) == (100.0, 1)\", \"assert bank_account_operations([('deposit', 50.0), ('withdraw', 30.0)]) == (20.0, 2)\", \"assert bank_account_operations([('withdraw', 50.0)]) == (0.0, 0)\", \"assert bank_account_operations([(...
{ "split": "train", "index": 66774, "acecode_id": "oss_7111", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of images represented as tuples of their dimensions (height, width). Your task is to implement a function that takes in two lists of images and a target size (height, width). The function should return a list of tuples where each tuple represents the dim...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert center_crop([(300, 400), (200, 200)], [(250, 250), (300, 300)], (250, 250)) == [(250, 250), (200, 200)]\", \"assert center_crop([(800, 1000)], [(900, 800)], (400, 400)) == [(400, 400)]\", \"assert center_crop([(500, 500)], [(500, 500)], (600, 600)) == [(500,...
{ "split": "train", "index": 66775, "acecode_id": "bigcode_python_fns_49395", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a given string of base64 encoded content and returns the decoded string. The function should take three parameters: 'contents', 'file_name', and 'date'. The 'contents' parameter is a string that can be either None or a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decode_base64_content('data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==', 'greeting.txt', '2023-10-01') == ('Hello, World!', 'greeting.txt is loaded')\", \"assert decode_base64_content(None, 'empty.txt', '2023-10-01') == ('No file is loaded yet', '')\", \"assert ...
{ "split": "train", "index": 66776, "acecode_id": "bigcode_python_fns_48478", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `search_lexicon(lexicon: Dict[str, str], term: str) -> List[str]` that searches through a given lexicon, which is a dictionary mapping keytypes to their explanations. The function should return a list of keytypes that either contain the search term in their...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_lexicon({'key1': 'This is explanation for key1', 'key2': 'This is explanation for key2'}, 'key') == ['key1', 'key2']\", \"assert search_lexicon({'key1': 'This is explanation for key1', 'key2': 'This is explanation for key2'}, 'explanation') == ['key1'...
{ "split": "train", "index": 66777, "acecode_id": "evol_32499", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of colors represented by strings, where each color may appear multiple times. Your task is to write a function that takes this list as input and returns a dictionary containing the frequency of each color in the list. The keys of the dictionary should be th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_colors(['red', 'blue', 'green', 'red', 'blue', 'blue']) == {'red': 2, 'blue': 3, 'green': 1}\", \"assert count_colors(['yellow', 'yellow', 'yellow']) == {'yellow': 3}\", \"assert count_colors(['cyan', 'magenta', 'cyan', 'black']) == {'cyan': 2, 'magent...
{ "split": "train", "index": 66778, "acecode_id": "oss_11962", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that generates a 3D hollow cube representation using pound signs (#) based on a specified edge length. The cube should be represented in a 2D format where only the borders of the cube are drawn with pound signs, and the interior is left blank. The function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_hollow_cube(1) == ['#']\", \"assert generate_hollow_cube(3) == ['###', '# #', '###']\", \"assert generate_hollow_cube(4) == ['####', '# #', '# #', '####']\", \"assert generate_hollow_cube(5) == ['#####', '# #', '# #', '# #', '#####']\", \"as...
{ "split": "train", "index": 66779, "acecode_id": "evol_32194", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Write a function `is_symmetric(num: int) -> bool` that checks if the given integer `num` is a symmetric number. A symmetric number is one that reads the same backward as forward. For example, 12321 and 45654 are symmetric numbers, while 12345 is not. Your function should return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_symmetric(12321) == True\", \"assert is_symmetric(45654) == True\", \"assert is_symmetric(12345) == False\", \"assert is_symmetric(1) == True\", \"assert is_symmetric(22) == True\", \"assert is_symmetric(1234321) == True\", \"assert is_symmetric(98789) ==...
{ "split": "train", "index": 66780, "acecode_id": "evol_3453", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a configuration dictionary for a machine learning model and returns a string summarizing the main configuration settings. The configuration dictionary contains keys such as 'learning_rate', 'optimizer', and 'batch_size'. Yo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert summarize_configuration({'learning_rate': 0.01, 'optimizer': 'adam', 'batch_size': 32}) == 'Learning Rate: 0.01, Optimizer: adam, Batch Size: 32'\", \"assert summarize_configuration({'learning_rate': 0.001, 'optimizer': 'sgd', 'batch_size': 64}) == 'Learning...
{ "split": "train", "index": 66781, "acecode_id": "oss_23415", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `browse_media(media_content_type: str, media_content_id: str, can_play_artist: bool = True) -> List[str]` that simulates browsing media content based on its type and ID. The function should take the following parameters: \n1. `media_conte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert browse_media('album', '123') == ['Browsing album with ID 123', 'Artist can be played: True']\", \"assert browse_media('playlist', '456') == ['Browsing playlist with ID 456', 'Artist can be played: True']\", \"assert browse_media('track', '789') == ['Browsing...
{ "split": "train", "index": 66782, "acecode_id": "bigcode_python_fns_17020", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a file path. Your task is to implement a function that checks if the path is valid. A valid path is defined as follows: it should not be empty, and it should not contain any illegal characters, which are defined as: '*', '?', '<', '>', '|', '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_path('/home/user/file') == True\", \"assert is_valid_path('') == False\", \"assert is_valid_path('C:/Invalid*Path/file.txt') == False\", \"assert is_valid_path('C:/Invalid?Path/file.txt') == False\", \"assert is_valid_path('C:/Invalid<Path/file.txt'...
{ "split": "train", "index": 66783, "acecode_id": "bigcode_python_fns_13647", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a string `name`, which represents the name of an anime, and a dictionary `new`, which contains new information about the anime. The keys in the dictionary may start with the prefix 'new_'. Your task is to create a function `update_anime_info(name: str, new: dict) ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_anime_info('Naruto', {'new_genre': 'Action', 'new_year': 2002}) == {'genre': 'Action', 'year': 2002}\", \"assert update_anime_info('One Piece', {'new_episodes': 100, 'new_rating': 8.5}) == {'episodes': 100, 'rating': 8.5}\", \"assert update_anime_info...
{ "split": "train", "index": 66784, "acecode_id": "bigcode_python_fns_33558", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of time points represented as floats, and two values tmin and tmax that define a time range. Your task is to implement a function that crops the list of time points to only include the points that fall within the inclusive range [tmin, tmax]. If tmin is gre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert crop_time_points([0.0, 0.5, 1.0, 1.5, 2.0], 0.0, 1.0) == [0.0, 0.5, 1.0]\", \"assert crop_time_points([0.0, 0.5, 1.0, 1.5, 2.0], 1.0, 1.5) == [1.0, 1.5]\", \"assert crop_time_points([0.0, 0.5, 1.0, 1.5, 2.0], 2.0, 3.0) == [2.0]\", \"assert crop_time_points([...
{ "split": "train", "index": 66785, "acecode_id": "bigcode_python_fns_46916", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of datetime objects, `datetimes` and `_datetimes`. Your task is to implement a function that checks if all datetime objects in the `datetimes` list fall within the minimum and maximum datetime values of the `_datetimes` list. If any datetime in `datetime...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_bounds([datetime(2022, 1, 1), datetime(2022, 1, 2)], [datetime(2021, 12, 31), datetime(2022, 1, 3)]) == True\", \"assert check_bounds([datetime(2021, 12, 31)], [datetime(2021, 12, 31), datetime(2022, 1, 3)]) == True\", \"assert check_bounds([datetime(2...
{ "split": "train", "index": 66786, "acecode_id": "bigcode_python_fns_9685", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function called `cycpattern_check` that takes two string arguments, `a` and `b`. The function should determine if the string `b` or any of its cyclic permutations appear as a contiguous subsequence within the string `a`. The comparison should be case insensitive, an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cycpattern_check('AbcD', 'aBd') == False\", \"assert cycpattern_check('Hello', 'ELl') == True\", \"assert cycpattern_check('Whas$sup', 'pSUs') == False\", \"assert cycpattern_check('aB!ab', 'BAa') == True\", \"assert cycpattern_check('EfEF', 'EeFf') == False...
{ "split": "train", "index": 66787, "acecode_id": "evol_35713", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `validate_strings(s1: str, s2: str, s3: str) -> Tuple[str, str, str]` that validates three input strings: s1, s2, and s3 based on specific rules. The function should return a tuple containing the validation results for each string in the order (s1, s2, s3). The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_strings('Cheers!2021', 'Code_42', 'Welcome_2022') == ('Valid', 'Valid', 'Valid')\", \"assert validate_strings('Cheers2021', 'Code42', 'Welcome_2022') == ('Invalid', 'Invalid', 'Valid')\", \"assert validate_strings('Cheers!2021', 'C_42', 'Welcome_202...
{ "split": "train", "index": 66788, "acecode_id": "evol_33231", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of a series of bars in a histogram. Your task is to write a function that calculates the area of the largest rectangle that can be formed within the histogram. The rectangle's height is determined by the shortest bar wit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert largest_rectangle_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert largest_rectangle_area([1]) == 1\", \"assert largest_rectangle_area([1, 1, 1, 1]) == 4\", \"assert largest_rectangle_area([0, 2, 0]) == 2\", \"assert largest_rectangle_area([1, 3, 2, 1, 2]) == 5\",...
{ "split": "train", "index": 66789, "acecode_id": "oss_22674", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a string s composed only of uppercase English alphabets without any special characters, examine its balance. A balanced string satisfies these conditions: 1. It has a minimum length of 8. 2. Distinctiveness characterizes every eight consecutive characters. 3. All unique c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert isBalancedString('A') == False\", \"assert isBalancedString('AA') == False\", \"assert isBalancedString('ABCDEFGH') == False\", \"assert isBalancedString('ADBBCCDA') == False\", \"assert isBalancedString('XYYZYZYX') == False\", \"assert isBalancedString('ABC...
{ "split": "train", "index": 66790, "acecode_id": "evol_1172", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the retrieval of data from a data source. The function should accept a boolean parameter `preload`, which indicates whether to preload data or not. If `preload` is True, the function should return a dictionary with a ke...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_data(True) == {'status': 'loaded', 'data_count': 100}\", \"assert get_data(False) == {'status': 'not loaded', 'data_count': 0}\", \"assert get_data(True)['status'] == 'loaded'\", \"assert get_data(True)['data_count'] == 100\", \"assert get_data(False)['s...
{ "split": "train", "index": 66791, "acecode_id": "bigcode_python_fns_37856", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary that represents a configuration containing two sections: 'profiles' and 'layouts'. Each section is another dictionary where the keys are strings representing the names of profiles and layouts. Your task is to implement a function that removes all entr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_autobash_sections({'profiles': {'autobash-user1': {}, 'user2': {}}, 'layouts': {'layout1': {}, 'autobash-layout': {}}}) == {'profiles': {'user2': {}}, 'layouts': {'layout1': {}}}\", \"assert remove_autobash_sections({'profiles': {}, 'layouts': {}}) ==...
{ "split": "train", "index": 66792, "acecode_id": "bigcode_python_fns_4279", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that aggregates predictions from multiple models for a binary classification task. Each model produces a prediction score for a given instance, and you need to combine these scores to produce a final prediction. Implement the function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert aggregate_predictions([0.8, 0.6, 0.9], 3, threshold=0.75, aggregation_type='mean') == 1\", \"assert aggregate_predictions([0.2, 0.3, 0.4], 3, threshold=0.35, aggregation_type='median') == 0\", \"assert aggregate_predictions([0.5, 0.5, 0.5], 3, threshold=0.5,...
{ "split": "train", "index": 66793, "acecode_id": "bigcode_python_fns_40961", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple banking system. The function should accept an account holder's name and a series of transactions represented as a list of tuples. Each tuple contains a transaction type ('deposit' or 'withdraw') and the amount. You...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert final_balance('John Doe', [('deposit', 1000), ('withdraw', 500)]) == 500\", \"assert final_balance('Jane Smith', [('deposit', 200), ('withdraw', 300)]) == 200\", \"assert final_balance('Alice', [('deposit', 100), ('withdraw', 50), ('withdraw', 60)]) == 50\",...
{ "split": "train", "index": 66794, "acecode_id": "oss_11403", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `convert_minutes(minutes: int) -> str` that takes an integer `minutes` representing a quantity of minutes and converts it into a string that denotes the equivalent time in years, days, hours, and minutes. The string format should be 'Years: X, Days: Y, Hours: Z...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_minutes(0) == 'Years: 0, Days: 0, Hours: 0, Minutes: 0'\", \"assert convert_minutes(60) == 'Years: 0, Days: 0, Hours: 1, Minutes: 0'\", \"assert convert_minutes(1440) == 'Years: 0, Days: 1, Hours: 0, Minutes: 0'\", \"assert convert_minutes(525600) ==...
{ "split": "train", "index": 66795, "acecode_id": "evol_25101", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function called `add_numbers` that takes two integers as arguments and returns their sum. The function should be callable, meaning that you can use parentheses to invoke it directly. It should also handle cases where the input is not an integer by raising a `ValueEr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_numbers(1, 2) == 3\", \"assert add_numbers(0, 0) == 0\", \"assert add_numbers(-1, 1) == 0\", \"assert add_numbers(100, 200) == 300\", \"assert add_numbers(-50, -50) == -100\", \"assert add_numbers(3, 7) == 10\", \"assert add_numbers(10, 5) == 15\", \"ass...
{ "split": "train", "index": 66796, "acecode_id": "evol_16341", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a rate-limiting mechanism for a hypothetical API client. The function `rate_limit_simulation` takes two parameters: `request_count`, an integer representing the number of requests made to the API, and `time_window`, an ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rate_limit_simulation(10, 900) == False\", \"assert rate_limit_simulation(15, 900) == False\", \"assert rate_limit_simulation(16, 900) == True\", \"assert rate_limit_simulation(14, 900) == False\", \"assert rate_limit_simulation(20, 900) == True\", \"assert ...
{ "split": "train", "index": 66797, "acecode_id": "oss_34669", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries representing student records, where each dictionary contains various attributes of a student such as 'name', 'age', and 'grades'. Your task is to write a function that sorts the list of student records based on the following criteria: first ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_student_records([{'name': 'Alice', 'age': 25, 'grades': [90, 92]}, {'name': 'Bob', 'age': 23, 'grades': [85, 87]}]) == [{'name': 'Alice', 'age': 25, 'grades': [90, 92]}, {'name': 'Bob', 'age': 23, 'grades': [85, 87]}]\", \"assert sort_student_records([{...
{ "split": "train", "index": 66798, "acecode_id": "bigcode_python_fns_38861", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Create a function `create_book(title: str, pages: int, price: float) -> dict` that takes in a title of the book (a string), the number of pages (an integer), and the price of the book (a float). The function should return a dictionary with the keys 'title', 'pages', and 'price'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_book('Python Programming', 300, 29.99) == {'title': 'Python Programming', 'pages': 300, 'price': 29.99}\", \"assert create_book('Data Structures', 400, 39.50) == {'title': 'Data Structures', 'pages': 400, 'price': 39.50}\", \"assert create_book('Machi...
{ "split": "train", "index": 66799, "acecode_id": "evol_3884", "num_tests": 16 }