data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are tasked with merging multiple lists of integers into a single sorted list. Each list contains unique integers, and the resulting merged list should also contain unique integers. You need to implement a function that takes a list of lists of integers and merges them into ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_sorted_lists([[1, 3, 5], [2, 4, 6], [1, 2, 3]]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_sorted_lists([[10, 20], [30], [10, 40, 50]]) == [10, 20, 30, 40, 50]\", \"assert merge_sorted_lists([[], [], []]) == []\", \"assert merge_sorted_lists([[1], [2], [3...
{ "split": "train", "index": 65900, "acecode_id": "bigcode_python_fns_17748", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of operations represented as strings, each indicating a specific type of NPU operation. The operations can be one of the following: 'ethosu_conv2d', 'ethosu_copy', 'ethosu_depthwise_conv2d', or 'ethosu_pooling'. Your task is to implement a function `transla...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert translate_operations(['ethosu_conv2d']) == ['Convolution 2D processed']\", \"assert translate_operations(['ethosu_copy']) == ['Copy operation processed']\", \"assert translate_operations(['ethosu_depthwise_conv2d']) == ['Depthwise Convolution 2D processed']\...
{ "split": "train", "index": 65901, "acecode_id": "bigcode_python_fns_42027", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_choke_point(lst)` that takes a list of integers `lst` as input and returns the index of the first 'choke point' in the list. A choke point is defined as an element where the sum of all elements to the left of it is equal to the product of all elements...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_choke_point([10, -1, -1, 10]) == -1\", \"assert find_choke_point([0, 0, 0, 0]) == 0\", \"assert find_choke_point([-1, -1, -1, -1]) == -1\", \"assert find_choke_point([5, 5, 1, 10]) == 2\", \"assert find_choke_point([1, 1, 2, 3, 4]) == 3\", \"assert find...
{ "split": "train", "index": 65902, "acecode_id": "evol_22220", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Develop a function that accepts a dictionary as input. The function should verify if all the keys in the dictionary are strings and all values are also strings. If any key or value is not a string, the function should raise a ValueError with a proper message. After validation, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_values_from_string_dict({'Country': 'USA', 'Capital': 'Washington D.C.', 'Currency': 'USD'}) == ('USA', 'Washington D.C.', 'USD')\", \"assert get_values_from_string_dict({'Name': 'Alice', 'Age': '30', 'City': 'New York'}) == ('Alice', '30', 'New York')\"...
{ "split": "train", "index": 65903, "acecode_id": "evol_376", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a string of text as input and returns the corresponding speech output as a string. For this problem, you will simulate the text-to-speech conversion by using a predefined mapping of input text to output speech. The mapping ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_text_to_speech('hello') == 'speech_hello'\", \"assert convert_text_to_speech('world') == 'speech_world'\", \"assert convert_text_to_speech('goodbye') == 'speech_goodbye'\", \"assert convert_text_to_speech('hello world') == 'Text not found'\", \"asser...
{ "split": "train", "index": 65904, "acecode_id": "oss_16116", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `calculate_modulus(num1, num2)` that calculates the modulus of two integers without using the modulus operator. The function should return 'Error: Division by zero' if the second integer (`num2`) is zero. If the first integer (`num1`) is negative, th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_modulus(10, 3) == 1\", \"assert calculate_modulus(10, 0) == 'Error: Division by zero'\", \"assert calculate_modulus(-10, -3) == -1\", \"assert calculate_modulus(0, 5) == 0\", \"assert calculate_modulus(5, 5) == 0\", \"assert calculate_modulus(-5, 5...
{ "split": "train", "index": 65905, "acecode_id": "evol_20376", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that predicts the classification label based on three input features. The function should accept three floating-point numbers as parameters, which represent the features of an input sample. Based on these features, the function will r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict_label(0.1, 0.2, 0.3) == 'Class A'\", \"assert predict_label(0.0, 1.0, 1.0) == 'Class B'\", \"assert predict_label(1.0, 1.0, 1.0) == 'Class B'\", \"assert predict_label(0.5, 1.5, 1.0) == 'Class B'\", \"assert predict_label(1.0, 1.0, 2.0) == 'Class C'\...
{ "split": "train", "index": 65906, "acecode_id": "oss_29287", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that filters a collection of armor items based on specified criteria and returns the filtered results. Implement the function `getFilteredArmor` that takes two parameters: a list of armor items and a dictionary of filtering criteri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert getFilteredArmor([{'name': 'Helmet', 'type': 'Head', 'defense': 20}, {'name': 'Chestplate', 'type': 'Chest', 'defense': 40}], {'type': 'Head'}) == [{'name': 'Helmet', 'type': 'Head', 'defense': 20}]\", \"assert getFilteredArmor([{'name': 'Helmet', 'type': 'H...
{ "split": "train", "index": 65907, "acecode_id": "oss_25649", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates user registration settings for a software system. The function, named `setup_user_registration`, should take four parameters: a list of activation requirements (strings), a list of pre-registration hooks (functions), a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert setup_user_registration(['Email verification', 'Phone number verification'], [], ['Full Name', 'Date of Birth'], [101, 202]) == {'activation_requirements': ['Email verification', 'Phone number verification'], 'hook_count': 0, 'attribute_count': 2, 'group_id_...
{ "split": "train", "index": 65908, "acecode_id": "oss_28472", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `parse_dict` that takes a dictionary `input_dict` as input and returns a new dictionary where the keys are converted to uppercase and the values are squared. If the input dictionary contains non-numeric values, the function should rai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_dict({'a': 2, 'b': 3.5}) == {'A': 4, 'B': 12.25}\", \"assert parse_dict({'x': 1, 'y': 0}) == {'X': 1, 'Y': 0}\", \"assert parse_dict({'key1': 5, 'key2': 7.1}) == {'KEY1': 25, 'KEY2': 50.41}\", \"assert parse_dict({}) == {}\", \"assert parse_dict({'sing...
{ "split": "train", "index": 65909, "acecode_id": "oss_27288", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a recursive function named 'generate_string' that creates a string of a specified length by repeating a given character. The function should take two parameters: a character 'c' and an integer 'n'. The function should return a string of length 'n' composed entirely of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_string('a', 5) == 'aaaaa'\", \"assert generate_string('b', 10) == 'bbbbbbbbbb'\", \"assert generate_string('c', 0) == ''\", \"assert generate_string('d', 1) == 'd'\", \"assert generate_string('e', 3) == 'eee'\", \"assert generate_string('f', 7) == '...
{ "split": "train", "index": 65910, "acecode_id": "evol_10968", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of positive integers and a string representing the order ('asc' for ascending, 'desc' for descending), implement a function that sorts the list in the specified order and removes all duplicates. Note that you should not use the built-in sorted() function, .sort() m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unordered_sort([7, 2, 9, 5, 2, 7, 9], 'desc') == [9, 7, 5, 2]\", \"assert unordered_sort([3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5], 'asc') == [1, 2, 3, 4, 5, 6, 9]\", \"assert unordered_sort([10, 20, 10, 30, 20], 'asc') == [10, 20, 30]\", \"assert unordered_sort([1,...
{ "split": "train", "index": 65911, "acecode_id": "evol_31581", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `generate_rating_email_html` that takes in a list of customer names and returns a string representing an HTML snippet for sending rating emails. Each email should include a greeting using the customer's name and a simple message asking th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_rating_email_html(['Alice', 'Bob']) == '<div><p>Dear Alice,</p><p>We hope you enjoyed your experience with us!</p><p>Please take a moment to rate us.</p></div><div><p>Dear Bob,</p><p>We hope you enjoyed your experience with us!</p><p>Please take a m...
{ "split": "train", "index": 65912, "acecode_id": "bigcode_python_fns_1720", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `hex_to_binary(hex_num: str) -> str` that converts a given hexadecimal number into its binary equivalent. The returned binary string should be in a 32-bit format, where positive values are represented normally and negative values are represented using two's...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hex_to_binary('1A') == '00000000000000000000000000011010'\", \"assert hex_to_binary('FFFFFFFE') == '11111111111111111111111111111110'\", \"assert hex_to_binary('0') == '00000000000000000000000000000000'\", \"assert hex_to_binary('7FFFFFFF') == '0111111111111...
{ "split": "train", "index": 65913, "acecode_id": "evol_16233", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a three-dimensional matrix (a list of lists of lists), implement a function that computes the product of all the elements within the matrix. The matrix can contain integers, and the function should return a single integer that represents the cumulative product of all elem...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multi_dimensional_mul([[[2, 3], [4, 5]], [[6, 1], [7, 0]], [[8, 2], [3, 9]]]) == 0\", \"assert multi_dimensional_mul([[[1, 2]], [[3, 4]], [[5, 6]]]) == 720\", \"assert multi_dimensional_mul([[[0]]]) == 0\", \"assert multi_dimensional_mul([[[1, 1], [1, 1]], [...
{ "split": "train", "index": 65914, "acecode_id": "evol_14447", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `remove_duplicates(arr: List[int]) -> List[int]` that takes a list of integers as input and returns a new list containing only the unique elements from the original list, preserving the order of their first occurrences. For example, given the input [5, 4, 5...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates([5, 4, 5, 3, 2, 3, 1]) == [5, 4, 3, 2, 1]\", \"assert remove_duplicates([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert remove_duplicates([1, 1, 1, 1]) == [1]\", \"assert remove_duplicates([]) == []\", \"assert remove_duplicates([2, 2, 3, 2...
{ "split": "train", "index": 65915, "acecode_id": "evol_8354", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a well-formed sentence that consists of subjects, conjunctions, verbs, and actions, implement a function that constructs a parse tree representing the structure of the sentence. The function should return the root node of the tree. The sentence can include multiple subjec...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_tree('Alice and Bob loves to swim') is not None\", \"assert build_tree('Alice but Bob likes to play') is not None\", \"assert build_tree('Alice likes to swim') is not None\", \"assert build_tree('Alice and likes to swim') is None\", \"assert build_tree...
{ "split": "train", "index": 65916, "acecode_id": "evol_9984", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the upsampling operation of a 1D or 2D convolution layer. The function takes in a layer type, which can be either 'UpSampling1D' or 'UpSampling2D', and the respective parameters for the upsampling operation. For 'UpSamp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert upsample_layer('UpSampling1D', (2,)) == {'scaling_factor_h': 1, 'scaling_factor_w': 2}\", \"assert upsample_layer('UpSampling1D', (1,)) == {'scaling_factor_h': 1, 'scaling_factor_w': 1}\", \"assert upsample_layer('UpSampling2D', (2, 3)) == {'scaling_factor_h...
{ "split": "train", "index": 65917, "acecode_id": "bigcode_python_fns_22925", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a class called `GridQueue` that simulates a bounded queue with a fixed capacity. The queue should support the following operations: 1. `push()`: Add an item to the queue. If the queue is already at capacity, it should raise a `GridSiteException`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert GridQueue(2, 'A').push() == 'A'\", \"assert GridQueue(2, 'A').push() == 'A'\", \"assert GridQueue(3, 'B').push() == 'B'\", \"assert GridQueue(3, 'B').push() == 'B'\", \"assert GridQueue(3, 'B').push() == 'B'\", \"assert GridQueue(1, 'C').push() == 'C'\", \"a...
{ "split": "train", "index": 65918, "acecode_id": "bigcode_python_fns_14663", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of numerical results from different models and a list of corresponding model names. Your task is to implement a function that generates a dictionary containing the minimum, maximum, and average values for each model's results. The function should take in tw...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert model_results_summary([[1, 2, 3], [4, 5, 6]], ['Model A', 'Model B']) == {'Model A': {'min': 1, 'max': 3, 'avg': 2.0}, 'Model B': {'min': 4, 'max': 6, 'avg': 5.0}}\", \"assert model_results_summary([[10, 20, 30], [5, 15, 25], [0, 0, 0]], ['Model X', 'Model Y...
{ "split": "train", "index": 65919, "acecode_id": "bigcode_python_fns_15165", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with designing a simple subscription management system. Create a function named `create_subscription_plan` that takes three parameters: `name` (a string representing the name of the subscription plan), `price` (a decimal value representing the price of the subscr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_subscription_plan('Basic Plan', 9.99, True) == {'name': 'Basic Plan', 'price': 9.99, 'automatic_renewal': True}\", \"assert create_subscription_plan('Premium Plan', 19.99, False) == {'name': 'Premium Plan', 'price': 19.99, 'automatic_renewal': False}\...
{ "split": "train", "index": 65920, "acecode_id": "oss_23854", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function called `event_dispatcher` that simulates an event handling system. The function will accept two parameters: a list of tuples where each tuple contains an event type and a corresponding handler function, and a list of tuples where each tuple cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert event_dispatcher([('event1', lambda data: f'Handled: {data}'), ('event1', lambda data: f'Another handler: {data}')], [('event1', 'data1'), ('event1', 'data2')]) == ['Handled: data1', 'Another handler: data1', 'Handled: data2', 'Another handler: data2']\", \"...
{ "split": "train", "index": 65921, "acecode_id": "oss_3658", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `replace_A_with_Z(string)` that takes a string as input and returns a new string where all instances of the character 'A' are replaced with 'Z'. Do not use any built-in replace functions.\nPlease reason step by step, then write a self-contained Python solution....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_A_with_Z('A') == 'Z'\", \"assert replace_A_with_Z('Hello World') == 'Hello World'\", \"assert replace_A_with_Z('This is a test') == 'This is a test'\", \"assert replace_A_with_Z('A quick brown fox') == 'Z quick brown fox'\", \"assert replace_A_with_Z...
{ "split": "train", "index": 65922, "acecode_id": "evol_29660", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a string `url`, implement a function `is_valid_url` that checks if the given string is a valid URL. A valid URL must have a scheme (e.g., 'http', 'https', 'ftp') specified. The function should return `True` if the URL is valid and `False` otherwise. The input string will ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_url('https://www.example.com') == True\", \"assert is_valid_url('http://example.org') == True\", \"assert is_valid_url('ftp://files.example.com') == True\", \"assert is_valid_url('https://') == False\", \"assert is_valid_url('http://example.com/path...
{ "split": "train", "index": 65923, "acecode_id": "bigcode_python_fns_37787", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of screen modes where each mode is represented as a dictionary containing 'width', 'height', 'port', 'rate', 'active', and 'preferred', implement a function that returns a list of preferred modes. A preferred mode is defined as one where the 'preferred' key is True...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_preferred_modes([{'width': '1920', 'height': '1080', 'port': 'HDMI-1', 'rate': '60.00', 'active': True, 'preferred': True}, {'width': '1280', 'height': '720', 'port': 'HDMI-1', 'rate': '60.00', 'active': True, 'preferred': False}]) == [{'width': '1920', ...
{ "split": "train", "index": 65924, "acecode_id": "bigcode_python_fns_10576", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing the names of different WMI classes. Each WMI class can have a description and a list of properties, where each property is also represented as a string. Your task is to implement a function `get_class_info(class_names: List[str], wit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_class_info(['CIM_DataFile'], True) == {'CIM_DataFile': {'description': 'A data file class', 'properties': ['Name', 'Size']}}\", \"assert get_class_info(['CIM_DataFile'], False) == {'CIM_DataFile': 'A data file class'}\", \"assert get_class_info(['CIM_Pro...
{ "split": "train", "index": 65925, "acecode_id": "bigcode_python_fns_15754", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a path in a directory structure. Your task is to implement a function that takes this list of strings and returns a new list containing the unique paths in the same order as they first appeared in the input list. A p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_paths(['a/b/c', 'a/b', 'a/b/c', 'd/e', 'a/b']) == ['a/b/c', 'a/b', 'd/e']\", \"assert unique_paths(['x/y/z', 'x/y', 'x/y/z', 'x/y/z/a']) == ['x/y/z', 'x/y', 'x/y/z/a']\", \"assert unique_paths(['foo/bar', 'foo/bar/baz', 'foo/bar', 'foo/baz']) == ['foo...
{ "split": "train", "index": 65926, "acecode_id": "bigcode_python_fns_4730", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the termination of connections to various remote hosts. The function should take the following parameters: a list of remote hosts, each represented as a dictionary containing a 'name' and a 'host', a control type string, an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert terminate_connections([{'name': 'service1', 'host': 'host1'}, {'name': 'service2', 'host': 'host2'}], 'control', 'daemon') == ['control -S build/daemon.host1 stop', 'control -S build/daemon.host2 stop']\", \"assert terminate_connections([{'name': 'serviceA',...
{ "split": "train", "index": 65927, "acecode_id": "bigcode_python_fns_48830", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a string of text and returns the count of each unique word in that text. The words are defined as sequences of characters separated by whitespace. Your function should not consider punctuation and should be case insensitive (e....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_words('Hello world') == {'hello': 1, 'world': 1}\", \"assert count_unique_words('Hello, hello world!') == {'hello': 2, 'world': 1}\", \"assert count_unique_words('This is a test. This test is only a test.') == {'this': 2, 'is': 2, 'a': 2, 'test'...
{ "split": "train", "index": 65928, "acecode_id": "bigcode_python_fns_8526", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that handles loading text features based on a specified mode. The function `load_text_features(challenge_mode)` takes a boolean parameter `challenge_mode`. If `challenge_mode` is `True`, the function should return the string 'Loading ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_text_features(True) == 'Loading challenge text features...'\", \"assert load_text_features(False) == 'Loading default text features...'\", \"assert load_text_features(True) == 'Loading challenge text features...'\", \"assert load_text_features(False) ==...
{ "split": "train", "index": 65929, "acecode_id": "oss_33099", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `greet` that takes a string parameter `msg` and prints the message to the console. The function should not return any value.\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 greet('hello') is None\", \"assert greet('Good morning!') is None\", \"assert greet('Welcome to the team!') is None\", \"assert greet('Happy coding!') is None\", \"assert greet('Hello, World!') is None\", \"assert greet('Python is great!') is None\"]}" }
{ "split": "train", "index": 65930, "acecode_id": "evol_10784", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a permission system for a software application. Each user can be assigned a set of permissions, and these permissions determine what actions the user can perform. Your task is to implement a function that checks whether a given user has a specif...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_permission({'read': True, 'write': False, 'execute': True, 'admin': False}, 'read') == True\", \"assert check_permission({'read': True, 'write': False, 'execute': True, 'admin': False}, 'write') == False\", \"assert check_permission({'read': True, 'wri...
{ "split": "train", "index": 65931, "acecode_id": "oss_17288", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `create_audio_file` that takes in five parameters: `title` (str), `description` (str), `publication_date` (datetime), `audio_link` (str), and `lyric_text` (str). This function should create an instance of the `AudioFile` class using these parameters ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_audio_file('Song Title', 'A great song', datetime(2023, 10, 1), 'http://audio.link/song', 'These are the lyrics') is not None\", \"assert create_audio_file('Another Song', 'Another great hit', datetime(2023, 5, 15), 'http://audio.link/another_song', '...
{ "split": "train", "index": 65932, "acecode_id": "evol_8344", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, each representing a log message. Your task is to implement a function that checks if the log messages contain the following sequence in order: \\n1. A warning message that starts with 'WARNING:' \\n2. A log start message that is exactly '=== LOG...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_logs(['WARNING: Running on DEVELOPMENT BUILD', '=== LOG STARTED ===', 'Hello World', '=== LOG FINISHED ===']) == True\", \"assert validate_logs(['Some other message', '=== LOG STARTED ===', 'Hello World', '=== LOG FINISHED ===']) == False\", \"asser...
{ "split": "train", "index": 65933, "acecode_id": "bigcode_python_fns_46444", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two distinct sets of integers, `groupA` and `groupB`, write a function `find_common_elements(groupA, groupB)` that returns a list of the common elements between these two sets. The order of the elements in the returned list does not matter.\nPlease reason step by step, th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_common_elements({1, 2, 3, 4, 5}, {4, 5, 6, 7, 8}) == [4, 5]\", \"assert find_common_elements({10, 20, 30}, {30, 40, 50}) == [30]\", \"assert find_common_elements({1, 2, 3}, {4, 5, 6}) == []\", \"assert find_common_elements({-1, -2, -3}, {-3, -4, -5}) ==...
{ "split": "train", "index": 65934, "acecode_id": "evol_34239", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that parses a SQL-like query string and returns a dictionary mapping SQL clauses to their respective arguments. The query string can contain the following clauses: 'SELECT', 'FROM', 'WHERE', 'GROUP BY', 'ORDER BY', and 'LIMIT'. Each claus...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_sql_query('SELECT name, age FROM users WHERE age > 21') == {'SELECT': ['name', 'age'], 'FROM': ['users'], 'WHERE': ['age > 21'], 'GROUP BY': [], 'ORDER BY': [], 'LIMIT': []}\", \"assert parse_sql_query('SELECT * FROM orders LIMIT 10') == {'SELECT': ['*...
{ "split": "train", "index": 65935, "acecode_id": "bigcode_python_fns_32499", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `elapsed_time(start_time: float) -> float` that takes a floating-point number `start_time` representing the timestamp (in seconds) when a process started. The function should return the elapsed time since that specific start time until the current time. You...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert elapsed_time(50.0) == 50.0\", \"assert elapsed_time(100.0) == 0.0\", \"assert elapsed_time(0.0) == 100.0\", \"assert elapsed_time(75.0) == 25.0\", \"assert elapsed_time(25.0) == 75.0\", \"assert elapsed_time(10.0) == 90.0\", \"assert elapsed_time(100.1) == 0...
{ "split": "train", "index": 65936, "acecode_id": "bigcode_python_fns_43918", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that performs a binary search on a sorted array to find the index of a specified item. If the item is found, return its index; otherwise, return -1. The function should be defined as `def binary_search(arr: List[int], item: int) -> int:` where `arr` is a so...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_search([1, 2, 3, 4, 5], 3) == 2\", \"assert binary_search([1, 2, 3, 4, 5], 1) == 0\", \"assert binary_search([1, 2, 3, 4, 5], 5) == 4\", \"assert binary_search([1, 2, 3, 4, 5], 6) == -1\", \"assert binary_search([], 3) == -1\", \"assert binary_search(...
{ "split": "train", "index": 65937, "acecode_id": "evol_29845", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function named `compute_central_tendency` that accepts an array of numerical elements (which can be integers or floats, including negative values) and a string `method` that specifies the type of central tendency to calculate. The `method` can be either 'mean' or...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_central_tendency([1, 2, 3, 4, 5], 'mean') == 3.0\", \"assert compute_central_tendency([1, 2, 3, 4, 5, 6], 'median') == 3.5\", \"assert compute_central_tendency([1.5, 2.5, 3.5], 'mean') == 2.5\", \"assert compute_central_tendency([-1, -5, -3], 'mean')...
{ "split": "train", "index": 65938, "acecode_id": "evol_5477", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that evaluates an integer input and returns a string message based on its value. The function should take an integer as input and return one of the following messages based on the integer's value: - If the integer is negative, retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_integer(-1) == '-1 is negative.'\", \"assert evaluate_integer(-10) == '-10 is negative.'\", \"assert evaluate_integer(0) == '0 is zero.'\", \"assert evaluate_integer(1) == '1 is positive.'\", \"assert evaluate_integer(10) == '10 is positive.'\", \"a...
{ "split": "train", "index": 65939, "acecode_id": "oss_3673", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `beacon_events(config: dict) -> list` that processes a configuration dictionary for monitoring file system events. The input configuration dictionary has a specific format where the 'directories' key maps to another dictionary. This i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert beacon_events({'beacons': {'watchdog': [{'directories': {'/path/to/dir1': {'mask': ['create', 'modify']}, '/path/to/dir2': {'mask': []}}}]}}) == ['create', 'modify']\", \"assert beacon_events({'beacons': {'watchdog': [{'directories': {'/path/to/dirA': {'mask...
{ "split": "train", "index": 65940, "acecode_id": "bigcode_python_fns_38569", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given the dimensions of two geometric shapes: a rectangle and a circle. Your task is to write a function that calculates the area and perimeter for both shapes and returns them in a tuple. The function should take four parameters: 'length', 'width' for the rectangle and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_shapes(4, 5, 3) == (20, 18, 28.274333882308138, 18.84955592153876)\", \"assert calculate_shapes(0, 0, 1) == (0, 0, 3.141592653589793, 6.283185307179586)\", \"assert calculate_shapes(10, 5, 0) == (50, 30, 0.0, 0.0)\", \"assert calculate_shapes(7, 3,...
{ "split": "train", "index": 65941, "acecode_id": "oss_22595", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a square matrix of dimensions NxN, where each cell contains a unique integer value ranging from 1 to N*N, implement a function `maxSumPath(grid, k)` to find the maximum cumulative sum of exactly k cells. The traversal can start from any cell and can only proceed to direct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxSumPath([[1,2,3], [4,5,6], [7,8,9]], 3) == 24\", \"assert maxSumPath([[1,1,1], [1,1,1], [1,1,1]], 2) == 2\", \"assert maxSumPath([[1]], 1) == 1\", \"assert maxSumPath([[1,2], [3,4]], 2) == 7\", \"assert maxSumPath([[1,2,3],[4,5,6],[7,8,9]], 1) == 9\", \"a...
{ "split": "train", "index": 65942, "acecode_id": "evol_21543", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that parses a string of filters and their corresponding logical operator. The input will be a string representing filters of the format 'field operator value' separated by semicolons, and a string that specifies whether the filters should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_matching_criteria('status=true;active=false', 'any') == ({'status': ('==', True), 'active': ('==', False)}, False)\", \"assert parse_matching_criteria('score=100;passed=true', 'all') == ({'score': ('==', 100), 'passed': ('==', True)}, True)\", \"assert...
{ "split": "train", "index": 65943, "acecode_id": "bigcode_python_fns_10291", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates a coupon code based on specific criteria. The function should take a dictionary as input and return a boolean value indicating whether the coupon code is valid. The dictionary will contain a key-value pair where the key...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_coupon_code({'code': 'Abc123'}) == True\", \"assert validate_coupon_code({'code': '123456'}) == False\", \"assert validate_coupon_code({'code': 'abcxyz'}) == False\", \"assert validate_coupon_code({'code': 'ABC123'}) == True\", \"assert validate_cou...
{ "split": "train", "index": 65944, "acecode_id": "oss_29630", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two dates in the format 'YYYY-MM-DD HH:MM:SS', write a function that calculates the total number of whole minutes between the two dates. The dates will always be valid and the first date will be earlier than the second date. The function should return an integer represent...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minutesBetween('2023-01-01 00:00:00', '2023-01-01 01:00:00') == 60\", \"assert minutesBetween('2023-01-01 00:00:00', '2023-01-02 00:00:00') == 1440\", \"assert minutesBetween('2023-01-01 12:00:00', '2023-01-01 12:30:00') == 30\", \"assert minutesBetween('202...
{ "split": "train", "index": 65945, "acecode_id": "bigcode_python_fns_44694", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a collection of bucket names. Write a function named `manage_buckets` that takes a list of existing bucket names and a new bucket name as input. The function should return a list containing all unique bucket names after adding the new bucket name, i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_buckets(['bucket1', 'bucket2', 'bucket1'], 'bucket3') == ['bucket1', 'bucket2', 'bucket3']\", \"assert manage_buckets(['bucket1', 'bucket2', 'bucket3'], 'bucket2') == ['bucket1', 'bucket2', 'bucket3']\", \"assert manage_buckets([], 'new-bucket') == ['...
{ "split": "train", "index": 65946, "acecode_id": "oss_15918", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that verifies if a given email address is valid according to a simple regex pattern. The function should take a single string input, which is the email address, and return True if the email address is valid, otherwise return False. A vali...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_email('test.email@example.com') == True\", \"assert is_valid_email('user.name@domain.co') == True\", \"assert is_valid_email('user@sub.domain.com') == True\", \"assert is_valid_email('plainaddress') == False\", \"assert is_valid_email('@missingusern...
{ "split": "train", "index": 65947, "acecode_id": "bigcode_python_fns_4944", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `average(values)` that computes the arithmetic mean of the numbers in the list. If the list is empty, the function should return None. The arithmetic mean is defined as the sum of all the numbers divided by the count of numbers. Yo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average([20, 30, 70]) == 40.0\", \"assert average([1, 2, 3, 4, 5]) == 3.0\", \"assert average([-1, -2, -3]) == -2.0\", \"assert average([0, 0, 0]) == 0.0\", \"assert average([10]) == 10.0\", \"assert average([]) == None\", \"assert average([1, 1, 1, 1]) == 1...
{ "split": "train", "index": 65948, "acecode_id": "bigcode_python_fns_9623", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a configuration string for a data analysis pipeline. The configuration string consists of multiple lines, where each line is either a command or a key-value pair. Your function should parse this configuration string and ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_configuration('run\\\\nmax-jobs=4\\\\n# This is a comment\\\\noutput=stdout\\\\n') == {'run': None, 'max-jobs': '4', 'output': 'stdout'}\", \"assert parse_configuration('') == {}\", \"assert parse_configuration('# Comment line\\\\n\\\\n') == {}\", \"as...
{ "split": "train", "index": 65949, "acecode_id": "bigcode_python_fns_49386", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function that processes server responses. The function will have two tasks: handling server errors and retrieving data from a server. The function will take two parameters: an error message and a data reference (href). If the error message is not empty, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_server_response('Unable to connect', 'data/123') == 'ServerError: The server has encountered an uncategorized error condition - Unable to connect'\", \"assert process_server_response('Timeout occurred', 'data/456') == 'ServerError: The server has enc...
{ "split": "train", "index": 65950, "acecode_id": "oss_17954", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a sequence of sensor readings. Your task is to implement a function that calculates the average of the first N readings, where N is a given positive integer. If N is greater than the number of readings available, return the average ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_readings([], 5) == 0.0\", \"assert average_readings([10], 1) == 10.0\", \"assert average_readings([10, 20], 1) == 10.0\", \"assert average_readings([10, 20], 2) == 15.0\", \"assert average_readings([1, 2, 3, 4, 5], 3) == 2.0\", \"assert average_readi...
{ "split": "train", "index": 65951, "acecode_id": "bigcode_python_fns_14521", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of users, each associated with their spent and estimated times for different periods. Your task is to create a function that calculates the difference between estimated and spent times for each user over a specified period. The function should return a dict...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_time_differences([1], {1: {'week1': 5, 'week2': 10}}, {1: {'week1': 10, 'week2': 15}}) == {1: [5, 5]}\", \"assert calculate_time_differences([1], {1: {'week1': 5}}, {1: {'week1': 10}}) == {1: [5]}\", \"assert calculate_time_differences([2], {2: {'w...
{ "split": "train", "index": 65952, "acecode_id": "bigcode_python_fns_33849", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of transfer syntax UIDs and a list of supported transfer syntax UIDs. Write a function that checks if all the transfer syntax UIDs in the first list are supported by the handler. The function should return `True` if all transfer syntax UIDs are supported, a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_transfer_syntax(['1.2.840.10008.1.2.1', '1.2.840.10008.1.2.2'], ['1.2.840.10008.1.2.1', '1.2.840.10008.1.2.2']) == True\", \"assert check_transfer_syntax(['1.2.840.10008.1.2.3'], ['1.2.840.10008.1.2.1', '1.2.840.10008.1.2.2']) == False\", \"assert chec...
{ "split": "train", "index": 65953, "acecode_id": "bigcode_python_fns_11715", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that sorts a list of dictionaries by the value of a specified key. Each dictionary represents an object with various attributes. If the specified key does not exist in one or more dictionaries, the function should return an error message. The function shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_json([{'name': 'Tom', 'age': 30}, {'name': 'Dick', 'age': 20}, {'name': 'Harry', 'age': 25}], 'age') == [{'name': 'Dick', 'age': 20}, {'name': 'Harry', 'age': 25}, {'name': 'Tom', 'age': 30}]\", \"assert sort_json([{'id': 3, 'value': 100}, {'id': 1, 'va...
{ "split": "train", "index": 65954, "acecode_id": "evol_15894", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of task IDs and a specific task ID to delete. Write a function `delete_task(task_ids: List[int], task_id: int) -> str` that removes the task with the specified ID from the list of task IDs. If the task ID is found and removed, return a message indicating th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_task([1, 2, 3, 4], 2) == 'Task with ID 2 deleted.'\", \"assert delete_task([1, 2, 3, 4], 5) == 'Task with ID 5 not found.'\", \"assert delete_task([], 1) == 'Task with ID 1 not found.'\", \"assert delete_task([1, 2, 3], 1) == 'Task with ID 1 deleted.'...
{ "split": "train", "index": 65955, "acecode_id": "bigcode_python_fns_431", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a custom error handling mechanism for a web application. Your goal is to create a function `custom_error_handler` that takes two parameters: 1. `status_code`: an integer representing the HTTP status code for which the error handler should be reg...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_error_handler(400, 'Bad Request') == {'msg': 'Bad Request', 'data': [], 'code': 400}\", \"assert custom_error_handler(403, 'Forbidden') == {'msg': 'Forbidden', 'data': [], 'code': 403}\", \"assert custom_error_handler(500, 'Internal Server Error') == ...
{ "split": "train", "index": 65956, "acecode_id": "oss_36012", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a client-server interaction where a client attempts to exclude certain items from a server's records. The function should take two parameters: a list of integers representing the items to exclude and a boolean represent...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert exclude_items([1, 2, 3], True) == 3\", \"assert exclude_items([4, 5], True) == 2\", \"assert exclude_items([], True) == 0\", \"assert exclude_items([1, 2, 3, 4, 5], True) == 5\", \"assert exclude_items([-1, -2], True) == 2\", \"assert exclude_items([0], True...
{ "split": "train", "index": 65957, "acecode_id": "bigcode_python_fns_31976", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of server IDs, and you need to determine the FPGA bypass mode for each server. Create a function `get_fpga_bypass_modes(server_ids: List[str]) -> List[str]` that takes a list of server IDs as input and returns a list of corresponding FPGA bypass modes. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_fpga_bypass_modes(['server1', 'server2', 'server3']) == ['enabled', 'disabled', 'enabled']\", \"assert get_fpga_bypass_modes(['server4']) == ['unknown']\", \"assert get_fpga_bypass_modes(['server1', 'server4']) == ['enabled', 'unknown']\", \"assert get_f...
{ "split": "train", "index": 65958, "acecode_id": "bigcode_python_fns_14844", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `sanity_check_result(line_increase_limit: int, line_decrease_limit: int, sanity_check: bool, mac_exists: bool) -> str` that simulates a sanity check for a version control system. The function should take the following parameters: \n1...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sanity_check_result(10, 5, False, False) == 'Success'\", \"assert sanity_check_result(10, 5, True, False) == 'Success'\", \"assert sanity_check_result(10, 5, True, True) == 'Sanity check failed'\", \"assert sanity_check_result(-1, 5, True, False) == 'Sanity ...
{ "split": "train", "index": 65959, "acecode_id": "oss_5082", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing news article data. Implement a function called `process_article` that takes three strings as input: `theme`, `title`, and `text`. The function should perform the following operations: convert the `theme` string to lowercase, remove any leading or ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_article('Politics', ' The Rise of Democracy ', '<p>This is a paragraph.</p>') == ('politics', 'The Rise of Democracy', 'This is a paragraph.')\", \"assert process_article('Technology', ' AI Innovations ', '<div>Latest trends in AI.</div>') ==...
{ "split": "train", "index": 65960, "acecode_id": "oss_4833", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function that takes an integer n as input and returns an nxn square matrix filled with successive positive integers from 1 to n^2 in a row-major order. The function should be defined as follows: def construct_square(n: int) -> List[List[int]].\nPlease reason step by...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_square(1) == [[1]]\", \"assert construct_square(2) == [[1, 2], [3, 4]]\", \"assert construct_square(3) == [[1, 2, 3], [4, 5, 6], [7, 8, 9]]\", \"assert construct_square(4) == [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]]\", \"asse...
{ "split": "train", "index": 65961, "acecode_id": "evol_22824", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a string input representing multiple lines of text. Each line is separated by a newline character (`\\n`). Your function should return the number of lines in the input string that contain the word 'Python' (case-sensitive)....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_python_lines('Hello World\\\\nPython is great\\\\nI love programming\\\\nPython') == 2\", \"assert count_python_lines('Python\\\\nPython\\\\nPython') == 3\", \"assert count_python_lines('This line does not contain the keyword\\\\nBut this one does: Pyt...
{ "split": "train", "index": 65962, "acecode_id": "bigcode_python_fns_38057", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function that takes this list and returns a new list containing only the unique integers from the input list, preserving their original order. If the input list is empty, return an empty list. The function should be ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert unique_integers([4, 5, 6, 4, 5, 6]) == [4, 5, 6]\", \"assert unique_integers([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_integers([1, 1, 1, 1]) == [1]\", \"assert unique_integers([]) == ...
{ "split": "train", "index": 65963, "acecode_id": "bigcode_python_fns_6239", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a string containing multiple lines of text and returns a list of individual lines as elements in that list. Each line in the input string is separated by a newline character ('\\n'). Your function should remove any leading ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_lines('Line 1\\\\nLine 2\\\\nLine 3') == ['Line 1', 'Line 2', 'Line 3']\", \"assert extract_lines('\\\\n Line 1 \\\\n Line 2 \\\\n') == ['Line 1', 'Line 2']\", \"assert extract_lines('Single Line') == ['Single Line']\", \"assert extract_lines(' ...
{ "split": "train", "index": 65964, "acecode_id": "bigcode_python_fns_41162", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `check_and_return(n)` that checks if a number is even or prime and returns the next even or prime number. The function should return a tuple containing three values: a boolean indicating if the number is even, a boolean indicating if the number is prime, an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_and_return(1) == (False, False, 2)\", \"assert check_and_return(2) == (True, True, 3)\", \"assert check_and_return(3) == (False, True, 5)\", \"assert check_and_return(4) == (True, False, 6)\", \"assert check_and_return(5) == (False, True, 7)\", \"asser...
{ "split": "train", "index": 65965, "acecode_id": "evol_16623", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two dictionaries, 'grouped_issues' and 'grouped_prs', where each dictionary maps group names (strings) to lists of items (strings). Additionally, you are provided with two lists of group names, 'issue_label_groups' and 'pr_label_groups'. Your task is to create a f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert join_label_groups({'bug': ['issue1', 'issue2']}, {'bug': ['pr1'], 'feature': ['pr2']}, ['bug'], ['bug', 'feature']) == {'bug': ['issue1', 'issue2', 'pr1'], 'feature': ['pr2']}\", \"assert join_label_groups({'bug': ['issue1']}, {'feature': ['pr1']}, ['bug'], ...
{ "split": "train", "index": 65966, "acecode_id": "bigcode_python_fns_10128", "num_tests": 13 }
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 even integers from the input list. Write a function `filter_even_numbers(numbers)` that takes a list of integers as input and performs the following tasks...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([0, 1, 2, 3, 4]) == [0, 2, 4]\", \"assert filter_even_numbers([7, 9, 11]) == []\", \"assert filter_even_numbers([6, 8...
{ "split": "train", "index": 65967, "acecode_id": "oss_9937", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `set_global_instance` which allows you to override a default instance of a global variable. The function takes a single parameter, `instance`, which can be any object. When the function is called, it should update a global vari...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_global_instance('instance1') == None\", \"assert set_global_instance(42) == None\", \"assert set_global_instance([1, 2, 3]) == None\", \"assert set_global_instance({'key': 'value'}) == None\", \"assert set_global_instance(None) == None\", \"assert set_gl...
{ "split": "train", "index": 65968, "acecode_id": "bigcode_python_fns_45939", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a price represented as a float and a conversion rate to another currency represented as a float. Write a function `convert_price(price: float, exchange_rate: float) -> str` that converts the given price to the new currency format using the exchange rate and return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_price(100.0, 1.2) == '$120.00'\", \"assert convert_price(50.5, 2.5) == '$126.25'\", \"assert convert_price(0.0, 1.0) == '$0.00'\", \"assert convert_price(150.75, 1.1) == '$165.83'\", \"assert convert_price(-10.0, 1.0) == 'Invalid price'\", \"assert c...
{ "split": "train", "index": 65969, "acecode_id": "bigcode_python_fns_8838", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves the encryption metadata for a given volume. The function should accept two parameters: a dictionary representing the volume metadata and a dictionary representing the encryption options. The volume metadata dictionary conta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_encryption_metadata({'volume_id': 'vol1', 'encryption_key_id': 'key123', 'volume_type_id': 'typeA'}, {'control_location': 'front-end', 'cipher': 'AES', 'key_size': 256, 'provider': 'providerX'}) == {'encryption_key_id': 'key123', 'control_location': 'fro...
{ "split": "train", "index": 65970, "acecode_id": "bigcode_python_fns_26980", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a Python function called `sum_even_numbers` that returns the sum of all even numbers in the list. If the input is not a list of integers, the function should raise a `TypeError`. The function should also handle any unexpected errors that may occu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_even_numbers([2, 4, 6, 8]) == 20\", \"assert sum_even_numbers([1, 3, 5, 7]) == 0\", \"assert sum_even_numbers([1, 2, 3, 4, 5]) == 6\", \"assert sum_even_numbers([10, 20, 30, 40]) == 100\", \"assert sum_even_numbers([-2, -4, -6]) == -12\", \"assert sum_ev...
{ "split": "train", "index": 65971, "acecode_id": "oss_21662", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `dyadic_equal` that takes two arguments, `alpha` and `omega`, and returns 1 if they are equal and 0 if they are not. The function should handle integer, float, and string types. If the types of `alpha` and `omega` are different, return 0. For example: `dyad...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dyadic_equal(3, 3) == 1\", \"assert dyadic_equal(2, 3) == 0\", \"assert dyadic_equal(3.1, 3.0) == 0\", \"assert dyadic_equal('abc', 'abc') == 1\", \"assert dyadic_equal('abc', 'def') == 0\", \"assert dyadic_equal('123', 123) == 0\", \"assert dyadic_equal(0, ...
{ "split": "train", "index": 65972, "acecode_id": "bigcode_python_fns_33202", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a bytes object `key`, a non-empty list of strings `seq`, and an optional bytes object `seed`, return one of the elements from `seq` based on the hash of the `key`. The selection should be determined by taking the hash of `key`, computing an index from that hash, and using...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert select(b'abc', ['apple', 'banana', 'cherry']) in ['apple', 'banana', 'cherry']\", \"assert select(b'key1', ['one', 'two', 'three', 'four']) in ['one', 'two', 'three', 'four']\", \"assert select(b'test', ['A', 'B', 'C', 'D', 'E']) in ['A', 'B', 'C', 'D', 'E']...
{ "split": "train", "index": 65973, "acecode_id": "bigcode_python_fns_22597", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of different agents in a reinforcement learning environment. Your task is to implement a function `calculate_average_score(scores: List[int]) -> float` that calculates and returns the average score of the agents. The aver...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average_score([10, 20, 30]) == 20.0\", \"assert calculate_average_score([]) == 0.0\", \"assert calculate_average_score([5]) == 5.0\", \"assert calculate_average_score([1, 2, 3, 4, 5]) == 3.0\", \"assert calculate_average_score([-1, -2, -3]) == -2.0...
{ "split": "train", "index": 65974, "acecode_id": "bigcode_python_fns_585", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to manage a library's book inventory. Your function should take two inputs: a string representing the publisher's name and another string representing the name of a book. The function should ensure that each publisher can only have on...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_book_inventory('Publisher A', 'Book 1') == True\", \"assert manage_book_inventory('Publisher B', 'Book 2') == True\", \"assert manage_book_inventory('Publisher B', 'Book 3') == True\", \"assert manage_book_inventory('Publisher C', 'Book 4') == True\",...
{ "split": "train", "index": 65975, "acecode_id": "oss_3192", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, `list_a` and `list_b`. Your task is to find the common elements between the two lists that satisfy the following conditions: each element in `list_a` must be greater than the corresponding element in `list_b` at the same index, and the eleme...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_common_greater_elements([5, 10, 15], [3, 8, 12]) == [5, 10, 15]\", \"assert find_common_greater_elements([1, 2, 3], [4, 5, 6]) == []\", \"assert find_common_greater_elements([10, 20, 30], [5, 15, 25]) == [10, 20, 30]\", \"assert find_common_greater_elem...
{ "split": "train", "index": 65976, "acecode_id": "bigcode_python_fns_45800", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function that calculates the total cost of purchasing a specified number of products, where each product has a unique unit cost. If a certain quantity is purchased, a bulk discount may apply, which is defined by a threshold and a discount rate. The function should tak...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_cost(6, 2.00, 5, 10) == 10.8\", \"assert calculate_total_cost(4, 2.00, 5, 10) == 8.0\", \"assert calculate_total_cost(5, 10.00, 5, 20) == 40.0\", \"assert calculate_total_cost(10, 5.00, 8, 15) == 42.5\", \"assert calculate_total_cost(3, 7.50,...
{ "split": "train", "index": 65977, "acecode_id": "evol_33861", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `get_first_element` that returns the first element of the list. If the list is empty, return None. The input will be a list of integers and the output should be a single integer or None. Example: For the input [3, 7, 1, 3, 2, 8], the o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_first_element([3, 7, 1, 3, 2, 8]) == 3\", \"assert get_first_element([10]) == 10\", \"assert get_first_element([-1, -5, 3]) == -1\", \"assert get_first_element([]) == None\", \"assert get_first_element([1, 2, 3, 4, 5]) == 1\", \"assert get_first_element(...
{ "split": "train", "index": 65978, "acecode_id": "bigcode_python_fns_47206", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `filter_even_greater_than_ten(numbers)` that takes a list of integers and returns a new list containing only the even integers from the input list that are greater than 10.\nPlease reason step by step, then write a self-contained Python solution. Give your ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_greater_than_ten([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) == []\", \"assert filter_even_greater_than_ten([11, 12, 13, 14, 15, 16]) == [12, 14, 16]\", \"assert filter_even_greater_than_ten([10, 11, 12, 13, 14, 15]) == [12, 14]\", \"assert filter_even_grea...
{ "split": "train", "index": 65979, "acecode_id": "evol_23200", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that formats a given non-negative number into a dollar format. The dollar format should include a dollar sign, commas for thousands separators, and exactly two decimal places. Your function should be able to handle both integer and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_dollars(0) == '$0.00'\", \"assert format_dollars(1) == '$1.00'\", \"assert format_dollars(10) == '$10.00'\", \"assert format_dollars(100) == '$100.00'\", \"assert format_dollars(1000) == '$1,000.00'\", \"assert format_dollars(1234.5) == '$1,234.50'\",...
{ "split": "train", "index": 65980, "acecode_id": "oss_3028", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `color_lerp(c1, c2, a)` that returns the linear interpolation between two RGB colors represented as tuples. The input `a` is a float that represents the interpolation factor, where `0` returns `c1`, `1` returns `c2`, and `0.5` returns a color that is halfwa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert color_lerp((255, 0, 0), (0, 0, 255), 0) == (255, 0, 0)\", \"assert color_lerp((255, 0, 0), (0, 0, 255), 1) == (0, 0, 255)\", \"assert color_lerp((255, 0, 0), (0, 0, 255), 0.5) == (127, 0, 127)\", \"assert color_lerp((255, 255, 0), (0, 255, 0), 0) == (255, 25...
{ "split": "train", "index": 65981, "acecode_id": "bigcode_python_fns_31129", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a user login process. The function `user_login(username: str, password: str, authenticated: bool) -> str` takes in three parameters: a string `username`, a string `password`, and a boolean `authenticated`. If the user is al...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert user_login('admin', 'admin', True) == 'Already logged in'\", \"assert user_login('admin', 'admin', False) == 'Login successful'\", \"assert user_login('admin', 'wrongpass', False) == 'Invalid credentials'\", \"assert user_login('user', 'admin', False) == 'In...
{ "split": "train", "index": 65982, "acecode_id": "bigcode_python_fns_18754", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple banking operation. The function should accept a list of operations where each operation is represented as a tuple. Each tuple consists of a string indicating the operation ('deposit', 'withdraw', 'calculate_interes...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_operations([('deposit', 100), ('withdraw', 50)]) == 50\", \"assert bank_operations([('deposit', 150), ('withdraw', 50), ('deposit', 100)]) == 200\", \"assert bank_operations([('withdraw', 10)]) == 0\", \"assert bank_operations([('deposit', -50), ('withd...
{ "split": "train", "index": 65983, "acecode_id": "oss_24472", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that initializes a dictionary to store user session data for a security application. The dictionary should contain the following keys with their respective initial values: 'login' (an empty string), 'hash' (an empty string), 'duration' (a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert init_session_data() == {'login': '', 'hash': '', 'duration': 0, 'nbFiles': 0, 'nbVirus': 0, 'nbErrors': 0, 'uuidUsb': '', 'viruses': []}\", \"assert isinstance(init_session_data(), dict)\", \"assert 'login' in init_session_data()\", \"assert 'hash' in init_s...
{ "split": "train", "index": 65984, "acecode_id": "bigcode_python_fns_43285", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function called `convert_args` that takes a variable number of arguments along with a list of types. The function should convert each argument to its corresponding type specified in the list. If there are more arguments than types, ignore the extr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_args('123', '456', types=[int, int]) == [123, 456]\", \"assert convert_args('1.5', types=[float]) == [1.5]\", \"assert convert_args('true', types=[bool]) == [True]\", \"assert convert_args(1, 2, 3, 4, types=[str, str]) == ['1', '2']\", \"assert conve...
{ "split": "train", "index": 65985, "acecode_id": "bigcode_python_fns_19627", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of deployed image IDs and their associated pod version identifiers. Your task is to implement a function `list_images(image_data: List[Tuple[str, List[str]]]) -> List[str]` that takes a list of tuples. Each tuple contains an image ID (a string) and a list o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_images([('image1', ['v1', 'v2']), ('image2', []), ('image3', ['v1'])]) == ['image1@v1', 'image1@v2', 'image2', 'image3@v1']\", \"assert list_images([('imageB', []), ('imageA', ['v1']), ('imageC', ['v2', 'v3'])]) == ['imageA@v1', 'imageB', 'imageC@v2', '...
{ "split": "train", "index": 65986, "acecode_id": "bigcode_python_fns_42004", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer representing a size in bytes, write a function `bytes_to_gb` that converts this size into gigabytes and returns the result rounded to two decimal places. The conversion should be done using the formula where 1 gigabyte is equal to 1024^3 bytes. For example, if ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bytes_to_gb(0) == 0.00\", \"assert bytes_to_gb(1024) == 0.00\", \"assert bytes_to_gb(1048576) == 0.00\", \"assert bytes_to_gb(1073741824) == 1.00\", \"assert bytes_to_gb(2147483648) == 2.00\", \"assert bytes_to_gb(3221225472) == 3.00\", \"assert bytes_to_gb(...
{ "split": "train", "index": 65987, "acecode_id": "oss_36877", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that retrieves a related object from a collection based on a unique identifier and sets it in a context dictionary. The function will take the following parameters: \n\n- `related_objects`: A list of dictionaries representing objects,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_related_object_context([], 'uuid1', 'related') == {}\", \"assert get_related_object_context([{'sodar_uuid': 'uuid1', 'name': 'Object 1'}, {'sodar_uuid': 'uuid2', 'name': 'Object 2'}], 'uuid1', 'related') == {'related': {'sodar_uuid': 'uuid1', 'name': 'Ob...
{ "split": "train", "index": 65988, "acecode_id": "oss_36083", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a URL for a Google Actions sync request. The function should take in two parameters: `base_url` (a string representing the base URL for Google Actions) and `id_token` (a string representing the authorization token). The fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_sync_request_url('https://example.com/google_actions', 'my_id_token') == ('https://example.com/google_actions/request_sync', {'Authorization': 'Bearer my_id_token'})\", \"assert generate_sync_request_url('https://test.com/google_actions', 'test_toke...
{ "split": "train", "index": 65989, "acecode_id": "bigcode_python_fns_12002", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that finds and replaces all occurrences of the substring 'cat' with 'dog' in a given string. You are not allowed to use any built-in string replace functions or methods. The function should return the modified string.\nPlease reason step by step, then write a s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_cat_with_dog('I have a cat and two cats') == 'I have a dog and two dogs'\", \"assert replace_cat_with_dog('cat') == 'dog'\", \"assert replace_cat_with_dog('This is a catalog') == 'This is a dogalog'\", \"assert replace_cat_with_dog('Caterpillar') == ...
{ "split": "train", "index": 65990, "acecode_id": "evol_14449", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `process_numbers(arr: List[Union[int, str]]) -> Union[str, Tuple[int, int, int]]` that takes a list of elements which may contain integers and strings. The function should return a tuple containing the smallest integer, the largest integer, and the sum of a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_numbers([1, 2, 3, 4, 5]) == (1, 5, 15)\", \"assert process_numbers([-10, -50, 0, 20]) == (-50, 20, -40)\", \"assert process_numbers([]) == 'List is empty'\", \"assert process_numbers(['hello', 2, 3]) == 'List contains non-integer values'\", \"assert ...
{ "split": "train", "index": 65991, "acecode_id": "evol_33329", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves a random inspirational quote from a predefined list of quotes. The function should return a dictionary containing the quote text and the author. The list of quotes is as follows: [{\"quote\": \"The only way to do great work...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_random_quote() in [{\\\"quote\\\": \\\"The only way to do great work is to love what you do.\\\", \\\"author\\\": \\\"Steve Jobs\\\"}, {\\\"quote\\\": \\\"Believe you can and you're halfway there.\\\", \\\"author\\\": \\\"Theodore Roosevelt\\\"}, {\\\"qu...
{ "split": "train", "index": 65992, "acecode_id": "oss_3552", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of bus schedules represented as a string, where each entry is either a number (indicating the bus's frequency) or 'x' (indicating that the bus does not operate). Your task is to find the earliest time 't' such that all buses with a frequency specified in th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert earliest_bus_time('7,13,x,x,59,x,31,19') == 1068781\", \"assert earliest_bus_time('67,7,59,61') == 754018\", \"assert earliest_bus_time('67,x,7,59,61') == 779210\", \"assert earliest_bus_time('67,7,x,59,61') == 1261476\", \"assert earliest_bus_time('1789,37,...
{ "split": "train", "index": 65993, "acecode_id": "bigcode_python_fns_20690", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Write a function that accepts an array of integers and returns a single array containing only the prime numbers from the input array.\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 separate_numbers([1,2,3,4,5,6,7,8,9,10]) == [2, 3, 5, 7]\", \"assert separate_numbers([10, 11, 12, 13, 14, 15]) == [11, 13]\", \"assert separate_numbers([4, 6, 8, 9, 10]) == []\", \"assert separate_numbers([17, 18, 19, 20]) == [17, 19]\", \"assert separate_n...
{ "split": "train", "index": 65994, "acecode_id": "evol_1680", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `store_article(title: str, content: str, author_id: int) -> Article` that takes a title, content, and an author's user ID, and stores a new article in the system. The function should return the newly created article object. Assume that the `Article` model h...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert store_article('First Article', 'This is the content of the first article.', 1).title == 'First Article'\", \"assert store_article('Second Article', 'Content for the second article goes here.', 2).content == 'Content for the second article goes here.'\", \"as...
{ "split": "train", "index": 65995, "acecode_id": "evol_31546", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `calculate_sum` that returns the sum of all even numbers in the list. If there are no even numbers, return 0. The function should take a single parameter, `nums`, which is a list of integers. The output should be a single integer repre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_sum([1, 2, 3, 4]) == 6\", \"assert calculate_sum([2, 4, 6, 8]) == 20\", \"assert calculate_sum([1, 3, 5, 7]) == 0\", \"assert calculate_sum([-2, -4, 1, 3]) == -6\", \"assert calculate_sum([]) == 0\", \"assert calculate_sum([0, 1, 2, 3]) == 2\", \"a...
{ "split": "train", "index": 65996, "acecode_id": "bigcode_python_fns_39877", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `fibonacci_in_binary(n)` that computes the n-th Fibonacci number and returns it in binary form. The Fibonacci sequence is defined as follows: F(0) = 0, F(1) = 1, and for n >= 2, F(n) = F(n-1) + F(n-2). Your function should handle the case when n is less than 2 ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci_in_binary(0) == '0'\", \"assert fibonacci_in_binary(1) == '1'\", \"assert fibonacci_in_binary(2) == '1'\", \"assert fibonacci_in_binary(3) == '10'\", \"assert fibonacci_in_binary(5) == '101'\", \"assert fibonacci_in_binary(6) == '1000'\", \"assert ...
{ "split": "train", "index": 65997, "acecode_id": "evol_23565", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that translates inputs from different sources into text. The function should be able to handle three types of inputs: ASL gestures from a Raspberry Pi camera, ASL gestures from a computer camera, and speech input. The function should perf...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert translate_input('raspberry_pi') == 'Translated ASL from Raspberry Pi'\", \"assert translate_input('computer') == 'Translated ASL from Computer'\", \"assert translate_input('speech') == 'Translated Speech'\", \"assert translate_input('invalid_source') == 'Inv...
{ "split": "train", "index": 65998, "acecode_id": "oss_27425", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list as input and returns a list of tuples, where each tuple consists of consecutive elements from the provided list. Additionally, the function should return a dictionary in which the keys are the tuples of consecutive elements, and the values...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_pairs([[1, 2], [3, 4]]) == ([(1, 2), (3, 4)], {(1, 2): [(0, 0)], (3, 4): [(1, 0)]})\", \"assert generate_pairs([(1, 2), (1, 2)]) == ([(1, 2), (1, 2)], {(1, 2): [(0, 0), (1, 0)]})\", \"assert generate_pairs([(1, 2), (1, 2), (2, 3)]) == ([(1, 2), (1, ...
{ "split": "train", "index": 65999, "acecode_id": "evol_11720", "num_tests": 7 }