data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that updates the settings of video streams based on their properties. You will receive a dictionary containing settings for various streams and a source stream object that contains information regarding its type, codec context, and bi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_stream_settings({}, Stream(index=1, type='video_stream', codec_context=CodecContext(name='h264', options={'preset': 'ultrafast'}), bit_rate=5000), 1) == None\", \"assert update_stream_settings({1: {}}, Stream(index=1, type='video_stream', codec_contex...
{ "split": "train", "index": 83500, "acecode_id": "oss_23827", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that takes a list of strings representing linguistic features and returns a dictionary containing the frequency of each unique feature, ignoring case. The keys in the output dictionary should be lowercase. Write a function `cou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_features(['Gender', 'Number', 'gender', 'Tense']) == {'gender': 2, 'number': 1, 'tense': 1}\", \"assert count_features(['Mood', 'Mood', 'Mood']) == {'mood': 3}\", \"assert count_features(['Polite', 'polite', 'POLITE', 'Polite']) == {'polite': 4}\", \"a...
{ "split": "train", "index": 83501, "acecode_id": "oss_33516", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists, `qD` and `delta_p`, each containing `n` floating-point numbers. You also have the constants `B`, `mu`, `perm`, and `h`, which are all floating-point numbers. Your task is to calculate the rate as the sum of constant flowing pressures using the formula: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_rate([1.0, 2.0], [3.0, 4.0], 1.0, 1.0, 1.0, 1.0) == 0.007082 * 1.0 * 1.0 / (1.0 * 1.0) * (1.0 * 3.0 + 2.0 * 4.0)\", \"assert calculate_rate([0.5, 1.5, 2.5], [1.0, 1.0, 1.0], 2.0, 1.0, 3.0, 4.0) == 0.007082 * 3.0 * 4.0 / (2.0 * 1.0) * (0.5 * 1.0 + 1...
{ "split": "train", "index": 83502, "acecode_id": "bigcode_python_fns_31253", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats server information based on the given parameters. The function should take three strings as input: `hostname`, `name`, and `region`. It should return a formatted string in the following format: 'Server <name> with hostname <h...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_server_info('host1.example.com', 'Server1', 'us-east-1') == 'Server Server1 with hostname host1.example.com is located in region us-east-1'\", \"assert format_server_info('host2.example.com', 'Server2', 'eu-west-1') == 'Server Server2 with hostname ho...
{ "split": "train", "index": 83503, "acecode_id": "oss_16808", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing pixel data to generate a heightmap. You will receive a list of pixel values in row-major order, and your goal is to reshape these pixel values into a 2D array (heightmap) based on a specified heightmap size. Implement a function named `generate_he...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_heightmap([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120], (3, 4)) == [[10, 20, 30, 40], [50, 60, 70, 80], [90, 100, 110, 120]]\", \"assert generate_heightmap([1, 2, 3, 4], (2, 2)) == [[1, 2], [3, 4]]\", \"assert generate_heightmap([5, 6, 7, 8, ...
{ "split": "train", "index": 83504, "acecode_id": "oss_13205", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates a modified version of the Mean Absolute Percentage Error (MAPE) between two lists: `approxes` and `targets`. The modification is that the denominator should take the maximum of the absolute value of the targets or a co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(custom_mape([0, 0, 0], [0, 0, 0]) - 0) < 1e-9\", \"assert abs(custom_mape([100000, 200000, 300000], [100000, 200000, 300000]) - 0) < 1e-9\", \"assert abs(custom_mape([290000, 290000, 290000], [290000, 290000, 290000]) - 0) < 1e-9\", \"assert abs(custom_m...
{ "split": "train", "index": 83505, "acecode_id": "bigcode_python_fns_2458", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function `smallest_change(arr: List[int], limit: int) -> Union[int, str]` that determines the minimum number of changes required to make the array a palindrome. You are allowed to change up to 'limit' unique elements in the array. If the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert smallest_change([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 5) == 5\", \"assert smallest_change([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 0) == -1\", \"assert smallest_change([1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 5) == 0\", \"assert smallest_change([1, 2, 3, 4, 5, 6, 7, 8, 9, 0], 10)...
{ "split": "train", "index": 83506, "acecode_id": "evol_21346", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a priority queue operation. The function should accept a list of tuples, where each tuple contains a value and its associated priority. The function should return a list of values sorted by their priority in descending ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert priority_queue_sort([('task1', 3), ('task2', 1), ('task3', 2)]) == ['task1', 'task3', 'task2']\", \"assert priority_queue_sort([('taskA', 1), ('taskB', 2), ('taskC', 2)]) == ['taskB', 'taskC', 'taskA']\", \"assert priority_queue_sort([('task1', 5), ('task2',...
{ "split": "train", "index": 83507, "acecode_id": "oss_29627", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a sequence of events. Implement a function that returns a list of integers where each element at index i represents the cumulative count of unique transitions of the events up to index i. A unique transition occurs when the value at...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_transitions([]) == []\", \"assert count_unique_transitions([1]) == [0]\", \"assert count_unique_transitions([1, 1, 1]) == [0, 0, 0]\", \"assert count_unique_transitions([1, 2, 3]) == [0, 1, 2]\", \"assert count_unique_transitions([1, 2, 2, 3]) =...
{ "split": "train", "index": 83508, "acecode_id": "bigcode_python_fns_17820", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of incoming event messages from a messaging platform. Each event can either be a message or a postback. The function should take a list of events, where each event is a dictionary containing either a 'message' with a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_events([{'message': {'text': 'Hello'}}, {'postback': {'payload': 'Button clicked'}}, {'message': {'text': 'How are you?'}}]) == ['Hello', 'Button clicked', 'How are you?']\", \"assert process_events([{'message': {'text': 'Hi'}}, {'delivery': {}}, {'p...
{ "split": "train", "index": 83509, "acecode_id": "bigcode_python_fns_29705", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple command-line parser function. Implement a function named `parse_arguments` that takes a list of command-line arguments and returns a dictionary containing the parsed arguments. The function should support a single optional argument '-v' or ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_arguments(['-v']) == {'verbose': True}\", \"assert parse_arguments(['--verbose']) == {'verbose': True}\", \"assert parse_arguments([]) == {'verbose': False}\", \"assert parse_arguments(['random_arg']) == {'verbose': False}\", \"assert parse_arguments([...
{ "split": "train", "index": 83510, "acecode_id": "bigcode_python_fns_12614", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates logging into an anime tracking service. The function should accept a user ID and an authentication token, and it should return a message indicating whether the login was successful or if the user needs to log in first. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert login_to_anime_service('user123', 'token456') == 'Login successful'\", \"assert login_to_anime_service('user1', 'token1') == 'Login successful'\", \"assert login_to_anime_service('user2', 'token2') == 'Login successful'\", \"assert login_to_anime_service('us...
{ "split": "train", "index": 83511, "acecode_id": "bigcode_python_fns_15038", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function called `connect_to_wifi` that simulates the process of connecting to a Wi-Fi network using a pre-shared key (PSK). The function should take a single argument, `psk`, which is a string representing the PSK for the network. If the PSK is pr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert connect_to_wifi('my_secret_psk') == 'Connected to Wi-Fi using PSK: my_secret_psk'\", \"assert connect_to_wifi('') == 'Connected to Wi-Fi using saved credentials: SavedCredentials123'\", \"assert connect_to_wifi('another_psk') == 'Connected to Wi-Fi using PSK...
{ "split": "train", "index": 83512, "acecode_id": "oss_21883", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a function that adds two numbers, implement a function that applies this addition function to two lists elementwise. If the lists are of different lengths, treat the missing values in the shorter list as zeros. Your function should return a new list containing the results...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bar([1, 2, 3], [3, 4, 2]) == [4, 6, 5]\", \"assert bar([1, 2], [3, 4, 5]) == [4, 6, 5]\", \"assert bar([5], [10]) == [15]\", \"assert bar([], [1, 2, 3]) == [1, 2, 3]\", \"assert bar([1, 2, 3], []) == [1, 2, 3]\", \"assert bar([1], [0]) == [1]\", \"assert bar...
{ "split": "train", "index": 83513, "acecode_id": "evol_15241", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of fish represented as dictionaries, where each dictionary contains the following keys: 'Species', 'Length1', 'Length2', 'Length3', 'Height', 'Width', and 'Weight'. Implement a function `get_average_weight(fish_data: List[Dict[str, Union[str, float]]]) -> f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_average_weight([{'Species': 'Bream', 'Length1': 23.0, 'Length2': 25.0, 'Length3': 26.0, 'Height': 11.0, 'Width': 4.0, 'Weight': 270.0}, {'Species': 'Bream', 'Length1': 20.0, 'Length2': 22.0, 'Length3': 23.0, 'Height': 10.0, 'Width': 5.0, 'Weight': 200.0}...
{ "split": "train", "index": 83514, "acecode_id": "bigcode_python_fns_35837", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function that determines whether a given number is a prime number. A prime number is a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. The function should return True if the number is prime and False otherwise. Please ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_prime_number(2) == True\", \"assert is_prime_number(3) == True\", \"assert is_prime_number(5) == True\", \"assert is_prime_number(7) == True\", \"assert is_prime_number(11) == True\", \"assert is_prime_number(13) == True\", \"assert is_prime_number(17) ==...
{ "split": "train", "index": 83515, "acecode_id": "evol_7336", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `get_article_summary` that takes a list of articles, where each article is represented as a dictionary with 'title' and 'content' keys. The function should return a list of summaries for each article, where each summary consists of the article's title follo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_article_summary([{'title': 'First Article', 'content': 'This is the content of the first article.'}, {'title': 'Second Article', 'content': 'Short content.'}]) == ['First Article: This is the content of the first article.', 'Second Article: Short content...
{ "split": "train", "index": 83516, "acecode_id": "evol_18350", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of user dictionaries, where each dictionary contains information about a user. Each user dictionary has the following structure: {'user_id': str, 'name': str, 'email': str}. Write a function called `filter_users_by_id` that takes a list of user dictionaries...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_users_by_id([{'user_id': '1', 'name': 'Alice', 'email': 'alice@example.com'}, {'user_id': '2', 'name': 'Bob', 'email': 'bob@example.com'}], '1') == [{'user_id': '1', 'name': 'Alice', 'email': 'alice@example.com'}]\", \"assert filter_users_by_id([{'use...
{ "split": "train", "index": 83517, "acecode_id": "bigcode_python_fns_41861", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_total_cost(quantity: int, unit_price: float) -> float` that calculates the total cost for purchasing a specified quantity of items at a given unit price. The function should take two parameters: `quantity` (an integer representing the number of i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_cost(5, 2.00) == 10.0\", \"assert calculate_total_cost(0, 10.00) == 0.0\", \"assert calculate_total_cost(3, 1.50) == 4.5\", \"assert calculate_total_cost(10, 0.99) == 9.9\", \"assert calculate_total_cost(7, 5.00) == 35.0\", \"assert calculate...
{ "split": "train", "index": 83518, "acecode_id": "evol_11967", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of a simple music application model for songs. This function should take in four parameters: `audio_file` (a string representing the path of the audio file), `song_visibility` (a string representing the visibil...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_song('path/to/audio.mp3', 'public', True, 'My Song') == {'audio_file': 'path/to/audio.mp3', 'song_visibility': 'public', 'is_favorite': True, 'song_title': 'My Song'}\", \"assert create_song('path/to/audio.mp3') == {'audio_file': 'path/to/audio.mp3', ...
{ "split": "train", "index": 83519, "acecode_id": "oss_5508", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionary entries where each entry represents a deck containing a list of card tuples. Each card tuple consists of a card ID and a card name. Your task is to create a function that takes a list of decks and a deck name as input, and returns a string tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert export_deck([{'name': 'Deck1', 'entries': [(1, 'Ace of Spades'), (2, 'King of Hearts')]}, {'name': 'Deck2', 'entries': [(3, 'Queen of Diamonds')]}], 'Deck1') == '1\\tAce of Spades\\\\n2\\tKing of Hearts\\\\n'\", \"assert export_deck([{'name': 'Deck1', 'entri...
{ "split": "train", "index": 83520, "acecode_id": "bigcode_python_fns_38714", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes music timing data to generate a chart for a rhythm-based game. The function should take in a dictionary containing music timing information and return a chart based on the provided timings. The music timing informati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_game_chart({'timings': {0: 120, 30: 140, 60: 100, 90: 160}}) == [('action1', 0, 120), ('action2', 30, 140), ('action3', 60, 100), ('action4', 90, 160)]\", \"assert generate_game_chart({'timings': {0: 60, 10: 80, 20: 100}}) == [('action1', 0, 60), ('...
{ "split": "train", "index": 83521, "acecode_id": "oss_21510", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function `generate_tensor()` that generates a 3-D tensor with dimensions 5x5x5, where the elements range between -1 and 1 with a precision of two decimal places, without using any Python library that directly supports such operations. The elements in the tensor should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_tensor()) == 5\", \"assert all(len(layer) == 5 for layer in generate_tensor())\", \"assert all(all(len(row) == 5 for row in layer) for layer in generate_tensor())\", \"assert all(-1 <= num <= 1 for layer in generate_tensor() for row in layer for...
{ "split": "train", "index": 83522, "acecode_id": "evol_6137", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer array 'nums', write a function that returns the length of the longest contiguous subarray that sums to zero. If no such subarray exists, return 0.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxLengthSubarray([0, 0, 0]) == 3\", \"assert maxLengthSubarray([1, -1, 2, -2, 3, -3]) == 6\", \"assert maxLengthSubarray([1, 2, 3, 4, 5]) == 0\", \"assert maxLengthSubarray([-1, 1]) == 2\", \"assert maxLengthSubarray([-2, 2, -3, 3]) == 4\", \"assert maxLeng...
{ "split": "train", "index": 83523, "acecode_id": "evol_25082", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a custom text storage functionality. You need to create a function called `manage_text` that accepts two parameters: an initial string `text` and a list of operations. The operations can be either 'GET' to retrieve the current text or 'SET' foll...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_text('Hello', ['GET']) == ['Hello']\", \"assert manage_text('Hello', ['SET Goodbye', 'GET']) == ['Goodbye']\", \"assert manage_text('Hello', ['SET World', 'GET', 'SET Everyone', 'GET']) == ['World', 'Everyone']\", \"assert manage_text('Initial', ['GET...
{ "split": "train", "index": 83524, "acecode_id": "oss_13998", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of a model importer. Implement a function called `import_model(model_name)` that accepts a single string parameter `model_name`. The function should raise a `ValueError` with the message \"{model_name} model ha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert import_model('model_a') == 'Importing model_a model...'\", \"assert import_model('model_b') == 'Importing model_b model...'\", \"assert import_model('model_c') == 'Importing model_c model...'\", \"assert import_model('model_a') == 'Importing model_a model......
{ "split": "train", "index": 83525, "acecode_id": "oss_12354", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Develop a Python function that identifies and returns the second smallest numerical value within a provided list. The list may contain integers, floating point numbers, strings, and nested lists. Your function should be capable of handling these different data types and should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert second_smallest([1, 2, 3]) == 2\", \"assert second_smallest([5, 3, 9, 1]) == 3\", \"assert second_smallest([1.5, 2.5, 3.5]) == 2.5\", \"assert second_smallest([10, 'a', 5, [3, 1]]) == 3\", \"assert second_smallest([[1, 2], [3, 4], 5]) == 2\", \"assert second...
{ "split": "train", "index": 83526, "acecode_id": "evol_21534", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that retrieves user information based on a given username or user ID from a mock user database. The function should handle different game modes and search options. Your task is to implement the `get_user_info` function, which takes...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_user_info('PlayerOne') == {'id': 1, 'username': 'PlayerOne', 'mode': 'osu'}\", \"assert get_user_info('PlayerTwo', mode='taiko') == {'id': 2, 'username': 'PlayerTwo', 'mode': 'taiko'}\", \"assert get_user_info('PlayerThree', mode='ctb') == {'id': 3, 'use...
{ "split": "train", "index": 83527, "acecode_id": "oss_22798", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a float value representing a latitude in degrees. Your task is to implement a function that converts this latitude to a specific grid coordinate used in the MERRA-2 data portal. The conversion formula is defined as follows: the output coordinate is calculated as (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_latitude_to_grid(0.0) == 180.0\", \"assert convert_latitude_to_grid(-90.0) == 0.0\", \"assert convert_latitude_to_grid(90.0) == 360.0\", \"assert convert_latitude_to_grid(-45.0) == 90.0\", \"assert convert_latitude_to_grid(45.0) == 270.0\", \"assert ...
{ "split": "train", "index": 83528, "acecode_id": "bigcode_python_fns_47280", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `count_positive_numbers` that counts the number of positive integers in the list. A positive integer is defined as any integer greater than zero. The function should return the count of positive integers. For example, given the input l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_positive_numbers([-1, 0, 1, 2, -2]) == 2\", \"assert count_positive_numbers([3, 5, -2, 0, 7]) == 3\", \"assert count_positive_numbers([-5, -1, -2, -3]) == 0\", \"assert count_positive_numbers([]) == 0\", \"assert count_positive_numbers([0, 0, 0]) == 0\...
{ "split": "train", "index": 83529, "acecode_id": "oss_30267", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary where each key is a unique string and its corresponding value is either a string or an integer, implement a function that returns a new dictionary with the keys and values flipped. The new dictionary should have the original values as keys and the original ke...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flip_dict({'a': 1, 'b': 2, 'c': 3}) == {1: 'a', 2: 'b', 3: 'c'}\", \"assert flip_dict({'x': 'apple', 'y': 'banana', 'z': 'apple'}) == {'apple': 'z', 'banana': 'y'}\", \"assert flip_dict({'name': 'Alice', 'age': 30, 'city': 'Wonderland'}) == {'Alice': 'name',...
{ "split": "train", "index": 83530, "acecode_id": "bigcode_python_fns_44087", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `calculate_property_value` that simulates a simple property management system. This function accepts a list of property details, where each property is represented as a dictionary containing 'address', 'type', and 'price'. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_property_value([]) == 0\", \"assert calculate_property_value([{'address': '123 Main St', 'type': 'House', 'price': 250000}]) == 250000\", \"assert calculate_property_value([{'address': '456 Oak St', 'type': 'Apartment', 'price': 150000}, {'address'...
{ "split": "train", "index": 83531, "acecode_id": "oss_14935", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a frame rate monitoring system. The function, `calculate_fps`, should take a list of time intervals (in seconds) representing the time it took to render each frame in a video. The function should return a list of the calcul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_fps([0.5, 0.25, 0.1]) == [2.0, 4.0, 10.0]\", \"assert calculate_fps([1.0, 2.0, 0.0]) == [1.0, 0.5, 'Infinity']\", \"assert calculate_fps([0.1, 0.2, 0.3, 0.4]) == [10.0, 5.0, 3.3333333333333335, 2.5]\", \"assert calculate_fps([]) == []\", \"assert c...
{ "split": "train", "index": 83532, "acecode_id": "bigcode_python_fns_26543", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D array of integers, find the maximum sum of two adjacent elements in the same row. Return both the maximum sum and a list of pairs of adjacent elements that produce this sum. If there are multiple pairs with the same maximum sum, include all of them in the list.\nPlea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_adjacents_with_largest_sum([[1, 1, 1],[2, 2, 2]]) == (4, [(2, 2), (2, 2)])\", \"assert find_adjacents_with_largest_sum([[10, 5, 0],[-3, -2, -1]]) == (15, [(10, 5)])\", \"assert find_adjacents_with_largest_sum([[2, 3, 5],[5, 3, 2]]) == (8, [(3, 5), (5, 3...
{ "split": "train", "index": 83533, "acecode_id": "evol_31001", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Write a function `is_valid_url(url: str) -> bool` that checks if a given string is a valid URL. A valid URL must contain a scheme (like 'http' or 'https') and a network location (like 'www.example.com'). Return True if the URL is valid, otherwise return False.\nPlease reason st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_url('http://www.example.com') == True\", \"assert is_valid_url('https://example.org') == True\", \"assert is_valid_url('ftp://ftp.example.com') == True\", \"assert is_valid_url('http://example.com/path/to/resource') == True\", \"assert is_valid_url(...
{ "split": "train", "index": 83534, "acecode_id": "evol_34734", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `triangle_area` that calculates the area of a triangle based on the input parameters: the length of a side and an optional second parameter for height. If only one parameter is provided, assume it is the side length of an equilateral triangle. If two parame...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert triangle_area(5, 3) == 7.5\", \"assert triangle_area(3, 4) == 6.0\", \"assert triangle_area(7, 2) == 7.0\", \"assert triangle_area(10) == 43.30127018922193\", \"assert triangle_area(1, 1) == 0.5\", \"assert triangle_area(6, 2) == 6.0\", \"assert triangle_are...
{ "split": "train", "index": 83535, "acecode_id": "evol_26464", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a dictionary containing metadata for a Python package named 'passgen-py'. The function should be named `generate_package_metadata` and should take no arguments. It must return a dictionary with the following structure: \n- ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_package_metadata() == {'name': 'passgen-py', 'packages': ['passgen'], 'version': '1.1', 'description': 'Generate Passwords Deterministically based on a Master Password.', 'classifiers': ['Development Status :: 3 - Alpha', 'License :: OSI Approved ::...
{ "split": "train", "index": 83536, "acecode_id": "oss_27687", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple event input/output (I/O) system for handling event data in a particle physics experiment. The function `event_io_system` should manage event data and provide the following functionalities:\n1. Construct event d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert event_io_system('pgraph1', [1, 2, 3], 'hit1', 1, 1, 1, 0) == ('pgraph1', [1, 2, 3], 'hit1')\", \"assert event_io_system('pgraph2', [4, 5, 6], 'hit2', 2, 2, 2, 0) == ('pgraph2', [4, 5, 6], 'hit2')\", \"assert event_io_system('pgraph3', [7, 8, 9], 'hit3', 3, 3...
{ "split": "train", "index": 83537, "acecode_id": "oss_20777", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the tiling of a backdrop on a screen. The backdrop is defined by its height and width, and you need to fill a screen of specified dimensions (width and height) with this backdrop. Your function should take four parameters: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_backdrop_tiling(2, 2, 8, 8) == 16\", \"assert count_backdrop_tiling(1, 1, 5, 5) == 25\", \"assert count_backdrop_tiling(3, 4, 12, 12) == 12\", \"assert count_backdrop_tiling(5, 5, 10, 10) == 4\", \"assert count_backdrop_tiling(2, 3, 10, 10) == 15\", \"...
{ "split": "train", "index": 83538, "acecode_id": "bigcode_python_fns_25461", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `has_zero_depth(obj)` that takes an object `obj` as input and returns `True` if the type of the object is one of the following: `str`, `bytes`, `Number`, or `bytearray`. Otherwise, it should return `False`. The function should work for both Python 2 and Pyt...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_zero_depth('hello') == True\", \"assert has_zero_depth(b'hello') == True\", \"assert has_zero_depth(42) == True\", \"assert has_zero_depth(3.14) == True\", \"assert has_zero_depth(bytearray(b'hello')) == True\", \"assert has_zero_depth(None) == False\", ...
{ "split": "train", "index": 83539, "acecode_id": "oss_19082", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `generate_alphanumeric_string()` that generates a random 10-character alphanumeric string. The string must include at least 3 uppercase letters, 3 lowercase letters, and 2 digits. The remaining characters can be any combination of uppercase letters, lowercase l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_alphanumeric_string().count('A') + generate_alphanumeric_string().count('B') + generate_alphanumeric_string().count('C') + generate_alphanumeric_string().count('D') + generate_alphanumeric_string().count('E') + generate_alphanumeric_string().count('...
{ "split": "train", "index": 83540, "acecode_id": "evol_11894", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of buildings. Your task is to implement a function that determines the maximum height of any building after adding a given integer 'k' to each building's height. The function should return the maximum possible height of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_height([1, 2, 3, 4], 2) == 6\", \"assert max_height([5, 1, 3], 4) == 9\", \"assert max_height([0, 0, 0], 10) == 10\", \"assert max_height([100, 200, 300], 50) == 350\", \"assert max_height([1], 1) == 2\", \"assert max_height([10, 20, 30], 0) == 30\", \"a...
{ "split": "train", "index": 83541, "acecode_id": "bigcode_python_fns_3288", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing memory allocation for a series of instructions that require memory addresses. Each instruction can either call a function, jump to a label, or perform other operations. Your goal is to implement a function that simulates the allocation of consecutiv...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert allocate_memory_addresses(['call'], {'bank0'}) == [('bank1', 0)]\", \"assert allocate_memory_addresses(['call', 'jump'], {'bank0'}) == [('bank1', 0), ('bank1', 1)]\", \"assert allocate_memory_addresses(['call', 'call', 'jump'], {'bank0'}) == [('bank1', 0), (...
{ "split": "train", "index": 83542, "acecode_id": "bigcode_python_fns_1283", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that starts a simple HTTP server on a specified port using a mock proxy. The function should take an integer input representing the port number and return a string indicating that the server has started successfully on that port. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert start_http_server(8080) == 'Server started successfully on port 8080.'\", \"assert start_http_server(1024) == 'Server started successfully on port 1024.'\", \"assert start_http_server(65535) == 'Server started successfully on port 65535.'\", \"assert start_h...
{ "split": "train", "index": 83543, "acecode_id": "bigcode_python_fns_11070", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a custom exception hierarchy for a Python application. You need to create a set of custom exception classes that inherit from the base `Exception` class. Implement the following custom exception classes: 1. `InvalidInputError`: This exception sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert InvalidInputError('Custom invalid input message').message == 'Custom invalid input message'\", \"assert InvalidInputError().message == 'Invalid input'\", \"assert NotFoundError('Resource not found').message == 'Resource not found'\", \"assert PermissionDenie...
{ "split": "train", "index": 83544, "acecode_id": "oss_31173", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of commands, each represented as a string. Your task is to simulate sending these commands to a connection and return a list of results. Each command will either succeed or fail. For the purpose of this simulation, if a command is 'fail', it returns an erro...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_commands(['command1', 'command2', 'fail', 'command3']) == ['Command succeeded', 'Command succeeded', 'Command failed', 'Command succeeded']\", \"assert send_commands(['fail', 'fail', 'command1']) == ['Command failed', 'Command failed', 'Command succeede...
{ "split": "train", "index": 83545, "acecode_id": "bigcode_python_fns_43858", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the creation of a channel in a messaging application. The function should take the following parameters: a user ID (string), a game ID (string), a channel ID (string), and a boolean that indicates whether the channel is fin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_channel('user123', 'game456', 'channel789', False) == {'channel_id': 'channel789', 'owner_id': 'user123', 'game_id': 'game456', 'finished': False, 'guild_id': 'default_guild'}\", \"assert create_channel('user001', 'game002', 'channel003', True) == {'c...
{ "split": "train", "index": 83546, "acecode_id": "bigcode_python_fns_12161", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates writing rows to a CSV format. The function `write_rows` should take a list of rows and return a single string representing the content of the CSV file. Each row is represented as a list of values, and the values in each...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert write_rows([['Name', 'Age'], ['Alice', 30], ['Bob', 25]]) == 'Name,Age\\\\nAlice,30\\\\nBob,25\\\\n'\", \"assert write_rows([['Header1', 'Header2'], ['Value1', 'Value2']]) == 'Header1,Header2\\\\nValue1,Value2\\\\n'\", \"assert write_rows([['a', 'b', 'c'], [...
{ "split": "train", "index": 83547, "acecode_id": "oss_8490", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates retrieving a random joke from a predefined list of jokes. Implement a function `get_random_joke(jokes: List[str]) -> str` that takes a list of strings, `jokes`, where each string is a joke. The function should return a rand...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_random_joke(['Why did the chicken cross the road?', 'To get to the other side!']) == 'To get to the other side!' or get_random_joke(['Why did the chicken cross the road?', 'To get to the other side!']) == 'Why did the chicken cross the road!'\", \"assert...
{ "split": "train", "index": 83548, "acecode_id": "oss_31929", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `lhs` and `rhs`, implement a function `dominates(lhs: List[int], rhs: List[int]) -> bool` that returns True if `lhs` weakly strictly dominates `rhs`. A list `lhs` weakly strictly dominates `rhs` if every element in `lhs` is greater than or equal to ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dominates([3, 4, 5], [3, 4, 5]) == False\", \"assert dominates([4, 5, 6], [3, 4, 5]) == True\", \"assert dominates([1, 2, 3], [2, 2, 2]) == False\", \"assert dominates([5, 6, 7], [5, 5, 5]) == True\", \"assert dominates([3, 2, 1], [1, 2, 3]) == False\", \"as...
{ "split": "train", "index": 83549, "acecode_id": "bigcode_python_fns_4225", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci_sequence(n)` that takes an integer `n` as input and returns a list containing 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. If `n` is ...
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": 83550, "acecode_id": "evol_35592", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with evaluating the validity of player moves in a simple game. Each player can make a move indicated by a string, either 'up' or 'down'. Your task is to implement a function that checks whether the player's move matches the expected move for that turn. The functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_move('up', 'up') == True\", \"assert validate_move('down', 'up') == False\", \"assert validate_move('up', 'down') == False\", \"assert validate_move('down', 'down') == True\", \"assert validate_move('up', 'up') == True\", \"assert validate_move('dow...
{ "split": "train", "index": 83551, "acecode_id": "oss_16579", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the total amount of money that can be used to repay a loan based on a specified collateral amount and a repayment limit. The function will take two parameters: `collateral` (a float representing the amount of collateral av...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_repayment_amount(1000.0, 500.0) == 500.0\", \"assert calculate_repayment_amount(2000.0, 1500.0) == 1500.0\", \"assert calculate_repayment_amount(750.0, 1000.0) == 750.0\", \"assert calculate_repayment_amount(0.0, 1000.0) == 0.0\", \"assert calculat...
{ "split": "train", "index": 83552, "acecode_id": "bigcode_python_fns_41485", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of numbers representing distances from a point along a straight line. Write a function `calculate_distances` that accepts a list of distances and returns a new list where each element at index `i` is the sum of the distances from index `0` to `i` in the inp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_distances([1.0, 2.0, 3.0]) == [1.0, 3.0, 6.0]\", \"assert calculate_distances([0.0, 0.0, 0.0]) == [0.0, 0.0, 0.0]\", \"assert calculate_distances([-1.0, -2.0, -3.0]) == [-1.0, -3.0, -6.0]\", \"assert calculate_distances([1.5, 2.5, 3.5]) == [1.5, 4....
{ "split": "train", "index": 83553, "acecode_id": "bigcode_python_fns_25837", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `ticks_cpu()` that simulates the retrieval of high-resolution time ticks from a CPU or high-resolution timer. The function should return a non-negative integer representing the number of ticks since an arbitrary starting point. The ticks ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ticks_cpu() < ticks_cpu()\", \"assert ticks_cpu() < ticks_cpu()\", \"assert ticks_cpu() < ticks_cpu()\", \"assert ticks_cpu() < ticks_cpu()\", \"assert ticks_cpu() < ticks_cpu()\", \"assert ticks_cpu() < ticks_cpu()\", \"assert ticks_cpu() < ticks_cpu()\", \...
{ "split": "train", "index": 83554, "acecode_id": "bigcode_python_fns_49679", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a tuple representing the dimensions of an image, write a function that returns a string describing the image size as 'Width x Height'. The input will be a tuple of two integers, where the first integer represents the width and the second integer represents the height. For...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert image_size_description((300, 400)) == '300 x 400'\", \"assert image_size_description((1920, 1080)) == '1920 x 1080'\", \"assert image_size_description((640, 480)) == '640 x 480'\", \"assert image_size_description((1280, 720)) == '1280 x 720'\", \"assert imag...
{ "split": "train", "index": 83555, "acecode_id": "bigcode_python_fns_3121", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a formatted message about a bird. The function should take two parameters: the name of the bird (a string) and the author's name (a string). The function should return a string in the following format: 'BIRDS 0_0\nAuthor: {...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_bird_message('Sparrow', 'Alice') == 'BIRDS 0_0\\\\nAuthor: Alice\\\\nBird: Sparrow'\", \"assert generate_bird_message('Eagle', 'Bob') == 'BIRDS 0_0\\\\nAuthor: Bob\\\\nBird: Eagle'\", \"assert generate_bird_message('Parrot', 'Charlie') == 'BIRDS 0_0...
{ "split": "train", "index": 83556, "acecode_id": "bigcode_python_fns_10239", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function `find_maximum` that returns the maximum integer from the list. If the list is empty, the function should return None. The function should be defined as follows: \n\n```python\ndef find_maximum(nums: List[int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_maximum([1, 2, 3, 4, 5]) == 5\", \"assert find_maximum([-1, -2, -3, -4, -5]) == -1\", \"assert find_maximum([0, 0, 0, 0]) == 0\", \"assert find_maximum([3, 1, 4, 1, 5, 9]) == 9\", \"assert find_maximum([10, 20, 30]) == 30\", \"assert find_maximum([-10, ...
{ "split": "train", "index": 83557, "acecode_id": "oss_19525", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks whether a given string is a valid endpoint ID for a URL routing system. The valid endpoint ID must start with 'endpoint/' followed by a non-empty alphanumeric string (which can include underscores). Your function should ta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_endpoint_id('endpoint/test123') == True\", \"assert is_valid_endpoint_id('endpoint/_my_endpoint') == True\", \"assert is_valid_endpoint_id('endpoint/1A2B3C') == True\", \"assert is_valid_endpoint_id('endpoint/valid_id_123') == True\", \"assert is_va...
{ "split": "train", "index": 83558, "acecode_id": "oss_35391", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function `print_date_in_timezone(timezone_str: str) -> str` that takes a string representing a time zone (e.g., 'America/New_York') and returns the current date formatted as 'Day/Month/Year' in that time zone. The function should handle exceptions for improper time zon...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_date_in_timezone('America/New_York') == datetime.now(pytz.timezone('America/New_York')).strftime('%d/%m/%Y')\", \"assert print_date_in_timezone('Europe/London') == datetime.now(pytz.timezone('Europe/London')).strftime('%d/%m/%Y')\", \"assert print_date...
{ "split": "train", "index": 83559, "acecode_id": "evol_179", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `s` that consists of lowercase letters, uppercase letters, numbers, and underscores, write a function `pretty_print(s: str, toUpper: bool) -> str` that replaces all underscores with spaces and capitalizes the first letter of each word if the string is composed en...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pretty_print('data_quality', False) == 'Data Quality'\", \"assert pretty_print('copy_number_123', False) == 'Copy Number 123'\", \"assert pretty_print('my_own_title', False) == 'My Own Title'\", \"assert pretty_print('hla', False) == 'Hla'\", \"assert pretty...
{ "split": "train", "index": 83560, "acecode_id": "bigcode_python_fns_49237", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a time series data. Your task is to implement a function that returns a new list containing the values of the time series that are greater than the average of the entire series. The function should take a list of integers as input a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_above_average([1, 2, 3, 4, 5]) == [4, 5]\", \"assert filter_above_average([10, 20, 30, 40, 50]) == [40, 50]\", \"assert filter_above_average([5, 5, 5]) == []\", \"assert filter_above_average([0, 0, 0, 0]) == []\", \"assert filter_above_average([-10, -...
{ "split": "train", "index": 83561, "acecode_id": "bigcode_python_fns_5226", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that filters out prime numbers from a given list of positive integers. The function should take a list as input and return a new list containing only the prime numbers. A prime number is defined as a number greater than 1 that has no positive divisors ot...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_primes([2, 3, 4, 5, 6, 7]) == [2, 3, 5, 7]\", \"assert filter_primes([1, 0, -1, 8]) == []\", \"assert filter_primes([11, 13, 17, 19]) == [11, 13, 17, 19]\", \"assert filter_primes([]) == []\", \"assert filter_primes([4, 6, 8, 9, 10]) == []\", \"assert...
{ "split": "train", "index": 83562, "acecode_id": "evol_28073", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two unordered lists, one containing integers and the other containing strings, implement a function that sorts the integer list in descending order using an optimized bubble sort algorithm and sorts the string list alphabetically while respecting case sensitivity (i.e., '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sorted_combined([4, 2, 3, 8, 1], ['apple', 'Mango', 'banana', 'cherry', 'grape']) == ['Mango', 'apple', 'banana', 'cherry', 'grape', 8, 4, 3, 2, 1]\", \"assert sorted_combined([], []) == []\", \"assert sorted_combined([1, 2, 3], ['c', 'a', 'b']) == ['a', 'b'...
{ "split": "train", "index": 83563, "acecode_id": "evol_5576", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with building a function that simulates the submission of a job to a cloud-based data processing system. Your function should accept a job ID, a job type, a region, and a project ID as parameters. If the job type is 'SPARK_JOB' and the submission is successful, y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert submit_job('job_001', 'SPARK_JOB', 'us-central1', 'project_123') == 'Job submitted successfully.'\", \"assert submit_job('job_002', 'SPARK_JOB', 'us-east1', 'project_456') == 'Job submitted successfully.'\", \"assert submit_job('job_004', 'SPARK_JOB', 'us-ce...
{ "split": "train", "index": 83564, "acecode_id": "bigcode_python_fns_5104", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a dictionary `pkg_data` where each key is a package name (a string) and the value is a list of filenames (strings) associated with that package. You are also given a dictionary `keywords` which contains a key 'options' that maps to another dictionary. Your task is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert gather_setup_keywords({'pkg1': ['file1.py', 'file2.py'], 'pkg2': ['file3.py']}, {'options': {}}) == {'options': {'packages': ['pkg1', 'pkg2'], 'package_data': {'pkg1': ['file1.py', 'file2.py'], 'pkg2': ['file3.py']}}}\", \"assert gather_setup_keywords({'pkgA...
{ "split": "train", "index": 83565, "acecode_id": "bigcode_python_fns_38245", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that migrates test paths based on old and new naming patterns. The function should take two string arguments, `old_pattern` and `new_pattern`, representing the old test path pattern and the new test path pattern, respectively. The fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert migrate_test_paths('test/old/path/*', 'test/new/path/*') == [{'old_test_key': 'test/old/path/test1', 'new_test_key': 'test/new/path/test1'}, {'old_test_key': 'test/old/path/test2', 'new_test_key': 'test/new/path/test2'}]\", \"assert migrate_test_paths('test/...
{ "split": "train", "index": 83566, "acecode_id": "bigcode_python_fns_24619", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that takes a list of tuples as input and returns a new list containing the second element of each tuple in the input list. If a tuple does not have a second element, the function should return None for that tuple. Write a funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_second_element([(1, 2), ('a', 'b', 'c'), (True,), (4, 5, 6)]) == [2, 'b', None, 5]\", \"assert extract_second_element([(3, 4), (5,), (None, 'test', 8)]) == [4, None, 'test']\", \"assert extract_second_element([('x', 'y'), ('hello',), ('Python', 'rock...
{ "split": "train", "index": 83567, "acecode_id": "oss_11433", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to update a configuration dictionary based on a source dictionary and a configuration description. The configuration dictionary `dst` contains various configuration settings, while the source dictionary `src` holds the new values to b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert _update_config({'server': {'host': 'localhost', 'port': 8080}, 'logging': {'level': 'info'}}, {'server': {'port': 9090}, 'logging': {'level': 'debug'}}, {'server': {'host': 'Server Hostname', 'port': ('Server Port', int)}, 'logging': {'level': 'Logging Level...
{ "split": "train", "index": 83568, "acecode_id": "oss_6593", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates the validation of an email address for a superuser in a web application. The function should take in the email address of the superuser and return a string indicating whether the email is valid or invalid for the cre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_superuser_email('user@example.com') == 'Valid email for superuser'\", \"assert validate_superuser_email('user@sub.example.com') == 'Valid email for superuser'\", \"assert validate_superuser_email('invalidemail.com') == 'Invalid email for superuser'\...
{ "split": "train", "index": 83569, "acecode_id": "oss_20620", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple banking operation. The function should take a list of transaction commands and return the final balance and the total number of transactions performed. Each transaction command can be a deposit or a withdrawal....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_operations([('deposit', 1000), ('withdraw', 400)]) == (600, 2)\", \"assert bank_operations([('deposit', 500), ('withdraw', 600)]) == (500, 2)\", \"assert bank_operations([('deposit', 200), ('withdraw', 100), ('withdraw', 150)]) == (100, 3)\", \"assert b...
{ "split": "train", "index": 83570, "acecode_id": "oss_24113", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a list of allowed origins for Cross-Origin Resource Sharing (CORS) based on a predefined set of valid origins and a given list of additional origins. The function should take in a list of additional origins and retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_allowed_origins([]) == ['http://localhost', 'http://localhost:8000', 'http://localhost:3000', 'https://example.com']\", \"assert generate_allowed_origins(['http://myapp.com']) == ['http://localhost', 'http://localhost:8000', 'http://localhost:3000',...
{ "split": "train", "index": 83571, "acecode_id": "oss_25583", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a recursive function that calculates the m-th Fibonacci word in the Fibonacci word sequence. The Fibonacci word sequence starts with '0' and '1', and each subsequent word is formed by concatenating the previous two words. Your function should take an integer m as inpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert Fibonacci_Word(0) == '0'\", \"assert Fibonacci_Word(1) == '1'\", \"assert Fibonacci_Word(2) == '10'\", \"assert Fibonacci_Word(3) == '101'\", \"assert Fibonacci_Word(4) == '10110'\"]}" }
{ "split": "train", "index": 83572, "acecode_id": "evol_23886", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that selects the best version of a package from a queue of available versions. Write a function `prune_to_best_version(pool, package_queue)` that takes in a `pool` of available packages and a `package_queue` containing different versi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prune_to_best_version(['2.0'], ['1.0', '1.1', '1.2']) == []\", \"assert prune_to_best_version(['1.0'], ['1.1', '1.0']) == ['1.1']\", \"assert prune_to_best_version(['2.0', '2.1'], ['2.0', '2.2', '2.1']) == ['2.2']\", \"assert prune_to_best_version(['2.5', '2...
{ "split": "train", "index": 83573, "acecode_id": "oss_36694", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Write a function `palindrome_prime(n: int) -> List[int]` that returns a list of all palindrome prime numbers less than or equal to a specified number `n`. A palindrome prime is a number that is both a prime number and a palindrome. The function should only consider positive int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert palindrome_prime(10) == [2, 3, 5, 7]\", \"assert palindrome_prime(11) == [2, 3, 5, 7, 11]\", \"assert palindrome_prime(1000) == [2, 3, 5, 7, 11, 101, 131, 151, 181, 191, 313, 353, 373, 383, 727, 757, 787, 797, 919, 929]\", \"assert palindrome_prime(5) == [2,...
{ "split": "train", "index": 83574, "acecode_id": "evol_5851", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of command-line arguments represented as strings, implement a function `process_args(args: List[str]) -> Dict[str, Any]` that processes these arguments and returns a dictionary containing the required and optional arguments. The arguments include a mandatory 'domai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_args(['--domain_type', 'typeA']) == {'domain_type': 'typeA'}\", \"assert process_args(['--domain_type', 'typeB', '--java_home', '/path/to/java']) == {'domain_type': 'typeB', 'java_home': '/path/to/java'}\", \"assert process_args(['--domain_type', 'ty...
{ "split": "train", "index": 83575, "acecode_id": "bigcode_python_fns_40788", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a string representing the operating mode of a room and returns a dictionary with a single key-value pair. The key should be 'operationMode' and the value should be the input string. Implement a function named 'room_operating_mo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert room_operating_mode('cool') == {'operationMode': 'cool'}\", \"assert room_operating_mode('heat') == {'operationMode': 'heat'}\", \"assert room_operating_mode('off') == {'operationMode': 'off'}\", \"assert room_operating_mode('ventilate') == {'operationMode':...
{ "split": "train", "index": 83576, "acecode_id": "bigcode_python_fns_24430", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates the setting of an active status for an email sending bot. The function should accept a boolean parameter representing the desired active status and return a string indicating the current status of the bot. If the sta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_bot_status(True) == 'Bot is active'\", \"assert set_bot_status(False) == 'Bot is inactive'\", \"assert set_bot_status(True) == 'Bot is active'\", \"assert set_bot_status(False) == 'Bot is inactive'\", \"assert set_bot_status(True) == 'Bot is active'\", \...
{ "split": "train", "index": 83577, "acecode_id": "oss_2624", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `extract_planet_info(data: List[str]) -> List[Tuple[str, str, str]]` that takes a list of strings, where each string contains information about a planet in the format 'Name: [name], Mass: [mass], Distance: [distance]'. The function should return a list of tuple...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_planet_info(['Name: Mercury, Mass: 0.330, Distance: 0.39', 'Name: Venus, Mass: 4.87, Distance: 0.72']) == [('Mercury', '0.330', '0.39'), ('Venus', '4.87', '0.72')]\", \"assert extract_planet_info(['Name: Earth, Mass: 5.97, Distance: 1.00', 'Name: Mar...
{ "split": "train", "index": 83578, "acecode_id": "evol_22495", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `remove_attribute(data: Union[dict, list], attr: Any) -> None` that removes all instances of a specified attribute `attr` from a nested data structure consisting of dictionaries and lists. The function should modify the data structure in place. The attribute ma...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_attribute({'a': 1, 'b': 2, 'c': 3, 'd': 4}, 'd') == None\", \"assert remove_attribute({'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': {'d': 5}}, 'd') == None\", \"assert remove_attribute({'x': 'd', 'y': [1, 2, 3]}, 'd') == None\", \"assert remove_attribute({'ke...
{ "split": "train", "index": 83579, "acecode_id": "evol_1395", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of stock prices, implement a function `calculate_stock_span(prices: List[int]) -> List[int]` that computes the span of stock prices for each day. The span of the stock's price on a given day is defined as the greatest number of consecutive days (starting from that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_stock_span([100, 80, 60, 70, 60, 75, 85]) == [1, 1, 1, 2, 1, 4, 6]\", \"assert calculate_stock_span([30, 10, 20, 10, 50]) == [1, 1, 2, 1, 5]\", \"assert calculate_stock_span([10, 20, 30, 40, 50]) == [1, 2, 3, 4, 5]\", \"assert calculate_stock_span(...
{ "split": "train", "index": 83580, "acecode_id": "evol_24498", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Write a function in Python that takes in a list and two values as inputs. The function should swap all occurrences of these two given values in the list without using built-in Python functions like 'replace'. Ensure that the list size remains constant after swapping the values....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert swap_values([1, 2, 3], 1, 2) == [2, 1, 3]\", \"assert swap_values([1, 2, 2, 3], 2, 3) == [1, 3, 3, 2]\", \"assert swap_values([1, 1, 1, 1], 1, 2) == [2, 2, 2, 2]\", \"assert swap_values([], 1, 2) == []\", \"assert swap_values([10, 20, 30, 10], 10, 20) == [20...
{ "split": "train", "index": 83581, "acecode_id": "evol_11157", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an object that can either be a string, a custom object with a 'build' method, or a special class called 'TexObject' which has its own 'build' method. Your task is to implement a function called 'build_object' that takes an object as input. If the object is a 'TexO...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_object('Hello, World!') == 'Hello, World!'\", \"assert build_object(123) == '123'\", \"assert build_object([]) == '[]'\", \"assert build_object({}) == '{}'\"]}" }
{ "split": "train", "index": 83582, "acecode_id": "bigcode_python_fns_42900", "num_tests": 4 }
acecode
[ { "role": "user", "content": "Given a string **text** and an integer **limit**, implement a function that truncates the string in the middle if its length exceeds the limit. The truncated version should keep the first half of the characters before the limit and the last half after the limit, replacing the m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert truncate_chars_middle('Short', 10) == 'Short'\", \"assert truncate_chars_middle('', 5) == ''\", \"assert truncate_chars_middle('Python programming', -1) == ''\", \"assert truncate_chars_middle('LeetCode', 8) == 'LeetCode'\", \"assert truncate_chars_middle('T...
{ "split": "train", "index": 83583, "acecode_id": "bigcode_python_fns_30576", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Design a Python function that accepts a URL as a text string input and verifies its validity using a regex pattern. The function should extract the top-level domain (TLD, e.g. .com, .co.uk, .net) and the most specific subdomain if it exists (e.g. www or mail etc), and return th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_url('http://example') == (False, None, None)\", \"assert check_url('ftp://example.com') == (False, None, None)\", \"assert check_url('https://1.2.3.4') == (False, None, None)\", \"assert check_url('https://example.com.') == (False, None, None)\", \"ass...
{ "split": "train", "index": 83584, "acecode_id": "evol_31365", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that evaluates the overlap between two sets of entities: taxa (organisms) and chemicals. You will be given two lists of strings, `taxa_list` and `chemicals_list`. Your function should find the overlapping entities between the two lists an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_entity_overlap([], ['Water', 'Salt']) == {'num_overlapping_entities': 0, 'overlapping_entities': [], 'overlapping_indices': []}\", \"assert find_entity_overlap(['Oxygen'], ['Oxygen', 'Nitrogen']) == {'num_overlapping_entities': 1, 'overlapping_entities'...
{ "split": "train", "index": 83585, "acecode_id": "oss_7075", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of students in a class. Write a function `average_score(scores: List[int]) -> float` that calculates and returns the average score of the students. The average should be computed as the total sum of the scores divided by ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_score([90, 80, 70]) == 80.0\", \"assert average_score([100, 90, 95, 85, 80]) == 90.0\", \"assert average_score([0, 0, 0]) == 0.0\", \"assert average_score([100]) == 100.0\", \"assert average_score([]) == 0.0\", \"assert average_score([50, 60]) == 55....
{ "split": "train", "index": 83586, "acecode_id": "bigcode_python_fns_10197", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of numerical values, write a function `normalize` that normalizes the values in the list to a scale of 0.0 to 1.0. The normalization should be done using the formula: normalized_value = (value - min_value) / (max_value - min_value), where min_value is the minimum v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize([1, 2, 3]) == [0.0, 0.5, 1.0]\", \"assert normalize([10, 20, 30, 40]) == [0.0, 0.3333333333333333, 0.6666666666666666, 1.0]\", \"assert normalize([-1, 0, 1]) == [0.0, 0.5, 1.0]\", \"assert normalize([-5, -3, -1]) == [0.0, 0.5, 1.0]\", \"assert norm...
{ "split": "train", "index": 83587, "acecode_id": "bigcode_python_fns_12745", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that determines if a given string ends with a specified substring, ignoring case sensitivity. The function should return True if the string ends with the substring and False otherwise. For example, calling the function with 'HelloWorld' and 'world' should retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_suffix('activity', 'ity') == True\", \"assert has_suffix('helloityity', 'ity') == True\", \"assert has_suffix('heaven', 'ity') == False\", \"assert has_suffix('HelloWorld', 'world') == True\", \"assert has_suffix('PythonProgramming', 'ming') == True\", \...
{ "split": "train", "index": 83588, "acecode_id": "evol_31663", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci(n: int) -> List[int]` that returns the first `n` elements of the Fibonacci sequence. The Fibonacci sequence is characterized by the fact that each number is the sum of the two preceding ones, starting from 0 and 1. For example, the first 8 elemen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(0) == []\", \"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]\",...
{ "split": "train", "index": 83589, "acecode_id": "evol_12917", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a file compression algorithm that utilizes a simple form of run-length encoding (RLE). In RLE, consecutive identical characters in a string are replaced with a count followed by a single instance of the character. For example, the string 'AAABBB...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compress_disk_content('') == ''\", \"assert compress_disk_content('A') == '1A'\", \"assert compress_disk_content('AA') == '2A'\", \"assert compress_disk_content('AAA') == '3A'\", \"assert compress_disk_content('AABBBCC') == '2A3B2C'\", \"assert compress_disk...
{ "split": "train", "index": 83590, "acecode_id": "oss_33515", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `wrap_integers` that takes the list and returns a new list where each integer is wrapped in a tuple. The output should be a list of tuples, each containing a single integer from the input list. For example, if the input list is [1,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert wrap_integers([1, 2, 3]) == [(1,), (2,), (3,)]\", \"assert wrap_integers([10, 20, 30]) == [(10,), (20,), (30,)]\", \"assert wrap_integers([-1, -2, -3]) == [(-1,), (-2,), (-3,)]\", \"assert wrap_integers([0]) == [(0,)]\", \"assert wrap_integers([]) == []\", \...
{ "split": "train", "index": 83591, "acecode_id": "bigcode_python_fns_36782", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers that can be both positive and negative, design an algorithm to find all the subsets of the list and return the subset(s) with the maximum sum. If there are multiple subsets with the same maximum sum, return all of them. The function should be defined as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_sum_subsets([1, 2, 3, -1, -2]) == [[1, 2, 3]]\", \"assert max_sum_subsets([-1, -2, -3]) == [[]]\", \"assert max_sum_subsets([5, 1, 2, -1]) == [[5, 1, 2]]\", \"assert max_sum_subsets([-5, -3, -1]) == [[]]\", \"assert max_sum_subsets([4, 2, 3]) == [[4, 2, ...
{ "split": "train", "index": 83592, "acecode_id": "evol_4116", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are working on a robotics project that involves controlling a robotic arm. You have a predefined set of preset positions for the robotic arm, stored in a dictionary. Each key in the dictionary represents a preset name, and its corresponding value is a tuple of three floatin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_preset_coordinates('o') == (0.0, 0.0, 0.0)\", \"assert get_preset_coordinates('c') == (3.5, 3.5, 3.5)\", \"assert get_preset_coordinates('invalid_preset') == 'Preset not available'\", \"assert get_preset_coordinates('preset1') == 'Preset not available'\"...
{ "split": "train", "index": 83593, "acecode_id": "oss_33495", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that determines if all numbers in a given list are within two defined thresholds (inclusive), and returns the average of these numbers if they are. If any number is outside the thresholds, the function should return None. The function signature is: def with...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert within_thresholds_and_average([1, 2, 4, 10], 1, 20) == 4.25\", \"assert within_thresholds_and_average([5, 10, 15], 5, 15) == 10.0\", \"assert within_thresholds_and_average([3, 3, 3], 2, 5) == 3.0\", \"assert within_thresholds_and_average([1, 2, 3, 4, 5], 1, ...
{ "split": "train", "index": 83594, "acecode_id": "evol_7988", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the creation of a ball in a 2D space. The function should take in a center point, a radius, and an optional mass (defaulting to -1). The function should return a dictionary representation of the ball with the following keys...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_ball((0, 0), 5) == {'center': (0, 0), 'radius': 5, 'mass': -1}\", \"assert create_ball((1, 1), 10, 2) == {'center': (1, 1), 'radius': 10, 'mass': 2}\", \"assert create_ball((-3, 4), 0) == None\", \"assert create_ball((0, 0), 3, 1) == {'center': (0, 0)...
{ "split": "train", "index": 83595, "acecode_id": "bigcode_python_fns_48689", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the unique integers from the input list, preserving the order of their first appearance. Implement the function `unique_integers(arr: List[int]) -> List[int]`, where `ar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 1, 4]) == [1, 2, 3, 4]\", \"assert unique_integers([1, 1, 1, 1]) == [1]\", \"assert unique_integers([]) == []\", \"assert unique_integers([5, 5, 6, 7, 6, 5, 8]) == [5, 6, 7, 8]\", \"assert unique_integers([3, 2, 1, 3, 2, 1]) == [...
{ "split": "train", "index": 83596, "acecode_id": "bigcode_python_fns_28627", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the win-loss-draw ratios for a set of AI agents based on the outcomes of duels between them. Each agent can have an outcome of 'win', 'loss', or 'draw' against another agent. You are given a list of agents and a list of p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fightDuels(['P', 'Q'], [('P', 'Q', 'loss')]) == {'P': {'win': 0.0, 'loss': 1.0, 'draw': 0.0}, 'Q': {'win': 1.0, 'loss': 0.0, 'draw': 0.0}}\", \"assert fightDuels(['D', 'E'], [('D', 'E', 'win')]) == {'D': {'win': 1.0, 'loss': 0.0, 'draw': 0.0}, 'E': {'win': 0...
{ "split": "train", "index": 83597, "acecode_id": "oss_22906", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates copying the contents of one string (representing the source file) to another string (representing the destination file). The function should take three parameters: the source string, the destination string, and a boolea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert copy_contents('Hello, World!', '', False) == 'Hello, World!'\", \"assert copy_contents('Hello, World!', '', True) == 'Hello, World!'\", \"assert copy_contents('', 'Existing content', False) == ''\", \"assert copy_contents('', 'Existing content', True) == ''\...
{ "split": "train", "index": 83598, "acecode_id": "oss_6188", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the training of a simple machine learning model using a given configuration and a dataset split. The function should take two parameters: a dictionary representing the model configuration and a list of data points represent...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert train_model({'learning_rate': 0.01, 'epochs': 10}, [1, 2, 3]) == 'Training completed'\", \"assert train_model({'learning_rate': 0.1, 'epochs': 5}, []) == 'Training failed'\", \"assert train_model({'learning_rate': 0.001, 'epochs': 20}, [4, 5, 6]) == 'Trainin...
{ "split": "train", "index": 83599, "acecode_id": "oss_9498", "num_tests": 16 }