data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `create_workflow` that simulates the creation of a workflow from a specified JSON configuration. The function should accept the following parameters: \n\n1. `name` (str): The name of the workflow, which should not be a valid UUID version ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_workflow('my_workflow', 'valid_token', {'key': 'value'}, None, 'yadage', None) == {'workflow': {'specification': {'key': 'value'}, 'type': 'yadage'}, 'inputs': None, 'outputs': None}\", \"assert create_workflow('my_workflow', 'valid_token', {'steps': ... | {
"split": "train",
"index": 62400,
"acecode_id": "bigcode_python_fns_43131",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a JSON object that represents an alert, which contains an 'alert_id' and additional attributes. Your task is to create a function `process_alert(p_json: dict) -> str` that processes this alert and returns a string message indicating whether the alert is new or if ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_alert({'alert_id': '12345'}) == 'New alert processed with ID: 12345'\", \"assert process_alert({'alert_id': '54321'}) == 'New alert processed with ID: 54321'\", \"assert process_alert({'alert_id': '33333'}) == 'Alert with ID: 33333 already exists.'\"... | {
"split": "train",
"index": 62401,
"acecode_id": "bigcode_python_fns_32879",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `generate_warning_message(port: int) -> str` that takes an integer `port` as input and returns a warning message indicating that an application should be run on that specific port. The format of the message should be 'Run an application o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_warning_message(8080) == 'Run an application on the port 8080 to start tunneling.'\", \"assert generate_warning_message(3000) == 'Run an application on the port 3000 to start tunneling.'\", \"assert generate_warning_message(5000) == 'Run an applicat... | {
"split": "train",
"index": 62402,
"acecode_id": "bigcode_python_fns_33221",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing timeline data for a file management application. Implement a function `save_timeline_columns(case_name: str, column_names: List[str]) -> Dict[str, List[str]]` that takes in a case name and a list of column names, and returns a dictionary where the k... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert save_timeline_columns('Case1', ['Column1', 'Column2']) == {'Case1': ['Column1', 'Column2']}\", \"assert save_timeline_columns('Case2', ['ColumnA', 'ColumnB', 'ColumnC']) == {'Case2': ['ColumnA', 'ColumnB', 'ColumnC']}\", \"assert save_timeline_columns('Case1... | {
"split": "train",
"index": 62403,
"acecode_id": "oss_7022",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that extracts the username and repository name from a given GitHub repository URL. The URL follows the format 'https://github.com/<username>/<reponame>'. Your function should take a string representing a GitHub repository URL as input and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extractRepoInfo('https://github.com/stalkermustang/catalyst') == ('stalkermustang', 'catalyst')\", \"assert extractRepoInfo('https://github.com/user123/repo456') == ('user123', 'repo456')\", \"assert extractRepoInfo('https://github.com/invalid-url') == None\... | {
"split": "train",
"index": 62404,
"acecode_id": "oss_34211",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating the movement of a vehicle's axles based on given parameters. Your function should calculate the new locations of all axles after a movement in a specified direction (either 'rtl' for right to left or 'ltr' for left to right). The function should t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_vehicle_movement(100, 5, 'ltr') == [0, 100, 200, 300, 400]\", \"assert simulate_vehicle_movement(30, 4, 'ltr') == [0, 30, 60, 90]\", \"assert simulate_vehicle_movement(20, 2, 'ltr') == [0, 20]\", \"assert simulate_vehicle_movement(200, 3, 'ltr') == ... | {
"split": "train",
"index": 62405,
"acecode_id": "oss_35289",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating a date range based on the first and last dates in a given dataset represented as a list of timestamps. Implement a function `generate_date_range(dates: List[str], DELTA: int, STEP: int) -> List[str]` that takes the following parameters: \n1. `date... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_date_range(['2023-01-01', '2023-01-02'], 1, 1) == ['2023-01-01']\", \"assert generate_date_range(['2023-01-01', '2023-01-10', '2023-01-15'], 5, 5) == ['2023-01-01', '2023-01-06']\", \"assert generate_date_range(['2023-01-01', '2023-01-07', '2023-01-... | {
"split": "train",
"index": 62406,
"acecode_id": "oss_36441",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "Implement a function `greet(name: str) -> str` that returns a greeting based on the input name. If the input is 'John', the function should return 'Welcome!'. If the input is 'Caroline', it should return 'Goodbye!'. For any other name, the function should return 'Hello, Guest!'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert greet('John') == 'Welcome!'\", \"assert greet('Caroline') == 'Goodbye!'\", \"assert greet('Alice') == 'Hello, Guest!'\", \"assert greet('Bob') == 'Hello, Guest!'\", \"assert greet('Charlie') == 'Hello, Guest!'\", \"assert greet('David') == 'Hello, Guest!'\",... | {
"split": "train",
"index": 62407,
"acecode_id": "evol_22507",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the process of encoding an image's metadata for upload to an image hosting service. The function should take five parameters: a base64 encoded string of the image data, an album identifier, a name for the image, a title for... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert upload_image('iVBORw0KGgoAAAANSUhEUgAAAAUA...', 'album123', 'test_image', 'My Image', 'This is a test image.') == {'image': 'iVBORw0KGgoAAAANSUhEUgAAAAUA...', 'album': 'album123', 'type': 'base64', 'name': 'test_image', 'title': 'My Image', 'description': 'T... | {
"split": "train",
"index": 62408,
"acecode_id": "bigcode_python_fns_15684",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `get_book_info` that takes in five parameters: `title` (string), `author` (string), `publication_year` (integer), `genre` (string), and `pages` (integer). The function should return a dictionary containing the book's details with keys 'title', 'autho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_book_info('1984', 'George Orwell', 1949, 'Dystopian', 328) == {'title': '1984', 'author': 'George Orwell', 'publication_year': 1949, 'genre': 'Dystopian', 'pages': 328}\", \"assert get_book_info('To Kill a Mockingbird', 'Harper Lee', 1960, 'Fiction', 281... | {
"split": "train",
"index": 62409,
"acecode_id": "evol_8896",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that analyzes a dictionary containing information about target applications and their maximum versions. Write a function `analyze_target_apps` that takes a dictionary `target_apps` as input and returns a tuple of boolean values repres... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert analyze_target_apps({'android': {'max': '10'}, 'firefox': {'max': '80'}, 'detected_type': 'theme'}) == (True, True, True, False)\", \"assert analyze_target_apps({'android': {'max': '5'}, 'firefox': {'max': '90'}, 'detected_type': 'extension'}) == (True, True... | {
"split": "train",
"index": 62410,
"acecode_id": "oss_3886",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that removes all duplicate integers from the list while maintaining the order of the first occurrence of each integer. The function should return a new list containing only the unique integers. Write a funct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert remove_duplicates([4, 5, 6, 4, 5, 6]) == [4, 5, 6]\", \"assert remove_duplicates([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert remove_duplicates([7, 8, 8, 9, 7, 10]) == [7, 8, 9, 10]\", \... | {
"split": "train",
"index": 62411,
"acecode_id": "bigcode_python_fns_2987",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with developing a function that processes a list of integers representing video frame data. The function should take in a list of integers and return a new list where each integer is doubled. The function should handle an empty list and should return an empty lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_video_frames([]) == []\", \"assert process_video_frames([1, 2, 3]) == [2, 4, 6]\", \"assert process_video_frames([-1, -2, -3]) == [-2, -4, -6]\", \"assert process_video_frames([0]) == [0]\", \"assert process_video_frames([5]) == [10]\", \"assert proc... | {
"split": "train",
"index": 62412,
"acecode_id": "oss_17083",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of coordinates representing the vertices of a polygon in the form of tuples, implement a function `create_polygon` that takes the list of coordinates and returns a string representation of the polygon. The polygon is defined by the vertices in the order they are gi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_polygon([(0, 0), (1, 0), (1, 1), (0, 1)]) == 'Polygon with vertices: [(0, 0), (1, 0), (1, 1), (0, 1)]'\", \"assert create_polygon([(1, 2), (3, 4), (5, 6)]) == 'Polygon with vertices: [(1, 2), (3, 4), (5, 6)]'\", \"assert create_polygon([(0, 1), (2, 3)... | {
"split": "train",
"index": 62413,
"acecode_id": "bigcode_python_fns_17746",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer number, implement a function that determines if the number is even or odd. The function should return the string 'Even' if the number is even and 'Odd' if the number is odd.\nPlease reason step by step, then write a self-contained Python solution. Give your fin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert determine_even_odd(0) == 'Even'\", \"assert determine_even_odd(1) == 'Odd'\", \"assert determine_even_odd(2) == 'Even'\", \"assert determine_even_odd(-1) == 'Odd'\", \"assert determine_even_odd(-2) == 'Even'\", \"assert determine_even_odd(100) == 'Even'\", \... | {
"split": "train",
"index": 62414,
"acecode_id": "evol_6619",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function named `get_and_store_events` that simulates retrieving events from a server and storing them in a queue. The function should accept two parameters: `amp_client_opts`, a dictionary containing options for the client, and `query_params`,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_and_store_events({'client_id': '123', 'client_secret': 'abc'}, {'event_type': 'malware'}) == {'success': True, 'message': 'Events retrieved successfully'}\", \"assert get_and_store_events({'client_id': '123', 'client_secret': 'abc'}, {'event_type': 'phis... | {
"split": "train",
"index": 62415,
"acecode_id": "oss_28104",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `tile_list` that takes a list `nums`, an integer `count`, and an integer `dim`. The function should create a new list by repeating the elements of `nums` along the specified dimension `dim` for `count` times. If `dim` is 0, it should r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert tile_list([1, 2, 3], 2, 0) == [1, 2, 3, 1, 2, 3]\", \"assert tile_list([1, 2, 3], 3, 0) == [1, 2, 3, 1, 2, 3, 1, 2, 3]\", \"assert tile_list([1, 2, 3], 2, 1) == [1, 1, 2, 2, 3, 3]\", \"assert tile_list([], 3, 0) == []\", \"assert tile_list([10], 5, 0) == [10... | {
"split": "train",
"index": 62416,
"acecode_id": "bigcode_python_fns_40123",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of tuples, where each tuple contains a key and a corresponding value. Your task is to implement a function `extract_values(data: List[Tuple[str, str]], keys: List[str]) -> List[str]` that takes in two parameters: a list of tuples `data`, and a list of strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_values([], ['key1', 'key2']) == []\", \"assert extract_values([('key1', 'value1'), ('key2', 'value2')], ['key1']) == ['value1']\", \"assert extract_values([('key1', 'value1'), ('key2', 'value2')], ['key3']) == []\", \"assert extract_values([('key1', ... | {
"split": "train",
"index": 62417,
"acecode_id": "oss_20218",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of music file names and returns a list of processed file names. The function should take two parameters: `song_list`, a list of strings representing the names of music files, and `processed_folder`, a string represen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_songs(['song1.mp3', 'song2.mp3'], 'processed_folder') == ['song1_processed.mp3', 'song2_processed.mp3']\", \"assert process_songs(['track1.wav', 'track2.wav', 'track3.wav'], 'processed_folder') == ['track1_processed.wav', 'track2_processed.wav', 'tra... | {
"split": "train",
"index": 62418,
"acecode_id": "oss_21235",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of articles, where each article is represented as a dictionary containing a title, a raw publication date string, and content as a list of strings. Your task is to implement a function that processes each article, cleaning the content and converting the pub... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_articles([{'title': 'Article 1', 'publication_date': 'Published on 2022-01-15', 'content': ['This is the content.']}, {'title': 'Article 2', 'publication_date': 'Unknown', 'content': ['Another content.']}]) == [{'title': 'Article 1', 'publication_dat... | {
"split": "train",
"index": 62419,
"acecode_id": "oss_26937",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a list of qubit measurements represented as a string of characters, where each character corresponds to a type of measurement (X, Y, or I), implement a function `measure_qubits(measurements: str) -> List[str]` that returns a list of strings indicating the result of measur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert measure_qubits('XYI') == ['H', 'Rx(0.5)', 'No Measurement']\", \"assert measure_qubits('XXI') == ['H', 'H', 'No Measurement']\", \"assert measure_qubits('IYXY') == ['No Measurement', 'Rx(0.5)', 'H', 'Rx(0.5)']\", \"assert measure_qubits('I') == ['No Measurem... | {
"split": "train",
"index": 62420,
"acecode_id": "bigcode_python_fns_37516",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary of scaffold coordinates, scaffold sequences, and a list of SNP positions. Your task is to identify potential gaps in the sequence based on the scaffold coordinates and update a dictionary with the identified gaps. The input consists of a dictionary `i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert identify_gaps({\\\"scaffold3\\\": [(1, 5), (10, 15)]}, {\\\"scaffold3\\\": \\\"ATATATATATAT\\\"}, [(\\\"scaffold3\\\", 6, [\\\"scaffold3\\\", \\\"6\\\", \\\"A\\\", \\\"T\\\"])]) == {\\\"scaffold3\\\": {6: 'scaffold3\\\\t6\\\\tA\\\\tT'}}\", \"assert identify_... | {
"split": "train",
"index": 62421,
"acecode_id": "oss_26381",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given two lists: `quality` and `wage`, where `quality[i]` is the quality of the `i-th` worker and `wage[i]` is the minimum wage expectation for the `i-th` worker. You need to hire exactly `k` workers to form a paid group. For the `i-th` worker to be paid their desired w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert abs(mincostToHireWorkers([10, 20, 5], [70, 50, 30], 2) - 105.00000) < 1e-5\", \"assert abs(mincostToHireWorkers([5, 10], [10, 20], 1) - 10.00000) < 1e-5\", \"assert abs(mincostToHireWorkers([2, 4, 6], [5, 10, 15], 1) - 5.00000) < 1e-5\", \"assert abs(mincost... | {
"split": "train",
"index": 62422,
"acecode_id": "oss_32501",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that removes a specified abbreviation from a provided list of abbreviations. Your function should take two inputs: a list of abbreviations and a string representing the abbreviation to remove. If the abbreviation exists in the list, i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_abbreviation(['abbr1', 'abbr2', 'abbr3'], 'abbr1') == ['abbr2', 'abbr3']\", \"assert remove_abbreviation(['abbr1', 'abbr2', 'abbr1'], 'abbr1') == ['abbr2']\", \"assert remove_abbreviation(['abbr1', 'abbr2', 'abbr1'], 'abbr3') == ['abbr1', 'abbr2', 'ab... | {
"split": "train",
"index": 62423,
"acecode_id": "oss_12909",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `month_info(month)` that takes a month as input, which can either be an integer (1-12) or a string (the full name of the month). The function should return a string that provides specific information about the month, including the number of days it has, whether... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert month_info(1) == 'January has 31 days and marks the beginning of the year.'\", \"assert month_info(2) == 'February has 28 days in a common year or 29 days in a leap year.'\", \"assert month_info(4) == 'April has 30 days and is known for spring blooms.'\", \"... | {
"split": "train",
"index": 62424,
"acecode_id": "evol_30366",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of integers, representing pixel values in an image, and applies a specific transformation based on a given threshold. The transformation works as follows: for each pixel value in the list, if the pixel value exce... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_pixels([1, 2, 3, 4, 5], 2.5) == [1, 2, 3, 4, 5]\", \"assert transform_pixels([10, 20, 30, 40, 50], 3.0) == [10, 20, 30, 40, 50]\", \"assert transform_pixels([0, 0, 0, 0, 0], 1.0) == [0, 0, 0, 0, 0]\", \"assert transform_pixels([10, 20, 30, 100, 50]... | {
"split": "train",
"index": 62425,
"acecode_id": "bigcode_python_fns_3486",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a list of lists, `data`, which is initially empty. Your task is to implement a function `add_and_get_data(data: List[List[int]], row: int, value: int, col: int) -> Optional[int]` that performs the following operations: 1. Add the given `value` to the `row`th list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_and_get_data([[]], 0, 10, 0) == 10\", \"assert add_and_get_data([[10], [20]], 1, 30, 0) == 20\", \"assert add_and_get_data([[10], [20]], 2, 50, 1) == None\", \"assert add_and_get_data([[10], [20]], 1, 30, 0) == 20\", \"assert add_and_get_data([[10], [], ... | {
"split": "train",
"index": 62426,
"acecode_id": "oss_23330",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Write a Python function called `calculate_average_and_sort(arrays)` that takes a list of lists as input. Each inner list consists of integers. The function should calculate the average of the integers in each inner list without using built-in functions. If an inner list is empt... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_and_sort([[], [100, 200], [50]]) == [0, 50.0, 150.0]\", \"assert calculate_average_and_sort([[10], [20, 30], [40, 50, 60]]) == [10.0, 25.0, 50.0]\", \"assert calculate_average_and_sort([[1], [2], [3], [4], [5]]) == [1.0, 2.0, 3.0, 4.0, 5.0]... | {
"split": "train",
"index": 62427,
"acecode_id": "evol_17285",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that simulates the operation of disabling a network interface. The function should take a string `ifname` representing the name of the interface. If the interface name is not provided (i.e., it is None), the function should do nothing and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert disable_interface(None) == None\", \"assert disable_interface('eth0') == 'Interface eth0 has been disabled.'\", \"assert disable_interface('wlan0') == 'Interface wlan0 has been disabled.'\", \"assert disable_interface('lo') == 'Interface lo has been disabled... | {
"split": "train",
"index": 62428,
"acecode_id": "bigcode_python_fns_11231",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing various callback settings for a machine learning estimator. Each dictionary contains a key 'callback_selection' which itself is a dictionary with a key 'callback_type'. Your task is to implement a function that checks if all cal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_allowed_callbacks([{'callback_selection': {'callback_type': 'EarlyStopping'}}, {'callback_selection': {'callback_type': 'None'}}]) == True\", \"assert check_allowed_callbacks([{'callback_selection': {'callback_type': 'TerminateOnNaN'}}, {'callback_sele... | {
"split": "train",
"index": 62429,
"acecode_id": "bigcode_python_fns_21378",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a word, determine if it uses capitalization correctly. The correct usage of capitalization is defined as follows: 1. Every letter in the word is capitalized (e.g., 'USA'). 2. No letter in the word is capitalized (e.g., 'leetcode'). 3. Only the first letter of the word is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detectCapitalUse('USA') == True\", \"assert detectCapitalUse('leetcode') == True\", \"assert detectCapitalUse('Google') == True\", \"assert detectCapitalUse('FlaG') == False\", \"assert detectCapitalUse('HELLO') == True\", \"assert detectCapitalUse('hello') ... | {
"split": "train",
"index": 62430,
"acecode_id": "evol_31600",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an adjacency matrix of a directed graph, write a function that converts this matrix into an edge index representation. The edge index should be a list of tuples where each tuple represents an edge from the source node to the target node. The adjacency matrix is a 2D list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_adj_to_edge_index([[0, 1], [0, 0]]) == [(0, 1)]\", \"assert convert_adj_to_edge_index([[0, 1, 0], [0, 0, 1], [0, 0, 0]]) == [(0, 1), (1, 2)]\", \"assert convert_adj_to_edge_index([[0, 0], [0, 0]]) == []\", \"assert convert_adj_to_edge_index([[1, 0], ... | {
"split": "train",
"index": 62431,
"acecode_id": "bigcode_python_fns_38397",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that transforms a list of integers based on specific filtering and sorting criteria. The function should be defined as follows: \n\n```python\ndef multipurpose_transform(data: List[int], filter_vowel: bool = False, filter_odd: bool = ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multipurpose_transform([0, 1, 2, 3]) == [0, 1, 2, 3]\", \"assert multipurpose_transform([], filter_vowel=True) == []\", \"assert multipurpose_transform([111, 222, 333], filter_vowel=False) == [111, 222, 333]\", \"assert multipurpose_transform([111, 222, 333]... | {
"split": "train",
"index": 62432,
"acecode_id": "evol_1331",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function to calculate the factorial of a given non-negative integer. The factorial of a non-negative integer n is defined as the product of all positive integers less than or equal to n. For example, the factorial of 5 (denoted as 5!) i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(... | {
"split": "train",
"index": 62433,
"acecode_id": "oss_7858",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `fibonacci_sequence(n)` that returns the first `n` numbers in the Fibonacci sequence. The Fibonacci sequence starts with 0 and 1, and each subsequent number is the sum of the two preceding ones. The function should take a single integer parameter `n` (0 <= n <=... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci_sequence(0) == []\", \"assert fibonacci_sequence(1) == [0]\", \"assert fibonacci_sequence(2) == [0, 1]\", \"assert fibonacci_sequence(3) == [0, 1, 1]\", \"assert fibonacci_sequence(4) == [0, 1, 1, 2]\", \"assert fibonacci_sequence(5) == [0, 1, 1, 2... | {
"split": "train",
"index": 62434,
"acecode_id": "evol_24550",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that modifies a Django settings dictionary based on the value of a debug environment variable. The function should update the 'DEBUG' key in the settings dictionary and, if the debug mode is enabled, add 'debug_toolbar' to the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_django_settings({'DEBUG': False, 'TEMPLATES': [{'OPTIONS': {'debug': False}}], 'INSTALLED_APPS': ['app1', 'app2']}, True) == {'DEBUG': True, 'TEMPLATES': [{'OPTIONS': {'debug': True}}], 'INSTALLED_APPS': ['app1', 'app2', 'debug_toolbar']}\", \"assert ... | {
"split": "train",
"index": 62435,
"acecode_id": "oss_29530",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with determining whether a specific message signature hash exists in a predefined set of messages in a messaging application. Implement a function `messageExists(sigHash)` that checks if the given signature hash exists within a hardcoded list of message signature... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert messageExists('abc123') == True\", \"assert messageExists('def456') == True\", \"assert messageExists('ghi789') == True\", \"assert messageExists('jkl012') == True\", \"assert messageExists('mno345') == True\", \"assert messageExists('xyz789') == False\", \"... | {
"split": "train",
"index": 62436,
"acecode_id": "oss_20308",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a string of HTML code presented in uppercase format and converts it to a string with all characters in lowercase. The function should only implement this transformation without any additional processing.\nPlease reason step by step, then write a self... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_html_to_lowercase('<HTML><BODY><H1>HELLO, WORLD!</H1></BODY></HTML>') == '<html><body><h1>hello, world!</h1></body></html>'\", \"assert convert_html_to_lowercase('<DIV><P>THIS IS A TEST.</P></DIV>') == '<div><p>this is a test.</p></div>'\", \"assert ... | {
"split": "train",
"index": 62437,
"acecode_id": "evol_24756",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an integer 'val', an integer 'offs', and a boolean 'value', implement a function that sets the bit at the specified offset 'offs' to 'value' in 'val'. If 'value' is true, the bit at 'offs' should be set to 1. If 'value' is false, the bit at 'offs' should be set to 0. The ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_bit_value(5, 1, True) == 7\", \"assert set_bit_value(0, 0, True) == 1\", \"assert set_bit_value(0, 0, False) == 0\", \"assert set_bit_value(15, 3, True) == 15\", \"assert set_bit_value(15, 3, False) == 7\", \"assert set_bit_value(8, 3, False) == 0\", \"a... | {
"split": "train",
"index": 62438,
"acecode_id": "bigcode_python_fns_39006",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, `nums`, and an integer `k`, implement a function that returns `True` if there are two distinct indices `i` and `j` such that `nums[i]` is equal to `nums[j]` and the absolute difference between `i` and `j` is less than or equal to `k`. Otherwise, retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert containsNearbyDuplicate([1, 2, 3, 1], 3) == True\", \"assert containsNearbyDuplicate([1, 0, 1, 1], 1) == True\", \"assert containsNearbyDuplicate([1, 2, 3, 1, 2, 3], 2) == False\", \"assert containsNearbyDuplicate([1, 2, 3, 4, 5], 10) == False\", \"assert co... | {
"split": "train",
"index": 62439,
"acecode_id": "evol_25577",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that filters a list of mixed data types and returns a new list containing only the elements that are of type float. The function should take a list of any data types as input and maintain the order of the float elements in the output list. For example, give... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert only_floats([1, 'a', 2.5, 4, 3.14]) == [2.5, 3.14]\", \"assert only_floats(['string', 3.0, {}, [], 2.2]) == [3.0, 2.2]\", \"assert only_floats([]) == []\", \"assert only_floats([True, 1, 0.0]) == [0.0]\", \"assert only_floats([1.1, 2.2, 3.3]) == [1.1, 2.2, 3... | {
"split": "train",
"index": 62440,
"acecode_id": "evol_2778",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing items to be added to a buffer. The buffer has a fixed maximum size. Your task is to implement a function `add_to_buffer(items: List[int], max_size: int) -> List[int]` that simulates adding these items to the buffer. If adding an ite... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_to_buffer([1, 2, 3, 4, 5], 3) == [3, 4, 5]\", \"assert add_to_buffer([1, 2, 3], 5) == [1, 2, 3]\", \"assert add_to_buffer([1, 2, 3, 4, 5, 6], 2) == [5, 6]\", \"assert add_to_buffer([1], 1) == [1]\", \"assert add_to_buffer([], 5) == []\", \"assert add_to_... | {
"split": "train",
"index": 62441,
"acecode_id": "bigcode_python_fns_6748",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that validates a given string based on the following criteria: The string must be between 5 and 20 characters long, inclusive. Additionally, the string must contain at least one digit, one special character, one uppercase letter, and one lowercase letter. I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_string('abcD1!') == 'String is valid'\", \"assert validate_string('1A!') == 'Error: String length must be between 5 and 20 characters'\", \"assert validate_string('aB1!') == 'Error: String length must be between 5 and 20 characters'\", \"assert vali... | {
"split": "train",
"index": 62442,
"acecode_id": "evol_25673",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simplified version of a bounding box handler for multi-object tracking. Your task is to create a dictionary that maps tracker types to their corresponding tracker creation functions. Additionally, implement a class `BoundingBox` that represent... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_bounding_box(10, 20, 30, 40).tracker_format == (10, 20, 30, 40)\", \"assert create_bounding_box(0, 0, 100, 100).tracker_format == (0, 0, 100, 100)\", \"assert create_bounding_box(5, 5, 1, 1).tracker_format == (5, 5, 1, 1)\", \"assert create_bounding_b... | {
"split": "train",
"index": 62443,
"acecode_id": "oss_11835",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts URLs from a given configuration string. The configuration string contains URLs enclosed within single quotes and may include comments denoted by a '#' character. Your function should extract all URLs and return them a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_urls(\\\"\\\"\\\"\\n _cfg(\\n url=\\n 'https://example.com/resource1' # comment\\n ),\\n 'another_key':\\n _cfg(\\n url=\\n 'http://example.com/resource2' # ignore this\\n ),\\n\\\"\\\"\\\") == ['https://e... | {
"split": "train",
"index": 62444,
"acecode_id": "oss_36397",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers `xs` and another list of integers `ys`, write a function `are_all_independent(xs: List[int], ys: List[int]) -> bool` that returns `True` if every element in `xs` is not statistically related to any element in `ys`. For the purpose of this problem, two i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_all_independent([2, 4, 6], [8, 10, 12]) == False\", \"assert are_all_independent([10], [2, 5]) == False\", \"assert are_all_independent([9], [3, 6]) == False\", \"assert are_all_independent([8, 9], [2, 3]) == False\", \"assert are_all_independent([14], [... | {
"split": "train",
"index": 62445,
"acecode_id": "bigcode_python_fns_7412",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list 'matrix' of size m x n filled with integers. Your task is to implement a function 'max_sum_submatrix(matrix)' that returns the maximum sum of any submatrix within the given matrix. A submatrix is defined by its upper left corner (row1, col1) and its lowe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_sum_submatrix([[0]]) == 0\", \"assert max_sum_submatrix([[1, 2], [3, 4]]) == 10\", \"assert max_sum_submatrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == 45\", \"assert max_sum_submatrix([[-1, -2, -3], [-4, -5, -6], [-7, -8, -9]]) == -1\", \"assert max_sum_sub... | {
"split": "train",
"index": 62446,
"acecode_id": "bigcode_python_fns_47255",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to extract the destination path from a given string that contains a description of a tarball unpacking operation. The destination path is specified in the input string and is denoted by the keyword '`dest`' followed by an absolute pat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_destination_path('- `dest` is the destination of the unpacked tarball in the image. This is an image-absolute path to a directory that must be created by another `feature_new` item.') == 'Destination path not specified'\", \"assert extract_destinatio... | {
"split": "train",
"index": 62447,
"acecode_id": "oss_36924",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that parses a simple configuration string representing shapes and their attributes. The configuration string follows a specific format where each shape is defined by the keyword 'shape' followed by the shape type (either 'Circle' o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_shape_config('shape Circle { color: \\\"red\\\" radius: 10 position: (100, 100) }') == [{'type': 'Circle', 'color': 'red', 'radius': 10, 'position': (100, 100)}]\", \"assert parse_shape_config('shape Rectangle { color: \\\"blue\\\" width: 20 height: 30... | {
"split": "train",
"index": 62448,
"acecode_id": "oss_31606",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary where the keys are string representations of integers (e.g., '0', '1', '2') and the values are strings representing fruits, implement a function that converts this dictionary into a list of values in the order of their corresponding keys. The keys will always... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_dict_to_list({'0': 'apple', '1': 'banana', '2': 'orange'}) == ['apple', 'banana', 'orange']\", \"assert convert_dict_to_list({'0': 'grape', '1': 'kiwi'}) == ['grape', 'kiwi']\", \"assert convert_dict_to_list({'0': 'carrot', '1': 'lettuce', '2': 'pepp... | {
"split": "train",
"index": 62449,
"acecode_id": "bigcode_python_fns_14054",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `sum_list(numbers)` that takes a list of integers and returns the sum of all the integers in the list.\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 sum_list([1, 2, 3, 4, 5]) == 15\", \"assert sum_list([-1, -2, -3, -4, -5]) == -15\", \"assert sum_list([0, 0, 0, 0]) == 0\", \"assert sum_list([10, 20, 30]) == 60\", \"assert sum_list([1]) == 1\", \"assert sum_list([]) == 0\", \"assert sum_list([5, 5, 5]) ==... | {
"split": "train",
"index": 62450,
"acecode_id": "evol_20098",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that processes a list of dictionaries. The function should filter the list based on a specific key matching a given value, and then sort the filtered list by that key. The function should handle potential exceptions that could occur during the filter and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data([{'name': 'Alice', 'age': 30}, {'name': 'Bob', 'age': 25}], 'age', 30) == [{'name': 'Alice', 'age': 30}]\", \"assert process_data([{'name': 'Alice', 'age': 30}, {'name': 'Bob', 'age': 25}], 'age', 25) == [{'name': 'Bob', 'age': 25}]\", \"assert ... | {
"split": "train",
"index": 62451,
"acecode_id": "evol_8096",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given an array of integers `A` and a non-negative integer `K`. Your task is to implement a function `largestSumAfterKNegations(A: List[int], K: int) -> int` that modifies the array by selecting an index `i` and replacing `A[i]` with its negation `-A[i]`, repeating this ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert largestSumAfterKNegations([4, 2, 3], 1) == 5\", \"assert largestSumAfterKNegations([3, -1, 0, 2], 3) == 6\", \"assert largestSumAfterKNegations([2, -3, -1, 5, -4], 2) == 13\", \"assert largestSumAfterKNegations([-2, -3, -1], 3) == 6\", \"assert largestSumAft... | {
"split": "train",
"index": 62452,
"acecode_id": "evol_2780",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a string `code` that represents a financial instrument. Your task is to determine whether this instrument is categorized as a 'stock' or a 'fund'. The categorization rules are as follows: If the `code` starts with '00', '30', or '60', it is classified as a 'stock'... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_code_type('001234') == 'stock'\", \"assert get_code_type('300456') == 'stock'\", \"assert get_code_type('601234') == 'stock'\", \"assert get_code_type('123456') == 'fund'\", \"assert get_code_type('987654') == 'fund'\", \"assert get_code_type('303456') =... | {
"split": "train",
"index": 62453,
"acecode_id": "bigcode_python_fns_15184",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with extracting version information from a string that represents the output of an Intel compiler executable. Your goal is to implement a function `extract_version(output: str) -> str` that takes a single parameter, `output`, which is a string containing the vers... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_version('icpc (ICC) 19.1.2.254 20200623') == '19.1.2.254'\", \"assert extract_version('gcc (GCC) 9.3.0') == None\", \"assert extract_version('icpc (ICC) version 18.1.1') == None\", \"assert extract_version('This is not a compiler version output.') ==... | {
"split": "train",
"index": 62454,
"acecode_id": "oss_32781",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a variable name, determine if the variable name is valid according to the following rules: a valid variable name must start with a lowercase letter and can contain letters, digits, or underscores. If the variable name is invalid, return an error mess... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_variable_name('myVariable') == ''\", \"assert validate_variable_name('var_name') == ''\", \"assert validate_variable_name('variable123') == ''\", \"assert validate_variable_name('var_name_1') == ''\", \"assert validate_variable_name('a') == ''\", \"... | {
"split": "train",
"index": 62455,
"acecode_id": "bigcode_python_fns_46497",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating an image transformation pipeline based on a configuration dictionary that dictates various image augmentations. Write a function `create_image_transformation_pipeline(config: dict, apply_augmentations: bool) -> list` that returns a list of transform... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_image_transformation_pipeline({'augmentation': {'use_random_affine': True, 'random_affine': {'max_angle': 10, 'max_horizontal_shift': 0.1, 'max_vertical_shift': 0.1, 'max_shear': 0.1}}, 'preprocess': {'resize': (256, 256), 'center_crop_size': (224, 22... | {
"split": "train",
"index": 62456,
"acecode_id": "bigcode_python_fns_28703",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a multi-line string representing a Python code snippet. This snippet contains metadata comments that follow a specific format, where each line has the pattern `__key__ = 'value'`. Your task is to write a function `extract_metadata(code_snippet: str) -> dict` that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_metadata(\\\"\\\"\\\"__status__ = '3 - Alpha'\\n__email__ = 'status@example.com'\\\"\\\"\\\") == {'status': '3 - Alpha', 'email': 'status@example.com'}\", \"assert extract_metadata(\\\"\\\"\\\"__author__ = 'Charlie'\\n__url__ = 'http://charlie.com'\\... | {
"split": "train",
"index": 62457,
"acecode_id": "oss_36305",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the power consumption of a device module. The function should take an integer input, representing the number of devices connected to the module. Each device consumes a constant amount of power, which is defined as 50 mW. Yo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_power(1) == 50.0\", \"assert calculate_total_power(2) == 100.0\", \"assert calculate_total_power(3) == 150.0\", \"assert calculate_total_power(4) == 200.0\", \"assert calculate_total_power(5) == 250.0\", \"assert calculate_total_power(10) == ... | {
"split": "train",
"index": 62458,
"acecode_id": "bigcode_python_fns_43832",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary that can contain integers, strings, and other nested dictionaries. Write a function `flatten_dictionary(d)` that takes a dictionary `d` as input and returns a flattened dictionary. In the flattened dictionary, all nested keys should be concatenated wi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert flatten_dictionary({'a': 1, 'b': {'c': 2, 'd': {'e': 3}}}) == {'a': 1, 'b/c': 2, 'b/d/e': 3}\", \"assert flatten_dictionary({}) == {}\", \"assert flatten_dictionary({'x': 'hello', 'y': {'z': 'world'}}) == {'x': 'hello', 'y/z': 'world'}\", \"assert flatten_di... | {
"split": "train",
"index": 62459,
"acecode_id": "bigcode_python_fns_4031",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibonacci(n: int) -> int` that calculates the nth Fibonacci number using recursion and memoization. The Fibonacci sequence is defined as follows: F(1) = 1, F(2) = 1, and F(n) = F(n-1) + F(n-2) for n > 2. Your implementation should optimize repeated calcula... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"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) == 21\", \"assert fibonacci(9) == ... | {
"split": "train",
"index": 62460,
"acecode_id": "evol_29122",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, you need to determine if it is possible to sort the array by moving exactly two elements. If the array is already sorted, you should check if the number of elements smaller than the first element is even. Implement a function `move_two_balls(arr: Lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert move_two_balls([]) == True\", \"assert move_two_balls([1, 2, 3, 4]) == True\", \"assert move_two_balls([4, 3, 2, 1]) == False\", \"assert move_two_balls([5, 4, 3, 2, 1]) == False\", \"assert move_two_balls([1, 1, 1, 1]) == True\", \"assert move_two_balls([10... | {
"split": "train",
"index": 62461,
"acecode_id": "evol_12186",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Given a list of process IDs (PIDs), return a list of names of systemd services that correspond to those PIDs. If a PID does not belong to any service, return 'None' for that PID. Implement the function `get_service_names(pids: List[int]) -> List[Optional[str]]`, where `pids` is... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_service_names([1, 2, 3]) == ['systemd', 'networkd', 'sshd']\", \"assert get_service_names([7]) == [None]\", \"assert get_service_names([]) == []\", \"assert get_service_names([1, 4, 5, 3]) == ['systemd', 'cron', 'httpd', 'sshd']\", \"assert get_service_n... | {
"split": "train",
"index": 62462,
"acecode_id": "bigcode_python_fns_2547",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `get_content_status(url: str) -> str` that takes a URL as a string input and returns the content of the webpage as a string. If the HTTP request returns a status code of 503, the function should simulate a retry to get the content (for the purpose of this probl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_content_status('https://example.com') == 'Content Retrieved'\", \"assert get_content_status('https://example.org') == 'Service Unavailable'\", \"assert get_content_status('https://example.net') == 'Content Retrieved'\", \"assert get_content_status('https... | {
"split": "train",
"index": 62463,
"acecode_id": "bigcode_python_fns_44847",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibfib(n: int) -> int` that calculates the FibFib sequence defined as follows: fibfib(0) == 0, fibfib(1) == 0, fibfib(2) == 1, and for n > 2, fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3). For n < 0, fibfib(n) == fibfib(n+3) - fibfib(n+2) - fibfib(n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibfib(0) == 0\", \"assert fibfib(1) == 0\", \"assert fibfib(2) == 1\", \"assert fibfib(3) == 1\", \"assert fibfib(4) == 2\", \"assert fibfib(5) == 4\", \"assert fibfib(6) == 7\", \"assert fibfib(7) == 13\", \"assert fibfib(8) == 24\", \"assert fibfib(9) == ... | {
"split": "train",
"index": 62464,
"acecode_id": "evol_10698",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of movie titles as input and returns a list containing only the titles that are longer than 5 characters. Implement the function `filter_long_titles(titles: List[str]) -> List[str]`, where `titles` is a list of strings r... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_long_titles(['A', 'B', 'C']) == []\", \"assert filter_long_titles(['The Shawshank Redemption', 'The Godfather']) == ['The Shawshank Redemption', 'The Godfather']\", \"assert filter_long_titles(['Memento', 'Fight Club', 'Se7en']) == ['Memento', 'Fight ... | {
"split": "train",
"index": 62465,
"acecode_id": "oss_5905",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers `entries` and an integer `count`, write a function that selects `count` unique elements from the `entries` list randomly. The function should return a list of `count` integers chosen from `entries`, ensuring that no integer appears more than once in the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert select_random([5, 5, 5, 5], 1) == [5]\", \"assert select_random([1, 2, 3], 3) in [[1, 2, 3]]\", \"assert select_random([1, 2, 3, 4], 0) == []\", \"assert select_random([9, 8, 7], 1) in [[9], [8], [7]]\", \"assert select_random([4, 4, 4, 4], 2) == [4]\", \"as... | {
"split": "train",
"index": 62466,
"acecode_id": "bigcode_python_fns_32763",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Design a function to convert a complex string of lowercase roman numerals back to equivalent positive integers. The input roman numeral string expands from 'i' up-to 'cdxxvi'. Implement a function `advanced_roman_to_int(roman: str) -> int` that takes a roman numeral string as i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert advanced_roman_to_int('i') == 1\", \"assert advanced_roman_to_int('ii') == 2\", \"assert advanced_roman_to_int('iii') == 3\", \"assert advanced_roman_to_int('iv') == 4\", \"assert advanced_roman_to_int('v') == 5\", \"assert advanced_roman_to_int('vi') == 6\"... | {
"split": "train",
"index": 62467,
"acecode_id": "evol_5930",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the behavior of a database initialization. The function should take two arguments: a boolean `is_admin` and a string `version`. If the `version` is not '1.0', the function should raise a `SystemExit` with a code of 1; other... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_database(True, '1.0') == 'Database initialized successfully'\", \"assert initialize_database(False, '1.0') == 'Database initialized successfully'\", \"assert initialize_database(True, '1.0') == 'Database initialized successfully'\", \"assert initi... | {
"split": "train",
"index": 62468,
"acecode_id": "bigcode_python_fns_46660",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of numbers, `actor_values` and `target_values`, and a float `tau` (0 <= tau <= 1). Your task is to create a function that updates the `target_values` list based on the values from the `actor_values` list using the following formula for each corresponding... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_target([1.0, 2.0, 3.0], [10.0, 20.0, 30.0], 0.5) == [5.5, 11.0, 16.5]\", \"assert update_target([1.0, 2.0], [1.0, 2.0], 1.0) == [1.0, 2.0]\", \"assert update_target([1.0, 1.0], [1.0, 1.0], 0.5) == [1.0, 1.0]\", \"assert update_target([5.0], [10.0], 0.... | {
"split": "train",
"index": 62469,
"acecode_id": "bigcode_python_fns_30083",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates depositing funds into a bank account. The function should take two parameters: an initial balance (a float representing the starting balance of the account) and an amount to deposit (a float representing the amount to b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert deposit_funds(100.00, 50.00) == 150.00\", \"assert deposit_funds(0.00, 100.00) == 100.00\", \"assert deposit_funds(200.50, 0.00) == 200.50\", \"assert deposit_funds(150.75, 25.25) == 176.00\", \"assert deposit_funds(1000.00, 1000.00) == 2000.00\", \"assert d... | {
"split": "train",
"index": 62470,
"acecode_id": "oss_10575",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that returns a list of unique characters that are present in both input strings, ignoring case. The function should take two strings as arguments and return a list of shared characters in lowercase. The order of the characters in the output list does not ma... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shared_chars('Python', 'Java') == []\", \"assert shared_chars('abcdEfG', 'ghijklmN') == ['g']\", \"assert shared_chars('Hello', 'hello') == ['h', 'e', 'l', 'o']\", \"assert shared_chars('abcd', 'efgh') == []\", \"assert shared_chars('!@#$', '%^&*') == []\", ... | {
"split": "train",
"index": 62471,
"acecode_id": "evol_1641",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given an integer array, 'arr'. Determine the minimum number of elements that must be manipulated for the array to become palindromic, where the number of distinctive element alterations must not exceed 50% of the array's length. You have the liberty to transform a given... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert smallest_change([1,2,3,5,4,7,9,6], 4) == 4\", \"assert smallest_change([1, 2, 3, 4, 3, 2, 2], 3) == 1\", \"assert smallest_change([1, 2, 3, 2, 1], 2) == 0\", \"assert smallest_change([1, 1, 1, 1], 2) == 0\", \"assert smallest_change([1, 2, 3, 3, 2, 1], 2) ==... | {
"split": "train",
"index": 62472,
"acecode_id": "evol_34709",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Write a function that takes a list of integers and returns a new list where each element is the product of all other elements in the original list except the element at the current index. For example, given the list [1, 2, 3, 4], the function should return [24, 12, 8, 6].\nPlea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_except_current([1, 2, 3, 4]) == [24, 12, 8, 6]\", \"assert sum_except_current([5, 6, 7]) == [42, 35, 30]\", \"assert sum_except_current([-1, -2, -3]) == [6, 3, 2]\", \"assert sum_except_current([1]) == [1]\", \"assert sum_except_current([2, 2]) == [2, 2]... | {
"split": "train",
"index": 62473,
"acecode_id": "evol_30246",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a function 'detectDupes' that checks if a tuple contains any duplicate entries. The function should return a boolean indicating whether duplicates are present, along with a set of the duplicated entries. The function should be case-sensitive for string entries. For ex... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert detectDupes((1, 2, 'Cat', 'cat', 2)) == (True, {2})\", \"assert detectDupes((3, 4, 5, 6)) == (False, set())\", \"assert detectDupes(('apple', 'banana', 'apple')) == (True, {'apple'})\", \"assert detectDupes((1, 1, 2, 3)) == (True, {1})\", \"assert detectDupe... | {
"split": "train",
"index": 62474,
"acecode_id": "evol_10540",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to decode a sequence of characters recognized by a neural network. The function takes in a set of distinct characters that the neural network can recognize, excluding a special CTC-blank character, and a list of recognized characters ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decode_text({'a', 'b', 'c', 'd', 'e'}, ['a', 'b', 'b', 'c', 'c', 'd', 'e']) == 'abcde'\", \"assert decode_text({'x', 'y', 'z'}, ['x', 'x', 'y', 'z', 'z']) == 'xyz'\", \"assert decode_text({'A', 'B', 'C'}, ['A', 'A', 'B', 'C', 'C']) == 'ABC'\", \"assert decod... | {
"split": "train",
"index": 62475,
"acecode_id": "oss_260",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given the first term of an arithmetic sequence and its common difference, implement a function that calculates the nth term of the sequence. The function should take three parameters: the first term (an integer), the common difference (an integer), and n (a positive integer). R... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert nth_term(1, 4, 1) == 1\", \"assert nth_term(1, 4, 2) == 5\", \"assert nth_term(1, 4, 3) == 9\", \"assert nth_term(1, 4, 4) == 13\", \"assert nth_term(1, 4, 5) == 17\", \"assert nth_term(1, 4, 6) == 21\", \"assert nth_term(1, 4, 7) == 25\", \"assert nth_term(... | {
"split": "train",
"index": 62476,
"acecode_id": "evol_10066",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representation of a chemical structure that uses a specific format to denote atoms and rings. Each atom is represented by its chemical symbol enclosed in square brackets, and rings are denoted by the format [RingN] where N is an integer. Your task is to i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_structure('[C][C][C][C][Ring1][O]') == True\", \"assert is_valid_structure('[C][C][C][C][Ring2][O][C]') == True\", \"assert is_valid_structure('[C][C][C][C][Ring2][O]') == True\", \"assert is_valid_structure('[C][C][C][C][Ring3][C]') == True\", \"as... | {
"split": "train",
"index": 62477,
"acecode_id": "bigcode_python_fns_44564",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a formatted string based on the time spent in a car and the timestamp when the car was captured. The function should take two arguments: `time_in_car` and `car_captured_timestamp`, both of which are datetime objects. The fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_time_string(datetime(2022, 10, 15, 8, 30), datetime(2022, 10, 15, 8, 0)) == '\\\\n\\\\tTime in Car: 2022-10-15T08:30:00 (captured at 2022-10-15T08:00:00)'\", \"assert generate_time_string(datetime(2023, 1, 1, 12, 0), datetime(2023, 1, 1, 11, 45)) ==... | {
"split": "train",
"index": 62478,
"acecode_id": "oss_5605",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple logging system. The function, named `log_messages`, should accept a list of messages and return a string that represents the content of the log file after appending all messages. The messages should be separated by... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert log_messages(['Error: File not found', 'Warning: Low disk space']) == 'Error: File not found\\\\nWarning: Low disk space'\", \"assert log_messages(['Info: Process started']) == 'Info: Process started'\", \"assert log_messages([]) == ''\", \"assert log_messag... | {
"split": "train",
"index": 62479,
"acecode_id": "oss_4804",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D grid representing a maze, where 0s represent open paths and 1s represent obstacles. Your task is to implement a function that finds the shortest path from a starting position to an ending position. You can only move vertically or horizontally (no diagonal mov... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_shortest_path([[0, 0, 0], [0, 1, 0], [0, 0, 0]], (0, 0), (2, 2)) == [(0, 0), (0, 1), (0, 2), (1, 2), (2, 2)]\", \"assert find_shortest_path([[0, 0, 1], [0, 1, 0], [0, 0, 0]], (0, 0), (2, 2)) == [(0, 0), (1, 0), (2, 0), (2, 1), (2, 2)]\", \"assert find_s... | {
"split": "train",
"index": 62480,
"acecode_id": "oss_6010",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that returns the sum of all even numbers in the list. If there are no even numbers, return 0. Write a function named 'sum_even_numbers' that takes one parameter, 'numbers', which is a list of integers. The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_even_numbers([1, 2, 3, 4, 5]) == 6\", \"assert sum_even_numbers([0, -2, -4, 3, 5]) == -6\", \"assert sum_even_numbers([1, 3, 5, 7]) == 0\", \"assert sum_even_numbers([2, 4, 6, 8]) == 20\", \"assert sum_even_numbers([]) == 0\", \"assert sum_even_numbers([... | {
"split": "train",
"index": 62481,
"acecode_id": "bigcode_python_fns_44605",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of sentences, and a list of specific words, write a function that capitalizes the first letter of every instance of a chosen word in each sentence. Additionally, ensure that the first letter of each sentence is capitalized. If the word list entered is empty, the fu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert capitalize_words(['hello there. how are you?'], ['hello', 'how']) == ['Hello there. How are you?']\", \"assert capitalize_words(['python programming is fun.'], ['python', 'fun']) == ['Python programming is fun.']\", \"assert capitalize_words(['what is this? ... | {
"split": "train",
"index": 62482,
"acecode_id": "evol_12606",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given two arrays `arr1` and `arr2`, sort the elements of `arr1` such that the relative ordering of items in `arr1` matches that in `arr2`. Any elements in `arr1` that are not present in `arr2` should be placed at the end of `arr1` in ascending order. The elements that do not ap... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert relativeSortArray([2,3,1,3,2,4,6,7,9,2,19], [2,1,4,3,9,6]) == [2,2,2,1,4,3,3,9,6,7,19]\", \"assert relativeSortArray([28,6,22,8,44,17], [22,17,8]) == [22,17,8,6,28,44]\", \"assert relativeSortArray([2,4,6,8,10], [10,8,6]) == [10,8,6,2,4]\", \"assert relative... | {
"split": "train",
"index": 62483,
"acecode_id": "evol_18570",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You have been tasked with creating a function that simulates the repetition of a given experiment plan. The function should take two parameters: a function `plan_func` that represents the experiment and an integer `n` that indicates how many times to repeat that experiment. The... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert repeat_experiment(lambda: 42, 1) == [42]\", \"assert repeat_experiment(lambda: 'test', 2) == ['test', 'test']\", \"assert repeat_experiment(lambda: 3.14, 3) == [3.14, 3.14, 3.14]\", \"assert repeat_experiment(lambda: True, 0) == []\", \"assert repeat_experim... | {
"split": "train",
"index": 62484,
"acecode_id": "bigcode_python_fns_33886",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `count_total_elements` that returns the total number of elements in the list. The function should take a single parameter, which is a list of integers, and return an integer representing the count of elements in that list. Note that th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_total_elements([]) == 0\", \"assert count_total_elements([1]) == 1\", \"assert count_total_elements([1, 2, 3]) == 3\", \"assert count_total_elements([1, 1, 1]) == 3\", \"assert count_total_elements([1, 2, 1, 3, 2]) == 5\", \"assert count_total_elements... | {
"split": "train",
"index": 62485,
"acecode_id": "bigcode_python_fns_36957",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple traffic light controller using Python. The traffic light has two states: green and red. You need to create a function `traffic_light_state(duration: int) -> str` that determines the state of the traffic light after a given number of secon... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert traffic_light_state(0) == 'green'\", \"assert traffic_light_state(1) == 'green'\", \"assert traffic_light_state(4) == 'green'\", \"assert traffic_light_state(5) == 'red'\", \"assert traffic_light_state(6) == 'red'\", \"assert traffic_light_state(9) == 'red'\... | {
"split": "train",
"index": 62486,
"acecode_id": "oss_14965",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings, where each string represents a file path. Your task is to implement a function that checks if these file paths are valid. A valid file path is defined as a non-empty string that does not contain any null characters (\\0). The function should ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_file_paths(['file1.txt', 'file2.txt', '']) == [True, True, False]\", \"assert check_file_paths(['', 'file.txt', 'valid/path/file.doc']) == [False, True, True]\", \"assert check_file_paths(['valid/path/file.txt', 'another/valid/path/file.doc', '']) == [... | {
"split": "train",
"index": 62487,
"acecode_id": "bigcode_python_fns_35061",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple in-memory cache system that allows storing and retrieving translations for different languages. Implement a function `memory_cache_operations(operations: List[Tuple[str, str, str]]) -> List[Optional[str]]` that simulates the operations ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert memory_cache_operations([('add', 'en', 'hello'), ('get', 'en', 'hello')]) == ['hello']\", \"assert memory_cache_operations([('add', 'es', 'hola'), ('get', 'fr', 'hola')]) == [None]\", \"assert memory_cache_operations([('add', 'en', 'goodbye'), ('get', 'en', ... | {
"split": "train",
"index": 62488,
"acecode_id": "oss_10648",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `generate_fibonacci(start: int, end: int) -> List[int]` that generates a list of all Fibonacci numbers within a specified range inclusive of the start and end values. Implement error handling to ensure that both start and end are non-negative integers and that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_fibonacci(0, 0) == [0]\", \"assert generate_fibonacci(1, 8) == [1, 1, 2, 3, 5, 8]\", \"assert generate_fibonacci(2, 13) == [2, 3, 5, 8, 13]\", \"assert generate_fibonacci(5, 21) == [5, 8, 13, 21]\", \"assert generate_fibonacci(3, 10) == [3, 5, 8]\",... | {
"split": "train",
"index": 62489,
"acecode_id": "evol_2427",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You're given a list of deposit and withdrawal operations on a bank account starting from zero balance. And, a list of fees corresponding to each operation is also provided. Your task is to detect if the balance goes below zero after applying the fees at any point in time. If so... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert account_balance([-100, 50, 50], [0.0, 0.0, 0.0]) == (True, -100.0, 0)\", \"assert account_balance([10, -20, 15], [0.0, 5.0, 0.0]) == (True, -15.0, 1)\", \"assert account_balance([0, -50, 100], [0.0, 0.0, 0.0]) == (True, -50.0, 1)\", \"assert account_balance(... | {
"split": "train",
"index": 62490,
"acecode_id": "evol_6934",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Write a function `is_power_of_two(num: int) -> bool` that determines if a given integer 'num' can be expressed as 2 raised to the power of some non-negative integer. The function should return True if 'num' is a power of two, and False otherwise. For example, if the input is 8,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_power_of_two(1) == True\", \"assert is_power_of_two(2) == True\", \"assert is_power_of_two(3) == False\", \"assert is_power_of_two(4) == True\", \"assert is_power_of_two(5) == False\", \"assert is_power_of_two(6) == False\", \"assert is_power_of_two(7) ==... | {
"split": "train",
"index": 62491,
"acecode_id": "evol_1552",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a given string based on specific parameters. The function should handle the following requirements: 1. If the parameter `copy` is `True`, the function should return a copy of the original string. 2. If `copy` is ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_string('hello world', copy=True) == 'hello world'\", \"assert process_string('hello world', copy=False, prefix='Greeting:') == 'Greeting:hello world'\", \"assert process_string('hello world', copy=False) == 'hello world'\", \"assert process_string('p... | {
"split": "train",
"index": 62492,
"acecode_id": "oss_18609",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with finding all prime numbers less than a given integer `n` using the Sieve of Eratosthenes algorithm. Implement a function `sieve_of_eratosthenes(n)` where: - `n` (2 <= n <= 10^6) is the upper limit for finding prime numbers. The function should return a list o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sieve_of_eratosthenes(3) == [2]\", \"assert sieve_of_eratosthenes(10) == [2, 3, 5, 7]\", \"assert sieve_of_eratosthenes(20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert sieve_of_eratosthenes(30) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]\", \"assert sieve_of_era... | {
"split": "train",
"index": 62493,
"acecode_id": "oss_10148",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two binary strings `a` and `b`, implement a function that returns their sum as a binary string. The function should not use any built-in binary to decimal or decimal to binary conversion functions. The input strings consist only of '0' or '1' characters and do not contain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert addBinary('0', '0') == '0'\", \"assert addBinary('1', '0') == '1'\", \"assert addBinary('1', '1') == '10'\", \"assert addBinary('10', '10') == '100'\", \"assert addBinary('110', '10') == '1000'\", \"assert addBinary('1010', '1010') == '10100'\", \"assert add... | {
"split": "train",
"index": 62494,
"acecode_id": "evol_32860",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `find_primes_in_range(start: int, end: int) -> List[int]` that takes two integers, `start` and `end`, and returns a list of all prime numbers within the inclusive range from `start` to `end`. The function should only return prime numbers and exclude any non-pri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_primes_in_range(50, 70) == [53, 59, 61, 67]\", \"assert find_primes_in_range(1, 10) == [2, 3, 5, 7]\", \"assert find_primes_in_range(10, 20) == [11, 13, 17, 19]\", \"assert find_primes_in_range(20, 30) == [23, 29]\", \"assert find_primes_in_range(30, 40... | {
"split": "train",
"index": 62495,
"acecode_id": "evol_30903",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "In a game similar to Master Mind, you are given a list of guesses containing a secret sequence of digits. Each guess corresponds to a number of correct digits that are in the correct position. Your task is to implement a function `get_number(guesses: List[Tuple[str, int]]) -> s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_number([('22222', 5), ('33333', 0)]) == '22222'\", \"assert get_number([('00000', 5), ('11111', 0)]) == '00000'\", \"assert get_number([('12345', 3), ('67890', 2)]) == '12345'\", \"assert get_number([('99999', 5), ('88888', 0)]) == '99999'\", \"assert ge... | {
"split": "train",
"index": 62496,
"acecode_id": "evol_34510",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given an n-ary tree, where each node has a key and a list of children, design an algorithm to find the lowest common ancestor (LCA) of two given nodes in the tree. If there is no common ancestor, return None. The LCA is defined as the deepest node that is an ancestor of both no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_lowest_common_ancestor(Node(1), 2, 2) is None\", \"assert find_lowest_common_ancestor(Node(1), 3, 4) is None\", \"assert find_lowest_common_ancestor(Node(1), 2, 3) is None\", \"assert find_lowest_common_ancestor(Node(1), 5, 6) is None\", \"assert find_l... | {
"split": "train",
"index": 62497,
"acecode_id": "evol_7151",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibonacci(n: int) -> List[int]` that returns the first 'n' components of the Fibonacci sequence. The Fibonacci sequence starts with 0 and 1, and each subsequent number is the sum of the two preceding ones. For example, the first eight numbers of the sequen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(7) == [0, 1... | {
"split": "train",
"index": 62498,
"acecode_id": "evol_30556",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the migration of fields in a database model. Your function should take two parameters: a dictionary representing the `Server` model and another dictionary representing the `Benchmarker` model. The function should add a new ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_migration_fields({}, {}) == ({'is_bench_target': False}, {'ip': ''})\", \"assert add_migration_fields({'existing_field': 'value'}, {'ip': '192.168.1.1'}) == ({'existing_field': 'value', 'is_bench_target': False}, {'ip': '192.168.1.1'})\", \"assert add_mi... | {
"split": "train",
"index": 62499,
"acecode_id": "oss_18467",
"num_tests": 13
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.