data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "You are given a list of boolean values where each value represents whether an animation is currently running (True) or not (False). Write a function `stop_all_animations(animations: List[bool]) -> List[bool]` that stops all running animations by setting each True value in the i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert stop_all_animations([True, True, True]) == [False, False, False]\", \"assert stop_all_animations([False, False, False]) == [False, False, False]\", \"assert stop_all_animations([True, False, True, True]) == [False, False, False, False]\", \"assert stop_all_a... | {
"split": "train",
"index": 81500,
"acecode_id": "bigcode_python_fns_15476",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns a new list containing only the even numbers from the original list, preserving the order of their first appearance. If there are no even numbers, return an empty list. The function signature is: def filter_even_numbers... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([1, 3, 5]) == []\", \"assert filter_even_numbers([2, 4, 6]) == [2, 4, 6]\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([0, 1, 2, 3]) == [0, 2]\", \"ass... | {
"split": "train",
"index": 81501,
"acecode_id": "bigcode_python_fns_27043",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings that represent file paths in a file system. Each path consists of directories followed by a file name. Your task is to implement a function that determines the longest file name present in the list of paths. If there are multiple longest file nam... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longest_file_name(['C:/folder1/file.txt', 'C:/folder2/anotherfile.doc', 'C:/folder3/short.txt']) == 'anotherfile.doc'\", \"assert longest_file_name(['C:/file1.txt', 'C:/file2.txt', 'C:/file3.txt']) == 'file1.txt'\", \"assert longest_file_name(['C:/a/b/c/d/e/... | {
"split": "train",
"index": 81502,
"acecode_id": "bigcode_python_fns_43420",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a function `verify_string_sequence(stringA: str, stringB: str) -> bool` that checks if two strings have the same characters, with the same frequency of characters, and determine whether the common characters appear in the same pattern in both strings (i.e., they recur at ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_string_sequence('abc', 'bac') == True\", \"assert verify_string_sequence('aabb', 'bbaa') == True\", \"assert verify_string_sequence('abcd', 'dcba') == True\", \"assert verify_string_sequence('a', 'a') == True\", \"assert verify_string_sequence('a', 'b... | {
"split": "train",
"index": 81503,
"acecode_id": "evol_1237",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string that contains metadata information formatted as key-value pairs. Each pair is separated by a comma, and the key and value are separated by an equal sign. The keys are metadata labels such as 'description', 'license', 'version', and 'author', while the val... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_metadata('description=\\\"A docopt library suitable for microcontrollers.\\\", license=\\\"MIT\\\", version=\\\"1.0.2\\\", author=\\\"<NAME>\\\"') == {'description': 'A docopt library suitable for microcontrollers.', 'license': 'MIT', 'version': '1.0.2... | {
"split": "train",
"index": 81504,
"acecode_id": "oss_34937",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function that identifies the repetitive strings within the list and returns a dictionary where the keys are the repetitive strings and the values are their respective counts in the list. A string is considered repetitive if it appears more t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_repetitive_strings(['apple', 'banana', 'apple', 'orange', 'banana', 'kiwi']) == {'apple': 2, 'banana': 2}\", \"assert find_repetitive_strings(['cat', 'dog', 'cat', 'fish']) == {'cat': 2}\", \"assert find_repetitive_strings(['one', 'two', 'three', 'four'... | {
"split": "train",
"index": 81505,
"acecode_id": "evol_23692",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function called `count_and_collect_tags` that takes a string representation of XML data and a tag name as input. Your function should return a tuple containing two elements: the first element is the count of occurrences of the specified tag within... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_and_collect_tags('<books><book><title>Title 1</title><author>Author 1</author></book></books>', 'title') == (1, ['Title 1'])\", \"assert count_and_collect_tags('<books><book><title>Title 1</title><author>Author 1</author></book></books>', 'author') == ... | {
"split": "train",
"index": 81506,
"acecode_id": "oss_15595",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns a new list containing only the unique elements of the original list, preserving the order of their first occurrence. The resulting list should not contain any duplicates. For example, given the input list [1, 2, 3, 3, 4, 5... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 3, 3, 4, 5, 6, 7, 7]) == [1, 2, 3, 4, 5, 6, 7]\", \"assert remove_duplicates([1, 1, 1, 1, 1]) == [1]\", \"assert remove_duplicates([]) == []\", \"assert remove_duplicates([5, 4, 3, 2, 1]) == [5, 4, 3, 2, 1]\", \"assert remove_duplica... | {
"split": "train",
"index": 81507,
"acecode_id": "evol_3008",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function called `filter_and_sort_evens` that returns a new list containing only the even numbers from the original list, sorted in ascending order. The function should not modify the original input list and should return a new list as speci... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_and_sort_evens([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_and_sort_evens([5, 7, 9, 11]) == []\", \"assert filter_and_sort_evens([-2, -4, -1, -3]) == [-4, -2]\", \"assert filter_and_sort_evens([0, 2, 0, 4]) == [0, 2, 4]\", \"assert filter_and_sort_e... | {
"split": "train",
"index": 81508,
"acecode_id": "oss_28776",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that finds the intersection of two input lists and returns a list of tuples, each containing a distinct element that is present in both lists and its frequency of occurrence. For this task, avoid using Python's built-in list functions or any libraries to sort ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert shared_elements([], []) == []\", \"assert shared_elements([1, 2, 3], [4, 5, 6]) == []\", \"assert shared_elements([1, 1, 1], [1, 1, 1]) == [(1, 3)]\", \"assert shared_elements([1, 2, 3], [1, 2, 3]) == [(1, 1), (2, 1), (3, 1)]\", \"assert shared_elements([1, ... | {
"split": "train",
"index": 81509,
"acecode_id": "evol_1860",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that determines whether a given integer is 'Prime', 'Composite', or 'Neither' (for the cases of 1 or 0). The function should efficiently handle large integers, including primes with 10 or more digits. Implement a single function named `check_number_type(... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_number_type(0) == 'Neither'\", \"assert check_number_type(1) == 'Neither'\", \"assert check_number_type(2) == 'Prime'\", \"assert check_number_type(3) == 'Prime'\", \"assert check_number_type(4) == 'Composite'\", \"assert check_number_type(5) == 'Prime... | {
"split": "train",
"index": 81510,
"acecode_id": "evol_25557",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two constants, `tauBp` and `Btaul`, and a function `dGcthetal(w, cthetal)` that calculates a value based on parameters `w` and `cthetal`. Your task is to implement a function `dGcthetalnorm(w: float, cthetal: float) -> float` that returns the normalized distributi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dGcthetalnorm(1.0, 0.5) == (tauBp / Btaul) * dGcthetal(1.0, 0.5)\", \"assert dGcthetalnorm(2.0, 0.0) == (tauBp / Btaul) * dGcthetal(2.0, 0.0)\", \"assert dGcthetalnorm(3.5, 1.0) == (tauBp / Btaul) * dGcthetal(3.5, 1.0)\", \"assert dGcthetalnorm(-1.0, -0.5) =... | {
"split": "train",
"index": 81511,
"acecode_id": "bigcode_python_fns_12354",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with initializing a neural network for training. The network can be initialized using various methods: 'normal', 'xavier', 'kaiming', and 'orthogonal'. You need to implement a function that takes the following parameters: a network (represented as a string), an i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_network('ResNet', 'normal', 0.02) == 'Network initialized with normal method and gain of 0.02'\", \"assert initialize_network('DenseNet', 'xavier', 0.03) == 'Network initialized with xavier method and gain of 0.03'\", \"assert initialize_network('... | {
"split": "train",
"index": 81512,
"acecode_id": "bigcode_python_fns_695",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing mention data represented as a JSON string. Each mention contains a 'tokens' field, which is a list of strings. Implement a function that reads multiple JSON strings representing mentions, aggregates the total number of tokens across all mentions, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_total_tokens(['{\\\"tokens\\\": [\\\"a\\\", \\\"b\\\"]}', '{\\\"tokens\\\": [\\\"c\\\"]}']) == 3\", \"assert get_total_tokens(['{\\\"tokens\\\": []}', '{\\\"tokens\\\": []}']) == 0\", \"assert get_total_tokens(['{\\\"tokens\\\": [\\\"x\\\", \\\"y\\\", \\... | {
"split": "train",
"index": 81513,
"acecode_id": "oss_8488",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a form validation function that checks if all required fields in a form are filled out correctly. Implement a function called `validate_form` that takes a dictionary `form_data` as input, where keys are field names and values are their corresponding... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_form({'code': '1234', 'friendly_name': 'The old books', 'category': 'library'}) == True\", \"assert validate_form({'code': '', 'friendly_name': 'The old books', 'category': 'library'}) == False\", \"assert validate_form({'code': '1234', 'friendly_na... | {
"split": "train",
"index": 81514,
"acecode_id": "bigcode_python_fns_16574",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the rankings of various items. Your task is to implement a function that counts how many of these rankings are strictly increasing and how many are strictly decreasing. The function should return a dictionary with two keys: 'increas... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_increasing_decreasing([1, 2, 3, 4, 5]) == {'increasing': 1, 'decreasing': 0}\", \"assert count_increasing_decreasing([5, 4, 3, 2, 1]) == {'increasing': 0, 'decreasing': 1}\", \"assert count_increasing_decreasing([1, 1, 1, 1, 1]) == {'increasing': 0, 'd... | {
"split": "train",
"index": 81515,
"acecode_id": "bigcode_python_fns_3272",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of processes, each represented by a tuple containing the number of sockets they bind and a boolean indicating if they successfully started. Your task is to implement a function `check_processes(process_list: List[Tuple[int, bool]]) -> List[str]` that return... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_processes([(2, True), (0, False), (1, True)]) == ['Success', 'Failed', 'Success']\", \"assert check_processes([(0, False), (0, False), (0, False)]) == ['Failed', 'Failed', 'Failed']\", \"assert check_processes([(1, True), (1, True), (2, True)]) == ['Su... | {
"split": "train",
"index": 81516,
"acecode_id": "bigcode_python_fns_4482",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function that checks if a given string starts with 'abc', ends with 'xyz', and contains at least two unique digits between 'abc' and 'xyz'. The function should return True if the string meets all these conditions, and False otherwise.\nPlease reason step by step, then w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert match_pattern('abc123xyz') == True\", \"assert match_pattern('abc12xyz') == True\", \"assert match_pattern('abc1xyz') == False\", \"assert match_pattern('abc234xyz') == True\", \"assert match_pattern('abc2xyz') == False\", \"assert match_pattern('abc456xyz')... | {
"split": "train",
"index": 81517,
"acecode_id": "evol_29980",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to encode a list of integers into a modified run-length encoding format. The run-length encoding (RLE) is a simple form of data compression where consecutive identical elements are replaced with a single element followed by the number... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert encodeList([]) == []\", \"assert encodeList([1]) == [1, 1]\", \"assert encodeList([1, 1]) == [1, 2]\", \"assert encodeList([1, 1, 1]) == [1, 3]\", \"assert encodeList([1, 2, 2]) == [1, 1, 2, 2]\", \"assert encodeList([1, 2, 3]) == [1, 1, 2, 1, 3, 1]\", \"ass... | {
"split": "train",
"index": 81518,
"acecode_id": "oss_34576",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two six-bit binary numbers, implement a function that checks if their sum causes an overflow when represented in two's complement format. The function should take two binary strings as input and return a boolean indicating whether an overflow occurs. An overflow occurs if... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_overflow('011000', '011000') == True\", \"assert check_overflow('000001', '000001') == False\", \"assert check_overflow('111111', '000001') == True\", \"assert check_overflow('100000', '011111') == True\", \"assert check_overflow('000000', '000000') ==... | {
"split": "train",
"index": 81519,
"acecode_id": "evol_22730",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simple question-answering model training setup. The function should take in two parameters: `max_epochs` (an integer representing the maximum number of training epochs) and `model_name` (a string representing the name... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert train_model(5, 'distilbert-base-uncased') == {'model_name': 'distilbert-base-uncased', 'max_epochs': 3}\", \"assert train_model(3, 'distilbert-base-uncased') == {'model_name': 'distilbert-base-uncased', 'max_epochs': 3}\", \"assert train_model(0, 'distilbert... | {
"split": "train",
"index": 81520,
"acecode_id": "oss_2877",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates storing user data in a simple key-value database. The function should accept a username and a dictionary of user data, then store this data in a format that can be easily retrieved later. The data should be stored in a ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert store_user_data('alice', {'age': '30', 'city': 'New York'}) is None\", \"assert retrieve_user_data('bob') == {}\", \"assert store_user_data('bob', {'age': '25', 'city': 'Los Angeles'}) is None\", \"assert store_user_data('charlie', {'age': '35', 'city': 'Chi... | {
"split": "train",
"index": 81521,
"acecode_id": "evol_3057",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers that can be either prime or composite, implement a function that organizes these integers in descending order. The function should return the sorted array.\nPlease reason step by step, then write a self-contained Python solution. Give your final progr... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_in_descending_order([17, 24, 11, 36, 29, 42]) == [42, 36, 29, 24, 17, 11]\", \"assert sort_in_descending_order([3, 5, 7, 2]) == [7, 5, 3, 2]\", \"assert sort_in_descending_order([15, 4, 9, 8, 12]) == [15, 12, 9, 8, 4]\", \"assert sort_in_descending_orde... | {
"split": "train",
"index": 81522,
"acecode_id": "evol_8854",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that checks if a given string is a palindrome. A palindrome is a string that reads the same forward and backward, ignoring spaces, punctuation, and capitalization. The function should return True if the string is a palindrome and False otherwise.\nPlease re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('amanaplanacanalpanama') == True\", \"assert is_palindrome('A man, a plan, a canal, Panama') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('No lemon, no melon') == True\", \"assert is_palindrome('Was it a car or... | {
"split": "train",
"index": 81523,
"acecode_id": "evol_28048",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of sentences, where each sentence is represented as a string, and a list of stop words. Your task is to implement a function that removes all occurrences of the stop words from each sentence in the list. The function should return a new list of sentences wi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_stopwords(['First sentence.', 'Second sentence.'], ['First', 'Second']) == ['sentence.', 'sentence.']\", \"assert remove_stopwords(['Single word', 'Another word'], ['word']) == ['Single', 'Another']\", \"assert remove_stopwords(['Keep it simple', 'Stu... | {
"split": "train",
"index": 81524,
"acecode_id": "bigcode_python_fns_11473",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given two integer values, lhs and rhs. Your task is to write a function that takes these two integers and returns their sum. Implement a function called `add_two_numbers` that takes two parameters: `lhs` (an integer) and `rhs` (an integer). The function should return th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_two_numbers(3, 5) == 8\", \"assert add_two_numbers(-2, 3) == 1\", \"assert add_two_numbers(0, 0) == 0\", \"assert add_two_numbers(-5, -5) == -10\", \"assert add_two_numbers(10, -5) == 5\", \"assert add_two_numbers(-10, 10) == 0\", \"assert add_two_number... | {
"split": "train",
"index": 81525,
"acecode_id": "bigcode_python_fns_28809",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the moving average of a stream of numbers. The function should take in a new number at each step and return the average of the last N numbers, where N is a parameter provided to the function. You should also handle the ca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert moving_average(3, [1, 10, 3, 5]) == [1.0, 5.5, 4.67, 6.0]\", \"assert moving_average(2, [1, 10, 3, 5]) == [1.0, 5.5, 6.5, 4.0]\", \"assert moving_average(1, [5]) == [5.0]\", \"assert moving_average(3, [2, 4, 6, 8]) == [2.0, 3.0, 4.0, 6.0]\", \"assert moving_... | {
"split": "train",
"index": 81526,
"acecode_id": "oss_3423",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string consisting of Unicode characters. Your task is to implement a function `count_bullet_glyphs(s: str) -> int` that counts and returns the number of bullet glyphs (•) present in the string. A bullet glyph is represented by the Unicode character '\\u2022'.\nP... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_bullet_glyphs('\\u2022') == 1\", \"assert count_bullet_glyphs('Hello World') == 0\", \"assert count_bullet_glyphs('\\u2022 \\u2022 \\u2022 \\u2022 \\u2022') == 5\", \"assert count_bullet_glyphs('') == 0\", \"assert count_bullet_glyphs('1234567890') == ... | {
"split": "train",
"index": 81527,
"acecode_id": "bigcode_python_fns_21792",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Given a floating-point number n, write a function that determines whether n can be considered an integer. To do this, if the absolute difference between n and the nearest integer (either floor or ceil) is less than a small threshold value epsilon (which you should assume to be ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_integer(3.0) == True\", \"assert is_integer(3.000000002) == False\", \"assert is_integer(-2.0) == True\", \"assert is_integer(-2.000000002) == False\", \"assert is_integer(0.0) == True\", \"assert is_integer(1e-9) == False\", \"assert is_integer(1.0) == T... | {
"split": "train",
"index": 81528,
"acecode_id": "bigcode_python_fns_5460",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of points in 3D space, where each point is represented as a tuple (x, y, z) along with a color represented as a tuple (r, g, b) and a class label (integer). Your task is to normalize the coordinates of the points so that their minimum x, y, and z values are... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert normalize_points([((1, 2, 3), (255, 0, 0), 1), ((4, 5, 6), (0, 255, 0), 2)]) == ([(0.0, 0.0, 0.0, 255, 0, 0, 1), (3.0, 3.0, 3.0, 0, 255, 0, 2)], 2)\", \"assert normalize_points([]) == ([], 0)\", \"assert normalize_points([((0, 0, 0), (255, 255, 255), 0), ((1... | {
"split": "train",
"index": 81529,
"acecode_id": "bigcode_python_fns_7333",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of tuples representing items in a gallery. Each tuple contains an integer representing the item's ID and a string representing the item's image path. Your function should return a dictionary where the keys are th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_gallery([(1, 'path1.jpg'), (2, 'path2.jpg')]) == {1: 'path1.jpg', 2: 'path2.jpg'}\", \"assert process_gallery([(1, 'path1.jpg'), (1, 'path2.jpg')]) == {1: 'path2.jpg'}\", \"assert process_gallery([(3, 'path3.jpg'), (4, 'path4.jpg'), (3, 'path5.jpg')]... | {
"split": "train",
"index": 81530,
"acecode_id": "oss_18565",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the number of days. You need to write a function `convert_days_to_units(days, units)` that takes in a list `days` and an integer `units`. The function should create a new list where each value in `days` is converted by dividing it b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_days_to_units([10, 20, 30], 7) == [1, 2, 4]\", \"assert convert_days_to_units([14, 28, 56], 14) == [1, 2, 4]\", \"assert convert_days_to_units([1, 2, 3], 1) == [1, 2, 3]\", \"assert convert_days_to_units([0, 0, 0], 5) == [0, 0, 0]\", \"assert convert... | {
"split": "train",
"index": 81531,
"acecode_id": "oss_28358",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries, where each dictionary represents an Auto Scaling Group (ASG) with various attributes. Your task is to implement a function `sync_asg_data(asg_list: List[Dict[str, Union[str, int]]]) -> List[Dict[str, str]]` that processes this list and retu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sync_asg_data([]) == []\", \"assert sync_asg_data([{'AutoScalingGroupName': 'test1'}]) == [{'AutoScalingGroupName': 'test1', 'AutoScalingGroupARN': '', 'LaunchTemplate': '', 'MinSize': 0, 'MaxSize': 0, 'DesiredCapacity': 0, 'AvailabilityZones': '', 'HealthCh... | {
"split": "train",
"index": 81532,
"acecode_id": "bigcode_python_fns_11173",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function `find_longest_ordered_subsequence(seq)` that identifies and returns the longest ordered subsequence (either ascending or descending) from the input list. The function should return a dictionary containing the length of the subseque... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_longest_ordered_subsequence([5, 1, 2, 3, 4]) == {'len': 4, 'order': 'ascending', 'subsequence': [1, 2, 3, 4]}\", \"assert find_longest_ordered_subsequence([3, 2, 1]) == {'len': 3, 'order': 'descending', 'subsequence': [3, 2, 1]}\", \"assert find_longest... | {
"split": "train",
"index": 81533,
"acecode_id": "evol_19366",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_element(data: List[List[int]], value: int) -> Tuple[int, int]` that searches for a specified integer `value` within a multi-dimensional array `data`. The function should return the coordinates `(i, j)` of the first occurrence of `value` in `data`, whe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_element([[1,2,3], [4,5,6], [7,8,9]], 5) == (1, 1)\", \"assert find_element([[1,2,3], [4,5,6], [7,8,9]], 9) == (2, 2)\", \"assert find_element([[1,2,3], [4,5,6]], 1) == (0, 0)\", \"assert find_element([[1,2,3], [4,5,6]], 3) == (0, 2)\", \"assert find_ele... | {
"split": "train",
"index": 81534,
"acecode_id": "evol_34141",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the management of a library of books. The library should support adding books, removing books, and checking if a specific book is available. Implement a function `manage_library(operations: List[Tuple[str, str]]) -> Lis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_library([('add', 'Book 1'), ('check', 'Book 1')]) == [True]\", \"assert manage_library([('add', 'Book A'), ('add', 'Book B'), ('check', 'Book A')]) == [True]\", \"assert manage_library([('add', 'Book X'), ('remove', 'Book Y')]) == ['Book Y is not in t... | {
"split": "train",
"index": 81535,
"acecode_id": "oss_26837",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that splits a list of numerical data into training and testing sets for machine learning model training and testing. The function should take a list of data, a test percentage, and return the training and testing data splits. The l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_data([1, 2, 3, 4, 0], 0.2) == ([1, 2, 3], 0, [4], 0)\", \"assert split_data([5, 6, 7, 8, 1], 0.25) == ([5, 6, 7], 1, [8], 1)\", \"assert split_data([10, 20, 30, 40, 1], 0.5) == ([10, 20], 1, [30, 40], 1)\", \"assert split_data([1, 1, 1, 1, 1], 0.1) == ... | {
"split": "train",
"index": 81536,
"acecode_id": "oss_19117",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dataset name and a title. Your task is to implement a function `process_dataset` that takes the dataset name and title as input, slugifies the name (i.e., converts it into a URL-friendly format by replacing spaces with hyphens and removing special characters), l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_dataset('Hello World', 'My First Dataset').data == {'name': 'hello-world', 'title': 'My First Dataset'}\", \"assert process_dataset('Data Science 101', 'Introduction to Data Science').data == {'name': 'data-science-101', 'title': 'Introduction to Dat... | {
"split": "train",
"index": 81537,
"acecode_id": "oss_23819",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of positive integers, implement a function `count_perfect_cube_triplets(nums)` that returns the cumulative count of non-overlapping adjacent triplets in the list, where the product of the three numbers is a perfect cube.\nPlease reason step by step, then write a se... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_perfect_cube_triplets([1, 8, 27, 64, 125]) == 1\", \"assert count_perfect_cube_triplets([2, 3, 6, 9, 12]) == 0\", \"assert count_perfect_cube_triplets([8, 1, 8, 1, 8]) == 1\", \"assert count_perfect_cube_triplets([10, 10, 10]) == 1\", \"assert count_pe... | {
"split": "train",
"index": 81538,
"acecode_id": "evol_16976",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `get_dataset_info` that simulates retrieving basic information about a dataset using its unique identifier (UUID). The function takes four parameters: a connector (a placeholder that signifies connectivity, but is not used in the processi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_dataset_info(None, 'http://example.com/', 'secret', '123') == {'id': '123', 'name': 'Dataset 123', 'description': 'Description for dataset 123'}\", \"assert get_dataset_info(None, 'http://example.com/', 'secret', '456') == {'id': '456', 'name': 'Dataset ... | {
"split": "train",
"index": 81539,
"acecode_id": "bigcode_python_fns_38888",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a list containing the square of each integer. The function should handle an empty list appropriately and return an empty list in that case. Write a function named 'square_numbers' that takes a sin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert square_numbers([]) == []\", \"assert square_numbers([0]) == [0]\", \"assert square_numbers([-1]) == [1]\", \"assert square_numbers([1, 2, 3]) == [1, 4, 9]\", \"assert square_numbers([2, 4, 6]) == [4, 16, 36]\", \"assert square_numbers([-2, -3, -4]) == [4, 9,... | {
"split": "train",
"index": 81540,
"acecode_id": "bigcode_python_fns_24145",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `generate_pattern(n)` that takes a positive integer `n` as input and returns a list of strings representing a specific pattern based on the value of `n`. The pattern consists of a series of numbers and asterisks arranged in a specific... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_pattern(1) == ['1']\", \"assert generate_pattern(2) == ['1 *', '1 2']\", \"assert generate_pattern(3) == ['1 * *', '1 2 *', '1 2 3']\", \"assert generate_pattern(4) == ['1 * * *', '1 2 * *', '1 2 3 *', '1 2 3 4']\", \"assert generate_pattern(5) == [... | {
"split": "train",
"index": 81541,
"acecode_id": "oss_36098",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `item_chosen(button: str, choice: str) -> str` that simulates a menu selection process. The function takes two parameters: a button represented by a string (`button`) and a choice represented by a string (`choice`). Your function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert item_chosen('enter', 'Pizza') == 'You have selected: Pizza'\", \"assert item_chosen('space', 'Burger') == 'You have selected: Burger'\", \"assert item_chosen('back', 'Salad') == 'Going back to the previous menu.'\", \"assert item_chosen('invalid', 'Tacos') =... | {
"split": "train",
"index": 81542,
"acecode_id": "bigcode_python_fns_2151",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, lst1 and lst2. Your task is to determine if it is possible to swap elements between the two lists such that lst1 consists solely of even numbers while both lists retain the same total sum of their elements. You should implement a function th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert exchange([1, 2, 3, 4], [1, 5, 3, 4]) == 'NO'\", \"assert exchange([2, 4, 6], [1, 3, 5]) == 'NO'\", \"assert exchange([2, 4, 6], [1, 2, 3]) == 'YES'\", \"assert exchange([1, 1, 1], [2, 2, 2]) == 'NO'\", \"assert exchange([2, 2, 2, 1], [1, 1, 1, 2]) == 'YES'\"... | {
"split": "train",
"index": 81543,
"acecode_id": "evol_30745",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating an initialization function for a distributed system. This function should initialize a global variable that represents a neighbor strategy based on a given configuration string. The function takes a single parameter `config_string`, which is a strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_neighbors('GOSSIP') == 'Initialization successful with strategy: GOSSIP'\", \"assert initialize_neighbors('DIRECT') == 'Initialization successful with strategy: DIRECT'\", \"assert initialize_neighbors('RANDOM') == 'Initialization successful with ... | {
"split": "train",
"index": 81544,
"acecode_id": "bigcode_python_fns_25873",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates a simplified version of the classic game \"Rock, Paper, Scissors.\" The game will be played between a user and the computer. The user will input their choice (rock, paper, or scissors), and the computer will randomly se... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rock_paper_scissors('rock') in ['You win!', 'You lose!', \\\"It's a tie!\\\"]\", \"assert rock_paper_scissors('paper') in ['You win!', 'You lose!', \\\"It's a tie!\\\"]\", \"assert rock_paper_scissors('scissors') in ['You win!', 'You lose!', \\\"It's a tie!\... | {
"split": "train",
"index": 81545,
"acecode_id": "oss_19653",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of strings representing function names. The goal is to extract the unique function names from the list and return them in sorted order. The list may contain duplicate function names, and the function names... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_function_names(['function_a', 'function_b', 'function_a', 'function_c']) == ['function_a', 'function_b', 'function_c']\", \"assert extract_function_names(['create', 'read', 'update', 'delete', 'create']) == ['create', 'delete', 'read', 'update']\", \... | {
"split": "train",
"index": 81546,
"acecode_id": "oss_12404",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string 'text', write a function that returns a new string containing the words from 'text' in reverse order. Words are defined as sequences of characters separated by spaces. Punctuation should be treated as part of the word. For example, if text = 'Hello world!', the o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_words('Python is fun') == 'fun is Python'\", \"assert reverse_words('Data structures and algorithms') == 'algorithms and structures Data'\", \"assert reverse_words('LeetCode is great') == 'great is LeetCode'\", \"assert reverse_words('') == ''\", \"a... | {
"split": "train",
"index": 81547,
"acecode_id": "evol_25457",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function called `calculate_product` that takes a list as input and returns the product of all the integers in the list. If the list is empty, return 1.\nPlease reason step by step, then write a self-contained Python solution. Give your fina... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_product([1, 2, 3, 4]) == 24\", \"assert calculate_product([-1, -2, -3]) == -6\", \"assert calculate_product([0, 1, 2]) == 0\", \"assert calculate_product([10]) == 10\", \"assert calculate_product([]) == 1\", \"assert calculate_product([2, 3, 5]) ==... | {
"split": "train",
"index": 81548,
"acecode_id": "evol_22171",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates a remote tag for a Docker image. The function should take in the name of an external Docker image (without the host) and an optional connection specification. If the connection specification is provided, the function should... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_docker_tag('my-image', 'docker.io/myuser') == 'docker.io/myuser/my-image'\", \"assert generate_docker_tag('my-image', 'registry.example.com') == 'registry.example.com/my-image'\", \"assert generate_docker_tag('my-image', None) == 'my-image'\", \"ass... | {
"split": "train",
"index": 81549,
"acecode_id": "bigcode_python_fns_44869",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a list of integers and returns a new list containing only the unique elements from the original list, in the order they first appeared. Write a function named `get_unique_elements` that accepts a single parameter, `arr`, which ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_elements([1, 2, 2, 3, 4, 1, 5]) == [1, 2, 3, 4, 5]\", \"assert get_unique_elements([1, 1, 1, 1]) == [1]\", \"assert get_unique_elements([]) == []\", \"assert get_unique_elements([10, 20, 10, 30, 20, 40]) == [10, 20, 30, 40]\", \"assert get_unique_... | {
"split": "train",
"index": 81550,
"acecode_id": "bigcode_python_fns_5141",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function `add_user` that takes in four parameters: `name` (string), `email` (string), `password` (string), and `address` (string). This function should enroll a new user by storing their information in a dictionary called `users`. If the email already exists in the dic... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_user('John', 'john@example.com', '1234', '999 Main St.') == True\", \"assert add_user('Jane', 'jane@example.com', 'abcd', '123 Elm St.') == True\", \"assert add_user('Alice', 'alice@example.com', 'xyz', '456 Oak St.') == True\", \"assert add_user('Bob', ... | {
"split": "train",
"index": 81551,
"acecode_id": "evol_20721",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a simple banking system. Implement a function named `bank_account_operations` that takes a list of operations to perform on a bank account and returns the final account balance. The operations will be represented as tuples, where the first element... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_account_operations([('deposit', 100), ('withdraw', 50)]) == 50\", \"assert bank_account_operations([('deposit', 200), ('withdraw', 300)]) == 200\", \"assert bank_account_operations([('deposit', 150), ('withdraw', 150), ('withdraw', 100)]) == 0\", \"asse... | {
"split": "train",
"index": 81552,
"acecode_id": "oss_8947",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, implement a function that returns the binary representation of the product of the highest and lowest integers in the list. If the list contains fewer than 2 elements or contains non-integer values, the function should raise a ValueError. Your function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert product_to_bin([2, 4, 10, 5]) == '10100'\", \"assert product_to_bin([0, 3, 7]) == '0'\", \"assert product_to_bin([1, 2]) == '10'\", \"assert product_to_bin([2, 2, 2, 2]) == '100'\", \"assert product_to_bin([0, 0, 0]) == '0'\", \"assert product_to_bin([3, 3, ... | {
"split": "train",
"index": 81553,
"acecode_id": "evol_14847",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `list1` and `list2`. Your task is to implement a function that merges these two lists into a single list containing all unique integers. The merged list should be sorted in ascending order. Write a function `merge_unique_sorted(list1: List[i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_unique_sorted([1, 2, 3], [3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert merge_unique_sorted([7, 8, 9], [9, 10, 11]) == [7, 8, 9, 10, 11]\", \"assert merge_unique_sorted([], [1, 2, 3]) == [1, 2, 3]\", \"assert merge_unique_sorted([1, 1, 2], [2, 3, 3]) == [1,... | {
"split": "train",
"index": 81554,
"acecode_id": "bigcode_python_fns_990",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of probe data, where each entry contains a timestamp followed by several values representing measurements at different probes. Your task is to implement a function that takes in this list and returns the average value for each probe. The function should be ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert averageProbeValues([[0.0, 1.0, 2.0], [1.0, 3.0, 4.0], [2.0, 5.0, 6.0]]) == [3.0, 4.0]\", \"assert averageProbeValues([[0.0, 1.0], [1.0, 2.0], [2.0, 3.0]]) == [2.0]\", \"assert averageProbeValues([[0.0, 5.0, 10.0], [1.0, 15.0, 20.0], [2.0, 25.0, 30.0]]) == [1... | {
"split": "train",
"index": 81555,
"acecode_id": "bigcode_python_fns_41116",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves a list of objects based on an optional bucket name. The function should return all objects if no bucket name is provided. If a bucket name is given, it should validate if the bucket exists, and if it does, return the object... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_objects() == [{'id': 1, 'name': 'Object1'}, {'id': 2, 'name': 'Object2'}, {'id': 3, 'name': 'Object3'}]\", \"assert get_objects('bucket1') == [{'id': 1, 'name': 'Object1'}, {'id': 2, 'name': 'Object2'}]\", \"assert get_objects('bucket3') == []\", \"asser... | {
"split": "train",
"index": 81556,
"acecode_id": "bigcode_python_fns_12146",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of lists representing a grid of buttons, where each inner list represents a row of buttons and each element in the inner list represents a button. The value of each button can be either 0 or 1. Write a function `count_adjacent_pairs(grid)` that takes in the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_adjacent_pairs([[1, 0, 1], [0, 1, 1], [1, 1, 0]]) == 4\", \"assert count_adjacent_pairs([[1, 1], [1, 1]]) == 4\", \"assert count_adjacent_pairs([[0, 1], [1, 0]]) == 0\", \"assert count_adjacent_pairs([[0]]) == 0\", \"assert count_adjacent_pairs([[1, 1,... | {
"split": "train",
"index": 81557,
"acecode_id": "oss_24952",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a string, implement a function that returns the minimum length of a palindrome that can be constructed using the characters of the given string. A palindrome reads the same forwards and backwards. The constructed palindrome can use each character from the string any numbe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert min_palindrome_length('aabb') == 4\", \"assert min_palindrome_length('abc') == 1\", \"assert min_palindrome_length('aa') == 2\", \"assert min_palindrome_length('aaa') == 3\", \"assert min_palindrome_length('abccba') == 6\", \"assert min_palindrome_length('ab... | {
"split": "train",
"index": 81558,
"acecode_id": "evol_30974",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes in a list of integers and returns a new list containing only the even numbers from the input list. The even numbers in the output list should maintain the same order as they appeared in the input list. Write a function `filter_... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5, 6]) == [2, 4, 6]\", \"assert filter_even_numbers([10, 15, 20, 25, 30]) == [10, 20, 30]\", \"assert filter_even_numbers([-1, -2, -3, -4]) == [-2, -4]\", \"assert filter_even_numbers([0, 1, 2, 3, 4]) == [0, 2, 4]\", \"assert... | {
"split": "train",
"index": 81559,
"acecode_id": "bigcode_python_fns_18732",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a detector name, implement a function that ensures the name is in a specific format. The acceptable formats are either 'n0' to 'n11' or the numbers '0' to '11' which should be prefixed with 'n'. If the input string is not in these formats, the functi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_detector_name('n0') == 'n0'\", \"assert parse_detector_name('n5') == 'n5'\", \"assert parse_detector_name('n11') == 'n11'\", \"assert parse_detector_name('0') == 'n0'\", \"assert parse_detector_name('1') == 'n1'\", \"assert parse_detector_name('10') ==... | {
"split": "train",
"index": 81560,
"acecode_id": "bigcode_python_fns_42979",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a list of log entries and extracts specific information based on the log level. Each log entry is formatted as follows: `[<log level>] <timestamp>: <message>`. The `<log level>` can be one of 'INFO', 'WARNING', 'ERRO... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_logs(['[INFO] 2022-01-01 12:00:00: Application started', '[WARNING] 2022-01-01 12:01:00: Disk space low'], 'INFO') == ['[INFO] 2022-01-01 12:00:00: Application started', '[WARNING] 2022-01-01 12:01:00: Disk space low']\", \"assert extract_logs(['[CRI... | {
"split": "train",
"index": 81561,
"acecode_id": "oss_31670",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the average energy consumption from a list of integer values representing hourly energy usage records. Implement a function `calculate_average_energy_consumption(data)` that takes in a list of integers, `data`, and returns the average energy cons... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_energy_consumption([100, 200, 300]) == 200.0\", \"assert calculate_average_energy_consumption([10, 20, 30, 40, 50]) == 30.0\", \"assert calculate_average_energy_consumption([5]) == 5.0\", \"assert calculate_average_energy_consumption([1, 2,... | {
"split": "train",
"index": 81562,
"acecode_id": "oss_7855",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that performs the bubble sort algorithm on a list of unique integers. The function should take a list as input and return a new list that contains the same integers sorted in ascending order.\nPlease reason step by step, then write a self-contained Python s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([17, 2, 11, 6, 13]) == [2, 6, 11, 13, 17]\", \"assert bubble_sort([5, 1, 4, 2, 8]) == [1, 2, 4, 5, 8]\", \"assert bubble_sort([20, 10, 30, 50, 40]) == [10, 20, 30, 40, 50]\", \"assert bubble_sort([3, 1, 2]) == [1, 2, 3]\", \"assert bubble_sort([9... | {
"split": "train",
"index": 81563,
"acecode_id": "evol_23580",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to identify equivalences between different atoms based on given relationships. The function should take in several inputs and produce a dictionary of equivalences. You are given the following information: \n- `lines_equivalences`: A l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert identify_equivalences(['A B'], ['A', 'B'], {'A': ['B'], 'B': ['A']}, {'A': ['B'], 'B': ['A']}, {'A': ['B'], 'B': ['A']}) == {'A': ['B'], 'B': ['A']}\", \"assert identify_equivalences(['M N'], ['M', 'N'], {'M': ['N'], 'N': ['M']}, {'M': ['N'], 'N': ['M']}, {'... | {
"split": "train",
"index": 81564,
"acecode_id": "oss_9032",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with counting the number of system calls used by a specific program based on a given JSON string representing the allowed system calls. Your function should parse this JSON string and return the count of system calls. If the JSON string cannot be parsed, your fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_syscalls('[\\\"open\\\", \\\"read\\\", \\\"write\\\"]') == 3\", \"assert count_syscalls('[]') == 0\", \"assert count_syscalls('[\\\"fork\\\", \\\"exec\\\", \\\"wait\\\"]') == 3\", \"assert count_syscalls('[\\\"socket\\\", \\\"connect\\\", \\\"send\\\",... | {
"split": "train",
"index": 81565,
"acecode_id": "oss_24616",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a URL that points to an m3u8 media playlist file. Your task is to create a function that extracts the base URL and the name of the m3u8 file from the given URL. The base URL is the combination of the scheme and netloc from the parsed URL, while the name is the las... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_m3u8_url('https://example.com/media/playlist.m3u8') == ('https://example.com', 'playlist.m3u8')\", \"assert parse_m3u8_url('http://mywebsite.org/videos/video1.m3u8') == ('http://mywebsite.org', 'video1.m3u8')\", \"assert parse_m3u8_url('https://cdn.exa... | {
"split": "train",
"index": 81566,
"acecode_id": "oss_25966",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of IP addresses and marks them as either 'blacklisted' or 'not blacklisted'. The function should take a dictionary where the keys are the IP addresses (as strings) and the values are booleans indicating whether the I... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_ip_list({'192.168.1.1': True, '192.168.1.2': False, '10.0.0.1': True}) == 'Blacklisted IPs: 192.168.1.1, 10.0.0.1'\", \"assert process_ip_list({'172.16.0.1': True, '172.16.0.2': True, '172.16.0.3': False}) == 'Blacklisted IPs: 172.16.0.1, 172.16.0.2'... | {
"split": "train",
"index": 81567,
"acecode_id": "bigcode_python_fns_38816",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 6x6 grid representing a chessboard. Each cell of the grid is denoted by its row and column indices, both ranging from 0 to 5. Your task is to write a function that, given the row and column indices of a cell on the chessboard, returns the number of possible move... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert knight_moves(0, 0) == 2\", \"assert knight_moves(0, 1) == 3\", \"assert knight_moves(0, 2) == 4\", \"assert knight_moves(0, 3) == 4\", \"assert knight_moves(0, 4) == 3\", \"assert knight_moves(0, 5) == 2\", \"assert knight_moves(1, 0) == 3\", \"assert knight... | {
"split": "train",
"index": 81568,
"acecode_id": "oss_17048",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Develop a Python function that takes an object as input and returns a dictionary of its attributes and their corresponding values. If the input is a dictionary, return it as is. If the input is a custom object, return its attributes using the vars() function. The function shoul... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_attributes({'name': 'Alice', 'age': 30, 'hobbies': ['reading', 'swimming']}) == {'name': 'Alice', 'age': 30, 'hobbies': ['reading', 'swimming']}\", \"assert get_attributes({'title': 'Developer', 'experience': 5}) == {'title': 'Developer', 'experience': 5... | {
"split": "train",
"index": 81569,
"acecode_id": "evol_23651",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers that represent processed data and a single integer parameter. Your task is to implement a function that takes these two inputs and returns a new list where each element is the result of applying a simple operation: multiply each integer in the l... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_data([1, 2, 3], 2) == [2, 4, 6]\", \"assert process_data([5, 10, 15], 3) == [15, 30, 45]\", \"assert process_data([0, 2, 4], 5) == [0, 10, 20]\", \"assert process_data([-1, -2, -3], 3) == [-3, -6, -9]\", \"assert process_data([10, 20, 30], 0) == [0, ... | {
"split": "train",
"index": 81570,
"acecode_id": "bigcode_python_fns_25340",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of events, where each event is represented by a handler function. Each handler function must take exactly one argument, which is an integer. Your task is to determine if a given handler function can be added to an event without causing a TypeError. If the h... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_add_handler(lambda x: x + 1) == True\", \"assert can_add_handler(lambda x, y: x + y) == False\", \"assert can_add_handler(lambda: 42) == False\", \"assert can_add_handler(lambda x, y, z: x + y + z) == False\", \"assert can_add_handler(lambda x: x) == Tru... | {
"split": "train",
"index": 81571,
"acecode_id": "bigcode_python_fns_19752",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of numerical values representing portfolio scores and a variable indicating the number of portfolios to create. Your task is to partition these scores into the specified number of portfolios based on their percentile rank. Each portfolio should contain the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert partition_portfolios([10, 20, 30, 40, 50], 5) == [[10], [20], [30], [40], [50]]\", \"assert partition_portfolios([], 5) == [[], [], [], [], []]\", \"assert partition_portfolios([10, 20, 30, 40], 1) == [[10, 20, 30, 40]]\", \"assert partition_portfolios([3, 1... | {
"split": "train",
"index": 81572,
"acecode_id": "bigcode_python_fns_12448",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a string containing sentences. Your task is to write a function that analyzes the frequency of each unique word in the string. The function should ignore punctuation and consider words in a case-insensitive manner. The output should be a list of tuples, where each... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_frequency_counter('Hello world! Hello everyone.') == [('hello', 2), ('world', 1), ('everyone', 1)]\", \"assert word_frequency_counter('Python is great. Python is fun!') == [('python', 2), ('is', 2), ('great', 1), ('fun', 1)]\", \"assert word_frequency_c... | {
"split": "train",
"index": 81573,
"acecode_id": "oss_26846",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers representing rewards received at each step in an episode, implement a function that calculates the n-step return for the episode. The n-step return is defined as the sum of the rewards from the current step up to the next `n-1` steps. If there are fewer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_returns([4, 5, 6, 7], 3) == ([15, 18], 22)\", \"assert calculate_returns([0, 0, 0, 0], 1) == ([0, 0, 0, 0], 0)\", \"assert calculate_returns([5, 10, 15], 1) == ([5, 10, 15], 30)\", \"assert calculate_returns([-1, -2, -3, -4], 2) == ([-3, -5, -7], -... | {
"split": "train",
"index": 81574,
"acecode_id": "bigcode_python_fns_481",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to write a function that calculates the sum of all even numbers in the list. The function should take a single parameter, which is the list of integers, and return a single integer representing the sum of the even numbers in the li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_even_numbers([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_even_numbers([-1, -2, -3, -4, -5]) == -6\", \"assert sum_of_even_numbers([0, 1, 2, 3, 4]) == 6\", \"assert sum_of_even_numbers([1, 3, 5, 7, 9]) == 0\", \"assert sum_of_even_numbers([]) == 0\", \"as... | {
"split": "train",
"index": 81575,
"acecode_id": "oss_9429",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function to merge two sets without duplicates and check if the length of the merged set is a perfect square. The function should take two sets as input and return a tuple containing the merged set and a boolean indicating whether the length of the merged set is a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_and_check({1, 2, 3}, {4, 5, 6}) == ({1, 2, 3, 4, 5, 6}, False)\", \"assert merge_and_check({1, 1, 1}, {2, 2}) == ({1, 2}, False)\", \"assert merge_and_check({0}, {1, 2, 3, 4}) == ({0, 1, 2, 3, 4}, False)\", \"assert merge_and_check({5, 6, 7}, {8, 9}) =... | {
"split": "train",
"index": 81576,
"acecode_id": "evol_10822",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Implement a Python function that generates the first n prime numbers using the Sieve of Eratosthenes method. The function should take a single integer n as input and return a list containing the first n prime numbers. For example, if n = 7, the output should be [2, 3, 5, 7, 11,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sieveOfEratosthenes(1) == [2]\", \"assert sieveOfEratosthenes(2) == [2, 3]\", \"assert sieveOfEratosthenes(3) == [2, 3, 5]\", \"assert sieveOfEratosthenes(4) == [2, 3, 5, 7]\", \"assert sieveOfEratosthenes(5) == [2, 3, 5, 7, 11]\", \"assert sieveOfEratosthen... | {
"split": "train",
"index": 81577,
"acecode_id": "evol_2591",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `s` that consists of lowercase letters, and you need to determine if it is a palindrome. A string is considered a palindrome if it reads the same backward as forward. Implement a function `is_palindrome(s: str) -> bool` that returns `True` if `s` is a pal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_palindrome('racecar') == True\", \"assert is_palindrome('madam') == True\", \"assert is_palindrome('hello') == False\", \"assert is_palindrome('a') == True\", \"assert is_palindrome('') == True\", \"assert is_palindrome('abba') == True\", \"assert is_pali... | {
"split": "train",
"index": 81578,
"acecode_id": "bigcode_python_fns_31398",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of numerical elements, implement a function that reorganizes the elements within the array in a manner that orders them from highest to lowest value. The array can contain both positive and negative integers as well as floating point numbers. Do not use the built... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([6, -2.5, 5, 3.1, 9]) == [9, 6, 5, 3.1, -2.5]\", \"assert bubble_sort([0, 0, 0, 0, 0]) == [0, 0, 0, 0, 0]\", \"assert bubble_sort([1, 1, 1, 0, 0]) == [1, 1, 1, 0, 0]\", \"assert bubble_sort([11, 2.5, -5, 13.1, -9]) == [13.1, 11, 2.5, -5, -9]\", \... | {
"split": "train",
"index": 81579,
"acecode_id": "evol_25362",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes two integers and returns their product. The function should be named `multiply_numbers` and accept two parameters: `num_1` and `num_2`. It should return the result of multiplying these two numbers together.\nPlease reason step by step, then write... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiply_numbers(10, 15) == 150\", \"assert multiply_numbers(0, 5) == 0\", \"assert multiply_numbers(-1, 1) == -1\", \"assert multiply_numbers(-5, -5) == 25\", \"assert multiply_numbers(7, 8) == 56\", \"assert multiply_numbers(100, 0) == 0\", \"assert multip... | {
"split": "train",
"index": 81580,
"acecode_id": "evol_13955",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to manage the creation of storage pools in a cloud computing environment. The function should accept a dictionary input representing a request to create a new storage pool on a specific compute node within a given datacenter. The dict... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_storage_pool({'permissions': ['SuperAdmin'], 'asynchronous': False, 'dc': 'datacenter1', 'zpool@node': 'pool1@node1'}) == (201, 'SUCCESS')\", \"assert create_storage_pool({'permissions': ['User'], 'asynchronous': False, 'dc': 'datacenter1', 'zpool@nod... | {
"split": "train",
"index": 81581,
"acecode_id": "oss_31153",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simple dependency resolution system. The function `resolve_dependencies` takes an integer input representing the number of dependencies, where each dependency resolves instantly. The function should return a string indica... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert resolve_dependencies(0) == 'No dependencies to resolve.'\", \"assert resolve_dependencies(1) == 'Resolved all dependencies.'\", \"assert resolve_dependencies(5) == 'Resolved all dependencies.'\", \"assert resolve_dependencies(10) == 'Resolved all dependencie... | {
"split": "train",
"index": 81582,
"acecode_id": "bigcode_python_fns_26987",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two integers, `train_epochs` and `eval_epochs`, representing the number of epochs for training and evaluating a machine learning model, respectively. Your task is to implement a function `calculate_total_iterations(train_epochs, eval_epochs)` that calculates the t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_iterations(0, 0) == 0\", \"assert calculate_total_iterations(1, 1) == 2\", \"assert calculate_total_iterations(5, 0) == 5\", \"assert calculate_total_iterations(0, 5) == 5\", \"assert calculate_total_iterations(10, 3) == 13\", \"assert calcul... | {
"split": "train",
"index": 81583,
"acecode_id": "oss_3585",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two strings, 's' and 'c', write a function that removes all characters from 's' that are present in 'c' and also eliminates any consecutive duplicate characters from the resultant string. Finally, check if the processed string is a palindrome (reads the same forwards and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_delete('abcde', 'ae') == ('bcd', False)\", \"assert reverse_delete('abcdef', 'b') == ('acdef', False)\", \"assert reverse_delete('abcdedcba', 'ab') == ('cdedc', True)\", \"assert reverse_delete('racecar', 'xyz') == ('racecar', True)\", \"assert rever... | {
"split": "train",
"index": 81584,
"acecode_id": "evol_11714",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a 2D list (matrix) of integers representing a connectivity matrix where the value at position (i, j) indicates the presence (1) or absence (0) of an edge between node i and node j, write a function `return_net_list(matrix: List[List[int]], int_factor: int) -> List[List[in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert return_net_list([[0, 1], [1, 0]], 1000) == [[0, 1, 1000], [1, 0, 1000]]\", \"assert return_net_list([[0, 0], [0, 0]], 1000) == []\", \"assert return_net_list([[0, 1, 0], [0, 0, 1], [1, 0, 0]], 200) == [[0, 1, 200], [1, 2, 200], [2, 0, 200]]\", \"assert retur... | {
"split": "train",
"index": 81585,
"acecode_id": "bigcode_python_fns_47026",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates the deletion of files based on a specified pattern. The function should take a string input representing a file path pattern and return a list of files that would have been deleted if the operation were performed. The input... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert simulate_file_deletion('*.docx') == []\", \"assert simulate_file_deletion('file*.txt') == ['file1.txt', 'file2.txt', 'file3.txt']\", \"assert simulate_file_deletion('*.csv') == []\", \"assert simulate_file_deletion('*.exe') == []\", \"assert simulate_file_de... | {
"split": "train",
"index": 81586,
"acecode_id": "bigcode_python_fns_14489",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a string `J` representing the types of stones that are jewels. Each character in `J` is a type of stone you have. You want to know how many of the stones you have are also jewels. Write a function `numJewelsInStones` to find the number of jewels in the string `S`.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert numJewelsInStones('aA', 'aAAbbbb') == 3\", \"assert numJewelsInStones('z', 'ZZ') == 0\", \"assert numJewelsInStones('abc', 'aabbcc') == 6\", \"assert numJewelsInStones('A', 'A') == 1\", \"assert numJewelsInStones('A', 'B') == 0\", \"assert numJewelsInStones(... | {
"split": "train",
"index": 81587,
"acecode_id": "oss_726",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a list of integers. Your function should take a list of integers as input, square each integer, and return the sum of the squared values. Implement a function called `sum_of_squares(numbers)` that fulfills this requirement.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_squares([1, 2, 3, 4, 5]) == 55\", \"assert sum_of_squares([-1, -2, -3]) == 14\", \"assert sum_of_squares([0]) == 0\", \"assert sum_of_squares([]) == 0\", \"assert sum_of_squares([10, 20]) == 500\", \"assert sum_of_squares([1]) == 1\", \"assert sum_of_... | {
"split": "train",
"index": 81588,
"acecode_id": "oss_10132",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of integers as input and returns a list containing only the even integers from the input list. The order of the even integers in the output list should be the same as their order in the input list. If there are no ev... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 21, 32, 43, 54]) == [10, 32, 54]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) =... | {
"split": "train",
"index": 81589,
"acecode_id": "oss_6049",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that generates an email message for a marketing campaign. The function should take in the recipient's name and a list of email addresses, and then construct an email message with a specific subject and sender. The email message sho... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_email_message('John Doe', ['john@example.com', 'jane@example.com']) == {'Subject': 'Karatbars replicated website for John Doe', 'From': 'your_email@example.com', 'To': 'john@example.com, jane@example.com'}\", \"assert generate_email_message('Alice',... | {
"split": "train",
"index": 81590,
"acecode_id": "oss_25155",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a single round of the classic rock-paper-scissors game. The function should take two inputs: the user's choice and the computer's choice. The possible choices are 'rock', 'paper', or 'scissors'. The function should return t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert play_round('rock', 'scissors') == 'win'\", \"assert play_round('rock', 'paper') == 'lose'\", \"assert play_round('rock', 'rock') == 'draw'\", \"assert play_round('paper', 'rock') == 'win'\", \"assert play_round('paper', 'scissors') == 'lose'\", \"assert play... | {
"split": "train",
"index": 81591,
"acecode_id": "oss_13261",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `is_unique_sequence(lst)` that determines whether all the integers in the list are unique. The function should return `True` if all elements are unique, and `False` if there are any duplicates. The input list may contain positive and n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_unique_sequence([]) == True\", \"assert is_unique_sequence([1]) == True\", \"assert is_unique_sequence([1, 2, 3]) == True\", \"assert is_unique_sequence([1, 2, 2]) == False\", \"assert is_unique_sequence([0, -1, -2, -3]) == True\", \"assert is_unique_sequ... | {
"split": "train",
"index": 81592,
"acecode_id": "bigcode_python_fns_11327",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list that may contain integers and nested lists, implement a function `count_elements_in_list(lst)` that counts the occurrences of each individual element and each sublist within the list. The function should return a dictionary where the keys are the elements (or strin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_elements_in_list([1, 1, 2, 2, [3,4], [3,4]]) == {1: 2, 2: 2, '[3, 4]': 2}\", \"assert count_elements_in_list([1, [2, 3], [2, 3], 1]) == {1: 2, '[2, 3]': 2}\", \"assert count_elements_in_list([]) == {}\", \"assert count_elements_in_list([1, 1, 1, 1]) ==... | {
"split": "train",
"index": 81593,
"acecode_id": "evol_23680",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "Implement a function `fibonacci(n: int) -> List[int]` that generates the first `n` elements of the Fibonacci sequence. The Fibonacci sequence is defined as follows: the first two elements are 0 and 1, and each subsequent element is the sum of the two preceding ones. The functio... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert fibonacci(0) == []\", \"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\",... | {
"split": "train",
"index": 81594,
"acecode_id": "evol_4422",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that checks whether a given hexadecimal string is a valid representation of a binary number of a fixed length. The function should take a string `hex_string` as input and return a boolean value. The `hex_string` is valid if its length... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_hex_binary_length('FFFFF') == True\", \"assert is_valid_hex_binary_length('FFFF') == False\", \"assert is_valid_hex_binary_length('1') == False\", \"assert is_valid_hex_binary_length('FFFFFFFFFF') == False\", \"assert is_valid_hex_binary_length('ABC... | {
"split": "train",
"index": 81595,
"acecode_id": "bigcode_python_fns_40837",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that registers a singleton component by its name. The function should accept several parameters: the name of the component, an error type to catch, an optional error message, an identifier for the component, and a category for the compone... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert register_component('componentA', Exception, None, None, 'category1') == {'error': Exception, 'error_message': 'componentA component error', 'identifier': 'componentA', 'component_category': 'category1'}\", \"assert register_component('componentB', ValueError... | {
"split": "train",
"index": 81596,
"acecode_id": "bigcode_python_fns_44384",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that sets a global debug mode for a program. Your function should take a boolean parameter `enabled` which indicates whether debug mode should be enabled (True) or disabled (False). When debug mode is enabled, it should change the value o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_debug_mode(True) is None; assert option['debug_mode'] == True;\", \"assert set_debug_mode(False) is None; assert option['debug_mode'] == False;\", \"assert set_debug_mode(True) is None; assert option['debug_mode'] == True;\", \"assert set_debug_mode(Fals... | {
"split": "train",
"index": 81597,
"acecode_id": "bigcode_python_fns_46852",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string representation of a basic arithmetic equation in the format 'A operator B', where A and B are integers or floats, and 'operator' can be one of the following: '+', '-', '*', '/', or '%', write a function that evaluates the equation and returns the result. If the o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_equation('10 + 5') == 15\", \"assert evaluate_equation('20 - 3') == 17\", \"assert evaluate_equation('5 * 6') == 30\", \"assert evaluate_equation('8 / 2') == 4\", \"assert evaluate_equation('9 % 4') == 1\", \"assert evaluate_equation('300 + 600') ==... | {
"split": "train",
"index": 81598,
"acecode_id": "bigcode_python_fns_41036",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that processes a given dictionary containing information about a system. The dictionary includes the system name, status, and the user IDs of the creator and modifier. Your function should extract and modify this information to cre... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_system_info({'system_name': 'task_creator_system_3', 'systemstatus': 'systemstatus_1', 'system_created_by_user_id': 'test_user', 'system_modified_by_user_id': 'test_user'}) == {'SYSTEM_NAME': 'TASK_CREATOR_SYSTEM_3', 'systemstatus': 'active', 'system... | {
"split": "train",
"index": 81599,
"acecode_id": "oss_9048",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.