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 given a list of integers that may contain at most one anomaly. An anomaly is defined as a single element that is out of place when the list is sorted. Your task is to implement a function `detect_anomaly(lst: List[int], n: int) -> Dict[str, int]` that returns a dictiona...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert detect_anomaly([3, 1, 2], 3) == {'anomaly_index': 0, 'replace_with': 1, 'total_replacements': 1}\", \"assert detect_anomaly([1, 2, 3], 3) == {'anomaly_index': -1, 'replace_with': -1, 'total_replacements': 0}\", \"assert detect_anomaly([2, 1, 3], 3) == {'anom...
{ "split": "train", "index": 1000, "acecode_id": "evol_25764", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function `calculate_sphere_volume` that takes two parameters: a string `diameter` representing the diameter of the sphere, and a float `diameter_default` representing the default diameter value to use if the conversion of `diameter` fails. The function should try...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(calculate_sphere_volume('10', 5.0) - 523.5987755982989) < 1e-9\", \"assert abs(calculate_sphere_volume('abc', 5.0) - 5.0) < 1e-9\", \"assert abs(calculate_sphere_volume('0', 5.0) - 0.0) < 1e-9\", \"assert abs(calculate_sphere_volume('-10', 5.0) - -523.59...
{ "split": "train", "index": 1001, "acecode_id": "oss_21028", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a simple string representation of a ResNet model configuration. The function should take in three parameters: 'layers', 'block', and 'ibn_cfg'. The 'layers' parameter is a list of integers representing the number of layers ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_resnet_model_config([1, 1, 1], 'Bottleneck', (None,)) == 'ResNet-[1, 1, 1] with Bottleneck blocks and IBN configuration (None,)'\", \"assert generate_resnet_model_config([10, 20], 'Bottleneck', (1, 2, 3)) == 'ResNet-[10, 20] with Bottleneck blocks a...
{ "split": "train", "index": 1002, "acecode_id": "bigcode_python_fns_33133", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple online ticket booking system. The function should allow users to book seats and cancel bookings based on given operations. Your task is to implement the function `ticket_booking_system(total_seats, operations)`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ticket_booking_system(5, [('book', 1, 'user1'), ('book', 2, 'user2'), ('cancel', 1), ('book', 1, 'user3')]) == [True, True, True, True]\", \"assert ticket_booking_system(3, [('book', 1, 'user1'), ('book', 3, 'user2'), ('book', 3, 'user3')]) == [True, True, F...
{ "split": "train", "index": 1003, "acecode_id": "oss_35164", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string as input and returns the count of uppercase letters, lowercase letters, and special characters in that string. Additionally, return a dictionary that maps each character type ('upper', 'lower', 'special') to its frequency in the input st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert char_category_counts('abcXYZ!@#') == (3, 3, 3, {'upper': {'X': 1, 'Y': 1, 'Z': 1}, 'lower': {'a': 1, 'b': 1, 'c': 1}, 'special': {'!': 1, '@': 1, '#': 1}})\", \"assert char_category_counts('12345') == (0, 0, 5, {'upper': {}, 'lower': {}, 'special': {'1': 1, ...
{ "split": "train", "index": 1004, "acecode_id": "evol_22166", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with simulating network traffic for a given set of parameters and calculating the effective goodput based on the amount of data transmitted and the time taken. Write a function `calculate_goodput(data_transmitted: int, time_taken: float) -> float` that takes in t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_goodput(1000, 1.0) == 1000.0\", \"assert calculate_goodput(500, 2.5) == 200.0\", \"assert calculate_goodput(0, 5.0) == 0.0\", \"assert calculate_goodput(10000, 10.0) == 1000.0\", \"assert calculate_goodput(2500, 0.0) == 0.0\", \"assert calculate_go...
{ "split": "train", "index": 1005, "acecode_id": "oss_3885", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of resetting a database connection pool. Write a Python function called `reset_db_connection_pool` that takes no arguments and simulates the resetting of a database connection pool by returning a string indicat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reset_db_connection_pool() == 'Database connection pool has been reset.'\", \"assert reset_db_connection_pool() == 'Database connection pool has been reset.'\", \"assert reset_db_connection_pool() == 'Database connection pool has been reset.'\", \"assert res...
{ "split": "train", "index": 1006, "acecode_id": "oss_1782", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves login information for a PostgreSQL database from a given string input. The input string contains the following information separated by whitespace: host, user, dbname, password, and port. Your function should return a tuple...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_postgresql_login_info('localhost admin mydb secret 5432') == (True, ('localhost', 'admin', 'mydb', 'secret', '5432'))\", \"assert get_postgresql_login_info('') == (False, None)\", \"assert get_postgresql_login_info('localhost admin mydb') == (False, None...
{ "split": "train", "index": 1007, "acecode_id": "bigcode_python_fns_1686", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `check_ends_with_goodbye(input_string: str) -> bool` that checks if the given input string ends with the term 'Goodbye'. The function should return True if it does, and False otherwise.\nPlease reason step by step, then write a self-contained Python solutio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_ends_with_goodbye('Hello World Goodbye') == True\", \"assert check_ends_with_goodbye('Goodbye') == True\", \"assert check_ends_with_goodbye('Goodbye!') == False\", \"assert check_ends_with_goodbye('Farewell Goodbye') == True\", \"assert check_ends_with...
{ "split": "train", "index": 1008, "acecode_id": "evol_3740", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that decodes a JSON string into a Python dictionary. The JSON string will only contain key-value pairs where the keys are strings and the values are integers. Your function should take a single input parameter, a string representing t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decode_json('{\\\"1\\\":2, \\\"3\\\":4}') == {'1': 2, '3': 4}\", \"assert decode_json('{\\\"a\\\":1, \\\"b\\\":2}') == {'a': 1, 'b': 2}\", \"assert decode_json('{\\\"key1\\\":100, \\\"key2\\\":200}') == {'key1': 100, 'key2': 200}\", \"assert decode_json('{\\...
{ "split": "train", "index": 1009, "acecode_id": "oss_24471", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple text-based game where a player can navigate through different rooms. You need to implement a function called `navigate_rooms` that takes the following parameters: `initial_room`, a list of `moves`, and `rooms`. Each room is represented by...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert navigate_rooms(1, ['east'], {1: {'description': 'a dark cave', 'exits': {'east': 2}}, 2: {'description': 'a mysterious forest', 'exits': {'west': 1}}}) == 2\", \"assert navigate_rooms(1, ['north'], {1: {'description': 'a dark cave', 'exits': {}}, 2: {'descri...
{ "split": "train", "index": 1010, "acecode_id": "oss_20103", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a class called `CancelAllLinking` that simulates a messaging protocol. The constructor can take an optional integer parameter `code`. The class should have the following properties: \n1. `hex`: A hexadecimal representation of the message, which is generated based...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_message() == {'hex': '0x0265', 'isack': False, 'isnak': False, 'sendSize': 2, 'receivedSize': 2}\", \"assert create_message(0x06) == {'hex': '0x026506', 'isack': True, 'isnak': False, 'sendSize': 2, 'receivedSize': 3}\", \"assert create_message(0x15) ...
{ "split": "train", "index": 1011, "acecode_id": "bigcode_python_fns_8057", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D list 'image' representing a grayscale image, where each element of the list is a list of integers (0-255) representing pixel values, write a function that determines if the image is a single-channel image. A single-channel image has only one value per pixel. Return T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert isGray([[0, 128, 255], [255, 128, 0], [0, 0, 0]]) == True\", \"assert isGray([[0], [128], [255]]) == True\", \"assert isGray([[255, 255], [255, 255]]) == True\", \"assert isGray([[0, 0, 0]]) == True\", \"assert isGray([[255], [0]]) == True\", \"assert isGray...
{ "split": "train", "index": 1012, "acecode_id": "bigcode_python_fns_3472", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of integers and returns a new list containing only the unique elements from the input list, preserving the original order of their first appearance. Write a function `get_unique_elements` that takes one parame...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_elements([1, 2, 2, 3, 4, 4]) == [1, 2, 3, 4]\", \"assert get_unique_elements([5, 6, 7, 5, 6, 7]) == [5, 6, 7]\", \"assert get_unique_elements([]) == []\", \"assert get_unique_elements([1, 1, 1, 1]) == [1]\", \"assert get_unique_elements([7, 8, 9, ...
{ "split": "train", "index": 1013, "acecode_id": "oss_18638", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a Python function `find_target_indices(lst: List[int], target: int) -> Union[Tuple[int, int], str]` that receives a sorted list of integers `lst` and a specific integer `target`. The function should return a tuple containing the indices of the first and last occurrenc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_target_indices([2, 4, 4, 5, 7, 7, 7, 8, 9], 7) == (4, 6)\", \"assert find_target_indices([1, 2, 3, 4, 5], 3) == (2, 2)\", \"assert find_target_indices([1, 1, 1, 1, 1], 1) == (0, 4)\", \"assert find_target_indices([1, 2, 3, 4, 5], 6) == 'Target not found...
{ "split": "train", "index": 1014, "acecode_id": "evol_15909", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a string as input, representing the contents of a text file, and converts it into its Base64 encoded representation. The function should handle any printable ASCII characters and return the encoded string. Implement the fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert encode_to_base64('Python is fun!') == 'UHl0aG9uIGlzIGZ1biE='\", \"assert encode_to_base64('') == ''\", \"assert encode_to_base64('1234567890') == 'MTIzNDU2Nzg5MA=='\", \"assert encode_to_base64('!@#$%^&*()') == 'IUAjJCVeJiooKQ=='\", \"assert encode_to_base64...
{ "split": "train", "index": 1015, "acecode_id": "bigcode_python_fns_23984", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of integers representing the key sizes of various certificates and returns a report indicating whether each certificate's key size is 'error', 'warning', or 'valid'. A key size is considered an 'error' if it is less than...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert key_size_report([512, 1024, 2048, 3072]) == ['error', 'warning', 'valid', 'valid']\", \"assert key_size_report([800, 1600, 2400]) == ['error', 'warning', 'valid']\", \"assert key_size_report([1023, 1024, 2047, 2048]) == ['error', 'warning', 'warning', 'valid...
{ "split": "train", "index": 1016, "acecode_id": "bigcode_python_fns_12474", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that formats a summary of a financial statement. The function should take in a summary and return the formatted summary based on a predefined order of statuses. The predefined order of statuses is given as `STATUS_ORDER = ['Pending', ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_summary({'Approved': '2 items', 'Pending': '1 item'}) == '1 item, 2 items'\", \"assert format_summary({'Rejected': '3 items', 'Pending': '2 items'}) == '2 items, 3 items'\", \"assert format_summary({'Approved': '5 items'}) == '5 items'\", \"assert for...
{ "split": "train", "index": 1017, "acecode_id": "oss_13929", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer n, implement a function that calculates the sum of all integers from 1 to n using a while loop. The function should take an integer n as input and return the computed sum. Note that the sum should be calculated by continuously adding the integer values ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_integers(1) == 1\", \"assert sum_integers(2) == 3\", \"assert sum_integers(3) == 6\", \"assert sum_integers(4) == 10\", \"assert sum_integers(5) == 15\", \"assert sum_integers(6) == 21\", \"assert sum_integers(7) == 28\", \"assert sum_integers(8) == 36\"...
{ "split": "train", "index": 1018, "acecode_id": "bigcode_python_fns_13941", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `fetch_pg_types` that takes a dictionary `columns_info` as input. Each key in this dictionary is a column name and each value is another dictionary that contains information about the column, including a key called 'type_code', which is a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fetch_pg_types({'col1': {'type_code': 1}, 'col2': {'type_code': 2}}) == [(1, 'integer'), (2, 'text')]\", \"assert fetch_pg_types({'col1': {'type_code': 3}}) == [(3, 'boolean')]\", \"assert fetch_pg_types({'col1': {'type_code': 4}, 'col2': {'type_code': 5}}) ...
{ "split": "train", "index": 1019, "acecode_id": "bigcode_python_fns_27774", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that generates a random integer within a specified range. The function should accept two parameters, `range_start` and `range_end`, which define the inclusive range from which to generate the random integer. If the input range is invalid (i.e., if `range_start`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_random_number(1, 10) is not None\", \"assert 1 <= generate_random_number(1, 10) <= 10\", \"assert generate_random_number(10, 10) == 10\", \"assert generate_random_number(50, 100) is not None\", \"assert 50 <= generate_random_number(50, 100) <= 100\"...
{ "split": "train", "index": 1020, "acecode_id": "evol_29067", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function `dbConnect` that simulates establishing a connection to a database. The function should take four parameters: `hostname`, `username`, `password`, and `database_name`. The function should return a string indicating whether the connection wa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dbConnect('localhost', 'user', 'pass', 'db') == 'Connection established at ' + dt.datetime.now().strftime('%Y-%m-%d %H:%M:%S')\", \"assert dbConnect('', 'user', 'pass', 'db') == 'Connection failed'\", \"assert dbConnect('localhost', '', 'pass', 'db') == 'Con...
{ "split": "train", "index": 1021, "acecode_id": "oss_20608", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates a set of command line options for a hypothetical tool that manages JavaScript environments. The function `validate_options(options)` will take a dictionary `options` with the following keys: 'node', 'jobs', 'verbose', '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_options({'node': '14.17.0', 'jobs': 2, 'verbose': False, 'quiet': False, 'requirements': '', 'prompt': '', 'list': False, 'without_ssl': False, 'debug': False, 'profile': False, 'without_npm': False, 'npm': 'latest', 'no_npm_clean': False}) == ['Mus...
{ "split": "train", "index": 1022, "acecode_id": "bigcode_python_fns_45398", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a function that identifies the Greatest Common Divisor (GCD) of two distinct prime numbers (a and b) using recursion. The function should return 1, since the GCD of any two distinct prime numbers is always 1. Ensure that the function is efficient enough to operate under t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert gcd(3, 5) == 1\", \"assert gcd(7, 11) == 1\", \"assert gcd(13, 17) == 1\", \"assert gcd(19, 23) == 1\", \"assert gcd(29, 31) == 1\", \"assert gcd(37, 41) == 1\", \"assert gcd(43, 47) == 1\", \"assert gcd(53, 59) == 1\", \"assert gcd(61, 67) == 1\", \"assert ...
{ "split": "train", "index": 1023, "acecode_id": "evol_26760", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of coordinates represented as tuples, where each tuple contains the x and y coordinates of a point. Your task is to calculate the distance of each coordinate from a given center point (x, y) using the Euclidean distance formula: distance = sqrt((xi - x)^2 +...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_distances([(1, 2), (3, 4)], (0, 0), 5) == [(2.23606797749979, 'Inside Radius'), (5.0, 'Inside Radius')]\", \"assert calculate_distances([(10, 10), (5, 5)], (0, 0), 8) == [(14.142135623730951, 'Outside Radius'), (7.0710678118654755, 'Inside Radius')...
{ "split": "train", "index": 1024, "acecode_id": "oss_29094", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of 2D points represented as tuples, where each tuple contains the x and y coordinates of the point. Your task is to calculate the Root Mean Square Deviation (RMSD) of these points with respect to a given reference point. The RMSD is defined as the square ro...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_rmsd([(0, 0), (0, 0)], (0, 0)) == 0.0\", \"assert calculate_rmsd([], (1, 1)) == 0.0\", \"assert calculate_rmsd([(7, 8)], (5, 5)) == 3.605551275463989\", \"assert calculate_rmsd([(1, 0), (0, 1)], (0, 0)) == 1.0\", \"assert calculate_rmsd([(0, 0)], (...
{ "split": "train", "index": 1025, "acecode_id": "bigcode_python_fns_9564", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Write a Python function called 'elementwise_product' that takes in two lists of numbers as inputs and returns a list of their products. The function should handle the following constraints: If the input is not a list or if it contains elements which are not numbers, the functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert elementwise_product([1, 2, 3], [4, 5, 6]) == [4.0, 10.0, 18.0]\", \"assert elementwise_product([1.0, 2.0, 3.0], [4.0, 5.0, 6.0]) == [4.0, 10.0, 18.0]\", \"assert elementwise_product([-1, -2, -3], [4, 5, 6]) == [-4.0, -10.0, -18.0]\", \"assert elementwise_pro...
{ "split": "train", "index": 1026, "acecode_id": "evol_33479", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `remove_last_element(lst)` that removes the last element from the provided list and returns the modified list. The input list will contain at least one element.\nPlease reason step by step, then write a self-contained Python soluti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_last_element([4, 8, 15, 16, 23, 42]) == [4, 8, 15, 16, 23]\", \"assert remove_last_element([1]) == []\", \"assert remove_last_element([10, 20, 30]) == [10, 20]\", \"assert remove_last_element([5, 3, 2, 4]) == [5, 3, 2]\", \"assert remove_last_element(...
{ "split": "train", "index": 1027, "acecode_id": "evol_32500", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the construction of a custom neural network model for classifying images from the MNIST dataset. The function should take in the following parameters: `target_model_layers`, `target_optimizer_args`, `mia_model_layers`, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_model_summary({'conv1': 1, 'relu1': 1, 'maxpool1': 1, 'conv2': 1, 'relu2': 1, 'maxpool2': 1, 'to1d': 1, 'dense1': 1, 'tanh': 1, 'dense2': 1, 'logsoftmax': 1}, {'lr': 0.02, 'momentum': 0.3}, {'dense1': 1, 'tanh': 1, 'dense2': 1, 'logsoftmax': 1}, {'...
{ "split": "train", "index": 1028, "acecode_id": "bigcode_python_fns_5674", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that updates certain attributes of a data structure representing yearly data. The input is a dictionary where each key is a year (an integer) and each value is a list of dictionaries, with each dictionary containing the keys 'max', 't...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_max_values({2020: [{'max': 10, 'time': '2020-01-01', 'asset': 5}, {'max': 0, 'time': '2020-01-02', 'asset': 15}, {'max': 0, 'time': '2020-01-03', 'asset': 10}]}, 2020, 'asset') is None\", \"assert update_max_values({2021: [{'max': 5, 'time': '2021-01-...
{ "split": "train", "index": 1029, "acecode_id": "oss_2603", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a 3D point movement system for a game. You need to create a function that simulates the movement of a point in a 3D space, starting from the coordinates (10, 0, 5). The function should accept two parameters: `dx`, which controls the step size fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_movement(2, 3, [('incr_x', None), ('incr_z', None)]) == (12, 0, 8)\", \"assert simulate_movement(2, 3, [('decr_z', None)]) == (10, 0, 2)\", \"assert simulate_movement(1, 1, [('incr_x', None), ('incr_x', None), ('incr_z', None)]) == (12, 0, 6)\", \"a...
{ "split": "train", "index": 1030, "acecode_id": "oss_4620", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a file caching mechanism based on the type of content and its file extension. The function `cache_file` should take in three parameters: a string `url`, a value `content`, and a string `extension`. The function should r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cache_file('https://example.com/data', 'Sample text content', 'txt') == 'Content saved as text'\", \"assert cache_file('https://example.com/data', 'Sample text content', 'xml') == 'Content saved as text'\", \"assert cache_file('https://example.com/data', {'k...
{ "split": "train", "index": 1031, "acecode_id": "oss_28625", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of complex numbers, implement a function that returns the complex numbers sorted in reverse order based on their absolute value magnitude. The absolute value of a complex number a + bj is defined as sqrt(a^2 + b^2).\nPlease reason step by step, then write a self-co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_complex_numbers([2+2j, 2-2j, -2+2j, -2-2j]) == [2+2j, 2-2j, -2+2j, -2-2j]\", \"assert classify_complex_numbers([3+0j, 0+3j, 0-3j, -3+0j]) == [3+0j, 0+3j, 0-3j, -3+0j]\", \"assert classify_complex_numbers([5+0j, 0+5j, -5+0j, 0-5j]) == [5+0j, 0+5j, -5...
{ "split": "train", "index": 1032, "acecode_id": "evol_30558", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `lucas(n: int) -> List[int]` that takes an integer `n` and returns the first `n` numbers in the Lucas sequence. The Lucas sequence is defined as follows: L(0) = 2, L(1) = 1, and L(n) = L(n-1) + L(n-2) for n > 1. The function should return a list of integers...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lucas(0) == [2]\", \"assert lucas(1) == [2, 1]\", \"assert lucas(2) == [2, 1, 3]\", \"assert lucas(3) == [2, 1, 3, 4]\", \"assert lucas(4) == [2, 1, 3, 4, 7]\", \"assert lucas(5) == [2, 1, 3, 4, 7, 11]\", \"assert lucas(6) == [2, 1, 3, 4, 7, 11, 18]\", \"ass...
{ "split": "train", "index": 1033, "acecode_id": "evol_21626", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that adjusts a learning rate for a machine learning optimizer. The learning rate should start from an initial value and decay by 90% every specified number of epochs. Write a function `adjust_learning_rate(initial_lr: float, epoch: in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert adjust_learning_rate(0.1, 0, 30) == 0.1\", \"assert adjust_learning_rate(0.1, 29, 30) == 0.1\", \"assert adjust_learning_rate(0.5, 0, 20) == 0.5\", \"assert adjust_learning_rate(0.5, 19, 20) == 0.5\", \"assert adjust_learning_rate(0.5, 20, 20) == 0.05\", \"a...
{ "split": "train", "index": 1034, "acecode_id": "bigcode_python_fns_4775", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a value, determine whether it is a numeric value. A numeric value is defined as an integer, a floating-point number, or a decimal number. The value should not be a boolean. Implement a function `is_numeric(value)` that returns `True` if the value is numeric and `False` ot...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_numeric(5) == True\", \"assert is_numeric(3.14) == True\", \"assert is_numeric(0) == True\", \"assert is_numeric(-1) == True\", \"assert is_numeric(-0.1) == True\", \"assert is_numeric('string') == False\", \"assert is_numeric(None) == False\", \"assert i...
{ "split": "train", "index": 1035, "acecode_id": "bigcode_python_fns_48286", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple decision-making function in Python. This function will evaluate a given context and return a score indicating the desirability of an action based on specific parameters within that context. The function should take a dictionary as input...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decision_score({'some_parameter': 0, 'another_parameter': 0, 'some_condition': True}) == 0.0\", \"assert decision_score({'some_parameter': 10, 'another_parameter': 20, 'some_condition': False}) == 0.0\", \"assert decision_score({'some_parameter': 0, 'another...
{ "split": "train", "index": 1036, "acecode_id": "oss_7258", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function that converts a Roman numeral string to its corresponding decimal integer value. The function should handle valid Roman numeral strings consisting of the characters 'I', 'V', 'X', 'L', 'C', 'D', and 'M'.\nPlease reason step by step, then write a self-contai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert roman_to_decimal('III') == 3\", \"assert roman_to_decimal('IV') == 4\", \"assert roman_to_decimal('IX') == 9\", \"assert roman_to_decimal('LVIII') == 58\", \"assert roman_to_decimal('MCMXCIV') == 1994\", \"assert roman_to_decimal('CDXLIV') == 444\", \"assert...
{ "split": "train", "index": 1037, "acecode_id": "evol_28873", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of n integers. Your task is to implement a function that returns the index of the maximum element in the list. If there are multiple occurrences of the maximum element, return the index of the first occurrence. The function should be able to handle an empty...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max_index([]) == -1\", \"assert find_max_index([1]) == 0\", \"assert find_max_index([1, 2, 3, 4, 5]) == 4\", \"assert find_max_index([5, 4, 3, 2, 1]) == 0\", \"assert find_max_index([1, 3, 2, 3, 1]) == 1\", \"assert find_max_index([5, 5, 5, 5, 5]) == 0\...
{ "split": "train", "index": 1038, "acecode_id": "bigcode_python_fns_44634", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function named `vowels_count_advanced` that accepts a string and returns the count of vowels in that string. The function should count the vowels 'a', 'e', 'i', 'o', 'u', and 'y' (only when it is at the end of a word). Additionally, it should consider diacritical ma...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert vowels_count_advanced('abcde') == 2\", \"assert vowels_count_advanced('ACEDY') == 3\", \"assert vowels_count_advanced('\\u00e9xampl\\u00eb') == 3\", \"assert vowels_count_advanced('r\\u00e9sum\\u00e9') == 3\", \"assert vowels_count_advanced('fianc\\u00e9e') ...
{ "split": "train", "index": 1039, "acecode_id": "evol_15516", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `get_version` that takes an optional argument `version`, which is a tuple containing three integers representing the major, minor, and patch version numbers. If `version` is not provided, it defaults to a predefined version tuple `(1, 2, 3)`. The function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_version() == '1.2 3'\", \"assert get_version((2, 0, 1)) == '2.0 1'\", \"assert get_version((0, 1, 0)) == '0.1 0'\", \"assert get_version((3, 4, 5)) == '3.4 5'\", \"assert get_version((10, 20, 30)) == '10.20 30'\", \"assert get_version((100, 200, 300)) ==...
{ "split": "train", "index": 1040, "acecode_id": "oss_22476", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes in a list of integers and returns a new list containing only the even integers from the input list. Your function should maintain the original order of the even integers in the output list. Implement the function `filter...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([0, 1, 2, 3, 4]) == [0, 2, 4]\", \"assert filter_even_numbers([1, 3, 5]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) == [2, 4, 6, 8]\", \"assert filter_even_numbers([]) ==...
{ "split": "train", "index": 1041, "acecode_id": "oss_28763", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function `interpret_command(user_input: str) -> str` that interprets user commands for a multi-level text-based mystery game. The function should recognize three commands: 'look', 'get <item>', and 'use <item>'. It should return the appropriate response based on the in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert interpret_command('look') == 'You observe your surroundings.'\", \"assert interpret_command('get key') == 'You picked up the key.'\", \"assert interpret_command('use key') == 'You used the key.'\", \"assert interpret_command('get map') == 'You picked up the ...
{ "split": "train", "index": 1042, "acecode_id": "evol_4930", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `purge_numbers(arr: List[int]) -> List[int]` that takes an array of integers and removes all even numbers and all prime numbers from it. The function should return the remaining numbers in the same order. You do not need to implement multithreading; focus s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert purge_numbers([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) == [1, 9]\", \"assert purge_numbers([19, 20, 21, 22, 23, 24]) == [21]\", \"assert purge_numbers([25, 26, 27, 28, 29]) == [25, 27]\", \"assert purge_numbers([30, 31, 32, 33, 34]) == [33]\", \"assert purge_numbers(...
{ "split": "train", "index": 1043, "acecode_id": "evol_17710", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `get_stereo_image()` that simulates the retrieval of a stereo camera image. The function should return a 2D array representing a grayscale image with a specified width and height. If the dimensions provided are valid (greater than 0), the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_stereo_image(5, 5) == [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]\", \"assert get_stereo_image(0, 5) == None\", \"assert get_stereo_image(5, 0) == None\", \"assert get_stereo_image(-1, 5) == None\", \"assert get_...
{ "split": "train", "index": 1044, "acecode_id": "bigcode_python_fns_14656", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with validating and cleaning boolean values. Implement a function `validate_and_clean(value: Any) -> Tuple[bool, bool]` that takes an input value and returns a tuple where the first element is a boolean indicating whether the input value is a valid boolean and th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_and_clean(True) == (True, True)\", \"assert validate_and_clean(False) == (True, False)\", \"assert validate_and_clean(1) == (True, True)\", \"assert validate_and_clean(0) == (True, False)\", \"assert validate_and_clean('True') == (True, True)\", \"a...
{ "split": "train", "index": 1045, "acecode_id": "oss_13043", "num_tests": 16 }
acecode
[ { "role": "user", "content": "A positive integer is magical if it is divisible by either `a` or `b`, where both `a` and `b` are prime numbers. Given three integers `n`, `a`, and `b`, return the `nth` magical number. If either `a` or `b` is not a prime number, return -1. The answer may be very large, so retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert nth_magical_number(1, 2, 3) == 2\", \"assert nth_magical_number(4, 2, 3) == 6\", \"assert nth_magical_number(2, 3, 5) == 5\", \"assert nth_magical_number(1, 4, 6) == -1\", \"assert nth_magical_number(2, 5, 10) == -1\"]}" }
{ "split": "train", "index": 1046, "acecode_id": "evol_16518", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple bank account. The function should take a list of operations as input where each operation is represented as a tuple. The first element of the tuple is a string indicating the operation type ('deposit' or 'withdraw'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert final_balance([('deposit', 100), ('withdraw', 50)]) == 50.0\", \"assert final_balance([('deposit', 200), ('deposit', 150), ('withdraw', 100)]) == 250.0\", \"assert final_balance([('withdraw', 50)]) == 0.0\", \"assert final_balance([('deposit', 50), ('withdra...
{ "split": "train", "index": 1047, "acecode_id": "evol_19826", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `unique_primes(n: int) -> List[int]` that takes an integer n and returns a list of all unique prime numbers less than n. The list should be sorted in ascending order and should not include any duplicate values. If there are no prime numbers less than n, ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_primes(10) == [2, 3, 5, 7]\", \"assert unique_primes(1) == []\", \"assert unique_primes(2) == []\", \"assert unique_primes(3) == [2]\", \"assert unique_primes(4) == [2, 3]\", \"assert unique_primes(5) == [2, 3]\", \"assert unique_primes(6) == [2, 3, 5...
{ "split": "train", "index": 1048, "acecode_id": "evol_15976", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `give_register_permission` that manages user permissions for a given base URI. The function will take two parameters: a string `username` and a string `base_uri`. The function should return a message indicating the status of the permissio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert give_register_permission('charlie', 'http://example.com') == 'User charlie has been granted register permissions for http://example.com'\", \"assert give_register_permission('david', 'http://example.com') == 'User david not registered'\", \"assert give_regis...
{ "split": "train", "index": 1049, "acecode_id": "bigcode_python_fns_35866", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a dictionary that represents an event from a Lambda function. This dictionary contains a list of records, and each record includes details about an S3 object. Your task is to write a function that extracts and returns the key of the S3 object from the first record...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_key_from_event({'Records': [{'s3': {'object': {'key': 'file1.txt'}}}]}) == 'file1.txt'\", \"assert get_key_from_event({'Records': [{'s3': {'object': {'key': 'document.pdf'}}}]}) == 'document.pdf'\", \"assert get_key_from_event({'Records': [{'s3': {'objec...
{ "split": "train", "index": 1050, "acecode_id": "bigcode_python_fns_49263", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that checks if a given string is a palindrome. A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization). Your function should take a single string as ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('racecar') == True\", \"assert is_palindrome('A man a plan a canal Panama') == True\", \"assert is_palindrome('No lemon no melon') == True\", \"assert is_palindrome('hello') == False\", \"assert is_palindrome('Able was I ere I saw Elba') == Tru...
{ "split": "train", "index": 1051, "acecode_id": "evol_29570", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that parses data from a Ceph insights command output provided in JSON format. The JSON data contains information about the Ceph storage cluster, including the cluster name, health status, monitor details, and OSD (Object Storage Daemon) i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_ceph_data({\\\"cluster_name\\\": \\\"my_cluster\\\", \\\"health\\\": {\\\"overall_status\\\": \\\"HEALTH_OK\\\", \\\"detail\\\": \\\"HEALTH_OK\\\"}, \\\"monitors\\\": {\\\"total\\\": 3, \\\"in_quorum\\\": 3, \\\"details\\\": [{\\\"name\\\": \\\"mon1\\\...
{ "split": "train", "index": 1052, "acecode_id": "oss_423", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries representing units, where each dictionary contains a 'spikes' key that holds an integer value representing the number of spikes for that unit, write a function `get_index_of_max_spikes(unit_list)` that returns the index of the unit with the most spi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_index_of_max_spikes([{'spikes': 5}, {'spikes': 2}, {'spikes': 8}]) == 2\", \"assert get_index_of_max_spikes([{'spikes': 3}, {'spikes': 3}, {'spikes': 1}]) == 0\", \"assert get_index_of_max_spikes([{'spikes': 0}, {'spikes': 0}, {'spikes': 0}]) == 0\", \"a...
{ "split": "train", "index": 1053, "acecode_id": "bigcode_python_fns_39934", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that cleans up old log entries and file uploads based on specific retention periods. The function should take a list of log entries, where each log entry is represented as a dictionary containing an 'id' and a 'created' timestamp (in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cleanup_logs_and_uploads([{'id': 1, 'created': 10}, {'id': 2, 'created': 91}], [{'uuid': 'a', 'path': 'file1.txt', 'created': 95}, {'uuid': 'b', 'path': 'file2.txt', 'created': 89}]) == ([{'id': 1, 'created': 10}], [{'uuid': 'b', 'path': 'file2.txt', 'create...
{ "split": "train", "index": 1054, "acecode_id": "bigcode_python_fns_42487", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with designing a function that simulates the process of upgrading a database table. The function `upgrade_table` takes a list of dictionaries representing old database entries and modifies them according to specific rules. Each entry contains the following keys: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert upgrade_table([{'tx_hash': '0x1', 'log_index': 0, 'from_address': '0xabc', 'timestamp': 1620000000, 'pubkey': 'pubkey1', 'withdrawal_credentials': 'withdraw1', 'amount': '100', 'usd_value': '200', 'deposit_index': 1}], 1620001000) == [{'tx_hash': '0x1', 'log...
{ "split": "train", "index": 1055, "acecode_id": "bigcode_python_fns_32465", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of table names represented as strings. Your task is to implement a function `check_table_names(tables: List[str]) -> Tuple[List[str], Set[str]]` that checks if any of the table names contain an underscore ('_'). The function should return a tuple containing...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_table_names(['table1', 'table2', 'table3']) == (['No malformed table names', ''], set())\", \"assert check_table_names(['user_data', 'orders', 'products']) == (['These tables have underscores in the name', 'user_data', ''], {'user_data'})\", \"assert c...
{ "split": "train", "index": 1056, "acecode_id": "bigcode_python_fns_12318", "num_tests": 11 }
acecode
[ { "role": "user", "content": "In Python, implement a function `calculate_gpa(course_history: Dict[str, str]) -> float` that takes a dictionary representing a student's course history, where the keys are course names and the values are the corresponding grades. The function should compute and return the stud...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_gpa({'Math': 'A', 'Science': 'B'}) == 3.5\", \"assert calculate_gpa({'Biology': 'C', 'Chemistry': 'C+'}) == 2.15\", \"assert calculate_gpa({'Math': 'A', 'Physics': 'A', 'Chemistry': 'A-'}) == 3.9\", \"assert calculate_gpa({}) == 0.0\", \"assert cal...
{ "split": "train", "index": 1057, "acecode_id": "evol_12572", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of integers and calculates the sum of all even numbers in the list. Your function should take a single parameter, a list of integers, and return the sum of the even integers. If there are no even numbers in the l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([2, 4, 6, 8]) == 20\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([-2, -4, -6]) == -12\", \"assert sum_of_evens([0, 1, 2, 3, 4]) == 6\", \"assert sum_of_evens([]) == 0\", \"as...
{ "split": "train", "index": 1058, "acecode_id": "oss_3588", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a tuple representing the shape of an input feature vector and integers for the number of hidden nodes and classes, implement a function `create_ann_model(input_shape: tuple, num_hidden_nodes: int, num_classes: int, activation_function: str = 'relu') -> str` that returns a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_ann_model((28, 28), 64, 10) == 'Flatten -> Dense(64, activation=relu) -> Dense(10, activation=softmax)'\", \"assert create_ann_model((32, 32), 128, 5) == 'Flatten -> Dense(128, activation=relu) -> Dense(5, activation=softmax)'\", \"assert create_ann_m...
{ "split": "train", "index": 1059, "acecode_id": "bigcode_python_fns_41914", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `find_emails(text: str) -> Tuple[List[str], List[str]]` that takes a string `text` as input and returns a tuple containing two lists: the first list should contain all valid Gmail addresses found in the text, and the second list should contain all other valid e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_emails('Contact us at user@gmail.com.') == (['user@gmail.com'], [])\", \"assert find_emails('Reach out to support@example.com and admin@gmail.com.') == (['admin@gmail.com'], ['support@example.com'])\", \"assert find_emails('No emails here!') == ([], [])...
{ "split": "train", "index": 1060, "acecode_id": "evol_16996", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a list of column definitions for an invoice report based on a fixed set of attributes. The function should return a list of strings, where each string represents a column definition in the format 'Column Name:Data Type:Widt...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_invoice_columns() == ['Invoice:Link:120', 'Posting Date:Date:80', 'Status::80', 'Customer:Link:120', 'Sales Person:Link:100', 'AR Status::75', 'Territory:Link:100', 'SKU:Link:100', 'Qty:Float:50', 'Price List:Currency/currency:120', 'Discount:Currency/cu...
{ "split": "train", "index": 1061, "acecode_id": "bigcode_python_fns_3637", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that converts a nested dictionary structure into a JSON string. The function should take in a dictionary as input and produce a JSON string representation of that data using the `json.dumps` function with the `ensure_ascii` par...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_data_to_json({'app1': {'model1': [{'id': 1, 'name': 'John'}, {'id': 2, 'name': 'Alice'}], 'model2': [{'id': 1, 'value': 100}, {'id': 2, 'value': 200}]}}) == '{\\\"app1\\\": {\\\"model1\\\": [{\\\"id\\\": 1, \\\"name\\\": \\\"John\\\"}, {\\\"id\\\": 2...
{ "split": "train", "index": 1062, "acecode_id": "oss_15080", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Develop a function that normalizes a given list of complex numbers. The normalization of a complex number is defined as dividing the number by its absolute value, resulting in a complex number with an absolute value of 1. Implement a function named `normalize_complex_numbers` t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_complex_numbers([0+0j, 2+3j]) == [0+0j, 0.5547001962252291+0.8320502943378437j]\", \"assert normalize_complex_numbers([-5-5j, 5+5j]) == [-0.7071067811865475-0.7071067811865475j, 0.7071067811865475+0.7071067811865475j]\", \"assert normalize_complex_...
{ "split": "train", "index": 1063, "acecode_id": "evol_29575", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing a collection of single pulse event records from files. Each record consists of five fields: DM (float), Sigma (float), Time (float), Sample (integer), and Downfact (integer). You are provided with a list of records, some of which may be duplicates...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_sorted_records([(1.0, 2.0, 3.0, 1, 1), (1.0, 2.0, 3.0, 1, 1), (4.0, 5.0, 2.0, 1, 1)]) == [(4.0, 5.0, 2.0, 1, 1), (1.0, 2.0, 3.0, 1, 1)]\", \"assert unique_sorted_records([(1.0, 2.0, 1.0, 1, 1), (2.0, 3.0, 1.5, 2, 2), (3.0, 4.0, 0.5, 3, 3)]) == [(3.0, ...
{ "split": "train", "index": 1064, "acecode_id": "bigcode_python_fns_35449", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the configuration of a task processing system. The function should take three string parameters: `user_id`, `project_id`, and an optional `node_id`. The function will log the initialization process and return a tuple co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert configure_task_system('user1', 'project1') == ('Config for user1 and project1', 'Task system configured successfully without a specific node.')\", \"assert configure_task_system('user2', 'project2', 'nodeA') == ('Config for user2 and project2', 'Task system ...
{ "split": "train", "index": 1065, "acecode_id": "bigcode_python_fns_35668", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that verifies a three-column image text section of a homepage. This section should consist of multiple entries, each containing a heading, subheading, body, and an image title. Your function should take a list of dictionaries, where e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_three_column_section([{'heading': 'heading1', 'sub_heading': 'subheading1', 'body': '<p>body1</p>', 'image__title': 'title1'}, {'heading': 'heading2', 'sub_heading': 'subheading2', 'body': '<p>body2</p>', 'image__title': 'title2'}, {'heading': 'head...
{ "split": "train", "index": 1066, "acecode_id": "bigcode_python_fns_24266", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the absolute difference between two angles in degrees. Write a function `angle_difference(begin: int, end: int) -> int` that takes in two integers, `begin` and `end`, representing angles in degrees. The function should return the absolute differe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert angle_difference(30, 150) == 120\", \"assert angle_difference(-30, 30) == 60\", \"assert angle_difference(-90, 90) == 180\", \"assert angle_difference(10, -10) == 20\", \"assert angle_difference(0, 90) == 90\", \"assert angle_difference(90, 0) == 90\", \"ass...
{ "split": "train", "index": 1067, "acecode_id": "oss_23089", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of strings and returns a new list containing only the unique strings from the original list, preserving the order of their first appearance. Write a function `get_unique_strings(strings: List[str]) -> List[str]` that...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_strings(['apple', 'banana', 'apple', 'orange', 'banana']) == ['apple', 'banana', 'orange']\", \"assert get_unique_strings(['a', 'b', 'a', 'c', 'b', 'd']) == ['a', 'b', 'c', 'd']\", \"assert get_unique_strings(['python', 'java', 'python', 'c++']) =...
{ "split": "train", "index": 1068, "acecode_id": "bigcode_python_fns_29918", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `intersperse` that takes a list of integers `numbers`, an integer `delimeter`, and an optional boolean parameter `even_positions_only` (default to False). The function should return a list in which the integer `delimeter` is inserted between every tw...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert intersperse([], 4) == []\", \"assert intersperse([1, 2, 3], 4) == [1, 4, 2, 4, 3]\", \"assert intersperse([5], 7) == [5]\", \"assert intersperse([1, 3, 5, 7], 0) == [1, 0, 3, 0, 5, 0, 7]\", \"assert intersperse([10, 20, 30], 99) == [10, 99, 20, 99, 30]\", \"...
{ "split": "train", "index": 1069, "acecode_id": "evol_4705", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function `get_colored_svg_icon(resource: str, color: str) -> str` that simulates fetching a colored SVG icon from resources. Given a resource name and a color, return a string indicating the color applied to the icon. If the same resource and color are r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_colored_svg_icon('new_points', 'red') == 'Icon: new_points, Color: red'\", \"assert get_colored_svg_icon('new_points', 'red') == 'Icon: new_points, Color: red'\", \"assert get_colored_svg_icon('new_points', 'blue') == 'Icon: new_points, Color: blue'\", \...
{ "split": "train", "index": 1070, "acecode_id": "bigcode_python_fns_3078", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates subscribing to stock updates and handling trade events in a stock trading system. The function should accept a list of stock instruments and a list of trade events, and it should return a list of messages indicating the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert stock_trading_system(['AAPL', 'GOOGL'], ['Trade1', 'Trade2']) == ['Subscribed to AAPL', 'Subscribed to GOOGL', 'Handled trade event for Trade1', 'Handled trade event for Trade2']\", \"assert stock_trading_system(['TSLA'], ['Trade3']) == ['Subscribed to TSLA'...
{ "split": "train", "index": 1071, "acecode_id": "oss_25836", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `advanced_sort_elements(array)` that sorts a multi-dimensional array based on the length of the inner arrays first, and then lexicographically for arrays of the same length. The function should handle arrays containing strings and integers.\nPlease reason s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert advanced_sort_elements([[3, 2], [1], [5, 6, 7, 8], [4]]) == [[1], [4], [3, 2], [5, 6, 7, 8]]\", \"assert advanced_sort_elements([[2, 3, 1], [5, 4], [6]]) == [[6], [5, 4], [2, 3, 1]]\", \"assert advanced_sort_elements([['dog'], ['cat', 'mouse'], ['elephant', ...
{ "split": "train", "index": 1072, "acecode_id": "evol_1701", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that initializes default parameters for a hypothetical aquatic species called 'zooplankton'. Your function should set up a global dictionary that holds the default parameters for zooplankton, which include the following key-value pairs: '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert _zooplankton_defaults == {'size': 0.5, 'color': 'transparent', 'diet': 'plankton', 'habitat': 'ocean'}\", \"assert _zooplankton_defaults['size'] == 0.5\", \"assert _zooplankton_defaults['color'] == 'transparent'\", \"assert _zooplankton_defaults['diet'] == '...
{ "split": "train", "index": 1073, "acecode_id": "bigcode_python_fns_21115", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an unsorted array of integers of size N, implement a custom sorting algorithm that sorts the array in ascending order. The array may contain duplicate values and negative integers. You should not use any pre-built function for sorting. Implement the function `sort_array(a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_array([3, 1, 2]) == [1, 2, 3]\", \"assert sort_array([-1, -3, 2, 0, 5]) == [-3, -1, 0, 2, 5]\", \"assert sort_array([5, 5, 5, 5]) == [5, 5, 5, 5]\", \"assert sort_array([-4, -2, -4, -1]) == [-4, -4, -2, -1]\", \"assert sort_array([0]) == [0]\", \"assert...
{ "split": "train", "index": 1074, "acecode_id": "evol_25421", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple bank account system. Create a function `transaction(transactions: List[Union[int, float]], overdraft_allowed: bool = False) -> bool` that handles a list of transactions (which can be positive for deposits or negative for withdrawals) an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transaction([100, 50, -30]) == False\", \"assert transaction([-10]) == True\", \"assert transaction([50, -100]) == True\", \"assert transaction([-20, -10, 5]) == True\", \"assert transaction([10.5, 20.5, -30]) == False\", \"assert transaction([50, -20, -40],...
{ "split": "train", "index": 1075, "acecode_id": "evol_21165", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple function to simulate a text-based chatbot's response mechanism. The chatbot should respond to user input based on specific keywords with predefined responses. Implement a function `chatbot_response(user_input: str) -> str` that returns the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert chatbot_response('hello') == 'Hello there!'\", \"assert chatbot_response('hi there!') == 'Hello there!'\", \"assert chatbot_response('bye') == 'Goodbye! Have a great day!'\", \"assert chatbot_response('Hello, how are you?') == 'Hello there!'\", \"assert chat...
{ "split": "train", "index": 1076, "acecode_id": "oss_27186", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of options and returns a standardized message definition. The function should take in a list of options and return a dictionary representing the message definition with the following keys and their corresponding defa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_message_definition([]) == {'options': [], 'is_extendable': False, 'syntax': 'proto2', 'extension_ranges': []}\", \"assert create_message_definition(['option1']) == {'options': ['option1'], 'is_extendable': False, 'syntax': 'proto2', 'extension_ranges'...
{ "split": "train", "index": 1077, "acecode_id": "oss_35782", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given three lists representing the Kline analysis of a stock, determine if a 'first buy' condition is met based on specific criteria. Each Kline analysis consists of a list of segments and markers indicating price movements. The function should check the following conditions:\n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_first_buy([{'dt': '2023-01-01', 'xd': 'd', 'fx_mark': 'd'}], [{'dt': '2023-01-01', 'xd': 'd', 'fx_mark': 'd'}, {'dt': '2023-01-02', 'xd': 'u', 'fx_mark': 'u'}, {'dt': '2023-01-03', 'xd': 'd', 'fx_mark': 'd'}, {'dt': '2023-01-04', 'xd': 'd', 'fx_mark': 'd'...
{ "split": "train", "index": 1078, "acecode_id": "bigcode_python_fns_13624", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages different software version releases. Your function should allow the following operations: adding a new version, retrieving the latest version, and retrieving all available versions. The function takes a list of operations...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_versions(['add_version(1.0.0)', 'add_version(1.2.0)', 'get_latest_version()']) == ('1.2.0', ['1.0.0', '1.2.0'])\", \"assert manage_versions(['add_version(1.0.0)', 'add_version(2.0.0)', 'add_version(1.5.0)', 'get_latest_version()']) == ('2.0.0', ['1.0....
{ "split": "train", "index": 1079, "acecode_id": "oss_32913", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that processes HTTP headers based on configuration settings. The function should take in two dictionaries: one for configuration settings and another for request headers, then return a dictionary of headers to be used in the HT...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_http_headers({'HTTP_LOADER_FORWARD_ALL_HEADERS': True, 'HTTP_LOADER_FORWARD_USER_AGENT': False}, {'User-Agent': 'Mozilla/5.0'}) == {'User-Agent': 'Mozilla/5.0'}\", \"assert process_http_headers({'HTTP_LOADER_FORWARD_ALL_HEADERS': False, 'HTTP_LOADER_...
{ "split": "train", "index": 1080, "acecode_id": "oss_17098", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `remove_duplicates` that removes all integers that appear more than once in the list, while maintaining the order of the remaining integers. The function should modify the input list in place and return the updated list. You must e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 1, 2, 3, 3, 4]) == [2, 4]\", \"assert remove_duplicates([3, 3, 3, 4, 5]) == [4, 5]\", \"assert remove_duplicates([1, 1, 1, 1, 1]) == []\", \"assert remove_duplicates([2, 3, 4, 5, 6]) == [2, 3, 4, 5, 6]\", \"assert remove_duplicates([-1,...
{ "split": "train", "index": 1081, "acecode_id": "evol_22696", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a string, write a function `longest_unique_char_substring(text: str) -> List[Tuple[str, int, int]]` that determines the length and the starting index of the longest contiguous substring consisting of only one unique character within the provided text string. The function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_unique_char_substring('aaaabbbb') == [('aaaa', 4, 0), ('bbbb', 4, 4)]\", \"assert longest_unique_char_substring('') == []\", \"assert longest_unique_char_substring('a') == [('a', 1, 0)]\", \"assert longest_unique_char_substring('aaabb') == [('aaa', 3...
{ "split": "train", "index": 1082, "acecode_id": "evol_35519", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `concat_verify(list1, list2)` that takes two lists as inputs and concatenates them. The function should check if both inputs are indeed lists, and then return the concatenated list if the inputs are valid. If either input is not a list, the function should retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert concat_verify([1, 2], [3, 4]) == [1, 2, 3, 4]\", \"assert concat_verify([], []) == []\", \"assert concat_verify([1], []) == [1]\", \"assert concat_verify([], [2]) == [2]\", \"assert concat_verify(['a', 'b'], ['c', 'd']) == ['a', 'b', 'c', 'd']\", \"assert co...
{ "split": "train", "index": 1083, "acecode_id": "evol_14165", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the prices of books. Your task is to implement a function `delete_book_price(prices: List[int], index: int) -> List[int]` that removes the price of the book at the given index from the list of prices and returns the updated list. If...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_book_price([10, 20, 30, 40], 2) == [10, 20, 40]\", \"assert delete_book_price([15, 25, 35], 1) == [15, 35]\", \"assert delete_book_price([5, 10, 15, 20], 0) == [10, 15, 20]\", \"assert delete_book_price([100], 0) == []\", \"assert delete_book_price([1...
{ "split": "train", "index": 1084, "acecode_id": "oss_28715", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `render_web_page(url: str) -> str` that takes a URL as input and returns a message indicating that the web page at the given URL is being rendered. The function should not actually render the web page but should return a string in the format 'Rendering web ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert render_web_page('http://www.google.com') == 'Rendering web page at http://www.google.com'\", \"assert render_web_page('http://www.example.com') == 'Rendering web page at http://www.example.com'\", \"assert render_web_page('http://localhost:8000') == 'Renderi...
{ "split": "train", "index": 1085, "acecode_id": "evol_24650", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a data structure that can hold a list of related objects. Define a function called `create_related_objects_list` that accepts a list of objects (each represented as a dictionary) and returns a dictionary containing a key `my_related` which holds the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_related_objects_list([]) == {'my_related': []}\", \"assert create_related_objects_list([{'id': 1}]) == {'my_related': [{'id': 1}]}\", \"assert create_related_objects_list([{'id': 1}, {'id': 2}]) == {'my_related': [{'id': 1}, {'id': 2}]}\", \"assert cr...
{ "split": "train", "index": 1086, "acecode_id": "oss_17186", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a string representing a DNA sequence and returns its complementary sequence. In DNA, the complementary bases are as follows: A pairs with T, and C pairs with G. Any characters in the input string should be ignored. Write a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert complementary_sequence('ATCGA') == 'TAGCT'\", \"assert complementary_sequence('A') == 'T'\", \"assert complementary_sequence('T') == 'A'\", \"assert complementary_sequence('C') == 'G'\", \"assert complementary_sequence('G') == 'C'\", \"assert complementary_s...
{ "split": "train", "index": 1087, "acecode_id": "oss_5161", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers and returns the sum of the two smallest distinct integers and the sum of the two largest distinct integers. If there are fewer than four distinct integers in the list, raise a ValueError. The function should handle both positiv...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_sums([1, 2, 3, 4]) == (3, 7)\", \"assert find_sums([-10, -20, 0, 10]) == (-30, 10)\", \"assert find_sums([3, 4, 5, 1, 2]) == (3, 9)\", \"assert find_sums([10, 20, 30, 40]) == (30, 70)\", \"assert find_sums([-10, -5, 0, 5, 10]) == (-15, 15)\", \"assert f...
{ "split": "train", "index": 1088, "acecode_id": "evol_18364", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple indexing process for a record in a database. The function `index_record` takes a record represented as a dictionary containing a title and a unique ID, and it also takes metadata including the created and updated t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert index_record({'title': 'Test Record', 'id': '1'}, 'test_index', 'doc', '2023-01-01T00:00:00Z', '2023-01-01T01:00:00Z') == {'id': '1', 'index': 'test_index', 'doc_type': 'doc', 'title': 'Test Record', '_created': '2023-01-01T00:00:00Z', '_updated': '2023-01-0...
{ "split": "train", "index": 1089, "acecode_id": "bigcode_python_fns_23010", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the number of records processed in a batch by a data pipeline. Implement a function `check_processing_delay(records: List[int], skip_delay: bool) -> bool` that returns True if the total processing time is less than or equal to 2 sec...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_processing_delay([], True) == True\", \"assert check_processing_delay([], False) == False\", \"assert check_processing_delay([0], True) == True\", \"assert check_processing_delay([0], False) == False\", \"assert check_processing_delay([1], False) == Tr...
{ "split": "train", "index": 1090, "acecode_id": "bigcode_python_fns_37851", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function `get_default_settings` that returns a dictionary containing default settings for a simulation. The dictionary should include the following key-value pairs: 'output_dir' should be None, 'timeout' should be None, 'force_field' should be 16, 'temperature' should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_default_settings() == {'output_dir': None, 'timeout': None, 'force_field': 16, 'temperature': 700, 'conformers': 50, 'time_step': 1, 'eq_time': 50, 'simulation_time': 1000, 'maximum_iterations': 2500, 'minimum_gradient': 0.05, 'use_cache': False}\", \"as...
{ "split": "train", "index": 1091, "acecode_id": "bigcode_python_fns_16306", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a registration system that allows for the dynamic registration of different entity types along with their specific options. Your goal is to create a function `register_entities` that takes a list of tuples, where each tuple contains three elemen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert register_entities([('Site', {'url': 'example.com', 'timeout': 30}, True), ('Course', {'duration': 5, 'level': 'beginner'}, False)]) == {'Site': {'options': {'url': 'example.com', 'timeout': 30}, 'menu_enabled': True}, 'Course': {'options': {'duration': 5, 'l...
{ "split": "train", "index": 1092, "acecode_id": "oss_30648", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates uploading files to a cloud service. The function should take a list of files (represented as strings), a destination string, and a boolean indicating whether to delete the files upon successful upload. The function should r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert upload(['file1.txt', 'file2.txt'], 'my_folder', False) == ['Uploaded: file1.txt', 'Uploaded: file2.txt']\", \"assert upload(['large_file.txt'], 'my_folder', False) == ['Uploaded: large_file.txt']\", \"assert upload(['small.txt'], 'my_folder', True) == ['Uplo...
{ "split": "train", "index": 1093, "acecode_id": "bigcode_python_fns_27740", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with retrieving unique tiers from a given list of hierarchy entries. Each entry in the hierarchy is represented as a string, and you need to return a list of unique tiers found in the entries. Implement a function `get_unique_tiers(hierarchy: List[str]) -> List[s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_tiers(['A', 'B', 'A', 'C']) == ['A', 'B', 'C']\", \"assert get_unique_tiers(['X', 'Y', 'X', 'X', 'Z']) == ['X', 'Y', 'Z']\", \"assert get_unique_tiers(['Tier1', 'Tier2', 'Tier1', 'Tier3']) == ['Tier1', 'Tier2', 'Tier3']\", \"assert get_unique_tier...
{ "split": "train", "index": 1094, "acecode_id": "bigcode_python_fns_14989", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of a dog. The function `make_dog(size: str, name: str) -> str` will take two parameters: `size` (a string that represents the size of the dog, e.g., 'small', 'medium', 'large') and `name` (a string that represe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_dog('small', 'Buddy') == 'Buddy, the small dog says Woof!'\", \"assert make_dog('medium', '') == 'The medium dog says Woof!'\", \"assert make_dog('large', 'Max') == 'Max, the large dog says Woof!'\", \"assert make_dog('small', 'Rex') == 'Rex, the small ...
{ "split": "train", "index": 1095, "acecode_id": "bigcode_python_fns_33672", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary where each key is a cell barcode (a string) and each value is another dictionary. The inner dictionary's keys are unique molecular identifiers (UMIs), and the values are lists of genotypes (strings) corresponding to those UMIs. Your task is to impleme...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert collapse_genotypes({'cell1': {'umi1': ['ref'], 'umi2': ['ref']}, 'cell2': {'umi1': ['alt'], 'umi2': ['alt']}}) == {'cell1': [2, 0], 'cell2': [0, 2]}\", \"assert collapse_genotypes({'cell1': {'umi1': ['alt'], 'umi2': ['alt'], 'umi3': ['ref']}, 'cell2': {'umi1...
{ "split": "train", "index": 1096, "acecode_id": "bigcode_python_fns_33580", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a list of objects, each of which may have attributes 'uuid' or 'id', write a function `get_id(obj)` that takes an object as input and returns its 'uuid' if it exists. If 'uuid' does not exist, return the object's 'id'. If neither attribute exists, return the object itself...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_id({'uuid': '1234-5678'}) == '1234-5678'\", \"assert get_id({'id': 'abcd-efgh'}) == 'abcd-efgh'\", \"assert get_id({'name': 'test'}) == {'name': 'test'}\", \"assert get_id({'uuid': '1111-2222', 'id': '3333-4444'}) == '1111-2222'\", \"assert get_id({'id':...
{ "split": "train", "index": 1097, "acecode_id": "bigcode_python_fns_21745", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes in a list of strings and returns the count of unique strings in the list. A unique string is one that appears only once in the list, ignoring case sensitivity. For instance, 'Hello' and 'hello' should be considered the same...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_strings(['apple', 'banana', 'apple', 'orange', 'banana', 'orange']) == 0\", \"assert count_unique_strings(['Hello', 'world', 'hello', 'WORLD']) == 0\", \"assert count_unique_strings(['unique', 'UNIQUE', 'different']) == 1\", \"assert count_uniqu...
{ "split": "train", "index": 1098, "acecode_id": "oss_16064", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a Python function that extracts only alphanumeric characters from a given sentence. Any block of alphanumeric characters exceeding a length of 10 should be discarded. The function should be case insensitive. Write a function `filter_alphanumeric(sentence: str) -> str` th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_alphanumeric(\\\"A quick brown fox jumps over the lazy dog.\\\") == \\\"a quick brown fox jumps over the lazy dog\\\"\", \"assert filter_alphanumeric(\\\"Test with numbers 12345 and special characters! @#$%^&*()\\\") == \\\"test with numbers 12345 and...
{ "split": "train", "index": 1099, "acecode_id": "evol_2376", "num_tests": 10 }