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": "Write a function `fibonacci_sequence(n)` that takes an integer `n` as input and returns a list containing the first `n` numbers of the Fibonacci sequence. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of t...
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": 4000, "acecode_id": "evol_31943", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that checks a list of hyperlinks to determine if the target files are listed in a given configuration. The 'pages' configuration is represented as a dictionary where the keys are the file names and the values are their correspondin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_hyperlinks([('index.html', 'about.html'), ('index.html', 'contact.html'), ('about.html', 'services.html'), ('services.html', 'pricing.html')], {'index.html': {'type': 'public'}, 'about.html': {'type': 'public'}, 'contact.html': {'type': 'private'}}) ==...
{ "split": "train", "index": 4001, "acecode_id": "oss_24559", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a string input representing a request header, determine if it contains a valid authentication signature. The authentication signature is considered valid if the header starts with 'X-Hub-Signature' followed by a colon and a non-empty value. Implement a function `is_authen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_authentic_request('X-Hub-Signature: abc123') == True\", \"assert is_authentic_request('X-Hub-Signature: ') == False\", \"assert is_authentic_request('X-Hub-Signature: validSignature123') == True\", \"assert is_authentic_request('X-Hub-Signature') == False...
{ "split": "train", "index": 4002, "acecode_id": "bigcode_python_fns_6571", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing an algorithm to resolve package dependencies for a software package manager. Each dependency is represented as a tuple of the form (package_name, dependent_package_name), indicating that package_name depends on dependent_package_name. The operat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert resolve_dependencies([('A', 'B'), ('B', 'C'), ('C', 'A')], ['A', 'B', 'C']) == 'Cycle detected, unable to resolve dependencies'\", \"assert resolve_dependencies([], ['A', 'B']) == ['A', 'B']\", \"assert resolve_dependencies([('A', 'B'), ('B', 'C'), ('C', 'D'...
{ "split": "train", "index": 4003, "acecode_id": "oss_12303", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function called `subtract_two_numbers` that takes two parameters, `a` and `b`. The function should first validate that both parameters are non-negative integers. If both are valid, it should return the result of subtracting `b` from `a`. If either parameter is inval...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert subtract_two_numbers(5, 3) == 2\", \"assert subtract_two_numbers(0, 0) == 0\", \"assert subtract_two_numbers(10, 5) == 5\", \"assert subtract_two_numbers(100, 50) == 50\", \"assert subtract_two_numbers(1, 1) == 0\", \"assert subtract_two_numbers(0, 1) == -1\...
{ "split": "train", "index": 4004, "acecode_id": "evol_30269", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function that analyzes a patient's medical data and provides a risk assessment based on provided risk factors and symptoms. Your function should take in a dictionary containing two lists: 'risk_factors' and 'symptoms'. The function will return a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_patient_risk({'risk_factors': ['smoking', 'obesity', 'diabetes', 'hypertension'], 'symptoms': ['chest pain']}) == 'High Risk'\", \"assert analyze_patient_risk({'risk_factors': ['smoking', 'obesity'], 'symptoms': []}) == 'Medium Risk'\", \"assert anal...
{ "split": "train", "index": 4005, "acecode_id": "oss_1772", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function that determines whether a given number is a Fermat prime. A Fermat prime is defined as a Fermat number that is also a prime number. A Fermat number F_n is defined as F_n = 2^(2^n) + 1, where n is a non-negative integer. The first few Fermat primes are 3, 5,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_fermat_prime(3) == True\", \"assert is_fermat_prime(5) == True\", \"assert is_fermat_prime(17) == True\", \"assert is_fermat_prime(257) == True\", \"assert is_fermat_prime(65537) == True\", \"assert is_fermat_prime(1) == False\", \"assert is_fermat_prime(...
{ "split": "train", "index": 4006, "acecode_id": "evol_26131", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing credit card bills, write a function that calculates the total amount of bills and returns it. The input list will contain non-negative integers only. The function should be named `calculate_total_bills(bills: List[int]) -> int`. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_bills([100, 200, 300]) == 600\", \"assert calculate_total_bills([0, 0, 0]) == 0\", \"assert calculate_total_bills([50, 150, 200]) == 400\", \"assert calculate_total_bills([1, 2, 3, 4, 5]) == 15\", \"assert calculate_total_bills([1000]) == 100...
{ "split": "train", "index": 4007, "acecode_id": "bigcode_python_fns_13690", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of ages in millions of years (Myr) and a float value representing a desired age, write a function that finds the closest age in the list to the given age. If the list is empty, return None. The function should return the closest age. If two ages are equally close, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert closest_age([1.5, 2.0, 3.0, 4.5], 2.3) == 2.0\", \"assert closest_age([1.5, 2.0, 3.0, 4.5], 3.1) == 3.0\", \"assert closest_age([1.5, 2.0, 3.0, 4.5], 4.5) == 4.5\", \"assert closest_age([1.5, 2.0, 3.0, 4.5], 1.0) == 1.5\", \"assert closest_age([1.5, 2.0, 3.0...
{ "split": "train", "index": 4008, "acecode_id": "bigcode_python_fns_2877", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that compares two software version strings and determines their relative order. The version strings are composed of numeric components separated by dots (e.g., '1.0.0', '2.1.1'). You need to implement a function `compare_versions(vers...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_versions('1.0.0', '1.0.1') == -1\", \"assert compare_versions('1.1.0', '1.0.9') == 1\", \"assert compare_versions('2.0.0', '2.0.0') == 0\", \"assert compare_versions('1.2.3-alpha', '1.2.3') == 0\", \"assert compare_versions('1.0.0', '1.0.0-beta') == ...
{ "split": "train", "index": 4009, "acecode_id": "bigcode_python_fns_10483", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that filters a list of permissions to only include those related to a specific model. The function should take a list of permission strings that follow the format 'app_label.permission_type_model'. For this problem, you only need t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_form_permissions(['db_store.add_savedformdataentry', 'db_store.change_savedformdataentry', 'auth.delete_user', 'db_store.view_savedformdataentry']) == ['db_store.add_savedformdataentry', 'db_store.change_savedformdataentry', 'db_store.view_savedformda...
{ "split": "train", "index": 4010, "acecode_id": "oss_15557", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that computes the number of channels for a neural network layer based on a given channel multiplier. The number of channels is derived from a base value of 1280, which is then scaled by the channel multiplier and rounded to the nearest mu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_channels(1.0) == 1280\", \"assert calculate_channels(1.1) == 1280\", \"assert calculate_channels(1.4) == 1280\", \"assert calculate_channels(1.5) == 1280\", \"assert calculate_channels(0.5) == 640\", \"assert calculate_channels(0) == 0\", \"assert ...
{ "split": "train", "index": 4011, "acecode_id": "bigcode_python_fns_2304", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `factorial_iterative(x)` that computes the factorial of a positive integer `x`, where `0 <= x < 20`, using an iterative approach. The function should return the factorial as an integer. For example, if `x = 5`, then `factorial_iterative(5)` should return `1...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial_iterative(0) == 1\", \"assert factorial_iterative(1) == 1\", \"assert factorial_iterative(2) == 2\", \"assert factorial_iterative(3) == 6\", \"assert factorial_iterative(4) == 24\", \"assert factorial_iterative(5) == 120\", \"assert factorial_itera...
{ "split": "train", "index": 4012, "acecode_id": "evol_3142", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with maintaining a history of integer values. Implement a function `manage_history(operations: List[Tuple[str, Union[int, None]]]) -> Tuple[float, int]` that processes a list of operations on the history. The operations can be of the following types: \n1. `update...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_history([('update', 1), ('update', 2), ('update', 3), ('update', 4), ('update', 5), ('set_max', 5), ('update', 6), ('get_avg')]) == (4.0, 6)\", \"assert manage_history([('set_max', 3), ('update', 10), ('update', 20), ('update', 30), ('get_max')]) == (...
{ "split": "train", "index": 4013, "acecode_id": "oss_20851", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of words, write a function `alphabeticOrder(words, order)` that sorts the words in either ascending or descending alphabetical order based on the given parameter `order`. The function should ignore any words that contain non-alphabetic characters or are empty strin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert alphabeticOrder(['banana', 'apple', 'orange'], 'asc') == ['apple', 'banana', 'orange']\", \"assert alphabeticOrder(['banana', 'apple', 'orange'], 'desc') == ['orange', 'banana', 'apple']\", \"assert alphabeticOrder(['hello', 'world', '123', 'test', ''], 'asc...
{ "split": "train", "index": 4014, "acecode_id": "evol_4868", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes two integers as inputs and returns their product. The function should be named `multiply_numbers` and should accept two parameters: `num1` and `num2`. It should return the product of these two numbers.\nPlease reason step by step, then write a self-c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply_numbers(2, 3) == 6\", \"assert multiply_numbers(0, 5) == 0\", \"assert multiply_numbers(-1, 1) == -1\", \"assert multiply_numbers(-4, -5) == 20\", \"assert multiply_numbers(10, 0) == 0\", \"assert multiply_numbers(7, 8) == 56\", \"assert multiply_nu...
{ "split": "train", "index": 4015, "acecode_id": "evol_35509", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to select a specific region in an image based on a given color. The image is represented as a 3D list, where the dimensions correspond to the height, width, and color channels. The color of the region to be selected is specified by a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert select_region_by_color([[[255, 0, 0], [255, 0, 0]], [[0, 255, 0], [0, 0, 255]]], [255, 0, 0]) == [(0, 0), (1, 0)]\", \"assert select_region_by_color([[[0, 0, 0], [0, 0, 0]], [[0, 0, 0], [0, 0, 0]]], [255, 255, 255]) == []\", \"assert select_region_by_color([...
{ "split": "train", "index": 4016, "acecode_id": "oss_25777", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of migration operations and returns the names of the fields that are being altered. Each migration operation is represented as a tuple containing the operation type, model name, and field name. Your function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_altered_fields([('AlterField', 'Order', 'status'), ('AlterField', 'Order', 'total')]) == ['status', 'total']\", \"assert extract_altered_fields([('AddField', 'User', 'email'), ('AlterField', 'User', 'username'), ('AlterField', 'User', 'password')]) =...
{ "split": "train", "index": 4017, "acecode_id": "oss_25237", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Design a function that simulates a simple chat system for a video conferencing tool. The function should take a list of messages (strings) and a username (string) as input, and return a list of formatted messages that include the username and the message. The format should be '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_chat_messages(['Hello', 'How are you?'], 'Alice') == ['Alice: Hello', 'Alice: How are you?']\", \"assert format_chat_messages(['Hi', 'Welcome to the conference!'], 'Bob') == ['Bob: Hi', 'Bob: Welcome to the conference!']\", \"assert format_chat_messag...
{ "split": "train", "index": 4018, "acecode_id": "evol_29424", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that normalizes certain string types based on predefined mappings. Implement a function `normalize_type` that takes a single string input representing a data type and returns the normalized type according to the following rules: If the in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_type('text') == 'text/plain'\", \"assert normalize_type('url') == 'text/uri-list'\", \"assert normalize_type('image') == 'image'\", \"assert normalize_type('text/plain') == 'text/plain'\", \"assert normalize_type('text/html') == 'text/html'\", \"as...
{ "split": "train", "index": 4019, "acecode_id": "bigcode_python_fns_30857", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of stock transactions, determine if a user can successfully buy a specified number of shares of a stock without exceeding their available cash. Each transaction is represented as a dictionary containing the stock symbol, the price per share, and the number of share...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_buy_stocks([{'symbol': 'AAPL', 'price': 150.0, 'shares': 2}], 350.0) == True\", \"assert can_buy_stocks([{'symbol': 'GOOGL', 'price': 2800.0, 'shares': 1}], 2500.0) == False\", \"assert can_buy_stocks([{'symbol': 'MSFT', 'price': 300.0, 'shares': 1}, {'s...
{ "split": "train", "index": 4020, "acecode_id": "bigcode_python_fns_32093", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that checks if a given string consists solely of digits and has a minimum length of 3 characters. The function should return True if both conditions are satisfied, otherwise return False.\nPlease reason step by step, then write a self-contained Python so...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_string('12345') == True\", \"assert check_string('12') == False\", \"assert check_string('1a2b3') == False\", \"assert check_string('123') == True\", \"assert check_string('') == False\", \"assert check_string('12a34') == False\", \"assert check_string...
{ "split": "train", "index": 4021, "acecode_id": "evol_299", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with correcting a function that contains several mistakes related to Python's built-in functions. Write a function named `correct_code` that fixes the errors in the provided code block. The function should return a tuple containing a corrected string, an integer ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert correct_code() == ('Python Programming', 101, 10.5, 20, 10, 4.0)\", \"assert correct_code() != ('Python Programming', 100, 10.5, 20, 10, 4.0)\", \"assert isinstance(correct_code(), tuple)\", \"assert len(correct_code()) == 6\", \"assert isinstance(correct_co...
{ "split": "train", "index": 4022, "acecode_id": "evol_29810", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are developing a game and need to classify weapons based on their properties. Write a function `isWeaponLightOrOneHandedPiercing(obj, weap)` that takes two parameters: `obj` (an object representing the context of the weapon) and `weap` (a string representing the type of wea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert isWeaponLightOrOneHandedPiercing(None, 'dagger') == 1\", \"assert isWeaponLightOrOneHandedPiercing(None, 'sword') == 1\", \"assert isWeaponLightOrOneHandedPiercing(None, 'sling') == 1\", \"assert isWeaponLightOrOneHandedPiercing(None, 'rapier') == 1\", \"ass...
{ "split": "train", "index": 4023, "acecode_id": "oss_24140", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string that represents a file name in a specific format, your task is to extract the valid time encoded within the file name. The file name format is as follows: it starts with a prefix 'BULLETIN_', followed by a timestamp in the format 'YYYY-MM-DD_HH-MM-SS.txt'. Your f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_valid_time('BULLETIN_2022-01-01_00-00-00.txt') == 1640995200\", \"assert extract_valid_time('BULLETIN_2020-02-29_15-15-15.txt') == 1582989315\", \"assert extract_valid_time('BULLETIN_2023-05-15_08-00-00.txt') == 1684137600\", \"assert extract_valid_t...
{ "split": "train", "index": 4024, "acecode_id": "bigcode_python_fns_16606", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a configuration dictionary for an optimizer and returns the learning rate schedule and the optimizer itself. The configuration dictionary will contain the following keys: 'decay_rate' (a float), 'decay_steps' (an integer), ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert optimizer_builder({'decay_rate': 0.96, 'decay_steps': 1000, 'learning_rate': 0.001, 'gradient_clipping_by_norm': 5.0}) == ('ExponentialDecay(0.001, 1000, 0.96)', 'RMSprop')\", \"assert optimizer_builder({'decay_rate': 0.9, 'decay_steps': 500, 'learning_rate'...
{ "split": "train", "index": 4025, "acecode_id": "bigcode_python_fns_7690", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks whether a given action will cause a hypothetical instance to shut down based on a provided action type and time. The function will accept two parameters: an action (a string) which can be one of 'stop', 'terminate', 'hibernate...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert will_instance_shutdown('stop', '2023-10-01T12:00:00Z') == True\", \"assert will_instance_shutdown('terminate', '2023-10-01T12:00:00Z') == True\", \"assert will_instance_shutdown('hibernate', '2023-10-01T12:00:00Z') == True\", \"assert will_instance_shutdown(...
{ "split": "train", "index": 4026, "acecode_id": "bigcode_python_fns_8249", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating API endpoint paths for managing complaints related to tender cancellations in a procurement management system. You need to implement a function that takes three parameters: `tender_id`, `cancellation_id`, and `complaint_id`. The function should re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_complaint_paths('ABC123', 'XYZ789', '456DEF') == ('/tenders/ABC123/cancellations/XYZ789/complaints', '/tenders/ABC123/cancellations/XYZ789/complaints/456DEF')\", \"assert generate_complaint_paths('TENDER001', 'CANCEL001', 'COMPLAINT001') == ('/tende...
{ "split": "train", "index": 4027, "acecode_id": "oss_34314", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of mountains. Implement a function `max_height_difference(heights: List[int]) -> int` that returns the maximum difference in height between any two mountains. If the list is empty or contains only one mountain, return 0....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_height_difference([1, 2, 3, 4, 5]) == 4\", \"assert max_height_difference([5, 3, 8, 1]) == 7\", \"assert max_height_difference([10]) == 0\", \"assert max_height_difference([]) == 0\", \"assert max_height_difference([4, 4, 4]) == 0\", \"assert max_height_...
{ "split": "train", "index": 4028, "acecode_id": "bigcode_python_fns_8869", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `s` that represents a serialized object of a specific format. Your task is to implement a function `decode(s: str) -> str`, which deserializes the string `s` into a more readable format by returning the first line of the multiple lines obtained after spli...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decode('Hello\\\\nWorld') == 'Hello'\", \"assert decode('Line1\\\\nLine2\\\\nLine3') == 'Line1'\", \"assert decode('\\\\nSingleLine') == ''\", \"assert decode('') == ''\", \"assert decode('A\\\\nB\\\\nC\\\\nD') == 'A'\", \"assert decode('FirstLine') == 'Firs...
{ "split": "train", "index": 4029, "acecode_id": "bigcode_python_fns_47065", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of file paths to saved Keras model files, but some of these paths may be commented out. Write a Python function `load_first_available_model(model_paths)` that takes a list of strings `model_paths` as input and returns the first available Keras model loaded ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_first_available_model(['#path1', '#path2', 'model_path_1.h5']) == 'model_path_1.h5'\", \"assert load_first_available_model(['model_path_2.h5', '#path1', '#path2']) == 'model_path_2.h5'\", \"assert load_first_available_model(['#path1', 'model_path_3.h5',...
{ "split": "train", "index": 4030, "acecode_id": "oss_21587", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a time step specification and an action specification as strings, create a function that simulates the instantiation of a behavioral cloning agent. The function should take in the following parameters: a string representing the time step specification, a string representi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_behavioral_cloning_agent('time_step_1', 'action_1', 'preprocess_1', 'network_1') == {'time_step_spec': 'time_step_1', 'action_spec': 'action_1', 'preprocessing_layers': 'preprocess_1', 'policy_network': 'network_1'}\", \"assert create_behavioral_cloni...
{ "split": "train", "index": 4031, "acecode_id": "bigcode_python_fns_7155", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two strings, `s` and `t`, determine if it is possible to transform string `s` into string `t` using a series of substring sort operations. A substring sort operation allows you to select a non-empty substring of `s` and sort its characters in ascending order. Return `true...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_sort('12345', '12435') == False\", \"assert can_sort('1', '2') == False\", \"assert can_sort('0000', '0000') == True\", \"assert can_sort('11111', '11111') == True\", \"assert can_sort('555', '555') == True\", \"assert can_sort('999', '999') == True\", \...
{ "split": "train", "index": 4032, "acecode_id": "evol_5451", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes in a state machine definition represented as a dictionary. The state machine definition consists of states and transitions. Each state is identified by a unique name and may have an optional label. Transitions between state...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_states_with_transitions({'A': {}, 'B': {'next_state': 'C'}, 'C': {'next_state': 'A'}, 'D': {}}) == ['B', 'C']\", \"assert get_states_with_transitions({'A': {'next_state': 'B'}, 'B': {'next_state': 'C'}, 'C': {}}) == ['A', 'B']\", \"assert get_states_with...
{ "split": "train", "index": 4033, "acecode_id": "oss_30133", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function that takes a block of text and removes all special characters, numbers, and any words that contain numbers. The function should return a cleaned-up version of the text that maintains the grammatical correctness of the sentence. The implementation should be eff...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert preprocess_text('Hello World!') == 'Hello World'\", \"assert preprocess_text('Python 3.8 is awesome!') == 'Python is awesome'\", \"assert preprocess_text('I have 2 apples and 3 oranges.') == 'I have apples and oranges'\", \"assert preprocess_text('This is a ...
{ "split": "train", "index": 4034, "acecode_id": "evol_20008", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to process real-time data feeds for a fleet of LimeBike scooters. Each scooter in the data feed is represented by a dictionary containing the scooter's speed and battery level. Your task is to create a function named `process_limebike...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_limebike_data([{ 'speed': 15.0, 'battery_level': 100 }, { 'speed': 10.0, 'battery_level': 50 }, { 'speed': 20.0, 'battery_level': 25 }, { 'speed': 5.0, 'battery_level': 10 }]) == (15.0, [{ 'speed': 15.0, 'battery_level': 100 }, { 'speed': 10.0, 'batt...
{ "split": "train", "index": 4035, "acecode_id": "oss_36580", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a non-negative integer, write a function `dec2bin(decimal_number)` that converts the given decimal number to its binary representation as a string. If the input number is 0, the function should return '0'.\nPlease reason step by step, then write a self-contained Python so...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dec2bin(0) == '0'\", \"assert dec2bin(1) == '1'\", \"assert dec2bin(2) == '10'\", \"assert dec2bin(3) == '11'\", \"assert dec2bin(4) == '100'\", \"assert dec2bin(5) == '101'\", \"assert dec2bin(6) == '110'\", \"assert dec2bin(7) == '111'\", \"assert dec2bin(...
{ "split": "train", "index": 4036, "acecode_id": "evol_25594", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `generate_sequence` that returns a list of integers starting from 1 and ending at 10, inclusive. The function should not display the sequence but rather return it as a list.\nPlease reason step by step, then write a self-contained Python solution. Give your fin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_sequence() == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\", \"assert generate_sequence() != [1, 2, 3, 4, 5, 6, 7, 8, 9]\", \"assert len(generate_sequence()) == 10\", \"assert generate_sequence()[0] == 1\", \"assert generate_sequence()[9] == 10\", \"assert all(...
{ "split": "train", "index": 4037, "acecode_id": "evol_21693", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that extracts a boolean value from a given dictionary. The function should take in a dictionary and a key. If the key is present in the dictionary and its value is the string '1', the function should return True. If the key is present but...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_boolean_from_dict({'param': '1'}, 'param') == True\", \"assert get_boolean_from_dict({'param': '0'}, 'param') == False\", \"assert get_boolean_from_dict({'param': 'true'}, 'param') == False\", \"assert get_boolean_from_dict({'param': 'false'}, 'param') =...
{ "split": "train", "index": 4038, "acecode_id": "bigcode_python_fns_18317", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that evaluates the results of a coding competition. The function will compare the expected output of a problem with a user's submitted output. The expected output is represented as a string, while the user's output is also a string. Y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert judge_result('Hello World', 'Hello World') == 'Accepted'\", \"assert judge_result('Hello World', 'Hello World') == 'Presentation Error'\", \"assert judge_result('Hello', 'Hello World') == 'Output limit'\", \"assert judge_result('Test', 'Test') == 'Accept...
{ "split": "train", "index": 4039, "acecode_id": "bigcode_python_fns_8835", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `extract_and_sort_integers(data: List[Union[int, str]]) -> List[int]` that takes a list of integers and strings as input. Your function should return a new list containing only the integer values from the input list, sorted in ascendi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_and_sort_integers([3, '5', '2', 'hello', 8, '10']) == [2, 3, 5, 8, 10]\", \"assert extract_and_sort_integers(['1', '2', '3']) == [1, 2, 3]\", \"assert extract_and_sort_integers(['a', 'b', 'c']) == []\", \"assert extract_and_sort_integers([1, 2, 3]) =...
{ "split": "train", "index": 4040, "acecode_id": "oss_3462", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a Python function that takes three integers, m, n, and divisor, and returns a list of all the numbers within the range from m to n (inclusive) that are divisible by the given divisor.\nPlease reason step by step, then write a self-contained Python solution. Give your fina...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_divisible_numbers(36, 74, 6) == [36, 42, 48, 54, 60, 66, 72]\", \"assert find_divisible_numbers(10, 30, 5) == [10, 15, 20, 25, 30]\", \"assert find_divisible_numbers(1, 5, 2) == [2, 4]\", \"assert find_divisible_numbers(0, 10, 1) == [0, 1, 2, 3, 4, 5, 6...
{ "split": "train", "index": 4041, "acecode_id": "evol_28438", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `default_user_agent(version: str, url: str) -> str` that returns a string representing a user agent. The user agent format should be 'airslate/{version} ({url})'. Write a function that takes in two parameters: `version`, a string repr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert default_user_agent('1.0.0', 'https://example.com') == 'airslate/1.0.0 (https://example.com)'\", \"assert default_user_agent('2.5.1', 'https://test.com') == 'airslate/2.5.1 (https://test.com)'\", \"assert default_user_agent('3.3.3', 'http://myapp.com') == 'ai...
{ "split": "train", "index": 4042, "acecode_id": "bigcode_python_fns_27908", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of a game. Your task is to implement a function `highest_score(scores: List[int]) -> int` that returns the highest score achieved in the game. If the input list is empty, the function should return 0. For example, given t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert highest_score([42, 56, 78, 91, 64, 89]) == 91\", \"assert highest_score([1, 2, 3, 4, 5]) == 5\", \"assert highest_score([-1, -2, -3, -4]) == -1\", \"assert highest_score([10, 20, 30, 40, 50]) == 50\", \"assert highest_score([100]) == 100\", \"assert highest_...
{ "split": "train", "index": 4043, "acecode_id": "oss_3837", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function, `get_model_configuration`, that takes a model name as input and returns the configuration file name for that model. The configuration file name is generated by formatting a predefined string with the model name. If the model name is 'mod...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_model_configuration('modelA') == 'modelA_config.json'\", \"assert get_model_configuration('modelB') == 'modelB_config.json'\", \"assert get_model_configuration('modelC') == 'Model configuration not found'\", \"assert get_model_configuration('modelD') == ...
{ "split": "train", "index": 4044, "acecode_id": "bigcode_python_fns_46620", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python decorator that logs the execution time of a function. Your decorator should return the time taken for the function to execute in milliseconds as an integer. Implement the function `execution_time_decorator(func)` that takes a function `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execution_time_decorator(lambda: time.sleep(0.1))() >= 100\", \"assert execution_time_decorator(lambda: time.sleep(0.05))() >= 50\", \"assert execution_time_decorator(lambda: time.sleep(0.15))() >= 150\", \"assert execution_time_decorator(lambda: time.sleep(...
{ "split": "train", "index": 4045, "acecode_id": "oss_27513", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with processing a list of sentences and organizing them into documents based on specific delimiters. Each document is defined as a sequence of sentences separated by blank lines. Your goal is to create a function that takes a list of sentences as input and return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_documents(['Hello world.', 'This is a test.', '', 'Another document starts here.', 'This is another sentence.']) == [['Hello world.', 'This is a test.'], ['Another document starts here.', 'This is another sentence.']]\", \"assert create_documents(['Fi...
{ "split": "train", "index": 4046, "acecode_id": "bigcode_python_fns_42162", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that takes three integers as input and returns the maximum of the three integers.\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 max_of_three(1, 2, 3) == 3\", \"assert max_of_three(10, 5, 7) == 10\", \"assert max_of_three(-1, -2, -3) == -1\", \"assert max_of_three(0, 0, 0) == 0\", \"assert max_of_three(4, 5, 4) == 5\", \"assert max_of_three(100, 200, 150) == 200\", \"assert max_of_thr...
{ "split": "train", "index": 4047, "acecode_id": "evol_4461", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `hash_set_operations(operations: List[Tuple[str, str]]) -> List[Union[None, bool]]`, which simulates a HashSet for strings based on specified operations. The function should take a list of operations, where each operation is a tuple c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hash_set_operations([('add', 'apple'), ('contains', 'apple')]) == [True]\", \"assert hash_set_operations([('add', 'banana'), ('remove', 'banana'), ('contains', 'banana')]) == [False]\", \"assert hash_set_operations([('add', 'cat'), ('add', 'dog'), ('contains...
{ "split": "train", "index": 4048, "acecode_id": "oss_25117", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the total number of nodes in a binary tree. The binary tree is represented using a simple binary tree node class with left and right child pointers. The function should take the root of the binary tree as input and return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_nodes(None) == 0\", \"assert count_nodes(TreeNode(1)) == 1\", \"assert count_nodes(TreeNode(1, TreeNode(2), TreeNode(3))) == 3\", \"assert count_nodes(TreeNode(1, TreeNode(2, TreeNode(4)), TreeNode(3))) == 4\", \"assert count_nodes(TreeNode(1, TreeNode...
{ "split": "train", "index": 4049, "acecode_id": "oss_23418", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with evaluating the reliability rating of a smartcab based on its success rate during testing. Given a list of boolean values representing whether the smartcab met the deadline for each test case (True for success, False for failure), implement a function `calcul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_reliability([True, True, True]) == ('A+', 'green')\", \"assert calculate_reliability([False, False, False]) == ('F', 'red')\", \"assert calculate_reliability([True, True, True, True, True, True, True, True]) == ('A+', 'green')\", \"assert calculate...
{ "split": "train", "index": 4050, "acecode_id": "bigcode_python_fns_11487", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the power of a given positive real number `a` raised to the integer power `n`. The function should be named `power(a, n)` and should compute the result without using the standard power function. The function should handle both positive and n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert power(2.0, 3) == 8.0\", \"assert power(3.0, 2) == 9.0\", \"assert power(5.0, 0) == 1.0\", \"assert power(2.5, 2) == 6.25\", \"assert power(4.0, 1) == 4.0\", \"assert power(10.0, -1) == 0.1\", \"assert power(7.0, -2) == 0.02040816326530612\", \"assert power(1...
{ "split": "train", "index": 4051, "acecode_id": "oss_2325", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a migration system for a ticketing application. Write a function called `start` that takes an instance of the `Migrator` class as input. The `Migrator` class has two methods: `migrate()` and `update_migrated_tickets()`. Your job is to complete t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert start(Migrator()) is None\", \"assert start(Migrator()) is None\", \"assert start(Migrator()) is None\", \"assert start(Migrator()) is None\", \"assert start(Migrator()) is None\", \"assert start(Migrator()) is None\", \"assert start(Migrator()) is None\", \...
{ "split": "train", "index": 4052, "acecode_id": "oss_31442", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `s` and an integer `k`, write a function that returns the length of the longest substring that contains at most `k` distinct characters. A substring is defined as a contiguous sequence of characters within the string.\nPlease reason step by step, then write a sel...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert length_of_longest_substring('eceba', 2) == 3\", \"assert length_of_longest_substring('ccaabbb', 2) == 5\", \"assert length_of_longest_substring('aaabbbccc', 3) == 9\", \"assert length_of_longest_substring('abcde', 1) == 1\", \"assert length_of_longest_substr...
{ "split": "train", "index": 4053, "acecode_id": "evol_35916", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a string as input and returns a new string with the first character of each word capitalized. Words are separated by spaces. The function should handle multiple spaces between words correctly.\nPlease reason step by step, then write a self-contained ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert capitalize_first_char('this is an example') == 'This Is An Example'\", \"assert capitalize_first_char('hello world') == 'Hello World'\", \"assert capitalize_first_char('singleword') == 'Singleword'\", \"assert capitalize_first_char('') == ''\", \"assert capi...
{ "split": "train", "index": 4054, "acecode_id": "evol_18172", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a XML request for a device insertion. The function `generate_device_xml` takes five parameters: `cookie` (a string representing a session or authentication token), `device_primary_key` (a string which is a unique identifier...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_device_xml('abc123', 'device_001', 'ModelX', 'SN123456', 'VendorA') == '<Device><Cookie>abc123</Cookie><DevicePrimaryKey>device_001</DevicePrimaryKey><Model>ModelX</Model><Serial>SN123456</Serial><Vendor>VendorA</Vendor></Device>'\", \"assert genera...
{ "split": "train", "index": 4055, "acecode_id": "bigcode_python_fns_22096", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with designing a function that simulates the document processing functionality of a cloud service. Your function should take in two parameters: `image_content` (a string representing the content of a document) and `api_key` (a string representing an API key). The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_document('This is a test document.', 'sample_api_key') == {'extracted_info': 'Processed content: This is a test document.'}\", \"assert process_document('Another document to process.', 'another_api_key') == {'extracted_info': 'Processed content: Anot...
{ "split": "train", "index": 4056, "acecode_id": "oss_24014", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that accepts a list of command line arguments (as a single string) and returns a string that represents all the arguments joined together with a space in between. The function should simulate the behavior of processing command line ar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert join_arguments(['arg1', 'arg2', 'arg3']) == 'arg1 arg2 arg3'\", \"assert join_arguments(['hello', 'world']) == 'hello world'\", \"assert join_arguments(['singleArgument']) == 'singleArgument'\", \"assert join_arguments([]) == ''\", \"assert join_arguments(['...
{ "split": "train", "index": 4057, "acecode_id": "bigcode_python_fns_343", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a lossy transmission of a string of data. The goal is to create a function that takes a string `data` and an integer `lossiness` as inputs. The `lossiness` parameter represents the percentage of data loss during transmission. Your function should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_lossy_transmission('Hello, World!', 0) == 'Hello, World!'\", \"assert simulate_lossy_transmission('Hello, World!', 100) == ''\", \"assert simulate_lossy_transmission('abcdefg', 0) == 'abcdefg'\", \"assert simulate_lossy_transmission('Python Programm...
{ "split": "train", "index": 4058, "acecode_id": "oss_20313", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the center coordinates of an ellipse (xy), its x-axis radius (ex), its y-axis radius (ez), and the number of points (n), write a function that generates n points on the ellipse. The points should be returned as a list of tuples, where each tuple represents the (x, y) coor...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ellipse_points([0, -5], 254, 190, 1) == [(254.0, -5.0)]\", \"assert ellipse_points([0, 0], 1, 1, 1) == [(1.0, 0.0)]\", \"assert ellipse_points([1, 1], 2, 3, 1) == [(3.0, 1.0)]\", \"assert ellipse_points([-1, -1], 5, 2, 1) == [(4.0, -1.0)]\", \"assert ellipse...
{ "split": "train", "index": 4059, "acecode_id": "bigcode_python_fns_32754", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `sort_array(arr)` that returns a new list containing the integers sorted in ascending order. The input list can contain both positive and negative integers, as well as duplicates. You should not modify the original list.\nPlease re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_array([7, 19, 5, 4, 16]) == [4, 5, 7, 16, 19]\", \"assert sort_array([3, -1, 2, 0]) == [-1, 0, 2, 3]\", \"assert sort_array([1, 1, 1, 1]) == [1, 1, 1, 1]\", \"assert sort_array([-5, -10, 0, 5]) == [-10, -5, 0, 5]\", \"assert sort_array([]) == []\", \"as...
{ "split": "train", "index": 4060, "acecode_id": "evol_35760", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `fibonacci_numbers_in_range(n)` that returns a list of all Fibonacci numbers up to and including `n`. The Fibonacci series starts with 0 and 1, and every subsequent number is the sum of the two preceding numbers. Your function should include edge cases such as ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci_numbers_in_range(-1) == []\", \"assert fibonacci_numbers_in_range(0) == [0]\", \"assert fibonacci_numbers_in_range(4) == [0, 1, 1, 2, 3]\", \"assert fibonacci_numbers_in_range(5) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci_numbers_in_range(6) == [0...
{ "split": "train", "index": 4061, "acecode_id": "evol_14780", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes film metadata for an item. Given a dictionary of film metadata, your function should add the appropriate properties to the item's properties. The input dictionary may contain keys for 'film', 'film_sequence_no', 'physical_f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_film_metadata({'film': '123', 'film_sequence_no': '234', 'physical_film_condition': '', 'format': '23 cm x 23 cm'}) == {'film:id': '123', 'film:negative_sequence': 234, 'film:physical_size': '23 cm x 23 cm'}\", \"assert add_film_metadata({'film': '', 'fi...
{ "split": "train", "index": 4062, "acecode_id": "bigcode_python_fns_31426", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D grid representing a lattice of size m x n and a flow object that can have obstacles. An obstacle can be represented by a mask where certain positions are blocked. Your task is to implement a function `is_obstacle_mask_applied(mask: List[List[int]]) -> bool` t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_obstacle_mask_applied([[0, 0], [0, 0]]) == False\", \"assert is_obstacle_mask_applied([[0, 1], [0, 0]]) == True\", \"assert is_obstacle_mask_applied([[1, 0], [0, 0]]) == True\", \"assert is_obstacle_mask_applied([[0, 0], [1, 0]]) == True\", \"assert is_ob...
{ "split": "train", "index": 4063, "acecode_id": "bigcode_python_fns_4232", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `register_user(name: str, email: str, password: str, address: str) -> str` that registers a new user by taking their authentic name, electronic communication address, private passkey, and domicile address. The function should store this information in a pre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert register_user('John', 'john@example.com', '1234', '999 Main St.') == 'Registration Successful!'\", \"assert register_user('Jane', 'jane@example.com', 'abcd', '123 Elm St.') == 'Registration Successful!'\", \"assert register_user('Alice', 'alice@example.com',...
{ "split": "train", "index": 4064, "acecode_id": "evol_10457", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to process a batch of OCR (Optical Character Recognition) data. The function, `create_ocr_dump`, should take a string input representing a batch of OCR data and return a string that indicates the creation of an OCR dump along with the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_ocr_dump('Sample OCR data') == 'Created OCR dump for: Sample OCR data'\", \"assert create_ocr_dump('Test batch 1') == 'Created OCR dump for: Test batch 1'\", \"assert create_ocr_dump('Another OCR data batch') == 'Created OCR dump for: Another OCR data...
{ "split": "train", "index": 4065, "acecode_id": "oss_14083", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of image paths and a list of labels, write a function `compute_images2labels(images: List[str], labels: List[str]) -> Dict[str, str]` that creates a mapping from each image path to its corresponding label. The image paths are formatted as '/<row_number>/test_<colum...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_images2labels([\\\"/0/test_0.png\\\", \\\"/0/test_1.png\\\", \\\"/0/test_2.png\\\"], [\\\"0\\\", \\\"1\\\"]) == {\\\"/0/test_0.png\\\": \\\"0\\\", \\\"/0/test_1.png\\\": \\\"0\\\", \\\"/0/test_2.png\\\": \\\"0\\\"}\", \"assert compute_images2labels([...
{ "split": "train", "index": 4066, "acecode_id": "bigcode_python_fns_19230", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program to simulate a game where players attempt to add rectangles to a canvas. The canvas is represented as a 2D grid, where each cell can either be empty (0) or occupied (1). Each rectangle is represented by its top-left and bottom-right coordin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_add_rectangle([[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]], 0, 0, 1, 1) == True\", \"assert can_add_rectangle([[1, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]], 0, 0, 1, 1) == False\", \"assert can_add_rectangle([[0, 0, 0], [0, 0, 0], ...
{ "split": "train", "index": 4067, "acecode_id": "oss_23281", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a string, implement a function that returns the length of the longest palindromic subsequence. A palindromic subsequence is a sequence that appears in the same order when read forwards and backwards. For example, in the string 'agbcba', the longest palindromic subsequence...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert LPS('agbcba') == 5\", \"assert LPS('a') == 1\", \"assert LPS('ab') == 1\", \"assert LPS('aa') == 2\", \"assert LPS('racecar') == 7\", \"assert LPS('abcdefg') == 1\", \"assert LPS('madamimadam') == 11\", \"assert LPS('civic') == 5\", \"assert LPS('noon') == 4...
{ "split": "train", "index": 4068, "acecode_id": "evol_12432", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function `sum_of_evens(nums)` that calculates the sum of all even numbers in the list. If there are no even numbers, the function should return 0. The function should take a single parameter: a list of integers `nums...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([0, 1, 2, 3, 4]) == 6\", \"assert sum_of_evens([-2, -1, 0, 1, 2]) == 0\", \"assert sum_of_evens([10, 15, 20, 25]) == 30\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\...
{ "split": "train", "index": 4069, "acecode_id": "oss_22317", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `s`, an old substring `old`, and a new substring `new`, you need to replace the last occurrence of `old` in `s` with `new`. Write a function `replace_last_occurrence(s: str, old: str, new: str) -> str` that returns the modified string. If `old` is not found in `s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_last_occurrence('hello world', 'world', 'there') == 'hello there'\", \"assert replace_last_occurrence('hello world', 'hello', 'hi') == 'hi world'\", \"assert replace_last_occurrence('hello hello', 'hello', 'hi') == 'hello hi'\", \"assert replace_last...
{ "split": "train", "index": 4070, "acecode_id": "bigcode_python_fns_31805", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a list of tuples representing file paths for downloading data based on given dates and station identifiers. Each filename follows a specific naming convention based on the provided information. Your function should take two...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_file_paths(['2021-01-01'], ['idx']) == [('remote_path/thg/l1/mag/idx/2021/thg_l1_mag_idx_20210101_v01.cdf', 'data_dir/thg/l1/mag/idx/2021/thg_l1_mag_idx_20210101_v01.cdf')]\", \"assert generate_file_paths(['2022-02-15'], ['stationA']) == [('remote_p...
{ "split": "train", "index": 4071, "acecode_id": "bigcode_python_fns_14538", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `instr`, a `marker` that is a substring within `instr`, and an integer `value`. Your task is to replace all occurrences of the `marker` in the `instr` with the string representation of the `value`. Implement a function `replace_marker(instr: str, marker: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_marker('Hello, {marker}!', '{marker}', 42) == 'Hello, 42!'\", \"assert replace_marker('The quick brown {marker} jumps over the lazy dog.', '{marker}', 5) == 'The quick brown 5 jumps over the lazy dog.'\", \"assert replace_marker('{marker} is the plac...
{ "split": "train", "index": 4072, "acecode_id": "bigcode_python_fns_49804", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing a list of responses from a sensor that may contain duplicate values. Your goal is to create a function `get_unique_elements(responses: List[List[int]]) -> List[int]` that takes a list of lists of integers (the responses) as input and returns a lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_elements([[1, 2, 3], [3, 4, 5], [5, 3]]) == [3]\", \"assert get_unique_elements([[1, 2], [2, 3], [3, 4]]) == []\", \"assert get_unique_elements([[10, 20, 30], [20, 30, 40], [30, 20, 10]]) == [20, 30]\", \"assert get_unique_elements([[1, 1, 1], [1,...
{ "split": "train", "index": 4073, "acecode_id": "oss_13284", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a Scheduler class that manages a list of posts. Each post has a unique submission ID. Implement a function `get_submitted_posts()` that returns all the posts that have been submitted to the scheduler. Additionally, if a `skip_post` parameter is provided, the funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(scheduler.get_submitted_posts()) == 2\", \"assert scheduler.get_submitted_posts(skip_post=post2) == [post1]\", \"assert scheduler.get_submitted_posts() == [post1, post2]\", \"assert scheduler.get_submitted_posts(skip_post=post1) == [post2]\", \"assert sc...
{ "split": "train", "index": 4074, "acecode_id": "bigcode_python_fns_17667", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the behavior of different animals. Create a function `animal_sound(animal_type: str) -> str` that takes in the type of animal as a string and returns the sound that the animal makes. The function should support the foll...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert animal_sound('dog') == 'Woof!'\", \"assert animal_sound('cat') == 'Meow!'\", \"assert animal_sound('cow') == 'Moo!'\", \"assert animal_sound('bird') == 'Unknown animal'\", \"assert animal_sound('fish') == 'Unknown animal'\", \"assert animal_sound('dog') == '...
{ "split": "train", "index": 4075, "acecode_id": "evol_19090", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary of aspect terms with their associated sentiment scores, a lexicon mapping categories to defining terms, and a list of predicted categories, write a function that determines the overall sentiment for each predicted category based on the aspect terms. The funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_sentiments({'termA': {'subtermA1': 2}}, {'cat1': ['termA'], 'cat2': ['termB']}, ['cat1', 'cat2', 'cat3']) == ['pos', 'neu', 'neu']\", \"assert classify_sentiments({'termX': {'subtermX1': -3}}, {'group1': ['termX'], 'group2': ['termY']}, ['group1', '...
{ "split": "train", "index": 4076, "acecode_id": "bigcode_python_fns_49720", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of profiles represented as dictionaries. Each profile contains the following keys: 'name' (string), 'age' (integer), 'gender' (string), and 'occupation' (string). Write a function that processes this list and returns a summary dictionary containing: the tot...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert profile_summary([]) == {'total_profiles': 0, 'average_age': 0, 'gender_count': {}, 'unique_occupations': []}\", \"assert profile_summary([{'name': 'Alice', 'age': 25, 'gender': 'female', 'occupation': 'engineer'}]) == {'total_profiles': 1, 'average_age': 25....
{ "split": "train", "index": 4077, "acecode_id": "oss_9276", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a logging function that formats a given error message with a timestamp. Implement a function `log_error(msg: str) -> str` that takes a string `msg` as input and returns a formatted string in the following format: 'LOG:: [timestamp] msg::LOG', where ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_error('An error occurred').startswith('LOG:: [') and log_error('An error occurred').endswith('::LOG')\", \"assert len(log_error('Error message')) > 20\", \"assert 'LOG:: [' in log_error('Test message')\", \"assert isinstance(log_error('Sample error'), st...
{ "split": "train", "index": 4078, "acecode_id": "bigcode_python_fns_16224", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers and returns the product of all the prime numbers in that list. A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. Use a while loop to iterate through the list. If no prime n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert product_of_primes([3, 5, 7, 10, 13]) == 1365\", \"assert product_of_primes([2, 4, 6, 8]) == 2\", \"assert product_of_primes([10, 15, 20]) == 1\", \"assert product_of_primes([11, 13, 17]) == 2431\", \"assert product_of_primes([1, 4, 6, 8]) == 1\", \"assert pr...
{ "split": "train", "index": 4079, "acecode_id": "evol_424", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function to determine if a list 'q' can achieve a state of equilibrium during flight. The function should return True if the following conditions are met: the list is a palindrome, the sum of its elements is less than or equal to a specified maximum weight 'w', and no...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert stable_flight([1, 2, 1], 5, 2) == True\", \"assert stable_flight([3, 2, 3], 9, 1) == False\", \"assert stable_flight([1, 0, 1], 2, 1) == True\", \"assert stable_flight([2, 3, 2], 10, 4) == True\", \"assert stable_flight([5, 5, 5], 15, 5) == True\", \"assert ...
{ "split": "train", "index": 4080, "acecode_id": "evol_17070", "num_tests": 16 }
acecode
[ { "role": "user", "content": "In the Python programming language, implement a function `shallow_copy(obj)` that takes an object as an argument and returns a shallow copy of that object using the appropriate built-in library. The function should handle various types of objects, including lists and dictionari...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shallow_copy([1, 2, 3]) == [1, 2, 3]\", \"assert shallow_copy({'a': 1, 'b': 2}) == {'a': 1, 'b': 2}\", \"assert shallow_copy('Hello') == 'Hello'\", \"assert shallow_copy((1, 2, 3)) == (1, 2, 3)\", \"assert shallow_copy([1, [2, 3]]) == [1, [2, 3]]\", \"assert...
{ "split": "train", "index": 4081, "acecode_id": "evol_19562", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary that contains the performance of a betting scenario. The dictionary has two keys: 'result' and 'starting_price'. The 'result' key can have a value of 1 or 0, where 1 indicates a win and 0 indicates a loss. The 'starting_price' key is a float represent...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_profit({'result': 1, 'starting_price': 100.0}) == 100.0\", \"assert calculate_profit({'result': 0, 'starting_price': 50.0}) == -1.0\", \"assert calculate_profit({'result': 1, 'starting_price': 200.5}) == 200.5\", \"assert calculate_profit({'result'...
{ "split": "train", "index": 4082, "acecode_id": "bigcode_python_fns_351", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a retry logic for a function. Write a function called `retry_function` that takes a callable function `func`, an integer `tries`, and a float `delay` as arguments. The `retry_function` should attempt to call `func` up to `tries` times, waiting f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retry_function(lambda: 42, 3, 1) == 42\", \"assert retry_function(lambda: (x:=1) + 1, 3, 1) == 2\", \"assert retry_function(lambda: 'test', 3, 1) == 'test'\", \"assert retry_function(lambda: 1 + 1, 3, 1) == 2\", \"assert retry_function(lambda: 1 / 1, 3, 1) =...
{ "split": "train", "index": 4083, "acecode_id": "oss_12425", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that retrieves help information related to a selected portion of text in a text editor. The function should accept two parameters: a string representing the selected text and a dictionary that maps certain keywords to their correspond...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_help('python', {'python': 'Python is a programming language.'}) == 'Python is a programming language.'\", \"assert get_help('java', {'python': 'Python is a programming language.'}) == 'No help available for the selected text.'\", \"assert get_help('html'...
{ "split": "train", "index": 4084, "acecode_id": "oss_4353", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of lists of strings, implement a function `merge_lists(cluster_sentences)` that merges all the inner lists into a single list while preserving the order of the strings. The function should take in a parameter `cluster_sentences`, which is a list of lists of strings...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_lists([['hello', 'world'], ['how', 'are', 'you']]) == ['hello', 'world', 'how', 'are', 'you']\", \"assert merge_lists([['a', 'b'], ['c', 'd', 'e'], ['f']]) == ['a', 'b', 'c', 'd', 'e', 'f']\", \"assert merge_lists([[], ['only'], ['one']]) == ['only', '...
{ "split": "train", "index": 4085, "acecode_id": "bigcode_python_fns_36933", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `generate_rhombus(n: int) -> List[str]` that takes an integer `n` (1 <= n <= 100) and generates a rhombus pattern represented as a list of strings. The upper part of the rhombus should consist of `n` lines, and each line should contain spaces followed by an inc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_rhombus(1) == ['*']\", \"assert generate_rhombus(2) == [' * ', '***', ' * ']\", \"assert generate_rhombus(3) == [' * ', ' *** ', '*****', ' *** ', ' * ']\", \"assert generate_rhombus(4) == [' * ', ' *** ', ' ***** ', '*******', ' ***** ', ...
{ "split": "train", "index": 4086, "acecode_id": "evol_22561", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Create a function that separates and sorts alphabetic characters, integers, and dictionaries from a mixed input list. The function should handle nested lists and dictionaries recursively. Given an input list, your function should return a tuple containing three sorted lists: on...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_data([1, 2, 3, 4, 5]) == ([1, 2, 3, 4, 5], [], [])\", \"assert analyze_data([1, [2, [3]], 'd']) == ([1, 2, 3], ['d'], [])\", \"assert analyze_data([]) == ([], [], [])\", \"assert analyze_data([[1, 2], [3, 4], 'e']) == ([1, 2, 3, 4], ['e'], [])\", \"a...
{ "split": "train", "index": 4087, "acecode_id": "evol_23036", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function `create_instance` that takes a class and returns an instance of that class using a metaclass. The class should use a metaclass that modifies the creation of its instances to include an additional attribute 'created_by' set to 'meta_instance'.\nPlease reason...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert isinstance(create_instance(MyClass), MyClass)\", \"assert isinstance(create_instance(AnotherClass), AnotherClass)\", \"assert create_instance(MyClass).__class__.__name__ == 'MyClass'\", \"assert create_instance(AnotherClass).__class__.__name__ == 'AnotherCla...
{ "split": "train", "index": 4088, "acecode_id": "evol_5057", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a hash table data structure in Python. The hash table should support the following operations: 1. Insertion of key-value pairs. 2. Retrieval of values based on keys. 3. Deletion of key-value pairs. Your task is to implement a function `hash_tabl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hash_table_operations([('insert', 'a', '1'), ('retrieve', 'a', None), ('delete', 'a', None), ('retrieve', 'a', None)]) == ['1', None]\", \"assert hash_table_operations([('insert', 'b', '2'), ('insert', 'c', '3'), ('retrieve', 'b', None)]) == ['2']\", \"asser...
{ "split": "train", "index": 4089, "acecode_id": "oss_22704", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to check if the original sequence `org` can be uniquely reconstructed from the sequences in `seqs`. The `org` sequence is a permutation of the integers from 1 to n, with 1 ≤ n ≤ 10^4. Additionally, the sequences in `seqs` must be in ascending order. If they are not, re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sequenceReconstruction([1,2,3], [[1,2],[1,3]]) == (False, '_')\", \"assert sequenceReconstruction([1,2,3], [[1,2]]) == (False, '_')\", \"assert sequenceReconstruction([1,2,3], [[1,2],[1,3],[2,3]]) == (True, 3)\", \"assert sequenceReconstruction([4,1,5,2,6,3]...
{ "split": "train", "index": 4090, "acecode_id": "evol_28809", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a binary image represented as a 2D list of integers, where 0s represent the background and 1s represent the foreground (the object of interest). Your task is to implement a function that takes this binary image as input and returns the total number of distinct obj...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_objects([[1, 0, 0], [0, 0, 0], [1, 0, 1]]) == 3\", \"assert count_objects([[1, 1], [1, 1]]) == 1\", \"assert count_objects([[0, 0], [0, 0]]) == 0\", \"assert count_objects([[1]]) == 1\", \"assert count_objects([[0]]) == 0\", \"assert count_objects([[1,...
{ "split": "train", "index": 4091, "acecode_id": "bigcode_python_fns_19720", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to manage patient information in a medical clinic. Implement a function `modify_patient_age` that takes in a DNI (string) and a new age (integer) as input parameters. The function should validate the new age to ensure it is a positive int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modify_patient_age('12345678A', 17) == -1\", \"assert modify_patient_age('12345678A', 16) == -1\", \"assert modify_patient_age('98765432Z', 30) == -1\", \"assert modify_patient_age('12345678B', 17) == -1\", \"assert modify_patient_age('12345678B', 16) == -1\...
{ "split": "train", "index": 4092, "acecode_id": "oss_8937", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries representing race and ethnicity data for births, implement a function that cleans and relabels this data. Each dictionary contains the following keys: 'sort', 'birth count', 'birth count_pct', 'county name', 'ethnicity desc', 'low birth weight ind d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_race_data([{'sort': 1, 'birth count': 10, 'birth count_pct': None, 'county name': 'County A', 'ethnicity desc': 'African American (Black)', 'low birth weight ind desc': 'Low birth weight (<2500g)', 'race catg desc': 'Race A', 'year desc': '2017 **'}])...
{ "split": "train", "index": 4093, "acecode_id": "bigcode_python_fns_26809", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of lines of PyQuil code generated by a translator. Each line starts with 'pg +='. Your function should extract and return the unique set of PyQuil gate names used in the input list of lines. Write a function c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_gate_names(['pg += H(0)', 'pg += CNOT(0, 1)', 'pg += RX(0, 1.57)', 'pg += CPHASE(1.57, 0, 1)']) == {'H', 'CNOT', 'RX', 'CPHASE'}\", \"assert extract_gate_names(['pg += H(0)', 'pg += H(1)', 'pg += H(2)']) == {'H'}\", \"assert extract_gate_names(['pg +...
{ "split": "train", "index": 4094, "acecode_id": "oss_18947", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer x, determine if it is a palindrome. A palindrome is a number that reads the same backward as forward. Implement a function `is_palindrome(x: int) -> bool` that returns `True` if x is a palindrome, and `False` otherwise. Note that negative numbers are not consid...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome(121) == True\", \"assert is_palindrome(-121) == False\", \"assert is_palindrome(10) == False\", \"assert is_palindrome(12321) == True\", \"assert is_palindrome(0) == True\", \"assert is_palindrome(1) == True\", \"assert is_palindrome(22) == Tru...
{ "split": "train", "index": 4095, "acecode_id": "oss_35310", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that determines whether a given attribute can be converted into a setting automatically based on its type. The function should consider the following conditions: If the attribute is an instance of `property`, `classmethod`, or `static...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert can_be_converted_to_setting(10) == True\", \"assert can_be_converted_to_setting('string') == True\", \"assert can_be_converted_to_setting([1, 2, 3]) == True\", \"assert can_be_converted_to_setting({'key': 'value'}) == True\", \"assert can_be_converted_to_set...
{ "split": "train", "index": 4096, "acecode_id": "oss_2415", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer `n`, return an array containing `n` unique integers such that their product is `1`. The integers in the output must be unique. If `n` is `1`, return an array containing the integer `1`. For even values of `n`, you can use pairs of `-1` and `1`. For odd values o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_integers(1) == [1]\", \"assert unique_integers(2) == [-1, 1]\", \"assert unique_integers(3) == [-1, 1, 1]\", \"assert unique_integers(4) == [-1, 1, -1, 1]\", \"assert unique_integers(5) == [-1, 1, -1, 1, 1]\", \"assert unique_integers(6) == [-1, 1, -1...
{ "split": "train", "index": 4097, "acecode_id": "evol_11312", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of complex numbers, implement a function that returns the complex number that appears the least frequently in the list. If there are multiple complex numbers with the same lowest frequency, return any one of them.\nPlease reason step by step, then write a self-cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert least_frequent_complex_number([1+1j, 2+2j, 2+2j, 3+3j, 1+1j, 1+1j, 2+2j]) == 3+3j\", \"assert least_frequent_complex_number([1+2j, 3+4j, 5+6j, 1+2j, 5+6j]) == 3+4j\", \"assert least_frequent_complex_number([7+8j, 7+8j, 9+10j, 11+12j, 9+10j]) == 11+12j\", \"a...
{ "split": "train", "index": 4098, "acecode_id": "evol_28369", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes an array of strings and groups them by their starting character after sorting them in alphabetical order. The function should return a new array containing arrays of the grouped strings, with each group ordered alphabetically. The input array can...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert group_strings(['apple', 'banana', 'apricot', 'blueberry', 'avocado']) == [['apple', 'apricot', 'avocado'], ['banana', 'blueberry']]\", \"assert group_strings(['dog', 'deer', 'cat', 'elephant', 'ant']) == [['ant'], ['cat'], ['deer', 'dog'], ['elephant']]\", \...
{ "split": "train", "index": 4099, "acecode_id": "evol_552", "num_tests": 13 }