data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are tasked with creating a decorator function named `if_active` that takes a callable function as an argument. This decorator should check if an object has an attribute `active` set to `True`. If `active` is `True`, the decorated function should execute normally. If `active...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert if_active(lambda x: x * 2)(self=type('obj', (object,), {'active': False})(), loop=None, args=(3,)) is None\", \"assert if_active(lambda: 42)(self=type('obj', (object,), {'active': False})(), loop=None) is None\", \"assert if_active(lambda: None)(self=type('o...
{ "split": "train", "index": 71700, "acecode_id": "bigcode_python_fns_2638", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a matrix containing 'n' numeric values, implement a function that checks if there exist three distinct rows such that the sum of all the numeric values in those rows equals a specified target. If such rows exist, return a list containing those rows; otherwise, return None...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_triplet_rows([[1, 1, 1], [1, 1, 1], [1, 1, 1]], 3) == None\", \"assert find_triplet_rows([[2, 3], [3, 4], [4, 5]], 27) == None\", \"assert find_triplet_rows([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 45) == [[1, 2, 3], [4, 5, 6], [7, 8, 9]]\", \"assert find_tri...
{ "split": "train", "index": 71701, "acecode_id": "evol_8213", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of integers, and your task is to find the sum of all unique integers in the list. An integer is considered unique if it appears exactly once in the list. Write a function `sum_of_unique_integers(nums: List[int]) -> int` that takes a list of integers as inpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_unique_integers([1, 1, 1, 1]) == 0\", \"assert sum_of_unique_integers([5, 3, 5, 7, 8, 8]) == 10\", \"assert sum_of_unique_integers([]) == 0\", \"assert sum_of_unique_integers([10, 20, 30, 10, 20]) == 30\", \"assert sum_of_unique_integers([1, 2, 3, 4, ...
{ "split": "train", "index": 71702, "acecode_id": "bigcode_python_fns_32999", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with managing a list of IP addresses for a local network. Your goal is to write a function that takes a list of IP addresses and a subnet mask, and returns a list of the IP addresses formatted in CIDR notation. The CIDR notation combines the IP address and the su...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_ips_to_cidr(['192.168.1.1', '192.168.1.1'], 24) == ['192.168.1.1/24']\", \"assert format_ips_to_cidr(['10.0.0.1'], 16) == ['10.0.0.1/16']\", \"assert format_ips_to_cidr([], 24) == []\", \"assert format_ips_to_cidr(['255.255.255.255'], 32) == ['255.255...
{ "split": "train", "index": 71703, "acecode_id": "bigcode_python_fns_9451", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a string and a specified alphanumeric symbol, implement a function that replaces each instance of the symbol within the string with a blank space, while also maintaining the reversed order of the original string. The output should not contain any additional spaces resulti...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_symbol('abcde', 'c') == 'ed ba'\", \"assert replace_symbol('abcdef', 'g') == 'fedcba'\", \"assert replace_symbol('', 'a') == ''\", \"assert replace_symbol('aaaaa', 'a') == ''\", \"assert replace_symbol('multiple spaces', ' ') == 'secaps elpitlum'\"...
{ "split": "train", "index": 71704, "acecode_id": "evol_1351", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that validates a given time format and raises a custom exception if the format is invalid. Your function should take a string representing the time as input and should follow the format 'HH:MM:SS' where HH represents hours (00 to 2...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_time_format('00:00:00') == True\", \"assert validate_time_format('23:59:59') == True\", \"assert validate_time_format('12:30:45') == True\", \"assert validate_time_format('01:01:01') == True\", \"assert validate_time_format('10:10:10') == True\", \"...
{ "split": "train", "index": 71705, "acecode_id": "oss_8848", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a binary tree represented as a nested dictionary, write a function `countTerminalNodes(tree)` that counts the number of terminal nodes (leaf nodes) in the tree. A terminal node is defined as a node that does not have any children (i.e., both left and right children are nu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert countTerminalNodes(None) == 0\", \"assert countTerminalNodes({'data': 1}) == 1\", \"assert countTerminalNodes({'data': 1, 'left': {'data': 2}}) == 1\", \"assert countTerminalNodes({'data': 1, 'right': {'data': 3}}) == 1\", \"assert countTerminalNodes({'data'...
{ "split": "train", "index": 71706, "acecode_id": "evol_25872", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a list of sports ranks, where each sport rank is represented as a tuple containing the name of the sport and its numerical rank. Your goal is to sort this list of ranks first by the numerical rank in ascending order and ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_sports_ranks([('Basketball', 2), ('Soccer', 1), ('Tennis', 3)]) == [('Soccer', 1), ('Basketball', 2), ('Tennis', 3)]\", \"assert sort_sports_ranks([('Swimming', 1), ('Running', 1), ('Cycling', 2)]) == [('Running', 1), ('Swimming', 1), ('Cycling', 2)]\",...
{ "split": "train", "index": 71707, "acecode_id": "oss_29148", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `get_polarisation_code(shape: List[int], wcs_codes: List[int]) -> str` that determines the polarisation code based on the shape of an image and its corresponding World Coordinate System (WCS) codes. The function should follow the FITS def...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_polarisation_code([2, 2], []) == 'stokesI'\", \"assert get_polarisation_code([3, 3], [-1, -2, -3]) == 'stokesI'\", \"assert get_polarisation_code([2, 2], [1]) == 'stokesI'\", \"assert get_polarisation_code([2, 2], [2]) == 'stokesI'\", \"assert get_polari...
{ "split": "train", "index": 71708, "acecode_id": "bigcode_python_fns_5020", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a list of non-negative integers representing counts, and a total number of reads, write a function that distributes the reads proportionally based on the counts. The function should return a list of integers where each integer represents the allocated reads for each count...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert distribute_reads([1, 2, 3], 6) == [1, 2, 3]\", \"assert distribute_reads([0, 0, 3], 3) == [0, 0, 3]\", \"assert distribute_reads([10, 20, 30], 0) == [0, 0, 0]\", \"assert distribute_reads([7, 1, 2], 10) == [7, 1, 2]\", \"assert distribute_reads([1], 5) == [5...
{ "split": "train", "index": 71709, "acecode_id": "bigcode_python_fns_14999", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a sorted array of integers and a target value. Implement a function `findTargetRange` to find the starting and ending positions of the target value in the array. The function should return a list containing the starting and ending positions of the target value. If...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert findTargetRange([1, 2, 3, 4, 5], 3) == [2, 2]\", \"assert findTargetRange([1, 2, 2, 3, 4], 2) == [1, 2]\", \"assert findTargetRange([1, 1, 1, 1, 1], 1) == [0, 4]\", \"assert findTargetRange([1, 2, 3, 4, 5], 6) == [-1, -1]\", \"assert findTargetRange([], 1) =...
{ "split": "train", "index": 71710, "acecode_id": "oss_11419", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two input types represented as strings, implement a function `check_input_types` that verifies if both types are 'float32' and if they are of the same type. If both types are valid and the same, return True. Otherwise, return False. The function should raise a TypeError w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_input_types('float32', 'float32') == True\", \"assert check_input_types('float32', 'float32') == True\", \"assert check_input_types('float32', 'float32') == True\", \"assert check_input_types('float32', 'float32') == True\", \"assert check_input_types(...
{ "split": "train", "index": 71711, "acecode_id": "bigcode_python_fns_18709", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Construct a function to blend two input strings by inserting characters alternatively from both strings. Ensure to bypass any numeric characters in both strings and keep a tally of such bypassed characters. Finally, output the result in the original order of insertion and appen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert custom_blender('', '') == ('', 0)\", \"assert custom_blender('123', '456') == ('', 6)\", \"assert custom_blender('a1c2e3', 'b4d5f6') == ('abcedf', 6)\", \"assert custom_blender('1a2b3c', '4d5e6f') == ('abcdef', 6)\", \"assert custom_blender('!@#$', '1234') =...
{ "split": "train", "index": 71712, "acecode_id": "evol_29090", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given two dictionaries `a` and `b`. Your task is to merge the dictionary `b` into `a`. If a key exists in both dictionaries and the values are also dictionaries, you should recursively merge those dictionaries. If the key exists in both dictionaries but the values are o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_dict({'x': 1, 'y': {'z': 3}}, {'y': {'z': 4, 'w': 5}, 'a': 6}) == {'x': 1, 'y': {'z': 4, 'w': 5}, 'a': 6}\", \"assert merge_dict({'a': {'b': 1}}, {'a': {'c': 2}}) == {'a': {'b': 1, 'c': 2}}\", \"assert merge_dict({}, {'a': 1}) == {'a': 1}\", \"assert m...
{ "split": "train", "index": 71713, "acecode_id": "bigcode_python_fns_30789", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two integers as input and returns their product using repeated addition. The function should handle both positive and negative integers and account for zero. The multiplication should be performed by adding the first integer to itself, the number...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply_numbers(3, 4) == 12\", \"assert multiply_numbers(-3, 4) == -12\", \"assert multiply_numbers(3, -4) == -12\", \"assert multiply_numbers(-3, -4) == 12\", \"assert multiply_numbers(0, 5) == 0\", \"assert multiply_numbers(5, 0) == 0\", \"assert multiply...
{ "split": "train", "index": 71714, "acecode_id": "evol_13357", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that converts measurements from imperial units to metric units and vice versa. The function should take a measurement string in the format 'X UNIT', where X is a floating-point number and UNIT can be either 'IN' for inches or 'CM' for...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_measurement('5.5 IN') == '13.97 CM'\", \"assert convert_measurement('20 CM') == '7.87 IN'\", \"assert convert_measurement('0 IN') == '0.00 CM'\", \"assert convert_measurement('0 CM') == '0.00 IN'\", \"assert convert_measurement('1 IN') == '2.54 CM'\"...
{ "split": "train", "index": 71715, "acecode_id": "oss_24603", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `initialize_database` that simulates the initialization of a database in either SQLite or MySQL based on the input parameters. If the parameter `use_mysql` is set to True, the function should return a string indicating that a MySQL databa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_database(False) == 'Initialized SQLite database.'\", \"assert initialize_database(True) == 'Initialized MySQL database with name: sbs.'\", \"assert initialize_database(True, 'test_db') == 'Initialized MySQL database with name: test_db.'\", \"asser...
{ "split": "train", "index": 71716, "acecode_id": "bigcode_python_fns_39603", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the implied volatility for a variance swap given the tenor and an optional forward start date. The function should take in the tenor as a string, and if a forward start date is provided, it should also be a string. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_implied_volatility('1m') == 1.0\", \"assert calculate_implied_volatility('2m') == 1.4142135623730951\", \"assert calculate_implied_volatility('3m') == 1.7320508075688772\", \"assert calculate_implied_volatility('invalid_tenor') == -1\", \"assert ca...
{ "split": "train", "index": 71717, "acecode_id": "bigcode_python_fns_25365", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function that converts a binary number represented as a string to its equivalent decimal value. The function should take a single string parameter, which consists of only '0's and '1's, and return the corresponding decimal integer value.\nPlease reason step by step,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_to_decimal('0') == 0\", \"assert binary_to_decimal('1') == 1\", \"assert binary_to_decimal('10') == 2\", \"assert binary_to_decimal('11') == 3\", \"assert binary_to_decimal('100') == 4\", \"assert binary_to_decimal('101') == 5\", \"assert binary_to_de...
{ "split": "train", "index": 71718, "acecode_id": "evol_31833", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of follow relationships represented as tuples and returns a list of unique users who have followers. Each tuple contains two strings: the follower's username and the followed user's username. Your function should ensure ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_users_with_followers([]) == []\", \"assert get_users_with_followers([('alice', 'bob')]) == ['bob']\", \"assert get_users_with_followers([('alice', 'bob'), ('eve', 'bob')]) == ['bob']\", \"assert get_users_with_followers([('alice', 'bob'), ('charlie', 'bo...
{ "split": "train", "index": 71719, "acecode_id": "oss_12563", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of integers and an integer target as input. The function should return a list of pairs of indices (i, j) from the input list such that the numbers at these indices add up to the target value. Each pair should be uniq...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_pairs([1, 2, 3, 4, 5], 5) == [(0, 3), (1, 2)]\", \"assert find_pairs([1, 2, 3, 4, 5], 10) == []\", \"assert find_pairs([], 5) == []\", \"assert find_pairs([1, 2, 3, 4, 5], 8) == [(2, 4)]\", \"assert find_pairs([1, 3, 5, 7, 9], 10) == [(0, 4), (1, 3)]\",...
{ "split": "train", "index": 71720, "acecode_id": "bigcode_python_fns_27969", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a dictionary representing a user's session data and returns a dictionary that indicates whether the user is logged in or not. The input dictionary may contain a key 'user' which holds the user's information. If the 'user' key e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_user_session({'user': {'name': 'Alice'}}) == {'logged_in': True, 'user_info': {'name': 'Alice'}}\", \"assert check_user_session({'user': None}) == {'logged_in': False, 'user_info': None}\", \"assert check_user_session({}) == {'logged_in': False, 'user_...
{ "split": "train", "index": 71721, "acecode_id": "oss_17871", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a non-sorted list of mixed values, implement a function that filters out any non-integer values from the list, sorts the remaining integers in ascending order, and calculates the arithmetic mean of the integers. If there are no integers left after filtering, the function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_mean([10, 20, 30, 40]) == (25.0, [10, 20, 30, 40])\", \"assert calculate_mean(['a', 'b', 'c']) == (None, [])\", \"assert calculate_mean([3.5, 2.5, 1.0]) == (None, [])\", \"assert calculate_mean([]) == (None, [])\", \"assert calculate_mean([1]) == (...
{ "split": "train", "index": 71722, "acecode_id": "evol_10133", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function that finds the longest contiguous subsequence of consonants in a given word. The function should return the length of this subsequence along with the starting and ending indices of this subsequence. If the word consists solely of consonants, the function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_subsequence('rhythm') == (6, 0, 5)\", \"assert longest_subsequence('xyz') == (3, 0, 2)\", \"assert longest_subsequence('bcd') == (3, 0, 2)\", \"assert longest_subsequence('x') == (1, 0, 0)\", \"assert longest_subsequence('bbbb') == (4, 0, 3)\", \"ass...
{ "split": "train", "index": 71723, "acecode_id": "evol_29590", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the retrieval of user credentials from a configuration dictionary. The function will take a dictionary containing user credentials and return a formatted string that includes the username, password, tenant name, and aut...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_user_credentials({'os_username': 'user1', 'os_password': 'pass1', 'os_tenant_name': 'tenant1', 'os_auth_url': 'http://auth.url'}) == 'Username: user1, Password: pass1, Tenant: tenant1, Auth URL: http://auth.url'\", \"assert get_user_credentials({'os_user...
{ "split": "train", "index": 71724, "acecode_id": "bigcode_python_fns_42246", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a street address, city, state, postal code, and an optional ISO country code, implement a function that validates the inputs and returns a formatted string containing the complete address. The state and ISO country code should be exactly two characters long. If the inputs...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_address('123 Main St', 'Springfield', 'IL', '62701') == '123 Main St, Springfield, IL, 62701, US'\", \"assert format_address('456 Elm St', 'Seattle', 'WA', '98101') == '456 Elm St, Seattle, WA, 98101, US'\", \"assert format_address('789 Maple Ave', 'A...
{ "split": "train", "index": 71725, "acecode_id": "bigcode_python_fns_19452", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function that accepts a list of integers and returns a new list containing only the even numbers from the original list. The output list should maintain the order of the original list. Write a function named `filter_even_numbers` that takes a li...
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, -2, -3, -4]) == [0, -2, -4]\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([1, 3, 5, 7...
{ "split": "train", "index": 71726, "acecode_id": "oss_25234", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing severity scores of outliers in a system. Your task is to implement a function that calculates the final severity score for each outlier. The final severity score is computed by multiplying the severity score of the outlier by a give...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_final_scores([10, 20, 30], [0.1, 0.2, 0.3]) == [1.0, 4.0, 9.0]\", \"assert calculate_final_scores([5, 15], [0.0, 0.5]) == [0.0, 7.5]\", \"assert calculate_final_scores([3], [1.0]) == [3.0]\", \"assert calculate_final_scores([], []) == []\", \"asser...
{ "split": "train", "index": 71727, "acecode_id": "bigcode_python_fns_25491", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a string input and returns the number of uppercase letters present in that string. Write a Python function called `count_uppercase_letters` that takes in one parameter: 1. `text` (string): The text in which you want to coun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_uppercase_letters('Hello World') == 2\", \"assert count_uppercase_letters('python') == 0\", \"assert count_uppercase_letters('PYTHON') == 6\", \"assert count_uppercase_letters('123ABC') == 3\", \"assert count_uppercase_letters('A B C D E') == 5\", \"as...
{ "split": "train", "index": 71728, "acecode_id": "oss_35628", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are working on a natural language processing (NLP) project and need to implement a function to process query vectors and word occurrences. Your task is to write a function that takes a query vector and a dataset of word occurrences, and returns the indices of words that sat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_query([0.0, 1e-9, 1e-8, 1e-7], [0, 1, 2, 3]) == [3]\", \"assert process_query([1e-9, 1e-9, 1e-9], [0, 0, 0]) == []\", \"assert process_query([0.1, 0.2, 0.3], [1, 2, 3]) == [0, 1, 2]\", \"assert process_query([1e-9, 1e-9, 1e-9], [1, 1, 1]) == []\", \"...
{ "split": "train", "index": 71729, "acecode_id": "oss_1904", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a network access service behavior. The service needs to maintain a list of authorized users and their access levels and should be able to grant or revoke access for users. Implement a function `access_service(operations: Li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert access_service([('grant', 'alice', 1), ('grant', 'bob', 2)]) == {'alice': 1, 'bob': 2}\", \"assert access_service([('grant', 'alice', 1), ('grant', 'bob', 2), ('grant', 'alice', 3)]) == {'alice': 3, 'bob': 2}\", \"assert access_service([('grant', 'alice', 1)...
{ "split": "train", "index": 71730, "acecode_id": "oss_10535", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a time expression, implement a function `parse_time_expression(expression, min_value, max_value)` that returns a list of integers that match the specified time expression within the range defined by `min_value` and `max_value`. The time expression can be one of the follow...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_time_expression('*', 0, 59) == [x for x in range(60)]\", \"assert parse_time_expression(None, 0, 59) == [x for x in range(60)]\", \"assert parse_time_expression('/5', 0, 59) == [x for x in range(0, 60, 5)]\", \"assert parse_time_expression('*', 0, 23) ...
{ "split": "train", "index": 71731, "acecode_id": "bigcode_python_fns_40228", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `s` that consists of lowercase English letters and parentheses `(` and `)`, your task is to remove the minimum number of invalid parentheses to make the input string valid. A valid parentheses string means that every opening parenthesis has a corresponding closin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert removeInvalidParentheses('()())()') == ['(())()', '()()()']\", \"assert removeInvalidParentheses('(a)())()') == ['(a())()', '(a)()()']\", \"assert removeInvalidParentheses(')(') == ['']\", \"assert removeInvalidParentheses('(()') == ['()']\", \"assert remove...
{ "split": "train", "index": 71732, "acecode_id": "evol_13762", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of boolean values, implement a function `logical_and(arr: List[bool]) -> bool` that returns True if all elements in the list are True, and False otherwise. The function should handle an empty list by returning True, as the logical AND of no elements is considered T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert logical_and([True, True, True]) == True\", \"assert logical_and([True, False, True]) == False\", \"assert logical_and([False, False, False]) == False\", \"assert logical_and([True]) == True\", \"assert logical_and([False]) == False\", \"assert logical_and([]...
{ "split": "train", "index": 71733, "acecode_id": "bigcode_python_fns_8200", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing water levels measured at different times, implement a function that determines if the slope of the least-squares linear fit to this data is positive, negative, or undefined. Return True if the slope is positive, False if the slope is negati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert slope_finder([1, 2, 3, 4]) == True\", \"assert slope_finder([4, 3, 2, 1]) == False\", \"assert slope_finder([1, 2, 3, 2]) == True\", \"assert slope_finder([3, 2, 1, 2]) == False\", \"assert slope_finder([2, 2, 2]) == False\", \"assert slope_finder([]) == Non...
{ "split": "train", "index": 71734, "acecode_id": "bigcode_python_fns_34002", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the process of restarting a bot. The function should print a message indicating that the bot process is restarting. It should then invoke a function that simulates the actual restart of the bot process. The bot process ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert perform_restart(Bot()) == None\", \"assert perform_restart(Bot()) == None\", \"assert perform_restart(Bot()) == None\", \"assert perform_restart(Bot()) == None\", \"assert perform_restart(Bot()) == None\", \"assert perform_restart(Bot()) == None\", \"assert ...
{ "split": "train", "index": 71735, "acecode_id": "oss_31063", "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 even numbers from the input list. Your function should be able to handle an empty list and should maintain the order of the even numbers as they appear in...
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([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([-2, -1, 0, 1, 2]) == [-2, 0, 2]\", \"assert filter_even_numbers(...
{ "split": "train", "index": 71736, "acecode_id": "oss_600", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a logging mechanism for an application. The function should take a string message as input and return a formatted log string. The log string should include a timestamp (in the format 'YYYY-MM-DD HH:MM:SS') followed by the m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_message('Error occurred') == '2023-10-01 12:00:00 - Error occurred'\", \"assert log_message('User logged in') == '2023-10-01 12:00:00 - User logged in'\", \"assert log_message('File not found') == '2023-10-01 12:00:00 - File not found'\", \"assert log_me...
{ "split": "train", "index": 71737, "acecode_id": "bigcode_python_fns_31185", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of dictionaries, where each dictionary represents a row of data. Each dictionary contains two keys: \"node\" and \"len\". The \"node\" key holds a string value, and the \"len\" key holds an integer value. Your ta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert aggregate_data([{\\\"node\\\": \\\"abc\\\", \\\"len\\\": 3}, {\\\"node\\\": \\\"def\\\", \\\"len\\\": 3}, {\\\"node\\\": \\\"xyz\\\", \\\"len\\\": 3}, {\\\"node\\\": \\\"pqrst\\\", \\\"len\\\": 5}]) == {3: 3.0, 5: 5.0}\", \"assert aggregate_data([{\\\"node\\...
{ "split": "train", "index": 71738, "acecode_id": "oss_20254", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function that takes a list of integers and returns a new list containing only the unique elements from the input list, maintaining the original order of their first appearance. Write a function `get_unique_elements(arr: List[int]) -> List[int]` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_elements([1, 2, 3, 1, 2, 3]) == [1, 2, 3]\", \"assert get_unique_elements([5, 5, 5, 5]) == [5]\", \"assert get_unique_elements([-1, -2, -1, -3, -2]) == [-1, -2, -3]\", \"assert get_unique_elements([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert ge...
{ "split": "train", "index": 71739, "acecode_id": "bigcode_python_fns_31838", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `template` which represents the name of a document template. Additionally, you have a structure `Info` that contains three lists: `files_added`, `tests_added`, and `examples_added`. The `files_added` list indicates files that were added, `tests_added` ind...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_relevant_docs('template1', Info(['file1', 'file2'], ['test1'], ['example1'])) == 'Files added: file1, file2\\\\nTests added: test1\\\\nExamples added: example1'\", \"assert print_relevant_docs('template2', Info([], [], [])) == 'No additions made for te...
{ "split": "train", "index": 71740, "acecode_id": "bigcode_python_fns_4345", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that represents a compound structure in either InChI or SMILES format. Your task is to implement a function that returns a unique query ID for the given compound structure. The function should simulate the process of creating a query ID by generating a ha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_query_id('CCC', 'smiles_test') == hash('CCC')\", \"assert generate_query_id('InChI=1S/C3H4O3/c1-2(4)3(5)6/h1H3,(H,5,6)') == hash('InChI=1S/C3H4O3/c1-2(4)3(5)6/h1H3,(H,5,6)')\", \"assert generate_query_id('C1=CC=CC=C1', 'label1') == hash('C1=CC=CC=C1...
{ "split": "train", "index": 71741, "acecode_id": "bigcode_python_fns_3077", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that extracts specific gazette information from a given municipality in Brazil using a provided query and territory ID. The function should take two parameters: a string representing the query (e.g., 'cod_entidade:98') and a string re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_gazette_information('cod_entidade:98', '4205704') == {'query': 'cod_entidade:98', 'territory_id': '4205704'}\", \"assert extract_gazette_information('cod_entidade:99', '4205705') == {'query': 'cod_entidade:99', 'territory_id': '4205705'}\", \"assert ...
{ "split": "train", "index": 71742, "acecode_id": "oss_20436", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the necessary heating capacity per unit area based on the energy conservation region and the type of room. Given an integer `region` (1 to 5) representing the energy conservation region and a string `R_type` which can either be 'Main Living Room'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calc_heating_capacity(1, 'Main Living Room') == 5.0\", \"assert calc_heating_capacity(1, 'Other Living Room') == 3.0\", \"assert calc_heating_capacity(2, 'Main Living Room') == 4.5\", \"assert calc_heating_capacity(2, 'Other Living Room') == 2.5\", \"assert ...
{ "split": "train", "index": 71743, "acecode_id": "bigcode_python_fns_40644", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing different dialog messages. Your task is to find the first dialog message that matches one of the acceptable dialogs provided in another list. If none of the acceptable dialogs are found in the list of messages, return 'No match found...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_first_dialog(['Hello', 'Goodbye', 'Welcome'], ['Welcome', 'Goodbye']) == 'Goodbye'\", \"assert find_first_dialog(['Hi', 'How are you?', 'Bye'], ['Hello', 'Goodbye']) == 'No match found'\", \"assert find_first_dialog(['Error', 'Warning', 'Success'], ['Su...
{ "split": "train", "index": 71744, "acecode_id": "bigcode_python_fns_26514", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple signal receiver mechanism. The function `mock_signal_receiver` should accept a signal (represented as a list), an optional callable to wrap, and additional keyword arguments (which will be ignored for this problem)...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert mock_signal_receiver([], None) == ['Receiver activated!']\", \"assert mock_signal_receiver([], lambda: 'Wrapped!') == ['Receiver activated!', 'Wrapped!']\", \"assert mock_signal_receiver(['Initial Signal'], None) == ['Initial Signal', 'Receiver activated!']\...
{ "split": "train", "index": 71745, "acecode_id": "bigcode_python_fns_43235", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `are_all_elements_of_type(_type, value_1, *args)` that checks if all the provided values are of the same specified type. The function should take the following parameters: \n1. `_type` (any): The type to check for. \n2. `value_1` (any): The first value to c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_all_elements_of_type(int, 1, 2, 3) == True\", \"assert are_all_elements_of_type(str, 'hello', 'world', 'python') == True\", \"assert are_all_elements_of_type(float, 1.0, 2.5, 3.14) == True\", \"assert are_all_elements_of_type(list, [1, 2], [3, 4]) == Tru...
{ "split": "train", "index": 71746, "acecode_id": "bigcode_python_fns_13645", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a Python function to calculate the mean of the numerical elements within the provided list. The function should iterate through the list to sum the elements and then perform the division to find the mean. You may assume that the list will contain at least one numerical e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_mean([1, 2, 3, 4, 5]) == 3.0\", \"assert calculate_mean([10, 20, 30]) == 20.0\", \"assert calculate_mean([5, 15, 25, 35]) == 20.0\", \"assert calculate_mean([100, 200, 300, 400, 500]) == 300.0\", \"assert calculate_mean([-1, -2, -3, -4]) == -2.5\",...
{ "split": "train", "index": 71747, "acecode_id": "evol_32150", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a given sentence by reversing the order of its words. The function should take a single string input and return a new string with the words in reverse order. Words are defined as sequences of characters separated by spa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_words('Hello World') == 'World Hello'\", \"assert reverse_words(' Python is fun ') == 'fun is Python'\", \"assert reverse_words(' LeetCode ') == 'LeetCode'\", \"assert reverse_words('a b c d e') == 'e d c b a'\", \"assert reverse_words(' a b ...
{ "split": "train", "index": 71748, "acecode_id": "oss_12706", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a max pooling operation on a 2D matrix. The function should take three parameters: a 2D list of integers representing the input matrix, a tuple of two integers representing the pool size, and a tuple of two integers rep...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_pool([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], (2, 2), (2, 2)) == [[6, 8], [14, 16]]\", \"assert max_pool([[1]], (1, 1), (1, 1)) == [[1]]\", \"assert max_pool([[1, 2], [3, 4]], (2, 2), (1, 1)) == [[4]]\", \"assert max_pool([[5, 5, ...
{ "split": "train", "index": 71749, "acecode_id": "bigcode_python_fns_9238", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the creation of a lock file. The function `create_lock(name: str) -> bool` should take a string `name` as input and return `True` if the lock file can be created, or `False` if a lock file with the same name already exists....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_lock('lock1') == True\", \"assert create_lock('lock2') == True\", \"assert create_lock('lock3') == True\", \"assert create_lock('lock4') == True\", \"assert create_lock('lock5') == True\", \"assert create_lock('lock6') == True\", \"assert create_lock(...
{ "split": "train", "index": 71750, "acecode_id": "bigcode_python_fns_5230", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists, `x` and `y`, where `x` represents the independent variable values and `y` represents the dependent variable values in a linear regression model. Additionally, you are provided with a list `w` that contains the weights corresponding to each independent v...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert residual_sum_of_squares([0.0, 0.0], [1.0, 1.0], [1.0, 1.0], 0.0) == 2.0\", \"assert residual_sum_of_squares([2.0, 3.0], [5.0, 7.0], [2.0, 2.0], 1.0) == 0.0\", \"assert residual_sum_of_squares([1.0, 2.0], [1.0, 2.0], [0.0, 0.0], 0.0) == 5.0\", \"assert residu...
{ "split": "train", "index": 71751, "acecode_id": "bigcode_python_fns_21153", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a list of strings where each string represents a line of dialogue in a screenplay formatted in ASS (Advanced SubStation Alpha) style. Your task is to implement a function that filters these lines based on a specified keyword. The function should return a new list ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_lines(['Dialogue: Mark=Hello', 'Dialogue: Mark=Goodbye'], 'Hello') == ['Dialogue: Mark=Hello']\", \"assert filter_lines(['Line1', 'Line2', 'Line3'], 'Line2') == ['Line2']\", \"assert filter_lines(['Hello World', 'Hello Everyone', 'Goodbye World'], 'He...
{ "split": "train", "index": 71752, "acecode_id": "bigcode_python_fns_33019", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that calculates the sum of squares of all natural numbers up to a given positive integer n (inclusive). The function should take one parameter n and return the computed sum.\nPlease reason step by step, then write a self-contained Python solution. Give your fi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_squares(1) == 1\", \"assert sum_of_squares(2) == 5\", \"assert sum_of_squares(3) == 14\", \"assert sum_of_squares(4) == 30\", \"assert sum_of_squares(5) == 55\", \"assert sum_of_squares(6) == 91\", \"assert sum_of_squares(7) == 140\", \"assert sum_of_...
{ "split": "train", "index": 71753, "acecode_id": "evol_5988", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists, nodes_list and values_list, construct a binary search tree (BST) and determine if it is valid. The nodes_list contains node relationships denoted by the strings 'root', 'left', and 'right', while values_list contains unique integer values corresponding to each ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_bst_validity(['root'], [10]) == True\", \"assert verify_bst_validity(['root', 'left'], [10, 5]) == True\", \"assert verify_bst_validity(['root', 'right'], [10, 15]) == True\", \"assert verify_bst_validity(['root', 'left', 'left'], [10, 5, 3]) == True\...
{ "split": "train", "index": 71754, "acecode_id": "evol_8338", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_primes(n)` that takes an integer `n` as input and returns a list of all prime numbers less than `n`. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. Your function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_primes(0) == []\", \"assert calculate_primes(1) == []\", \"assert calculate_primes(2) == []\", \"assert calculate_primes(3) == [2]\", \"assert calculate_primes(4) == [2, 3]\", \"assert calculate_primes(5) == [2, 3]\", \"assert calculate_primes(6) =...
{ "split": "train", "index": 71755, "acecode_id": "evol_10806", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating a string of digits based on specific criteria. Implement a function `generate_string(value: int, basic: int) -> str` that generates a string based on the following rules: 1. If `value` is greater than 100, return `None`. 2. If `basic` is less than...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_string(50, 10) is not None\", \"assert generate_string(101, 10) is None\", \"assert generate_string(50, 21) is not None\", \"assert generate_string(50, 20) is not None\", \"assert generate_string(50, 0) is not None\", \"assert len(generate_string(50...
{ "split": "train", "index": 71756, "acecode_id": "oss_8634", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with generating a series of events with unique IDs based on the provided parameters. Write a function `generate_events(event_id: int, quantity: int, time_diffs: Optional[List[int]] = None, source_attrs: Optional[List[Optional[str]]] = None) -> List[Tuple[int, int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_events(1, 1) == [(1, 1410895419859714, None)]\", \"assert generate_events(1, 2) == [(1, 1410895419859714, None), (2, 1410895419859714, None)]\", \"assert generate_events(1, 3, [1, 2]) == [(1, 1410895419859714, None), (2, 1410895419859715, None), (3,...
{ "split": "train", "index": 71757, "acecode_id": "bigcode_python_fns_16209", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a list of strings, write a function that returns the longest common substring that appears at least 'k' times across all strings in the list. If no such substring exists or the list is empty, return None. In case of a tie, return the substring that appears first in the li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_substring([], 2) is None\", \"assert longest_substring(['a', 'b', 'c'], 2) is None\", \"assert longest_substring(['abc', 'abcabc', 'abcabcabc'], 3) == 'abc'\", \"assert longest_substring(['test', 'tester', 'testing'], 2) == 'test'\", \"assert longest...
{ "split": "train", "index": 71758, "acecode_id": "evol_19116", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `second_smallest_even_element(l: list)` that returns the second smallest even number from the list. If there is no second smallest even number, return None. Additionally, compute the sum of all even numbers in the list and return i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert second_smallest_even_element([5, 3, -6, 2, -3, 4, 9, 0, 123, 1, -10]) == (-6, -10)\", \"assert second_smallest_even_element([1, 3, 5, 7]) == (None, 0)\", \"assert second_smallest_even_element([2, 2, 2, 2]) == (None, 8)\", \"assert second_smallest_even_elemen...
{ "split": "train", "index": 71759, "acecode_id": "evol_7812", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `import_object(obj_path: str, hard: bool) -> Any` that imports an object from a given string URI in the format 'module:object'. If the object cannot be imported, the function should return None unless the `hard` parameter is set to True, in which case it sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert import_object('math:sqrt', False) is not None\", \"assert import_object('math:non_existing_function', False) is None\", \"assert import_object('math:sqrt', True) is not None\", \"assert import_object('os:path', False) is not None\", \"assert import_object('o...
{ "split": "train", "index": 71760, "acecode_id": "bigcode_python_fns_12516", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples, where each tuple contains a group identifier and a value. Your task is to rank the values within each group and return a new list of tuples that contains the original group identifier, the original value, and its rank within the group. The rankin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rank_in_group([('C', 1), ('C', 2), ('C', 2), ('D', 3)]) == [('C', 1, 1), ('C', 2, 2), ('C', 2, 2), ('D', 3, 1)]\", \"assert rank_in_group([('A', 1), ('A', 1), ('A', 1)]) == [('A', 1, 1), ('A', 1, 1), ('A', 1, 1)]\", \"assert rank_in_group([('H', 3), ('H', 3)...
{ "split": "train", "index": 71761, "acecode_id": "bigcode_python_fns_18198", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a URI encoded string, implement a function that decodes the string by converting percent-encoded characters back to their original characters. Write the function `decode_uri(uri: str) -> str` that takes a single string argument `uri` and returns the decoded version of the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decode_uri('https://www.example.com/%3Fsort%3Dalphabetical%26order%3Dasc%26search%3Dsomething') == 'https://www.example.com/?sort=alphabetical&order=asc&search=something'\", \"assert decode_uri('%20Hello%20World%21') == ' Hello World!'\", \"assert decode_uri...
{ "split": "train", "index": 71762, "acecode_id": "evol_11850", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `check_anagrams(s1: str, s2: str) -> bool` that checks if two strings are anagrams of each other considering case sensitivity, without using any built-in or sorting functions. Your solution should run in linear time complexity, i.e., O(n).\nPlease reason step b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_anagrams('Listen', 'Silent') == False\", \"assert check_anagrams('anagram', 'nagaram') == True\", \"assert check_anagrams('hello', 'world') == False\", \"assert check_anagrams('rat', 'car') == False\", \"assert check_anagrams('evil', 'vile') == True\",...
{ "split": "train", "index": 71763, "acecode_id": "evol_18826", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if the brackets are closed in the correct order. An empty string is also considered valid. Implement a function `is_valid(s: str) -> b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid('()') == True\", \"assert is_valid('()[]{}') == True\", \"assert is_valid('{[()]}') == True\", \"assert is_valid('(') == False\", \"assert is_valid(')') == False\", \"assert is_valid('([)]') == False\", \"assert is_valid('{[}') == False\", \"assert ...
{ "split": "train", "index": 71764, "acecode_id": "bigcode_python_fns_39156", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that verifies if a given list of group members is empty. The function should take a list of strings as input, where each string represents a member's name. If the list is empty, the function should return True; otherwise, it should return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_members_table_empty([]) == True\", \"assert is_members_table_empty(['Alice']) == False\", \"assert is_members_table_empty(['Bob', 'Charlie']) == False\", \"assert is_members_table_empty(['David', 'Eve', 'Frank']) == False\", \"assert is_members_table_empt...
{ "split": "train", "index": 71765, "acecode_id": "bigcode_python_fns_36012", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the behavior of a command-line utility for file compression. The function should accept the following parameters: a string 'codec' which specifies the compression codec (it can be 'zstd', 'blosclz', 'lz4', 'lz4hc', 'zlib', ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compress_files('zstd', 3, False, 1, 'input_file.txt', 'output_file.txt') == 'Compressing input_file.txt to output_file.txt using zstd at level 3 with 1 worker(s), overwrite: False'\", \"assert compress_files('blosclz', 5, True, 2, 'input.txt', 'output.txt') ...
{ "split": "train", "index": 71766, "acecode_id": "oss_13626", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if the contents of a specified directory have changed. The function should take in a string representing the directory path. If the directory has changed since the last check, the function should return True; otherwise, it sho...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_directory_changed('tests', []) == True\", \"assert has_directory_changed('tests', ['file1.txt']) == True\", \"assert has_directory_changed('tests', ['file1.txt', 'file2.txt']) == True\", \"assert has_directory_changed('tests', ['file2.txt']) == True\", \...
{ "split": "train", "index": 71767, "acecode_id": "bigcode_python_fns_25935", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that calculates the squares of all integers from 1 to a given integer n. The function should take a single integer parameter n and return a list of the squares of these integers. Implement a function called `calculate_squares(n)` t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_squares(1) == [1]\", \"assert calculate_squares(2) == [1, 4]\", \"assert calculate_squares(3) == [1, 4, 9]\", \"assert calculate_squares(4) == [1, 4, 9, 16]\", \"assert calculate_squares(5) == [1, 4, 9, 16, 25]\", \"assert calculate_squares(0) == [...
{ "split": "train", "index": 71768, "acecode_id": "oss_33538", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of stock data for different industries, where each entry contains the industry name and its corresponding average pledge ratio. Your task is to write a function that calculates the average pledge ratio across all industries. The input will be a list of tupl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_pledge_ratio([('Technology', 15.0), ('Finance', 20.0), ('Healthcare', 10.0)]) == 15.0\", \"assert average_pledge_ratio([('Energy', 30.0), ('Utilities', 25.0)]) == 27.5\", \"assert average_pledge_ratio([('Retail', 5.0), ('Manufacturing', 15.0), ('Tran...
{ "split": "train", "index": 71769, "acecode_id": "bigcode_python_fns_9404", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a file path, write a function `load_object(file_path: str) -> object` that simulates loading an object from the specified file path. The function should return a string indicating whether the loading was successful or not based on whether the file pa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_object('data.txt') == 'Loading successful'\", \"assert load_object('image.png') == 'Loading failed'\", \"assert load_object('config.json') == 'Loading successful'\", \"assert load_object('archive.zip') == 'Loading failed'\", \"assert load_object('notes....
{ "split": "train", "index": 71770, "acecode_id": "bigcode_python_fns_19049", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with configuring a message broker for a distributed task queue system using a specific URL and transport options. Write a function `configure_celery(broker_url: str, transport_options: dict) -> dict` that takes in a broker URL and transport options as parameters,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert configure_celery('redis://10.10.10.13:6379/0', {'visibility_timeout': 3600}) == {'CELERY_BROKER_URL': 'redis://10.10.10.13:6379/0', 'CELERY_BROKER_TRANSPORT_OPTIONS': {'visibility_timeout': 3600}}\", \"assert configure_celery('amqp://user:pass@localhost:5672...
{ "split": "train", "index": 71771, "acecode_id": "oss_26536", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of n elements and two integers k and m, implement a function that finds the m-length subarray with the maximum sum that is less than k. If no such subarray exists, return None.\nPlease reason step by step, then write a self-contained Python solution. Give your fi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_sum_subarray([-1, -2, -3, -4, -5], -1, 3) == -6\", \"assert max_sum_subarray([10, 20, 30, -10, -20], 50, 3) == 40\", \"assert max_sum_subarray([1, 2, 3, 4, 5], 15, 2) == 9\", \"assert max_sum_subarray([5, 5, 5, 5, 5], 20, 2) == 10\", \"assert max_sum_sub...
{ "split": "train", "index": 71772, "acecode_id": "evol_6754", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of chunks, where each chunk is represented as a tuple containing a list of strings (data) and an integer (key). Your task is to implement a function that groups the chunks based on the integer key. For each unique key, you should concatenate the data from a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_chunks([(['A', 'B', 'C'], 1), (['D', 'E'], 2), (['F', 'G', 'H'], 1), (['I'], 2)]) == {1: ['A', 'B', 'C', 'F', 'G', 'H'], 2: ['D', 'E', 'I']}\", \"assert process_chunks([(['X'], 3), (['Y'], 3), (['Z'], 4)]) == {3: ['X', 'Y'], 4: ['Z']}\", \"assert pro...
{ "split": "train", "index": 71773, "acecode_id": "oss_3796", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `construct_url` that takes in a list of subdomains, a domain, a path fragment, and a dictionary of query parameters. The function should construct a valid HTTPS URL. The URL should include the subdomains, domain, path, and the query string based on the prov...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_url(['www', 'mail'], 'example.com', 'home', {'user':'john', 'id':'123'}) == 'https://www.mail.example.com/home?user=john&id=123'\", \"assert construct_url([], 'example.com', 'home', {'user':'john'}) == 'https://example.com/home?user=john'\", \"asse...
{ "split": "train", "index": 71774, "acecode_id": "evol_14533", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages a dictionary of measurements and their associated values and units. Your function should have the following signature: `def set_value(measurements: dict, key: str, value: float, unit: Optional[str] = None) -> None`. The f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert (measurements := {}) or True; set_value(measurements, 'temperature', 25, 'Celsius'); assert measurements == {'temperature': {'value': 25, 'unit': 'Celsius'}}\", \"assert (measurements := {}) or True; set_value(measurements, 'pressure', 1013.25, 'hPa'); asser...
{ "split": "train", "index": 71775, "acecode_id": "oss_12124", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Write a Python function that takes a 2D list (array) as input, where each row represents a unique entity and each column represents a different attribute of that entity. The function should return a dictionary that categorizes data according to attribute, where each attribute (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_data([[1, 2, None], [4, None, 6], [7, 8, 9]]) == {0: [1, 4, 7], 1: [2, 8], 2: [6, 9]}\", \"assert categorize_data([[1.5, 2.5], [3.5, None], [None, 5.5]]) == {0: [1.5, 3.5], 1: [2.5, 5.5]}\", \"assert categorize_data([[1, 'a', None], [2, 'b', 3], [...
{ "split": "train", "index": 71776, "acecode_id": "evol_23655", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that determines the appropriate padding values based on the given input padding. The input can either be a single non-negative integer or a tuple containing 2 to 4 non-negative integers. Your function should return a tuple of four int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_padding(3) == (3, 3, 3, 3)\", \"assert calculate_padding((2, 4)) == (2, 4, 2, 4)\", \"assert calculate_padding((5, 10, 15)) == (5, 10, 15, 10)\", \"assert calculate_padding((1, 2, 3, 4)) == (1, 2, 3, 4)\", \"assert calculate_padding(0) == (0, 0, 0,...
{ "split": "train", "index": 71777, "acecode_id": "oss_36727", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `binary_search` that takes a sorted array of integers and a target integer as its parameters. The function should return the index of the target integer within the array if it exists. If the target integer is not found in the array, the function shou...
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) == 'Not Found'\", \"assert binary_search([], 1) == 'Not Found'\", \"ass...
{ "split": "train", "index": 71778, "acecode_id": "evol_6240", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer depth, return a string that consists of a specific character repeated 'depth' times. The specific character is defined as the null character, represented by the escape sequence '\\0'. If the depth is 0, return an empty string. The function should be defined as ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_null_character_string(0) == ''\", \"assert get_null_character_string(1) == '\\\\0'\", \"assert get_null_character_string(2) == '\\\\0\\\\0'\", \"assert get_null_character_string(3) == '\\\\0\\\\0\\\\0'\", \"assert get_null_character_string(4) == '\\\\0\\...
{ "split": "train", "index": 71779, "acecode_id": "bigcode_python_fns_15896", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes statistics related to a natural language processing (NLP) model's performance. The function `process_stats(batch, pred_tgt_words, gold_regexes)` takes in three parameters: `batch`, a list of input data (each element ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_stats(['text'], [], ['regex']) == {'reward': 0, 'train_reward': 1, 'e_hat_len': 0, 'e_star_len': 5, 'd_star_len': 4}\", \"assert process_stats(['first', 'second'], [], []) == {'reward': 0, 'train_reward': 2, 'e_hat_len': 0, 'e_star_len': 0, 'd_star_l...
{ "split": "train", "index": 71780, "acecode_id": "oss_36618", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Write a Python function to calculate the Frobenius inner product of two matrices. The Frobenius inner product is defined as the sum of the products of their corresponding entries. The function should take two 2D lists (matrices) as input and return a single integer that represe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert frobenius_product([[0, 0], [0, 0]], [[1, 1], [1, 1]]) == 0\", \"assert frobenius_product([[1]], [[1]]) == 1\", \"assert frobenius_product([[1, 2], [3, 4]], [[5, 6], [7, 8]]) == 70\", \"assert frobenius_product([[2, 2], [2, 2]], [[1, 1], [1, 1]]) == 8\", \"as...
{ "split": "train", "index": 71781, "acecode_id": "evol_15970", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages a list of supervisor nodes in a distributed system. Each supervisor node is represented by a unique identifier (a string). Your function should perform the following operations: 1. Add a supervisor node to the list. 2. Re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_supervisors([], 'action1', 'add', 'node1') == (['node1'], '')\", \"assert manage_supervisors(['node1'], 'action1', 'execute', 'node1') == (['node1'], 'Action action1 executed on node1')\", \"assert manage_supervisors(['node1'], 'action1', 'remove', 'n...
{ "split": "train", "index": 71782, "acecode_id": "oss_16434", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two integer arrays `i` and `k`, where both arrays have the same length `N`, implement a function `increment(i: List[int], k: List[int]) -> List[int]` that modifies the array `k` based on the values in array `i`. The function should increment the elements of `k` using a ca...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert increment([2, 0, 2], [1, 0, 1]) == [1, 0, 2]\", \"assert increment([1, 1, 1], [0, 0, 0]) == [0, 0, 1]\", \"assert increment([1, 1, 1], [1, 0, 0]) == [1, 0, 1]\", \"assert increment([1, 1, 1], [1, 1, 1]) == [0, 0, 0]\", \"assert increment([3, 2], [0, 0]) == [...
{ "split": "train", "index": 71783, "acecode_id": "bigcode_python_fns_8785", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a configuration dictionary where keys are strings representing modules (alphanumeric characters only) and values are instances of a class called HParams. Your function should return the number of unique modules in the confi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_modules({'module1': HParams(), 'module2': HParams(), 'module3': HParams()}) == 3\", \"assert count_unique_modules({'module1': HParams(), 'module1': HParams()}) == 1\", \"assert count_unique_modules({'module1': HParams(), 'module2': HParams(), 'm...
{ "split": "train", "index": 71784, "acecode_id": "bigcode_python_fns_31684", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a Python function that takes a string as input and returns its lowercase version after removing all non-alphabetical characters. The function should ignore numbers, punctuation, and any other symbols, only keeping letters. For example, if the input is 'Hello World! 12...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_convert_string('FOO123!') == 'foo'\", \"assert clean_convert_string('Python@3.8') == 'python'\", \"assert clean_convert_string('12345') == ''\", \"assert clean_convert_string('Good Morning!') == 'good morning'\", \"assert clean_convert_string('Special#...
{ "split": "train", "index": 71785, "acecode_id": "evol_27462", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a batch size and an array of time running on GPU, implement a function `compute_throughputs(batch_size, gpu_times)` that returns an array of throughputs. The throughput for each GPU time is calculated as the formula: (batch_size / gpu_times[i]) * 1000, where `gpu_times[i]...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_throughputs(100, [2.0, 4.0, 5.0]) == [50000.0, 25000.0, 20000.0]\", \"assert compute_throughputs(50, [1.0, 2.0, 0.0]) == [50000.0, 25000.0, 'Infinity']\", \"assert compute_throughputs(200, [10.0, 20.0, 25.0]) == [20000.0, 10000.0, 8000.0]\", \"assert...
{ "split": "train", "index": 71786, "acecode_id": "bigcode_python_fns_49907", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the allocation of ports for services in a Kubernetes-like environment. Your function should take a service name, a namespace, a target port, and an optional local port. If the local port is not provided, it should default t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert allocate_port('my-service', 'default', 8080) == 8080\", \"assert allocate_port('my-service', 'default', 8080, 3000) == 3000\", \"assert allocate_port('another-service', 'test', 9090) == 9090\", \"assert allocate_port('another-service', 'test', 9090, 5000) ==...
{ "split": "train", "index": 71787, "acecode_id": "bigcode_python_fns_16232", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of license usage records, where each record contains the number of licenses booked, the lead host, and the user name. Your task is to write a function that receives this list and returns a list of unique user names that have booked licenses. Each user name ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_user_names([{'booked': 19, 'lead_host': 'host1', 'user_name': 'user1'}, {'booked': 11, 'lead_host': 'host2', 'user_name': 'user2'}]) == ['user1', 'user2']\", \"assert get_unique_user_names([{'booked': 20, 'lead_host': 'host1', 'user_name': 'user3'...
{ "split": "train", "index": 71788, "acecode_id": "bigcode_python_fns_43312", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function that converts a given temperature from one unit to another. The function should take three parameters: the temperature value (a float), the unit of the temperature value (a string), and the target unit to convert to (also a string). The supported units are ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_temperature(0, 'Celsius', 'Fahrenheit') == 32.00\", \"assert convert_temperature(32, 'Fahrenheit', 'Celsius') == 0.00\", \"assert convert_temperature(273.15, 'Kelvin', 'Celsius') == 0.00\", \"assert convert_temperature(100, 'Celsius', 'Kelvin') == 37...
{ "split": "train", "index": 71789, "acecode_id": "evol_24860", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the root of a binary tree, write a function to find the size of the largest Binary Search Tree (BST) subtree within that tree. A BST is a binary tree in which for each node, the values in the left subtree are less than the node's value, and the values in the right subtree...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert largest_bst_subtree(None) == 0\", \"assert largest_bst_subtree(TreeNode(10, TreeNode(5), TreeNode(15))) == 3\", \"assert largest_bst_subtree(TreeNode(10, TreeNode(5, TreeNode(1), TreeNode(8)), TreeNode(15, TreeNode(6), TreeNode(20)))) == 3\", \"assert larges...
{ "split": "train", "index": 71790, "acecode_id": "evol_26236", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that manages a list of storage shares. The function `addStorageShare` takes two parameters: a list of existing share names and a string representing the path of the storage share to be added. Your function should perform the follow...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert addStorageShare(['share1', 'share2'], 'share3') == True\", \"assert addStorageShare(['share1', 'share2'], 'share1') == False\", \"assert addStorageShare([], 'share4') == True\", \"assert addStorageShare(['shareA', 'shareB'], 'shareC') == True\", \"assert add...
{ "split": "train", "index": 71791, "acecode_id": "oss_24899", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an integer representing a size in bytes. Your task is to implement a function that converts this size into gigabytes (GB). The conversion should be done using the following formula: 1 GB = 1,073,741,824 bytes. The function should return the size in gigabytes as a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_size_bytes_to_gb(0) == 0.0\", \"assert convert_size_bytes_to_gb(1073741824) == 1.0\", \"assert convert_size_bytes_to_gb(2147483648) == 2.0\", \"assert convert_size_bytes_to_gb(3221225472) == 3.0\", \"assert convert_size_bytes_to_gb(4294967296) == 4.0...
{ "split": "train", "index": 71792, "acecode_id": "bigcode_python_fns_31375", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `longest_sequence(input_string: str) -> str` that takes a string of ASCII characters as input and returns the longest continuous sequence of identical characters. If there are multiple sequences of the same maximum length, return the first one encountered i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_sequence('abccdeefghj') == 'cc'\", \"assert longest_sequence('aaaabbbccdde') == 'aaaa'\", \"assert longest_sequence('abc') == 'a'\", \"assert longest_sequence('') == ''\", \"assert longest_sequence('a') == 'a'\", \"assert longest_sequence('abcdde') =...
{ "split": "train", "index": 71793, "acecode_id": "evol_28257", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a generator function in Python that accepts a list of strings and a key string. The generator should yield the next unique string from the list that contains the key string each time it is called. If the key string does not exist in any of the list strings or if all m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list(string_generator(['Alice', 'Bob', 'Charlie', 'David', 'Alison'], 'Al')) == ['Alice', 'Alison']\", \"assert list(string_generator(['abc', 'def', 'ghijkl', 'abcde'], 'abc')) == ['abc', 'abcde']\", \"assert list(string_generator(['test', 'testing', 'tested...
{ "split": "train", "index": 71794, "acecode_id": "evol_10706", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing test cases, where each integer is a unique identifier for a test. Your task is to implement a function that takes in this list and a set of identifiers to skip. The function should return a new list that contains only the identifier...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_tests([1, 2, 3, 4, 5], {2, 4}) == [1, 3, 5]\", \"assert filter_tests([10, 20, 30, 40], {10}) == [20, 30, 40]\", \"assert filter_tests([5, 6, 7, 8, 9], {6, 7}) == [5, 8, 9]\", \"assert filter_tests([1, 2, 3], set()) == [1, 2, 3]\", \"assert filter_test...
{ "split": "train", "index": 71795, "acecode_id": "bigcode_python_fns_18108", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with determining if a given list of pages requires moderation. A page requires moderation if it has any associated moderator. Implement a function `requires_moderation(pages: List[List[int]]) -> List[bool]` that takes a list of lists, where each inner list repres...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert requires_moderation([[1, 2], [], [3]]) == [True, False, True]\", \"assert requires_moderation([[], [], []]) == [False, False, False]\", \"assert requires_moderation([[5], [6, 7, 8], []]) == [True, True, False]\", \"assert requires_moderation([[1], [2], [3], ...
{ "split": "train", "index": 71796, "acecode_id": "bigcode_python_fns_44219", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two arrays, determine if there is at least one common element between them. Write a function that takes two lists as input and returns True if there is at least one element that appears in both lists; otherwise, return False.\nPlease reason step by step, then write a self...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_arrays([1, 2, 3], [4, 5, 6]) == False\", \"assert check_arrays([1, 2, 3], [3, 4, 5]) == True\", \"assert check_arrays([7, 8, 9], [10, 11, 12]) == False\", \"assert check_arrays([5, 6, 7], [7, 8, 9]) == True\", \"assert check_arrays([1], [1]) == True\",...
{ "split": "train", "index": 71797, "acecode_id": "evol_18430", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a menu represented as a list of strings, where each string is a food item available in that menu. You are also given a dictionary of good food items, where each key is the name of a food item and the value is a set of its acceptable aliases. Your task is to implem...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_good_food({'mac and cheese': {'mac+cheese'}}, ['mac+cheese', 'pizza', 'salad']) == {'mac and cheese'}\", \"assert find_good_food({'pizza': {'pizza', 'pie'}, 'salad': {'salad', 'green salad'}}, ['Pizza', 'burger', 'green salad']) == {'pizza', 'salad'}\",...
{ "split": "train", "index": 71798, "acecode_id": "oss_14276", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that checks if a given value is present in two non-ascending sorted lists. The function should take two lists and a value as input and return true if the value exists in both lists, otherwise return false.\nPlease reason step by step, then write a self-cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert exists_in_both([5, 3, 1], [4, 3, 2], 3) == True\", \"assert exists_in_both([10, 9, 8], [5, 6, 7], 5) == False\", \"assert exists_in_both([1, 2, 3], [3, 2, 1], 2) == True\", \"assert exists_in_both([7, 5, 3], [3, 6, 1], 7) == False\", \"assert exists_in_both(...
{ "split": "train", "index": 71799, "acecode_id": "evol_9432", "num_tests": 16 }