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 Vowel Spellchecker that will take a list of valid words called `wordlist` and a list of `queries`. For each query, your function should return the correct word from the `wordlist` based on the following rules: \n1. If the query exactly matches a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert spellchecker(['KiTe','kite','hare','Hare'], ['kite','Kite','KiTe','Hare','HARE','Hear','hear','keti','keet','keto']) == ['kite','KiTe','KiTe','Hare','hare','','','KiTe','','KiTe']\", \"assert spellchecker(['hello', 'world'], ['hello', 'HELLO', 'hell', 'worl'...
{ "split": "train", "index": 3900, "acecode_id": "evol_2480", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given an input array of both positive and negative integer values and a designated integer k, implement a function that determines if there exist at least three distinct index positions i, j, and l within the array such that the elements nums[i], nums[j], and nums[l] form a geo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert geometric_progression([2, 6, -3, 18, -54, 9], 3) == True\", \"assert geometric_progression([1, 2, 4, 8, 16], 2) == True\", \"assert geometric_progression([-1, -2, -4, -8], 1) == True\", \"assert geometric_progression([3, 9, 27, 81], 1) == True\", \"assert ge...
{ "split": "train", "index": 3901, "acecode_id": "evol_12163", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `check_pattern(string: str) -> bool` that checks if the input string starts with an uncommon symbolic character, is followed by exactly three lowercase alphabetic characters, and ends with a numeric sequence of two to four digits. The uncommon symbolic char...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_pattern('@abc12') == True\", \"assert check_pattern('#xyz3456') == True\", \"assert check_pattern('$def78') == True\", \"assert check_pattern('%ghi9') == False\", \"assert check_pattern('^jkl123') == True\", \"assert check_pattern('&mno1234') == True\"...
{ "split": "train", "index": 3902, "acecode_id": "evol_28959", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of layers, where each layer is represented by a dictionary containing two keys: 'name' (a string representing the layer's name) and 'has_weights' (a boolean indicating whether the layer has weights or not). Write a function `get_inbound_layers_without_weigh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_inbound_layers_without_weights([{'name': 'layer1', 'has_weights': False}, {'name': 'layer2', 'has_weights': True}]) == ['layer1']\", \"assert get_inbound_layers_without_weights([{'name': 'layer3', 'has_weights': False}, {'name': 'layer4', 'has_weights': ...
{ "split": "train", "index": 3903, "acecode_id": "bigcode_python_fns_2053", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `most_seldom_element(lst)` that takes a list of elements as input and returns the most seldom appearing element in that list. If there are multiple elements that appear with the same minimum frequency, return any one of them. The input list can contain any ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert most_seldom_element(['a', 'b', 'c', 'd', 'd', 'e', 'a', 'a', 'b', 'b', 'c', 'c', 'c']) == 'e'\", \"assert most_seldom_element([1, 2, 2, 3, 3, 3, 4, 4, 4, 4]) == 1\", \"assert most_seldom_element([5, 5, 6, 6, 7, 8]) == 7\", \"assert most_seldom_element([True,...
{ "split": "train", "index": 3904, "acecode_id": "evol_16139", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a license reconciliation process for a software application. The function should take a status code as input and determine the outcome of the reconciliation. If the status code is 200, the function should return 'Reconcilia...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reconcile_license(200) == 'Reconciliation successful'\", \"assert reconcile_license(200) == 'Reconciliation successful'\", \"assert reconcile_license(200) == 'Reconciliation successful'\", \"assert reconcile_license(200) == 'Reconciliation successful'\", \"a...
{ "split": "train", "index": 3905, "acecode_id": "bigcode_python_fns_25197", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with filtering a list of dictionaries based on a specific attribute value. Each dictionary represents a polygon with various attributes. Your task is to implement a function `remove_polygons(polygons: List[Dict[str, Any]], attribute: str, value: Any) -> List[Dict...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_polygons([{'id': 1, 'type': 'triangle'}, {'id': 2, 'type': 'square'}, {'id': 3, 'type': 'triangle'}], 'type', 'triangle') == [{'id': 2, 'type': 'square'}]\", \"assert remove_polygons([{'id': 1, 'color': 'red'}, {'id': 2, 'color': 'blue'}, {'id': 3, 'c...
{ "split": "train", "index": 3906, "acecode_id": "oss_12698", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `random_expression` that generates a random arithmetic expression involving the addition operation. The expression should consist of a random number of operands (between 2 and 5 inclusive), each being a random integer within the range of 0 and 5 inclusive. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert random_expression() is not None\", \"assert isinstance(random_expression(), str)\", \"assert all(0 <= int(num) <= 5 for num in random_expression().split(' + '))\", \"assert 2 <= len(random_expression().split(' + ')) <= 5\", \"assert ' + ' in random_expressio...
{ "split": "train", "index": 3907, "acecode_id": "evol_35963", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function that transposes elements within a numerical list by a specified number of positions towards the left, while maintaining the order of neighboring elements. The transposition should wrap around to the end of the list. Your function should handle the following c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_transpose([2, 4, 6, 8], 2) == [6, 8, 2, 4]\", \"assert list_transpose([5, 2, 1, 8, 3], 4) == [3, 5, 2, 1, 8]\", \"assert list_transpose([], 3) == []\", \"assert list_transpose([1, 2, 3, 4, 5], 0) == [1, 2, 3, 4, 5]\", \"assert list_transpose([1, 2, 3], ...
{ "split": "train", "index": 3908, "acecode_id": "evol_12885", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a class type, and you need to determine whether it is a mapped class, a Mapper instance, or an AliasedClass instance. Implement a function `is_mapped_class(cls)` that returns True if the given class is one of these types; otherwise, return False. The function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_mapped_class(AliasedClass()) == True\", \"assert is_mapped_class(Mapper()) == True\", \"assert is_mapped_class(ClauseElement()) == False\", \"assert is_mapped_class(type) == False\", \"assert is_mapped_class(int) == False\", \"assert is_mapped_class(str) ...
{ "split": "train", "index": 3909, "acecode_id": "bigcode_python_fns_24005", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given two 2D points represented by their coordinates (x1, y1) and (x2, y2). Your task is to determine the closest cardinal direction (North, East, South, or West) from the first point to the second point. The directions are represented as integers: 0 for North, 1 for Ea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert closest_direction(0, 0, 1, 0) == 1\", \"assert closest_direction(0, 0, 0, 1) == 0\", \"assert closest_direction(1, 1, 1, 0) == 2\", \"assert closest_direction(1, 1, 0, 1) == 3\", \"assert closest_direction(0, 0, 0, 0) == 0\", \"assert closest_direction(5, 5,...
{ "split": "train", "index": 3910, "acecode_id": "bigcode_python_fns_4135", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that accepts a string and a list of strings, and returns the position (1-based index) of the string in the list. The search should be case-insensitive and only consider complete word matches. If the string is not present in the list, return the length of the s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_position('Hello', ['hello', 'world']) == 1\", \"assert find_position('hello', ['Hello', 'world']) == 1\", \"assert find_position('Python', ['Java', 'C#', 'Ruby']) == 6\", \"assert find_position('test', ['Test', 'TEST', 'testing']) == 1\", \"assert find_...
{ "split": "train", "index": 3911, "acecode_id": "evol_6631", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple calculator function that can perform addition, subtraction, multiplication, and division operations. The function should take three parameters: two numbers (num1 and num2) and a string (operation) that specifies the operation to be perf...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculator(5, 3, 'add') == 8\", \"assert calculator(5, 3, 'subtract') == 2\", \"assert calculator(5, 3, 'multiply') == 15\", \"assert calculator(6, 3, 'divide') == 2.0\", \"assert calculator(5, 0, 'divide') == 'Error: Division by zero'\", \"assert calculator...
{ "split": "train", "index": 3912, "acecode_id": "oss_26461", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `replace_in_nested_array(arr, target, replacement)` that takes a multi-dimensional array (up to 5 levels deep) and replaces all occurrences of a specified target number with a new replacement number. The function should maintain the original structure and o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_in_nested_array([[1, 2, 3], [4, 5, 1]], 1, 9) == [[9, 2, 3], [4, 5, 9]]\", \"assert replace_in_nested_array([[[1, 1]], [1]], 1, 0) == [[[0, 0]], [0]]\", \"assert replace_in_nested_array([1, 2, 3], 2, 5) == [1, 5, 3]\", \"assert replace_in_nested_arra...
{ "split": "train", "index": 3913, "acecode_id": "evol_15248", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings consisting solely of the characters '(' and ')', determine if it is possible to concatenate these strings to form a valid sequence of parentheses. A valid sequence is defined as one where every opening parenthesis has a corresponding closing parenthesis ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert intricate_nested_parentheses([')', ')', '(', '(']) == 'No'\", \"assert intricate_nested_parentheses(['))', '(', '())', '()']) == 'No'\", \"assert intricate_nested_parentheses(['(', '(', ')', ')']) == 'Yes'\", \"assert intricate_nested_parentheses(['(', '(', ...
{ "split": "train", "index": 3914, "acecode_id": "evol_32392", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given an array of dictionaries, implement a function that sorts the array based on a specified key. The function should take two parameters: an array of dictionaries and a string representing the key to sort by. The function should return a new array sorted in ascending order b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert organize_by_key([{'name': 'Fred', 'age': 31}, {'name': 'John', 'age': 28}], 'age') == [{'name': 'John', 'age': 28}, {'name': 'Fred', 'age': 31}]\", \"assert organize_by_key([{'name': 'Alice', 'height': 5.5}, {'name': 'Bob', 'height': 6.0}, {'name': 'Charlie'...
{ "split": "train", "index": 3915, "acecode_id": "evol_7111", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a sequence (either a list or a tuple) and an element, write a function that adds the element to the sequence. If the sequence is a list, the element should be appended to the end. If the sequence is a tuple, a new tuple should be returned that includes the original elemen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_element_to_sequence([1, 2, 3], 4) == [1, 2, 3, 4]\", \"assert add_element_to_sequence((1, 2, 3), 4) == (1, 2, 3, 4)\", \"assert add_element_to_sequence([], 'a') == ['a']\", \"assert add_element_to_sequence((), 'a') == ('a',)\", \"assert add_element_to_se...
{ "split": "train", "index": 3916, "acecode_id": "evol_6460", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `s` and an array of strings `words`, write a function `numMatchingSubseq(s: str, words: List[str]) -> int` that returns the number of strings in `words` that are subsequences of `s`. A subsequence of a string is a new string generated from the original string wit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert numMatchingSubseq('abcde', ['a', 'bb', 'acd', 'ace', 'a*e']) == 4\", \"assert numMatchingSubseq('dsahjpjauf', ['ahjpjau', 'ja', 'ahbwzgqnuk', 'tnmlanowax', '*a*']) == 3\", \"assert numMatchingSubseq('hello', ['h*llo', 'he*lo', 'hel*o', 'hell*', 'hello']) == ...
{ "split": "train", "index": 3917, "acecode_id": "evol_28878", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a string representing a binary number (e.g., '1101101'), implement a function that converts this binary number to its corresponding octal representation as a string. The input will be a valid binary number without leading zeros. Your function should return the octal repre...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_to_octal('0') == '0'\", \"assert binary_to_octal('1') == '1'\", \"assert binary_to_octal('10') == '2'\", \"assert binary_to_octal('11') == '3'\", \"assert binary_to_octal('100') == '4'\", \"assert binary_to_octal('101') == '5'\", \"assert binary_to_oc...
{ "split": "train", "index": 3918, "acecode_id": "evol_20766", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes in a list of strings and returns True if any of the strings have the character 't' as their second to last character. The function should ignore case when checking for 't'. If no string meets this criteria, return False.\nPlease reason step by st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_penultimate_t(['apple', 'banana', 'grape']) == False\", \"assert has_penultimate_t(['sun', 'moon', 'star']) == False\", \"assert has_penultimate_t(['hello', 'world', 'Python']) == False\", \"assert has_penultimate_t(['example', 'sample', 'simple']) == Fa...
{ "split": "train", "index": 3919, "acecode_id": "evol_14777", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a list of drugs where each drug is represented as a tuple of strings, consisting of the drug name and its type. Your task is to implement a function that filters the drugs tested in clinical trials only. A drug is considered to be tested in a clinical trial if its...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_clinical_trial_drugs([('Aspirin', 'Over-the-counter'), ('DrugX', 'ClinicalTrial'), ('DrugY', 'Experimental'), ('Ibuprofen', 'ClinicalTrial')]) == ['DrugX', 'Ibuprofen']\", \"assert filter_clinical_trial_drugs([('DrugA', 'ClinicalTrial'), ('DrugB', 'Cl...
{ "split": "train", "index": 3920, "acecode_id": "bigcode_python_fns_11226", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a star object with a defined orbital period (a float representing seconds) and a time (a float representing seconds) since the start of the orbit. Your task is to implement a function `calc_phase(star_period: float, time: float) -> float` that calculates the phase...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calc_phase(10.0, 5.0) == 0.5\", \"assert calc_phase(15.0, 15.0) == 1.0\", \"assert calc_phase(20.0, 0.0) == 0.0\", \"assert calc_phase(5.0, 10.0) == 2.0\", \"assert calc_phase(100.0, 50.0) == 0.5\", \"assert calc_phase(2.5, 6.25) == 2.5\", \"assert calc_phas...
{ "split": "train", "index": 3921, "acecode_id": "bigcode_python_fns_21572", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a python function that takes a list of integers and returns the first even number found in the list. The function should handle edge cases where the list might be empty or contain non-integer values.\nPlease reason step by step, then write a self-contained Python solution...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_first_even([1, 3, 5, 7]) is None\", \"assert find_first_even([]) is None\", \"assert find_first_even(['a', 'b', 2]) == 2\", \"assert find_first_even([1, 2.5, 4]) == 4\", \"assert find_first_even([3, 5, 8, 10]) == 8\", \"assert find_first_even([9, 11, 13...
{ "split": "train", "index": 3922, "acecode_id": "evol_13099", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that validates a list of data against expected values. The function `validate_data(expected_data, actual_data)` takes two parameters: \n- `expected_data`: A list of tuples, where each tuple contains three elements: an ID (integer),...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_data([(1, [1.0, 2.0], 'meta1'), (2, [3.0, 4.0], 'meta2')], [(1, [1.0, 2.0], 'meta1'), (2, [3.0, 4.0], 'meta2')]) == True\", \"assert validate_data([(1, [1.0, 2.0], 'meta1'), (2, [3.0, 4.0], 'meta2')], [(1, [1.0, 2.0], 'meta1'), (2, [3.0, 4.0], 'meta...
{ "split": "train", "index": 3923, "acecode_id": "oss_32931", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a tree-like structure where each node can have multiple children, implement a function `is_node_in_section_title(node: Node) -> bool` that determines whether the given node is part of a section title. A node is considered to be in a section title if one of its ancestors i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_node_in_section_title({'type': 'title', 'children': []}) == False\", \"assert is_node_in_section_title({'type': 'section', 'children': [{'type': 'title', 'children': []}]}) == True\", \"assert is_node_in_section_title({'type': 'other', 'children': [{'type...
{ "split": "train", "index": 3924, "acecode_id": "bigcode_python_fns_45970", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing data chunks from multiple sources. Your task is to combine these chunks into a single list. Each chunk is represented by an array of integers, and you will also receive two additional lists: one representing the sizes of each chunk ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert gather_chunks([[1, 2], [3, 4]], [2, 2], [0, 2]) == [1, 2, 3, 4]\", \"assert gather_chunks([[1], [2], [3]], [1, 1, 1], [0, 2, 4]) == [1, 0, 2, 0, 3]\", \"assert gather_chunks([[5, 6], [7, 8]], [2, 2], [0, 2]) == [5, 6, 7, 8]\", \"assert gather_chunks([[10, 20...
{ "split": "train", "index": 3925, "acecode_id": "bigcode_python_fns_17446", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function `transform_string(text: str) -> str` that takes a string of alphanumeric characters and transforms it such that every letter immediately following an underscore (`_`) is converted to uppercase. The function should keep all other characters unchanged, includ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_string('hello_world') == 'helloWorld'\", \"assert transform_string('this_is_a_test') == 'thisIsATest'\", \"assert transform_string('_leading_underscore') == 'LeadingUnderscore'\", \"assert transform_string('multiple___underscores') == 'multipleUnde...
{ "split": "train", "index": 3926, "acecode_id": "evol_1878", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that ensures each item is added to a list only once. Implement a function called `add_unique_item` that takes two parameters: a list `worklist` and an item `item`. If the item is not already present in the worklist, it should be appended ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert (lambda w: (add_unique_item(w, 1) or w) == [1])([])\", \"assert (lambda w: (add_unique_item(w, 'a') or w) == ['a'])([])\", \"assert (lambda w: (add_unique_item(w, 1) or w) == [1])([1])\", \"assert (lambda w: (add_unique_item(w, 'b') or w) == ['a', 'b'])(['a'...
{ "split": "train", "index": 3927, "acecode_id": "bigcode_python_fns_16992", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function `get_doc_string_length(doc_string: str) -> int` that takes a single string argument `doc_string`, which represents a multi-line docstring. The function should return the length of the longest line in the docstring. If the doc_string is empty, re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_doc_string_length('') == 0\", \"assert get_doc_string_length('Single line') == 11\", \"assert get_doc_string_length('A\\\\nB\\\\nC\\\\nD') == 1\", \"assert get_doc_string_length('Line 1\\\\nLine 2\\\\nLine 3\\\\nLine 4\\\\nLine 5') == 6\", \"assert get_d...
{ "split": "train", "index": 3928, "acecode_id": "bigcode_python_fns_42309", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates the process of reverting database migrations. In this problem, a migration is represented by a dictionary where the keys are migration names and the values are lists of changes to be reverted. Each change is represen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert revert_migration({'create_users_table': [{'type': 'drop', 'table_name': 'users'}]}, 'create_users_table') == ['users']\", \"assert revert_migration({'create_posts_table': [{'type': 'drop', 'table_name': 'posts'}]}, 'create_posts_table') == ['posts']\", \"ass...
{ "split": "train", "index": 3929, "acecode_id": "oss_7369", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `categorize_book` that takes four parameters: `title`, `author`, `publication_year`, and `genre`. This function should return a tuple containing the age of the book (calculated as the current year minus the publication year) and the genre category based on ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_book('Book1', 'Author1', 2000, 'Fiction') == (23, 1)\", \"assert categorize_book('Book2', 'Author2', 2005, 'Non-fiction') == (18, 2)\", \"assert categorize_book('Book5', 'Author5', 2020, 'Mystery') == (3, 'Invalid genre')\", \"assert categorize_bo...
{ "split": "train", "index": 3930, "acecode_id": "evol_27128", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple contact form for a web application. The contact form should allow users to submit their name, email, and a message. Write a function named `create_contact_form` that takes three parameters: `name` (string), `email` (string), and `message` (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_contact_form('John Doe', 'john@example.com', 'Hello!') == {'Name': 'John Doe', 'Email': 'john@example.com', 'Message': 'Hello!'}\", \"assert create_contact_form('', 'empty@example.com', 'Test message') == None\", \"assert create_contact_form('Alice', ...
{ "split": "train", "index": 3931, "acecode_id": "oss_21254", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of system configuration parameters represented as a list of dictionaries, where each dictionary contains a 'ParameterName' and its corresponding 'ParameterValue', write a function `replace_decimals(configurations: List[Dict[str, str]]) -> List[Dict[str, str]]` that...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_decimals([{'ParameterName': 'max_connections', 'ParameterValue': 100}, {'ParameterName': 'timeout', 'ParameterValue': 2.5}]) == [{'ParameterName': 'max_connections', 'ParameterValue': '100'}, {'ParameterName': 'timeout', 'ParameterValue': '2.5'}]\", ...
{ "split": "train", "index": 3932, "acecode_id": "bigcode_python_fns_14433", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes in a list of dictionaries representing people's information and returns a new list containing only the dictionaries where the 'age' key is present and the value is greater than or equal to 18. The input list will consist of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_adults([{'name': 'Alice', 'age': 25}, {'name': 'Bob', 'age': 17}, {'name': 'Charlie'}]) == [{'name': 'Alice', 'age': 25}]\", \"assert filter_adults([{'name': 'David', 'age': 30}, {'name': 'Eva', 'age': 20}, {'name': 'Frank', 'age': 15}]) == [{'name': ...
{ "split": "train", "index": 3933, "acecode_id": "oss_23949", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the distance between two points in a 3D space. Each point is represented by its coordinates (x, y, z). The function should take two tuples as input, where each tuple contains three integers representing the coordinates...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(calculate_distance((0, 0, 0), (10, 10, 10)) - 17.3205) < 1e-4\", \"assert abs(calculate_distance((1, 1, 1), (1, 1, 1)) - 0.0) < 1e-4\", \"assert abs(calculate_distance((1, 2, 3), (4, 5, 6)) - 5.1962) < 1e-4\", \"assert abs(calculate_distance((-1, -1, -1)...
{ "split": "train", "index": 3934, "acecode_id": "oss_17997", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function that takes an array of strings and identifies the longest consecutive alphabetic substring that is common among all strings in the array. Your function should be able to handle and correctly process special non-alphabetic characters and capital letters in the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_common_substr(['1234', '5678', '9012']) == ''\", \"assert find_common_substr(['abc', 'abc', 'abc']) == 'abc'\", \"assert find_common_substr(['abcXYZ123', 'mnoXYZ456', 'pqrXYZ789']) == 'XYZ'\", \"assert find_common_substr(['qwerty', 'qwxyz', 'qwe']) == '...
{ "split": "train", "index": 3935, "acecode_id": "evol_24787", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with cleaning a given string by implementing a function `clean_string(s: str) -> str`. The function should perform the following operations: 1. Convert all characters to lowercase. 2. Replace all occurrences of new lines with a space. 3. Remove all hyphens and fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_string(' Hello World! ') == 'hello world!'\", \"assert clean_string(' Multiple Spaces ') == 'multiple spaces'\", \"assert clean_string('No punctuation here') == 'no punctuation here'\", \"assert clean_string('') == None\", \"assert clean_string('...
{ "split": "train", "index": 3936, "acecode_id": "bigcode_python_fns_41220", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a digital clock by returning the current time in the format HH:MM:SS. The function should accept an integer parameter 'seconds' which represents the number of seconds since midnight (00:00:00). Your function should convert ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert digital_clock_time(0) == '00:00:00'\", \"assert digital_clock_time(3600) == '01:00:00'\", \"assert digital_clock_time(3661) == '01:01:01'\", \"assert digital_clock_time(86399) == '23:59:59'\", \"assert digital_clock_time(86400) == '00:00:00'\", \"assert digi...
{ "split": "train", "index": 3937, "acecode_id": "oss_2695", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `generate_spiral(n: int) -> List[List[int]]` that generates an n x n matrix filled with integers from 1 to n^2 in a spiral order, starting from the top-left corner and moving clockwise. The function should return the resulting matrix as a list of lists.\nPl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_spiral(1) == [[1]]\", \"assert generate_spiral(2) == [[1, 2], [4, 3]]\", \"assert generate_spiral(3) == [[1, 2, 3], [8, 9, 4], [7, 6, 5]]\", \"assert generate_spiral(4) == [[1, 2, 3, 4], [12, 13, 14, 5], [11, 16, 15, 6], [10, 9, 8, 7]]\", \"assert g...
{ "split": "train", "index": 3938, "acecode_id": "evol_4907", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a DNA sequence represented as a string consisting of the characters 'A', 'T', 'C', and 'G', write a function that returns the reverse complement of the sequence. The reverse complement is obtained by reversing the sequence and replacing each base with its complementary ba...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_complement('A') == 'T'\", \"assert reverse_complement('T') == 'A'\", \"assert reverse_complement('C') == 'G'\", \"assert reverse_complement('G') == 'C'\", \"assert reverse_complement('ATCG') == 'CGAT'\", \"assert reverse_complement('GCTA') == 'TAGC'\...
{ "split": "train", "index": 3939, "acecode_id": "bigcode_python_fns_37826", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that parses a list of strings representing rows of tabular data, where each row contains information about protein sequence alignment results. Each row is formatted as a tab-separated string with the following structure: 'target_name\\tfu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_tblout_data(['item2\\\\t1.2e-07\\\\t1.2e-07', 'item3\\\\t1.2e-07\\\\t1.2e-07']) == [{'target_name': 'item2', 'full_sequence_e_value': '1.2e-07', 'best_1_domain_e_value': '1.2e-07'}, {'target_name': 'item3', 'full_sequence_e_value': '1.2e-07', 'best_1_d...
{ "split": "train", "index": 3940, "acecode_id": "oss_648", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `make_palindrome` that determines the smallest number of characters that must be appended to the end of a given string in order to make it a palindrome. The function should ignore differences in case, non-alphanumeric characters, and spaces between words. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_palindrome('') == 0\", \"assert make_palindrome('cat') == 2\", \"assert make_palindrome('race') == 3\", \"assert make_palindrome('racecar') == 0\", \"assert make_palindrome('hello') == 4\", \"assert make_palindrome('abc') == 2\", \"assert make_palindrom...
{ "split": "train", "index": 3941, "acecode_id": "evol_19118", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of strings called `data` and a string called `info_name`. Your task is to determine if the string 'modifier' is present in the `data` list. If 'modifier' is found, return '1', otherwise return '0'. Implement a function `check_modifier(data: List[str], info_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_modifier(['modifier', 'test', 'example'], 'info') == '1'\", \"assert check_modifier(['test', 'example'], 'info') == '0'\", \"assert check_modifier(['foo', 'modifier', 'bar'], 'info') == '1'\", \"assert check_modifier(['foo', 'bar', 'baz'], 'info') == '...
{ "split": "train", "index": 3942, "acecode_id": "bigcode_python_fns_41609", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of domain names and their corresponding details that include a primary server, contact email, and a list of nameservers with optional TTL (time to live) for DNS records. Your task is to create a function `create_zone` that takes the following parameters: `r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_zone('example.com', 'ns1.example.com', 'admin@example.com', [('ns1.example.com', 3600, ['public'])]) == {'success': True, 'success_url': '/en-US/core/search/#q=zone=:{0}'.format('example.com')}\", \"assert create_zone('example.com', 'ns1.example.com',...
{ "split": "train", "index": 3943, "acecode_id": "bigcode_python_fns_20535", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that determines the type of operating system based on a given string input. The function should accept a string representing the name of an operating system and return a string indicating the platform category. The platform categories are ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_platform_category('Windows') == 'windows'\", \"assert get_platform_category('Linux') == 'linux'\", \"assert get_platform_category('Darwin') == 'mac'\", \"assert get_platform_category('Macintosh') == 'unknown'\", \"assert get_platform_category('Ubuntu') =...
{ "split": "train", "index": 3944, "acecode_id": "bigcode_python_fns_20345", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of instances, each represented by a set of vertices, and a specific instance also represented by a set of vertices, write a function `instances_overlap(instanceList: List[Set[int]], instance: Set[int]) -> bool` that returns True if the specific instance contains at...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert instances_overlap([{1, 2}, {3, 4}, {5}], {4, 6}) == True\", \"assert instances_overlap([{1, 2}, {3, 4}, {5}], {6, 7}) == False\", \"assert instances_overlap([{0, 1}, {2, 3}, {4, 5}], {1}) == True\", \"assert instances_overlap([{10, 20}, {30, 40}], {50}) == F...
{ "split": "train", "index": 3945, "acecode_id": "bigcode_python_fns_29745", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers, merge them into a new list by concatenating the two lists and then applying a transformation to each element in the merged list. The transformation consists of multiplying each element by a given weight and then adding a bias. Implement a function '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_and_transform([1, 2, 3], [4, 5, 6], 2, 1) == [3, 5, 7, 9, 11, 13]\", \"assert merge_and_transform([], [1], 5, 2) == [7]\", \"assert merge_and_transform([10, 20], [30, 40], 1, 0) == [10, 20, 30, 40]\", \"assert merge_and_transform([1], [], 0, 5) == [5]\...
{ "split": "train", "index": 3946, "acecode_id": "bigcode_python_fns_44498", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a user message and responds based on specific prefixes. The input to the function is a string message. If the message starts with one of the following prefixes: 'sleep-', 'body-', 'mind-', 'motivation-', or 'dream-', your f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_message('sleep-8 hours') == '8 hours'\", \"assert process_message('body-need more exercise') == 'need more exercise'\", \"assert process_message('mind-relaxation techniques') == 'relaxation techniques'\", \"assert process_message('motivation-daily go...
{ "split": "train", "index": 3947, "acecode_id": "bigcode_python_fns_1433", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that converts an XML-like structure represented as a list of dictionaries into a specific format. The input will be a list of dictionaries, where each dictionary represents an XML element with attributes and potentially nested elements. Y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_xml([{'term-english-equiv': 'example', 'term-id': '1', 'term-lang': 'en', 'term-revision-num': '1', 'children': []}]) == [{'term-english-equiv': 'example', 'term-id': '1', 'term-lang': 'en', 'term-revision-num': '1'}]\", \"assert convert_xml([{'term-...
{ "split": "train", "index": 3948, "acecode_id": "oss_1007", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an unsorted two-dimensional list of integers, implement a function that sorts the internal lists based on the sum of their elements in ascending order. The function should accept a two-dimensional list and return the sorted list. For example, given [[12,3,7,9,1], [5,4,6,8...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_2d_array([[5, 5], [1, 1], [2, 2]]) == [[1, 1], [2, 2], [5, 5]]\", \"assert sort_2d_array([[4], [3], [2], [1]]) == [[1], [2], [3], [4]]\", \"assert sort_2d_array([[10, 20], [5, 15], [0]]) == [[0], [5, 15], [10, 20]]\", \"assert sort_2d_array([[0], [0], [...
{ "split": "train", "index": 3949, "acecode_id": "evol_919", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function that accepts three parameters: 'info', a list of varying-length lists; 'y', a string; and 'z', a positive integer. The function should return an array of index positions where 'y' occurs at least 'z' times within the 'info' list. Report these positions as (row,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_indexes([['apple', 'banana'], ['apple', 'apple']], 'apple', 3) == []\", \"assert get_indexes([['cat', 'dog', 'cat'], ['cat', 'cat'], ['dog']], 'cat', 4) == []\", \"assert get_indexes([['test', 'test', 'test'], ['test', 'test']], 'test', 5) == []\", \"ass...
{ "split": "train", "index": 3950, "acecode_id": "evol_23038", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with generating a pattern of numbers based on an input integer `n`. Your goal is to implement a function `generate_pattern(n: int) -> List[str]` that takes an integer `n` (1 <= n <= 100) and returns a list of strings, where each string represents a line of the pa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_pattern(1) == []\", \"assert generate_pattern(2) == ['1']\", \"assert generate_pattern(3) == ['1', '3 3']\", \"assert generate_pattern(4) == ['1', '3 3', '5 5 5']\", \"assert generate_pattern(5) == ['1', '3 3', '5 5 5', '7 7 7 7']\", \"assert genera...
{ "split": "train", "index": 3951, "acecode_id": "oss_8545", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Design a function `parse_command(command: str) -> dict` that takes a string command representing a player's action in a text-based multiplayer adventure game. The command can include actions such as 'move', 'attack', 'pick', or 'talk' followed by the target (like a character or...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_command('move north') == {'action': 'move', 'target': 'north'}\", \"assert parse_command('attack goblin') == {'action': 'attack', 'target': 'goblin'}\", \"assert parse_command('run away') == {'action': 'unknown', 'target': None}\", \"assert parse_comma...
{ "split": "train", "index": 3952, "acecode_id": "evol_18159", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a string `fulloutput` that contains a potentially large error message. Your task is to implement a function that checks this error message against a predefined set of known error strings and return a corresponding recommendation for resolving the issues. The known...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_error('multiply error occurred') == 'NOTE: you might(?) need to clean the `tmp/` folder!'\", \"assert check_error('An already defined variable was found') == 'NOTE: you probably (might?) need to clean the `tmp/` folder!'\", \"assert check_error('There ...
{ "split": "train", "index": 3953, "acecode_id": "bigcode_python_fns_20502", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that validates version numbers according to the PEP 440 specification. A valid version number should consist of a series of dot-separated numerical components, with an optional pre-release and post-release tag. The pre-release tag ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_version('1.0.0') == True\", \"assert validate_version('1.0.0-alpha') == True\", \"assert validate_version('4.2.1-alpha+001') == True\", \"assert validate_version('5.0.0') == True\", \"assert validate_version('7.1.2+123') == True\", \"assert validate...
{ "split": "train", "index": 3954, "acecode_id": "oss_22514", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a string, reconstruct all the non-repeated characters from the string in reverse order and store them in a new string. Spaces should not be counted as characters. If a letter appears more than once, do not include it in the new string. Note that uppercase and lowercase ve...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_non_repeated('abcde') == 'edcba'\", \"assert reverse_non_repeated('aabbcc') == ''\", \"assert reverse_non_repeated('') == ''\", \"assert reverse_non_repeated('!@# $%^') == '^%$#@!'\", \"assert reverse_non_repeated('123321') == ''\", \"assert reverse_...
{ "split": "train", "index": 3955, "acecode_id": "evol_12858", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given two lists of integers, list_a and list_b, your task is to create a function that finds the elements that are present in list_a but not in list_b. The function should return a new list containing these unique elements from list_a in the same order as they appear in list_a....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_unique_elements([1, 2, 3, 4, 5], [4, 5, 6]) == [1, 2, 3]\", \"assert find_unique_elements([1, 2, 2, 3], [2, 3]) == [1]\", \"assert find_unique_elements([10, 20, 30], [10]) == [20, 30]\", \"assert find_unique_elements([5, 5, 5], [5]) == []\", \"assert fi...
{ "split": "train", "index": 3956, "acecode_id": "bigcode_python_fns_15962", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of items, each represented by a dictionary containing a 'description' (string), a 'descriptionType' (string), and an optional 'lang' (string), create a function `transform_descriptions(values)` that returns a list of formatted strings. Each formatted string should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_descriptions([]) == []\", \"assert transform_descriptions([{'description': 'Hello', 'descriptionType': 'Greeting', 'lang': 'en'}]) == ['Description: Hello, Type: Greeting, Language: en']\", \"assert transform_descriptions([{'description': 'Hola', '...
{ "split": "train", "index": 3957, "acecode_id": "bigcode_python_fns_43569", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function to calculate the circumference of a circle given its radius. The function should take a single parameter, radius, which is a positive float. Return the circumference of the circle.\nPlease reason step by step, then write a self-contained Python solution. Give y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_circumference(1) == 6.283185307179586\", \"assert find_circumference(2) == 12.566370614359172\", \"assert find_circumference(3) == 18.84955592153876\", \"assert find_circumference(5) == 31.41592653589793\", \"assert find_circumference(6) == 37.699111843...
{ "split": "train", "index": 3958, "acecode_id": "evol_18828", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of unique prime numbers, write a function that determines if the sum of any two primes in the list results in a prime number. Return True if such a pair exists, otherwise return False.\nPlease reason step by step, then write a self-contained Python solution. Give y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_primes([2, 3, 5]) == True\", \"assert check_primes([2, 5, 7]) == True\", \"assert check_primes([3, 5, 11]) == False\", \"assert check_primes([2]) == False\", \"assert check_primes([2, 3, 11]) == True\", \"assert check_primes([41, 43, 53]) == False\", \...
{ "split": "train", "index": 3959, "acecode_id": "evol_22557", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes player statistics from a game. The function should take a list of player dictionaries, where each dictionary contains the player's ID, gamertag, discord username, rank, number of wins, number of losses, and a boolean indica...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_player_stats([{'id': 1, 'gamertag': 'Gamer1', 'discord': 'Discord1', 'rank': 5, 'wins': 10, 'losses': 5, 'challenged': True, 'total_goals': 30, 'total_challenges': 10}]) == [{'id': 1, 'avg_goals_per_challenge': 3.0}]\", \"assert process_player_stats(...
{ "split": "train", "index": 3960, "acecode_id": "bigcode_python_fns_30543", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two arrays of integers, implement a function that calculates the dot product of the corresponding elements. If the arrays are not of the same length, the function should raise a ValueError with the message 'Arrays must be the same length'.\nPlease reason step by step, the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dot_product([1, 2, 3], [4, 5, 6]) == 32\", \"assert dot_product([-1, 0, 1], [1, 0, -1]) == -2\", \"assert dot_product([0, 0, 0], [1, 2, 3]) == 0\", \"assert dot_product([1, 2], [3, 4]) == 11\", \"assert dot_product([2], [5]) == 10\", \"assert dot_product([1]...
{ "split": "train", "index": 3961, "acecode_id": "evol_12029", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given an integer n, write a function that generates a list of integers from 1 to n, but for multiples of three, add 'Fizz' instead of the number, for multiples of five, add 'Buzz' instead of the number, and for numbers that are multiples of both three and five, add 'FizzBuzz'. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fizz_buzz(1) == [1]\", \"assert fizz_buzz(3) == [1, 2, 'Fizz']\", \"assert fizz_buzz(5) == [1, 2, 'Fizz', 4, 'Buzz']\", \"assert fizz_buzz(15) == [1, 2, 'Fizz', 4, 'Buzz', 'Fizz', 7, 8, 'Fizz', 'Buzz', 11, 'Fizz', 13, 14, 'FizzBuzz']\", \"assert fizz_buzz(10...
{ "split": "train", "index": 3962, "acecode_id": "bigcode_python_fns_21204", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `s` and a substring `foo`. Write a function `makeSpecial(s, foo)` that replaces all occurrences of `foo` in the string `s` with `<span class=\"special\">foo</span>`. The function should return the modified string.\nPlease reason step by step, then write a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert makeSpecial('I am the most foo h4ck3r ever!!', 'foo') == 'I am the most <span class=\\\"special\\\">foo</span> h4ck3r ever!!'\", \"assert makeSpecial('Hello world!', 'foo') == 'Hello world!'\", \"assert makeSpecial('foofoofoo', 'foo') == '<span class=\\\"spe...
{ "split": "train", "index": 3963, "acecode_id": "evol_3608", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `rotate_matrix_90(matrix)` that takes a square matrix as input and returns the matrix rotated 90 degrees clockwise. The input matrix is guaranteed to be a list of lists where each list has the same length as the number of lists in the outer list.\nPlease re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotate_matrix_90([[1, 2], [3, 4]]) == [[3, 1], [4, 2]]\", \"assert rotate_matrix_90([[1]]) == [[1]]\", \"assert rotate_matrix_90([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == [[7, 4, 1], [8, 5, 2], [9, 6, 3]]\", \"assert rotate_matrix_90([[1, 2, 3, 4], [5, 6, 7, 8],...
{ "split": "train", "index": 3964, "acecode_id": "evol_4483", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the process of obtaining an access token using a provided authentication code. The function should take a string parameter `authen_code`, which represents the authentication code and return a dictionary containing the a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_access_token('valid_code') == {'access_token': 'token_value', 'message': 'success'}\", \"assert get_access_token('another_valid_code') == {'access_token': 'another_token_value', 'message': 'success'}\", \"assert get_access_token('') == {'message': 'failu...
{ "split": "train", "index": 3965, "acecode_id": "bigcode_python_fns_24020", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the sizes of different contours, write a function `sizeRange(contourList: List[int], low: int, high: int) -> List[int]` that filters and returns a new list containing only the sizes that fall within the inclusive range [low, high]. The inpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sizeRange([1, 3, 5, 7, 9], 3, 7) == [3, 5, 7]\", \"assert sizeRange([10, 20, 30, 40], 15, 25) == [20]\", \"assert sizeRange([5, 15, 25, 35, 45], 0, 10) == [5]\", \"assert sizeRange([], 1, 5) == []\", \"assert sizeRange([2, 4, 6, 8, 10], 6, 10) == [6, 8, 10]\...
{ "split": "train", "index": 3966, "acecode_id": "bigcode_python_fns_16978", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of player data strings where each string contains a player's name and their score, separated by a semicolon (';'). Your task is to create a function called `format_player_data(data: List[str]) -> List[str]` that takes in a list of these data strings and ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_player_data(['Alice;200']) == ['Alice\\\\n200']\", \"assert format_player_data(['Bob;150', 'Charlie;300']) == ['Bob\\\\n150', 'Charlie\\\\n300']\", \"assert format_player_data(['Dave;400']) == ['Dave\\\\n400']\", \"assert format_player_data(['Eve;750'...
{ "split": "train", "index": 3967, "acecode_id": "bigcode_python_fns_19070", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of sentences. Your task is to implement a function that determines the sentiment polarity of each sentence and returns a list of scores. Each score should be a dictionary containing the sentiment values: 'neg', 'neu', 'pos', and 'compound', where 'neg' repr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_sentiment_scores(['I love programming']) == [{'neg': 0.0, 'neu': 0.1, 'pos': 0.9, 'compound': 0.8}]\", \"assert get_sentiment_scores(['I hate bugs']) == [{'neg': 0.7, 'neu': 0.1, 'pos': 0.2, 'compound': -0.5}]\", \"assert get_sentiment_scores(['It is a s...
{ "split": "train", "index": 3968, "acecode_id": "bigcode_python_fns_2449", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function to compute the surface area of a rectangular prism given its length, width, and height. The formula for the surface area of a rectangular prism is: 2 * (length * width + length * height + width * height). Your function should take three parameters: length (...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rectangle_surface_area(1, 1, 1) == 6\", \"assert rectangle_surface_area(2, 3, 4) == 52\", \"assert rectangle_surface_area(5, 5, 5) == 150\", \"assert rectangle_surface_area(0, 0, 0) == 0\", \"assert rectangle_surface_area(10, 10, 10) == 600\", \"assert recta...
{ "split": "train", "index": 3969, "acecode_id": "evol_20442", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `add_two_numbers(a, b)` that takes two integers `a` and `b` as input and returns their sum. The function should handle both positive and negative integers.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_two_numbers(1, 2) == 3\", \"assert add_two_numbers(-1, 1) == 0\", \"assert add_two_numbers(0, 0) == 0\", \"assert add_two_numbers(-5, -5) == -10\", \"assert add_two_numbers(100, 200) == 300\", \"assert add_two_numbers(-10, 10) == 0\", \"assert add_two_nu...
{ "split": "train", "index": 3970, "acecode_id": "evol_13508", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that accepts a variable number of keyword arguments (kwargs) representing various statistics for a fictional module. Each keyword corresponds to a specific statistic name and its value, which can be either an integer or a float. Your func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lvnf_stats() == {}\", \"assert lvnf_stats(a=1) == {'a': 1}\", \"assert lvnf_stats(x=3.14) == {'x': 3.14}\", \"assert lvnf_stats(a=1, b=2) == {'a': 1, 'b': 2}\", \"assert lvnf_stats(a=1.5, b=2.5, c=3.5) == {'a': 1.5, 'b': 2.5, 'c': 3.5}\", \"assert lvnf_stats...
{ "split": "train", "index": 3971, "acecode_id": "bigcode_python_fns_6777", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `deep_copy(obj)` that takes an object and returns a deep copy of that object. A deep copy means that all objects are copied recursively, and changes made to the original object should not affect the copied object. Use Python's built-in `copy` module to impl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert deep_copy(['a', 'b', 'c']) == ['a', 'b', 'c']\", \"assert deep_copy([1, 2, [3, 4]]) == [1, 2, [3, 4]]\", \"assert deep_copy({'key': 'value'}) == {'key': 'value'}\", \"assert deep_copy({'a': [1, 2, 3]}) == {'a': [1, 2, 3]}\", \"assert deep_copy((1, 2, 3)) == ...
{ "split": "train", "index": 3972, "acecode_id": "evol_31839", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You have a list of student IDs representing members of a course group and a list of participation records indicating which students attended specific activities. Write a function `calculate_participation_count(students: List[int], participation_records: List[int]) -> Dict[int, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_participation_count([1, 2, 3], [1, 2, 1, 3]) == {1: 2, 2: 1, 3: 1}\", \"assert calculate_participation_count([4, 5, 6], [5, 5, 6]) == {4: 0, 5: 2, 6: 1}\", \"assert calculate_participation_count([7, 8, 9], [8, 8]) == {7: 0, 8: 2, 9: 0}\", \"assert ...
{ "split": "train", "index": 3973, "acecode_id": "bigcode_python_fns_45301", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `trifib(n: int) -> int` that computes the n-th number in a modified Fibonacci sequence called Trifibonacci. The Trifibonacci sequence is defined as follows: T(0) = 0, T(1) = 0, T(2) = 1, and for n >= 3, T(n) = T(n-1) + T(n-2) + 2 * T(n-3). The function shou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert trifib(0) == 0\", \"assert trifib(1) == 0\", \"assert trifib(2) == 1\", \"assert trifib(3) == 1\", \"assert trifib(4) == 2\"]}" }
{ "split": "train", "index": 3974, "acecode_id": "evol_10115", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are working on a script to manage and organize various folders and files related to a machine learning project. The script contains a section with commented-out lines that specify different folder names and lists of features and models. Your task is to write a function `ext...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_script_info(\\\"\\\"\\\"## backup_folder = 'my_backup'\\\\n## features_choices_labels = ['feature1', 'feature2']\\\\n## models_names_list = ['model1']\\\\n## normalization_choices = ['min_max']\\\\n\\\"\\\"\\\") == {'backup_folder': 'my_backup', 'fea...
{ "split": "train", "index": 3975, "acecode_id": "oss_4766", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of emails, write a function that takes an email and returns True if the email is present in the list, otherwise return False. The email is considered valid if it matches the standard email format (e.g., 'example@example.com'). You need to implement the function 'is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_email_present(['test@example.com', 'hello@world.com'], 'test@example.com') == True\", \"assert is_email_present(['test@example.com', 'hello@world.com'], 'TEST@EXAMPLE.COM') == False\", \"assert is_email_present(['user@domain.com'], 'user@domain.com') == T...
{ "split": "train", "index": 3976, "acecode_id": "bigcode_python_fns_45848", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function named count_nums_plus that accepts a list of integers and strings. The function should return the number of elements whose absolute value exceeds zero and is divisible by either 4 or 5. Convert all string elements to integers, ignoring any that cannot be co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_nums_plus([]) == 0\", \"assert count_nums_plus([-1, 11, -11, '4', 'five']) == 1\", \"assert count_nums_plus([1, 1, 2, '4', 'nine']) == 1\", \"assert count_nums_plus(['-20', '10', 15, -30]) == 4\", \"assert count_nums_plus(['-5', '5', '15', -10]) == 4\"...
{ "split": "train", "index": 3977, "acecode_id": "evol_28508", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a point represented by its x-coordinate, a wave frequency, an amplitude, and offsets for both x and y. Your task is to implement a function `point_in_wave(point_x: float, frequency: float, amplitude: float, offset_x: float, offset_y: float) -> float` that calculat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert point_in_wave(0, 1, 1, 0, 0) == 0.0\", \"assert point_in_wave(0, 1, 1, 0, 1) == 1.0\", \"assert point_in_wave(0, 2, 1, 0, 0) == 0.0\", \"assert point_in_wave(0, 1, 5, 0, 0) == 0.0\", \"assert point_in_wave(0.5, 1, 5, 0, 0) == 5.0\", \"assert point_in_wave(0,...
{ "split": "train", "index": 3978, "acecode_id": "bigcode_python_fns_45896", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates the process of evaluating a machine learning model's performance on a validation dataset. The function will take in a list of integers representing the model's performance scores on different validation batches and r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_performance([10]) == 10.0\", \"assert average_performance([10, 20]) == 15.0\", \"assert average_performance([1, 2, 3, 4, 5]) == 3.0\", \"assert average_performance([5, 10, 15, 20]) == 12.5\", \"assert average_performance([100, 200, 300]) == 200.0\", ...
{ "split": "train", "index": 3979, "acecode_id": "oss_31710", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dataset represented as a list of integers. Your task is to create a function that returns a random subset of the dataset. The subset size can be specified in two ways: as a fraction (float) of the dataset size between 0 and 1, or as an integer representing the a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_random_subset([1, 2, 3, 4, 5], 0.5) == [1, 2] or get_random_subset([1, 2, 3, 4, 5], 0.5) == [3, 4] or get_random_subset([1, 2, 3, 4, 5], 0.5) == [2, 3] or get_random_subset([1, 2, 3, 4, 5], 0.5) == [4, 5] or get_random_subset([1, 2, 3, 4, 5], 0.5) == [1,...
{ "split": "train", "index": 3980, "acecode_id": "bigcode_python_fns_48564", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are working on a file management system that organizes files into specific categories based on their names. Your task is to write a Python function that takes in a list of file names and categorizes them based on certain rules. The function should categorize the files into ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert categorize_files(['asset_file1.txt', 'data_file1.txt', 'item_file1.txt', 'file1.txt']) == {'assets': ['asset_file1.txt'], 'data': ['data_file1.txt'], 'items': ['item_file1.txt'], 'others': ['file1.txt']}\", \"assert categorize_files(['file_without_keywords.t...
{ "split": "train", "index": 3981, "acecode_id": "oss_24696", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function `get_storage_size(storage_opt: Dict[str, Union[str, int]]) -> int` that determines the storage size based on the provided storage options. The input is a dictionary `storage_opt` which may contain a key 'size'. Your function should return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_storage_size({'size': 'host'}) == -1\", \"assert get_storage_size({'size': '-1'}) == -1\", \"assert get_storage_size({'size': '100GB'}) == 107374182400\", \"assert get_storage_size({'size': '1GB'}) == 1073741824\", \"assert get_storage_size({'size': '2GB...
{ "split": "train", "index": 3982, "acecode_id": "bigcode_python_fns_48375", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the routing of packets in a network using a simplified contact graph. Given a packet with specific attributes, the source node, a contact graph, a list of routes, a list of contacts, the current time, and a limbo list f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert route_packet({'return_to_sender': False, 'is_critical': False, 'hops': [], 'end_node': 'A'}, 'B', {'B': ['C'], 'C': ['A']}, [], {'C': Contact()}, 1000, []) == None\", \"assert route_packet({'return_to_sender': False, 'is_critical': True, 'hops': [], 'end_nod...
{ "split": "train", "index": 3983, "acecode_id": "bigcode_python_fns_24163", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the perplexity (PPL) of a language model based on its cumulative loss and cumulative target words. The perplexity is calculated using the formula: PPL = exp(cumulative_loss / cumulative_target_words). Implement a function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(calculate_perplexity(0.0, 1) - 1.0) < 1e-9\", \"assert abs(calculate_perplexity(1.0, 1) - 2.718281828459045) < 1e-9\", \"assert abs(calculate_perplexity(2.0, 1) - 7.38905609893065) < 1e-9\", \"assert abs(calculate_perplexity(0.6931471805599453, 1) - 2.0)...
{ "split": "train", "index": 3984, "acecode_id": "oss_32807", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a date string in the ISO-8601 format (YYYY-MM-DD), write a function that returns a formatted URL string. The URL format should be: 'http://example.com/index.php?dir=YYYY/MM/DD/'. Replace YYYY, MM, and DD with the corresponding year, month, and the full date from the input...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_formatted_url('2023-01-01') == 'http://example.com/index.php?dir=2023/01/2023-01-01/'\", \"assert get_formatted_url('2022-02-15') == 'http://example.com/index.php?dir=2022/02/2022-02-15/'\", \"assert get_formatted_url('2020-12-31') == 'http://example.com...
{ "split": "train", "index": 3985, "acecode_id": "bigcode_python_fns_30177", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `get_positive_and_sort(l: list) -> list` that returns a new list containing only the positive numbers from the input list `l`, sorted in ascending order. The input list may contain negative numbers and zeros, which should be ignored. \n\nExample: \n- get_po...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_positive_and_sort([-1, 2, -4, 5, 6]) == [2, 5, 6]\", \"assert get_positive_and_sort([-3, -2, -1]) == []\", \"assert get_positive_and_sort([0, -1, -2, 0, 1]) == [1]\", \"assert get_positive_and_sort([10, 20, -30, 40, 50]) == [10, 20, 40, 50]\", \"assert g...
{ "split": "train", "index": 3986, "acecode_id": "evol_30216", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing a note, where keys are attributes and their corresponding values. Your task is to create a function `remove_attribute(note_dict: Dict[str, Any], attribute: str) -> Dict[str, Any]` that takes a dictionary and an attribute name as input. Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_attribute({'title': 'Note 1', 'content': 'This is the content'}, 'content') == {'title': 'Note 1', 'content': None}\", \"assert remove_attribute({'title': 'Note 2', 'content': 'Another content', 'author': 'Author A'}, 'author') == {'title': 'Note 2', ...
{ "split": "train", "index": 3987, "acecode_id": "bigcode_python_fns_13250", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `log_transform` that takes two lists of positive numbers, `x_values` and `y_values`, and returns two new lists containing the natural logarithm of each element in the input lists. The function should return both transformed lists as a tuple. You may assume ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_transform([4, 5, 6], [40, 50, 60]) == ([1.3862943611198906, 1.6094379124341003, 1.791759469228055], [3.6888794541139363, 3.912023005428146, 4.0943445622221])\", \"assert log_transform([1, 3, 7], [2, 8, 16]) == ([0.0, 1.0986122886681098, 1.945910149055313...
{ "split": "train", "index": 3988, "acecode_id": "evol_32918", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Write a function `sum_of_odd(n: int, m: int) -> int` that takes two parameters, n and m, and returns the sum of the first n odd integers starting with m. If n or m are not positive integers, the function should raise a ValueError.\nPlease reason step by step, then write a self-...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_odd(3, 1) == 9\", \"assert sum_of_odd(1, 7) == 7\", \"assert sum_of_odd(5, 2) == 35\", \"assert sum_of_odd(1, 11) == 11\", \"assert sum_of_odd(7, 1) == 49\", \"assert sum_of_odd(1, 2) == 3\"]}" }
{ "split": "train", "index": 3989, "acecode_id": "evol_1597", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function that computes the total count of the digit '7' found within numbers less than the specified integer n that are divisible by either 11 or 13. The numbers must be collected in a steady ascending arithmetic series, starting from the smallest number divisible b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_digit_seven(10) == 0\", \"assert count_digit_seven(11) == 0\", \"assert count_digit_seven(12) == 0\", \"assert count_digit_seven(13) == 0\", \"assert count_digit_seven(20) == 0\", \"assert count_digit_seven(30) == 0\", \"assert count_digit_seven(40) ==...
{ "split": "train", "index": 3990, "acecode_id": "evol_25184", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Construct a function that takes a string message and an integer value representing the maximum number of bits to use for embedding the message. The function should return a binary representation of the message, ensuring that it does not exceed the specified maximum bit limit. I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert embed_message_binary('Hello', 40) == '0100100001100101011011000110110001101111'\", \"assert embed_message_binary('Hello', 32) == '01001000011001010110110001101100'\", \"assert embed_message_binary('A', 8) == '01000001'\", \"assert embed_message_binary('AB', ...
{ "split": "train", "index": 3991, "acecode_id": "evol_9490", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing a sequence of scores. Your task is to implement a function `calculate_total_score(scores: List[int]) -> int` that computes the total score by summing all the integers in the list. The function should return the total score. Note tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_score([1, 2, 3]) == 6\", \"assert calculate_total_score([-1, -2, -3]) == -6\", \"assert calculate_total_score([5, 10, -3, 2]) == 14\", \"assert calculate_total_score([]) == 0\", \"assert calculate_total_score([0, 0, 0]) == 0\", \"assert calcu...
{ "split": "train", "index": 3992, "acecode_id": "bigcode_python_fns_5289", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list that may contain nested lists, write a function `flatten` that takes this list as input and returns a single list with all the elements flattened. The function should handle lists nested to any level and should preserve the order of the elements as they appear in t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert flatten([1, 2, 3]) == [1, 2, 3]\", \"assert flatten([[1, 2], [3, 4]]) == [1, 2, 3, 4]\", \"assert flatten([1, [2, 3], 4]) == [1, 2, 3, 4]\", \"assert flatten([1, [2, [3, 4]], 5]) == [1, 2, 3, 4, 5]\", \"assert flatten([[[1]], 2, [3, [4, 5]]]) == [1, 2, 3, 4,...
{ "split": "train", "index": 3993, "acecode_id": "bigcode_python_fns_34078", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a rectangular area defined by its top-left corner (x, y), width, and height. Your task is to determine whether a point (px, py) lies inside this rectangle. Write a function `is_point_inside_rectangle(x: int, y: int, width: int, height: int, px: int, py: int) -> bo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_point_inside_rectangle(1, 1, 2, 2, 2, 2) == True\", \"assert is_point_inside_rectangle(1, 1, 2, 2, 1, 1) == False\", \"assert is_point_inside_rectangle(1, 1, 2, 2, 3, 3) == False\", \"assert is_point_inside_rectangle(0, 0, 4, 4, 2, 2) == True\", \"assert ...
{ "split": "train", "index": 3994, "acecode_id": "oss_17569", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating a formatted alert message based on a given alert object. The alert object contains the following properties: 'title' (a string), 'is_error' (a boolean), 'is_warning' (a boolean), 'details' (a list of strings), and 'stack' (a list of strings). Your...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_alert_message({'title': 'Sample Error', 'is_error': True, 'is_warning': False, 'details': ['Detail 1', 'Detail 2'], 'stack': ['Frame 1', 'Frame 2']}) == '<error message=\\\"Sample Error\\\">\\\\nDetail 1\\\\nDetail 2\\\\n\\\\nFrame 1\\\\nFrame 2'\",...
{ "split": "train", "index": 3995, "acecode_id": "bigcode_python_fns_17968", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a string containing Markdown text. Your task is to write a function `extract_hyperlinks(markdown_text: str) -> List[Tuple[str, str]]` that extracts all hyperlinks from the text. Each hyperlink is represented in Markdown format as `[anchor_text](url)`. The function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_hyperlinks('') == []\", \"assert extract_hyperlinks('No links here.') == []\", \"assert extract_hyperlinks('[Broken Link](not_a_url)') == []\", \"assert extract_hyperlinks('Text without links.') == []\", \"assert extract_hyperlinks('[Link](link) and ...
{ "split": "train", "index": 3996, "acecode_id": "oss_5140", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function `cumulative_multiplier(start: int, end: int) -> int` that calculates the cumulative product of all odd integers in a given inclusive range from `start` to `end`. If there are no odd integers in the range, the function should return 1.\nPlease reason step by...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cumulative_multiplier(1, 5) == 15\", \"assert cumulative_multiplier(2, 10) == 945\", \"assert cumulative_multiplier(3, 3) == 3\", \"assert cumulative_multiplier(4, 4) == 1\", \"assert cumulative_multiplier(1, 1) == 1\", \"assert cumulative_multiplier(0, 0) =...
{ "split": "train", "index": 3997, "acecode_id": "evol_18378", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `get_color_name` that takes three integer arguments representing the RGB (Red, Green, Blue) values, each ranging from 0 to 255. Your function should return the corresponding color name based on the following rules: \n- If all three RG...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_color_name(0, 0, 0) == 'BLACK'\", \"assert get_color_name(255, 0, 0) == 'RED'\", \"assert get_color_name(0, 255, 0) == 'GREEN'\", \"assert get_color_name(0, 0, 255) == 'BLUE'\", \"assert get_color_name(255, 255, 255) == 'WHITE'\", \"assert get_color_name...
{ "split": "train", "index": 3998, "acecode_id": "oss_15932", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that converts Unicode escape sequences in a string to their corresponding characters. The escape sequences take the form of `\\uXXXX`, `\\UXXXXXXXX`, `\\u{XXXX}`, or `u{XXXX}`, where `X` represents a hexadecimal digit. Write a functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unicodeConverter('Hello,\\\\u0057\\\\u006F\\\\u0072\\\\u006C\\\\u0064! \\\\U0001F600') == 'Hello,World! \\ud83d\\ude00'\", \"assert unicodeConverter('\\\\u0041\\\\u0042\\\\u0043') == 'ABC'\", \"assert unicodeConverter('Unicode: \\\\u03B1\\\\u03B2\\\\u03B3') ...
{ "split": "train", "index": 3999, "acecode_id": "oss_4388", "num_tests": 11 }