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 designing a function that will take a list of student data and add a new field called 'grade_level' to each student's record. The student data is represented as a list of dictionaries, where each dictionary contains the keys 'first_name', 'last_name', and 'd...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_grade_level([{ 'first_name': 'John', 'last_name': 'Doe', 'date_of_birth': '2000-01-01' }], '5th') == [{'first_name': 'John', 'last_name': 'Doe', 'date_of_birth': '2000-01-01', 'grade_level': '5th'}]\", \"assert add_grade_level([{ 'first_name': 'Jane', 'l...
{ "split": "train", "index": 68300, "acecode_id": "oss_14456", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function named `fatal` that prints an error message to the console and then terminates the program. Your task is to implement a function `handle_error(msg: str) -> None` that takes a string message as input and simulates the behavior of the `fatal` function by p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_error('Error: File not found') == None\", \"assert handle_error('Error: Invalid input') == None\", \"assert handle_error('Error: Connection lost') == None\", \"assert handle_error('Warning: Low memory') == None\", \"assert handle_error('Error: Operati...
{ "split": "train", "index": 68301, "acecode_id": "bigcode_python_fns_17938", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string 'word', return 'a' if the last character of the string is one of the vowels 'a', 'o', or 'u'. Otherwise, return 'ä'. The input string will only contain lowercase letters and will not be empty. Implement a function `last_char_to_aou(word: str) -> str:` that takes ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert last_char_to_aou('cocoa') == 'a'\", \"assert last_char_to_aou('menu') == 'a'\", \"assert last_char_to_aou('auto') == 'a'\", \"assert last_char_to_aou('bamboo') == 'a'\", \"assert last_char_to_aou('a') == 'a'\", \"assert last_char_to_aou('o') == 'a'\", \"asse...
{ "split": "train", "index": 68302, "acecode_id": "bigcode_python_fns_23066", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a nested data structure that can represent either an empty set, an empty array, or a non-empty set that may contain other sets or arrays, implement a function `is_empty(ir)` that checks if the given structure is empty. An empty set is represented as `None`, an empty array...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_empty(None) == True\", \"assert is_empty([]) == True\", \"assert is_empty([None]) == False\", \"assert is_empty([1, 2, 3]) == False\", \"assert is_empty([[1], [2, 3]]) == False\", \"assert is_empty([[None], [1]]) == False\", \"assert is_empty([[], [1, 2]]...
{ "split": "train", "index": 68303, "acecode_id": "bigcode_python_fns_18496", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function that takes two lists of integers as input and returns a list of all the unique prime numbers found in both lists. The two lists may be of different lengths and can contain duplicate values. Your function should only return unique prime numbers in ascending ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_primes([23, 45, 7, 18, 9, 11, 14, 39, 22], [15, 29, 32, 71, 43]) == [7, 11, 23, 29, 43, 71]\", \"assert unique_primes([4, 6, 8, 10], [12, 14, 16]) == []\", \"assert unique_primes([], [2, 3, 5]) == [2, 3, 5]\", \"assert unique_primes([2, 3, 5], []) == ...
{ "split": "train", "index": 68304, "acecode_id": "evol_28701", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing scores obtained by a group of students in a series of tests. Your task is to implement a function that takes this list of scores and returns a new list where each score is replaced by the average score of all students who scored hig...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_with_higher_average([10, 20, 20, 30]) == [20.0, 25.0, 25.0, -1]\", \"assert replace_with_higher_average([100]) == [-1]\", \"assert replace_with_higher_average([55]) == [-1]\", \"assert replace_with_higher_average([70, 60, 70, 80, 90]) == [75.0, 70.0,...
{ "split": "train", "index": 68305, "acecode_id": "bigcode_python_fns_1119", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a dictionary where each key-value pair represents an item and its associated value. Your task is to implement a function `transform_dict` that takes in a transformation function `f` and a dictionary `dct`. The function `f` will be called with each key and its corr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_dict(lambda k, v: (k.upper(), v * 2), {'a': 1, 'b': 2}) == {'A': 2, 'B': 4}\", \"assert transform_dict(lambda k, v: (k + '!', v + 1), {'hello': 3, 'world': 5}) == {'hello!': 4, 'world!': 6}\", \"assert transform_dict(lambda k, v: (v, k), {1: 'one',...
{ "split": "train", "index": 68306, "acecode_id": "bigcode_python_fns_20310", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes two strings as input and determines if the first string is an anagram of the second string. An anagram is a word formed by rearranging the letters of another, such as 'listen' being an anagram of 'silent'. The function should return True if the two s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_anagram('listen', 'silent') == True\", \"assert is_anagram('triangle', 'integral') == True\", \"assert is_anagram('apple', 'pale') == False\", \"assert is_anagram('anagram', 'nagaram') == True\", \"assert is_anagram('rat', 'car') == False\", \"assert is_a...
{ "split": "train", "index": 68307, "acecode_id": "evol_32429", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that generates a unique identifier using the UUID (Universally Unique Identifier) standard. The function should return a string representation of a valid version 4 UUID. Please implement the function `generate_uuid()` that retu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_uuid() is not None\", \"assert len(generate_uuid()) == 36\", \"assert generate_uuid()[8] == '-' and generate_uuid()[13] == '-' and generate_uuid()[18] == '-' and generate_uuid()[23] == '-'\", \"assert generate_uuid().count('-') == 4\", \"assert all(...
{ "split": "train", "index": 68308, "acecode_id": "oss_9278", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of sensor measurement records and a qualified table name as input, and returns a formatted SQL INSERT statement. The function should generate an SQL statement that correctly formats the list of records into a single ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_insert_sql(['value1', 'value2'], 'schema.table') == \\\"INSERT INTO schema.table VALUES (%s, %s);\\\"\", \"assert generate_insert_sql(['sensor1', 'sensor2', 'sensor3'], 'public.data') == \\\"INSERT INTO public.data VALUES (%s, %s, %s);\\\"\", \"asse...
{ "split": "train", "index": 68309, "acecode_id": "bigcode_python_fns_6508", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple decorator function in Python that logs the elapsed time of a given function. Implement a function named `timer` that takes a function as an argument and returns a wrapper function. The wrapper function should log the name of the function be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert timer(lambda: None)() == 'Function <lambda> executed in 1.5 seconds.'\", \"assert timer(lambda x: x)(5) == 'Function <lambda> executed in 1.5 seconds.'\", \"assert timer(lambda: print('Hello, World!'))() == 'Function <lambda> executed in 1.5 seconds.'\", \"a...
{ "split": "train", "index": 68310, "acecode_id": "bigcode_python_fns_19794", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given the shape of a 2D array and its extent in the form of a bounding box defined by the coordinates (xmin, xmax, ymin, ymax), implement a function that calculates the header information of the array. The header should include the number of columns (ncols), the number of rows ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shape_extent_to_header((2, 3), (0, 6, 0, 4)) == {'ncols': 3, 'nrows': 2, 'xllcorner': 0, 'yllcorner': 0, 'cellsize': 2.0, 'NODATA_value': -9999}\", \"assert shape_extent_to_header((1, 1), (1, 2, 1, 2)) == {'ncols': 1, 'nrows': 1, 'xllcorner': 1, 'yllcorner':...
{ "split": "train", "index": 68311, "acecode_id": "bigcode_python_fns_3118", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Write a function `calculate_squares_and_roots(nums: List[int]) -> List[Tuple[int, float]]` that takes a list of integers and returns a list of tuples. Each tuple should contain the square of the integer and its square root calculated using the Babylonian method (without using a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_squares_and_roots([4]) == [(16, 2.0)]\", \"assert calculate_squares_and_roots([9]) == [(81, 3.0)]\", \"assert calculate_squares_and_roots([1, 4, 9]) == [(1, 1.0), (16, 2.0), (81, 3.0)]\", \"assert calculate_squares_and_roots([0]) == [(0, 0.0)]\", \...
{ "split": "train", "index": 68312, "acecode_id": "evol_27504", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer `x`, write a function to determine if `x` is a palindrome. An integer is considered a palindrome if it reads the same backward as forward. You should not convert the integer to a string to solve the problem. Additionally, negative integers should be handled app...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert isPalindrome(121) == True\", \"assert isPalindrome(-121) == False\", \"assert isPalindrome(10) == False\", \"assert isPalindrome(0) == True\", \"assert isPalindrome(12321) == True\", \"assert isPalindrome(123321) == True\", \"assert isPalindrome(-12321) == F...
{ "split": "train", "index": 68313, "acecode_id": "oss_5707", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a hex string that represents a series of bytes. Your task is to write a function that calculates the number of bytes represented by the hex string. A byte is represented by two hexadecimal characters. If the input string contains any invalid hexadecimal characters...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_bytes('a1b2c3') == 3\", \"assert count_bytes('0001') == 2\", \"assert count_bytes('abcdef') == 3\", \"assert count_bytes('') == 0\", \"assert count_bytes('ghij') == -1\", \"assert count_bytes('1234567890abcdef') == 8\", \"assert count_bytes('1234gh') =...
{ "split": "train", "index": 68314, "acecode_id": "bigcode_python_fns_40334", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a validation check for a specific configuration scenario in a service mesh. Your function should take a list of destination rules, a list of peer authentication objects, and a namespace TLS status. Each destination rule and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_mesh_configuration([], [], {'bookinfo': 'DISABLED'}) == []\", \"assert validate_mesh_configuration([('bookinfo', 'KIA0208')], [], {'bookinfo': 'DISABLED'}) == ['KIA0208']\", \"assert validate_mesh_configuration([], [('istio-system', 'KIA0401')], {'i...
{ "split": "train", "index": 68315, "acecode_id": "bigcode_python_fns_47042", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates sending messages in a chat application. The function should take a `chat_id` and an optional `message` parameter. If the `message` is provided, it should be sent as a text message. If the `message` is not provided, the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert send_message(1, 'Hello!') == 'Message sent to chat_id: 1'\", \"assert send_message(2, 'Hi there!') == 'Message sent to chat_id: 2'\", \"assert send_message(5, 'Goodbye!') == 'Message sent to chat_id: 5'\", \"assert send_message(7, 'Test message') == 'Message...
{ "split": "train", "index": 68316, "acecode_id": "bigcode_python_fns_5643", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple yes/no prompt. Your function should take a question as a string and return True if the user responds with 'yes' or 'y', and False if the user responds with 'no' or 'n'. If the user does not provide an answer, the f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert yes_no_prompt('Is the sky blue?', 'y') == True\", \"assert yes_no_prompt('Is the sky blue?', 'n') == False\", \"assert yes_no_prompt('Is the grass green?', 'Yes') == True\", \"assert yes_no_prompt('Is the grass green?', 'No') == False\", \"assert yes_no_prom...
{ "split": "train", "index": 68317, "acecode_id": "bigcode_python_fns_26881", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a simple document processing system. The system will handle different sections of a document, such as front matter, main matter, appendix, and back matter. Each section will have its own directive and format. Your ta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_document_sections(['frontmatter']) == {'frontmatter': 'frontmatter'}\", \"assert process_document_sections(['mainmatter']) == {'mainmatter': 'mainmatter'}\", \"assert process_document_sections(['appendix']) == {'appendix': 'appendix'}\", \"assert pro...
{ "split": "train", "index": 68318, "acecode_id": "oss_2773", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of strings as input and concatenates them into a single string, with each word separated by a space. The function should return the concatenated string. For example, if the input is ['Hello', 'world'], the output should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert concatenate_words(['Hello', 'world']) == 'Hello world'\", \"assert concatenate_words(['This', 'is', 'a', 'test']) == 'This is a test'\", \"assert concatenate_words(['Python', 'is', 'fun']) == 'Python is fun'\", \"assert concatenate_words(['Leet', 'Code']) ==...
{ "split": "train", "index": 68319, "acecode_id": "bigcode_python_fns_48842", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates downloading a file. The function should take in two parameters: a filename (string) and a URL (string). If the file with the given filename does not exist, the function should simulate downloading the file from the URL ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert download_if_not_exists('file1.txt', 'http://example.com/file1') == True\", \"assert download_if_not_exists('file2.txt', 'http://example.com/file2') == True\", \"assert download_if_not_exists('file3.txt', 'http://example.com/file3') == True\", \"assert downlo...
{ "split": "train", "index": 68320, "acecode_id": "bigcode_python_fns_13285", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that formats and displays a multiple-choice question. The function should take two parameters: `question_type` (a string representing the type of the question, such as 'Colour' or 'Fruit') and `choices` (a tuple containing the availab...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_multiple_choice_question('Colour', ('Blue', 'Red', 'Green', 'Yellow')) == 'Question Type: Colour\\\\nChoices: Blue, Red, Green, Yellow'\", \"assert format_multiple_choice_question('Fruit', ('Apple', 'Banana', 'Cherry')) == 'Question Type: Fruit\\\\nCh...
{ "split": "train", "index": 68321, "acecode_id": "oss_7977", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `convert_to_snake_case(text: str) -> str` that takes a string `text` and converts it into a lower snake_case format. The function should first trim any leading or trailing whitespace from the string, replace all spaces with underscores, convert all characters t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_snake_case('Hello World') == 'hello_world'\", \"assert convert_to_snake_case(' Leading and trailing spaces ') == 'leading_and_trailing_spaces'\", \"assert convert_to_snake_case('Special@Characters!') == 'specialcharacters'\", \"assert convert_to...
{ "split": "train", "index": 68322, "acecode_id": "bigcode_python_fns_43073", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `cleanup_system` that simulates the cleanup process of a system upon receiving a termination signal. The function takes two boolean parameters: `is_backup_alive` and `is_timer_alive`, which indicate whether the backup system and backu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cleanup_system(True, True) == 'Backup killed and Timer killed'\", \"assert cleanup_system(True, False) == 'Backup killed'\", \"assert cleanup_system(False, True) == 'Timer killed'\", \"assert cleanup_system(False, False) == 'No cleanup needed'\", \"assert cl...
{ "split": "train", "index": 68323, "acecode_id": "bigcode_python_fns_711", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function `find_smallest(numbers)` that returns the smallest integer in the list. If the list is empty, the function should return None. Please ensure your implementation handles various edge cases, including negative numbers and large integ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_smallest([3, 5, 1, 2]) == 1\", \"assert find_smallest([-1, -5, -3, -2]) == -5\", \"assert find_smallest([0, 0, 0]) == 0\", \"assert find_smallest([100, 200, 300]) == 100\", \"assert find_smallest([7]) == 7\", \"assert find_smallest([]) == None\", \"asse...
{ "split": "train", "index": 68324, "acecode_id": "evol_24205", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer array sorted in ascending order, write a function to search for a target integer in the array. If the target exists, return the first and last index of its occurrence as a tuple; otherwise, return (-1, -1). The array size is unknown, and you may only access it ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert searchRange(ArrayReader([-1,0,3,5,9,12]), 2) == (-1, -1)\", \"assert searchRange(ArrayReader([1, 3, 5, 7, 9]), 1) == (0, 0)\", \"assert searchRange(ArrayReader([10, 20, 30, 40, 50]), 60) == (-1, -1)\", \"assert searchRange(ArrayReader([7, 8, 9, 10, 10]), 10)...
{ "split": "train", "index": 68325, "acecode_id": "evol_35711", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Write a function `generate_password` that generates a secure password. The password must meet the following criteria: it must contain exactly ten characters, and include at least one uppercase letter, one lowercase letter, one digit, and one special character. The order of thes...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert len(generate_password()) == 10\", \"assert any(c.islower() for c in generate_password())\", \"assert any(c.isupper() for c in generate_password())\", \"assert any(c.isdigit() for c in generate_password())\", \"assert any(c in string.punctuation for c in gene...
{ "split": "train", "index": 68326, "acecode_id": "evol_32625", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that retrieves sensitive information for a network node from a given dictionary and returns it in a structured format. The dictionary contains the following keys: 'NODE_IP', 'NODE_PORT', 'NODE_USER', 'NODE_PWD', 'STREAM_SMART_LICEN...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retrieve_and_store_credentials({'NODE_IP': '192.168.1.1', 'NODE_PORT': '8080', 'NODE_USER': 'admin', 'NODE_PWD': 'password', 'STREAM_SMART_LICENSE': 'license1', 'STREAM_SMART_LICENSE_ATTESTATION': 'attestation1'}) == {'ip': '192.168.1.1', 'port': '8080', 'us...
{ "split": "train", "index": 68327, "acecode_id": "oss_1462", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the motion of a single particle in a celestial system. Your function should take the initial data of the particle, which includes its mass, initial position, and initial velocity, as well as the duration for which the simulation should run in days...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_particle_motion({'mass': 1.0, 'position': (0.0, 0.0, 0.0), 'velocity': (1.0, 0.0, 0.0)}, 5) == [0.0, 1.0, 2.0, 3.0, 4.0, 5.0]\", \"assert simulate_particle_motion({'mass': 1.0, 'position': (2.0, 0.0, 0.0), 'velocity': (2.0, 0.0, 0.0)}, 5) == [2.0, 4...
{ "split": "train", "index": 68328, "acecode_id": "oss_34989", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers as input and returns a new list containing the same integers sorted in ascending order. The input list should not be modified. For example, given the input list [4, 9, 8, 1, 5], the output should be [1, 4, 5, 8, 9].\nPlease rea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_list([4, 9, 8, 1, 5]) == [1, 4, 5, 8, 9]\", \"assert sort_list([10, -1, 3, 0]) == [-1, 0, 3, 10]\", \"assert sort_list([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert sort_list([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]\", \"assert sort_list([7, 3, 9, 5, 2]) =...
{ "split": "train", "index": 68329, "acecode_id": "evol_25697", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of employee salaries represented as integers. Write a function `calculate_salaries_summary(salaries: List[int]) -> List[Tuple[int, int]]` that returns a list of tuples where each tuple contains the employee index (0-based) and the cumulative salary up to th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_salaries_summary([4000, 5000, 6000]) == [(0, 4000), (1, 9000), (2, 15000)]\", \"assert calculate_salaries_summary([3000, 4000, 2000]) == [(0, 3000), (1, 7000), (2, 9000)]\", \"assert calculate_salaries_summary([1000]) == [(0, 1000)]\", \"assert cal...
{ "split": "train", "index": 68330, "acecode_id": "bigcode_python_fns_37689", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the Probability Density Function (PDF) of a normal distribution given a mean (mu) and standard deviation (sigma) for a specific value of x. The PDF is defined by the formula: \n\n f(x | mu, sigma) = (1 / (sigma * sqrt(...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert abs(calculate_pdf(0, 0, 1) - 0.3989422804014337) < 1e-9\", \"assert abs(calculate_pdf(1, 0, 1) - 0.24197072451914337) < 1e-9\", \"assert abs(calculate_pdf(-1, 0, 1) - 0.24197072451914337) < 1e-9\", \"assert abs(calculate_pdf(5, 5, 2) - 0.19947114020071635) <...
{ "split": "train", "index": 68331, "acecode_id": "oss_33201", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `power_funcs(max_pow)` that returns a list of lambda functions. Each lambda function should compute the successive powers of its input, starting from 1 up to `max_pow`. For example, calling `power_funcs(3)` should return a list of functions where the first ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert power_funcs(1)[0](2) == 2\", \"assert power_funcs(2)[0](3) == 3\", \"assert power_funcs(2)[1](3) == 9\", \"assert power_funcs(3)[0](4) == 4\", \"assert power_funcs(3)[1](4) == 16\", \"assert power_funcs(3)[2](4) == 64\", \"assert power_funcs(4)[0](5) == 5\",...
{ "split": "train", "index": 68332, "acecode_id": "evol_468", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of tuples, each tuple can contain one or more indices. Implement a function `get_elements_at_indices(tuples: List[Tuple[int]], lst: List[Any]) -> List[Tuple[Any]]` that returns a list of tuples, where each tuple corresponds to the elements in `lst` at the indices s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_elements_at_indices([(0, 2), (), (1,)], ['a', 'b', 'c', 'd']) == [('a', 'c'), (), ('b',)]\", \"assert get_elements_at_indices([(0, 1), (2, 3)], ['x', 'y', 'z', 'w']) == [('x', 'y'), ('z', 'w')]\", \"assert get_elements_at_indices([(0, 3)], [1, 2, 3]) == ...
{ "split": "train", "index": 68333, "acecode_id": "bigcode_python_fns_30991", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D list of integers representing a tensor, write a function `eval_tensor_density(tensor: List[List[int]]) -> float` that calculates the density of the tensor. The density is defined as the fraction of non-zero values in the tensor compared to the total number of element...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert eval_tensor_density([[0, 0, 0], [0, 0, 0]]) == 0.0\", \"assert eval_tensor_density([[1, 1], [1, 1]]) == 1.0\", \"assert eval_tensor_density([[1, 2, 3], [0, 0, 0], [4, 5, 6]]) == 0.6666666666666666\", \"assert eval_tensor_density([[0, 1], [2, 0]]) == 0.5\", \...
{ "split": "train", "index": 68334, "acecode_id": "bigcode_python_fns_36913", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with managing a list of squads in a software project management system. Each squad has a unique ID, a name, and associated database information. Implement a function `buscar_por_id(squads: List[Squad], id: int) -> Squad` that takes a list of `Squad` objects and a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert buscar_por_id([], 1) == None\", \"assert buscar_por_id([Squad(1, 'Alpha', 'MySQL')], 1) == Squad(1, 'Alpha', 'MySQL')\", \"assert buscar_por_id([Squad(1, 'Alpha', 'MySQL'), Squad(2, 'Beta', 'PostgreSQL')], 2) == Squad(2, 'Beta', 'PostgreSQL')\", \"assert bus...
{ "split": "train", "index": 68335, "acecode_id": "oss_14390", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function to find the maximum value in the array without using any built-in standard library functions. The function should return 'Array is empty' if the input array is empty. Your solution should handle large-scale inputs efficiently.\nP...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max([5, 10, 8, 2345, 89076, 544, 334, 65, 78]) == 89076\", \"assert find_max([1, 3, 2, 5, 4]) == 5\", \"assert find_max([-10, -20, -30]) == -10\", \"assert find_max([1000, 500, 250]) == 1000\", \"assert find_max([0, 0, 0]) == 0\", \"assert find_max([]) ...
{ "split": "train", "index": 68336, "acecode_id": "evol_15921", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a URL. Implement a function that simulates the process of powering on an inverter which, under certain conditions, raises a 'ZeversolarError'. The inverter can only be powered on if the URL does not contain the word 'test'. If the URL contain...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert power_on_inverter('http://example.com') == 'Inverter powered on successfully'\", \"assert power_on_inverter('https://myinverter.com') == 'Inverter powered on successfully'\", \"assert power_on_inverter('http://mydevice.com') == 'Inverter powered on successfu...
{ "split": "train", "index": 68337, "acecode_id": "bigcode_python_fns_43330", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the locking of contents in a hierarchical structure of nodes. Each node can contain other nodes (children), and you need to lock all the child nodes of a given node if they are marked as non-editable. The function should ta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lock_all_non_editable_nodes({'editable': False, 'children': []}) == [{'editable': False, 'children': []}]\", \"assert lock_all_non_editable_nodes({'editable': True, 'children': []}) == []\", \"assert lock_all_non_editable_nodes({'editable': False, 'children'...
{ "split": "train", "index": 68338, "acecode_id": "bigcode_python_fns_8239", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a list of items, where each item is a dictionary containing two keys: 'comic_urls' and 'novel_urls'. Each of these keys maps to a list of URLs (strings). Your task is to create a function that takes this list of items as input and returns the total number of URLs ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_total_urls([{'comic_urls': [], 'novel_urls': []}]) == 0\", \"assert count_total_urls([{'comic_urls': ['url1'], 'novel_urls': ['url2', 'url3', 'url4']}, {'comic_urls': ['url5'], 'novel_urls': ['url6']}]) == 6\", \"assert count_total_urls([]) == 0\", \"a...
{ "split": "train", "index": 68339, "acecode_id": "bigcode_python_fns_18488", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing survey data related to job preferences. The survey responses are represented as a list of integers where each integer corresponds to a respondent's opinion on whether a job in the industry adds value to a resume. The values range from 1 to 4, where...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_job_preferences([1, 2, 3, 4, 4, 3, 2, 1]) == {1: 2, 2: 2, 3: 2, 4: 2}\", \"assert analyze_job_preferences([1, 1, 1, 1]) == {1: 4, 2: 0, 3: 0, 4: 0}\", \"assert analyze_job_preferences([4, 4, 4, 4]) == {1: 0, 2: 0, 3: 0, 4: 4}\", \"assert analyze_job_...
{ "split": "train", "index": 68340, "acecode_id": "oss_20490", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `add_values(a: int, b: int) -> int` that takes two integers as input and returns their sum. The function should be able to handle both positive and negative integers. Please ensure that the implementation is straightforward and efficient.\nPlease reason ste...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_values(1, 2) == 3\", \"assert add_values(-1, -2) == -3\", \"assert add_values(0, 0) == 0\", \"assert add_values(100, 200) == 300\", \"assert add_values(-100, 50) == -50\", \"assert add_values(5, -5) == 0\", \"assert add_values(123456, 654321) == 777777\"...
{ "split": "train", "index": 68341, "acecode_id": "evol_31956", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string containing a person's full name, write a function `extract_first_name(text: str) -> str` that extracts and returns the first name from the provided string. The first name is defined as the first sequence of alphabetic characters at the beginning of the string. If...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_first_name('John Doe is a programmer') == 'John'\", \"assert extract_first_name('Jane Smith is a doctor') == 'Jane'\", \"assert extract_first_name('Alice') == 'Alice'\", \"assert extract_first_name('Charlie Brown is a teacher') == 'Charlie'\", \"asse...
{ "split": "train", "index": 68342, "acecode_id": "evol_23296", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple decorator function, `with_patch_inspect(f)`, that modifies the behavior of two functions from the `inspect` module: `inspect.findsource` and `inspect.getargs`. The decorator should temporarily replace these functions with the custom imp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert with_patch_inspect(some_function) is not None\", \"assert inspect.findsource == original_findsource\", \"assert inspect.getargs == original_getargs\", \"assert inspect.findsource == original_findsource\", \"assert inspect.getargs == original_getargs\", \"ass...
{ "split": "train", "index": 68343, "acecode_id": "bigcode_python_fns_14507", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `retrieve_graph` that simulates the retrieval of a graph based on specified parameters. The function takes in several parameters that define the behavior of the graph retrieval process. The function should return a dictionary representing...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retrieve_graph() == {'directed': False, 'preprocess': 'auto', 'load_nodes': True, 'load_node_types': True, 'load_edge_weights': True, 'auto_enable_tradeoffs': True, 'version': '4.46'}\", \"assert retrieve_graph(directed=True) == {'directed': True, 'preproces...
{ "split": "train", "index": 68344, "acecode_id": "bigcode_python_fns_30397", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `hex_to_int(hex_list)` that takes a list of hexadecimal strings and converts them to a list of integers. The function should ignore any invalid hexadecimal entries (non-hexadecimal values) and return only a list of valid integers. A valid hexadecimal string con...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hex_to_int(['23', '45', '7', '67', 'G5', '1Z']) == [35, 69, 7, 103]\", \"assert hex_to_int(['1A', '2B', '3C', '4D', '5E']) == [26, 43, 60, 77, 94]\", \"assert hex_to_int(['FF', 'G1', '1F', '123', 'XYZ']) == [255, 31, 291]\", \"assert hex_to_int(['0', '1', '2...
{ "split": "train", "index": 68345, "acecode_id": "evol_15207", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function `get_n_largest_elements(n, lst)` that takes an integer `n` and a list of integers `lst`, and returns the `n` largest elements from the list in descending order. If there are fewer than `n` elements in the list, return all the elements sorted in descending order...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_n_largest_elements(3, [1, 3, 5, 7, 9]) == [9, 7, 5]\", \"assert get_n_largest_elements(2, [1, 2, 2, 3, 4]) == [4, 3]\", \"assert get_n_largest_elements(5, [5, 3, 1, 4, 2]) == [5, 4, 3, 2, 1]\", \"assert get_n_largest_elements(4, [10, 9, 8, 7, 6]) == [10,...
{ "split": "train", "index": 68346, "acecode_id": "bigcode_python_fns_41530", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the total expected value of a binomial probability distribution. The binomial probability distribution models the number of successes in a fixed number of independent Bernoulli trials, each with the same probability of su...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_expected_value(0, 0.5) == 0.0\", \"assert total_expected_value(1, 0.0) == 0.0\", \"assert total_expected_value(1, 1.0) == 1.0\", \"assert total_expected_value(2, 0.0) == 0.0\", \"assert total_expected_value(2, 0.5) == 1.0\", \"assert total_expected_val...
{ "split": "train", "index": 68347, "acecode_id": "oss_25007", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given two lists: 'y' which contains the actual binary labels (0 or 1) of a classification problem, and 'yh' which contains the predicted probabilities (between 0 and 1) for the positive class. Write a function `calculate_metrics(y: List[int], yh: List[float], y_thresh: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_metrics([1, 1, 1, 1], [0.7, 0.8, 0.9, 0.95], 0.5) == {'accuracy': 1.0, 'precision': 1.0, 'recall': 1.0, 'false_positive_rate': 0.0, 'false_negative_rate': 0.0}\", \"assert calculate_metrics([0, 0, 0, 0], [0.1, 0.2, 0.3, 0.4], 0.5) == {'accuracy': 1...
{ "split": "train", "index": 68348, "acecode_id": "bigcode_python_fns_24380", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing sequences of characters that may include smiley faces. A smiley face is defined as either ':)' or ':D', and can optionally include a nose represented by '-' or '~'. Your task is to implement a function that counts the number of valid...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_smileys([':)', ':D', ':~D', ':-)']) == 4\", \"assert count_smileys([':)', ':(', ':D', ':~)']) == 3\", \"assert count_smileys([':~)', ':~D']) == 2\", \"assert count_smileys([':)', ':-)', ':D', ':-D']) == 4\", \"assert count_smileys([':(', ':|', ':D', ':...
{ "split": "train", "index": 68349, "acecode_id": "bigcode_python_fns_21911", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings, implement a function that returns the longest word in the list along with its length and index. If there are multiple words of the longest length, return the first one encountered. The comparison should be space-and-case-sensitive.\nPlease reason step b...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_longest_word(['apple', 'banana', 'cherry']) == ('banana', 6, 1)\", \"assert find_longest_word(['cat', 'dog', 'elephant']) == ('elephant', 8, 2)\", \"assert find_longest_word(['hello', 'world']) == ('hello', 5, 0)\", \"assert find_longest_word(['The', 'q...
{ "split": "train", "index": 68350, "acecode_id": "evol_35554", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of a game. The game has a special rule where if the current score is the same as the previous score, the current score is not counted towards the final score. Your task is to write a function `calculate_final_score(scores...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_final_score([1, 1, 1, 1, 1]) == 1\", \"assert calculate_final_score([0]) == 0\", \"assert calculate_final_score([]) == 0\", \"assert calculate_final_score([-1, -1, 0, 1, 1]) == 0\", \"assert calculate_final_score([3, 3, 3, 3, 3, 4, 4, 5]) == 12\", ...
{ "split": "train", "index": 68351, "acecode_id": "oss_1207", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that encodes a list of strings using a specified encoding. Your function should take two arguments: a list of strings and an encoding type. The function should return a list of encoded byte strings. If a string is encoded using the sp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert encode_strings(['Hello', 'World'], 'utf-8') == [b'Hello', b'World']\", \"assert encode_strings(['Hello', 'World'], 'latin-1') == [b'Hello', b'World']\", \"assert encode_strings(['Hello', 'World'], 'ascii') == [b'Hello', b'World']\", \"assert encode_strings([...
{ "split": "train", "index": 68352, "acecode_id": "oss_30415", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a log message based on a provided logging level. The function should take a string `log_level` as input, which represents the desired logging level (can be 'INFO', 'WARNING', 'CRITICAL', or 'DEBUG'). The function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_log_message('INFO') == 'INFO Logging Level -- Enabled'\", \"assert generate_log_message('WARNING') == 'WARNING Logging Level -- Enabled'\", \"assert generate_log_message('CRITICAL') == 'CRITICAL Logging Level -- Enabled'\", \"assert generate_log_mes...
{ "split": "train", "index": 68353, "acecode_id": "bigcode_python_fns_8774", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function `timestamps` that generates Timestamp objects based on given parameters. A Timestamp object consists of a Duration and a boolean flag indicating whether the timestamp is before the epoch. The Duration is defined by two attribut...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert timestamps([(1, 500), (0, 999)], [True, False]) == [Timestamp(Duration(1, 500), True), Timestamp(Duration(0, 999), False)]\", \"assert timestamps([(0, 0)], [True]) == [Timestamp(Duration(0, 0), True)]\", \"assert timestamps([(2, 0), (3, 999)], [False, True])...
{ "split": "train", "index": 68354, "acecode_id": "oss_28082", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating a simple HTML template string based on a given template name and a context object name. Write a function `generate_template(template_name: str, context_object_name: str) -> str` that takes in the following parameters: \n- `template_name`: A string...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_template('index', 'users') == '<html>\\\\n<head>\\\\n<title>index</title>\\\\n</head>\\\\n<body>\\\\n<h1>users</h1>\\\\n</body>\\\\n</html>'\", \"assert generate_template('about', 'posts') == '<html>\\\\n<head>\\\\n<title>about</title>\\\\n</head>\\...
{ "split": "train", "index": 68355, "acecode_id": "oss_12016", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given three strings representing three different CI environment variables: `pull_request`, `branch`, and `commit`. Your task is to create a function `tag_from_ci_env_vars(ci_name: str, pull_request_var: str, branch_var: str, commit_var: str) -> str` that constructs a CI...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert tag_from_ci_env_vars('CI', '1', 'main', 'abcdef1234567890') == 'pull_1'\", \"assert tag_from_ci_env_vars('CI', 'false', 'dev', 'abcdef1234567890') == 'dev_abcdef1234'\", \"assert tag_from_ci_env_vars('CI', '', 'feature', 'fedcba0987654321') == 'feature_fedcb...
{ "split": "train", "index": 68356, "acecode_id": "bigcode_python_fns_40975", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given two lists of integers, one containing distinct prime numbers and the other containing their corresponding frequencies, implement a function named 'prime_lcm_list' that returns the Least Common Multiple (LCM) of the primes raised to their respective frequencies. The functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prime_lcm_list([2, 7, 11], [2, 1, 1]) == 308\", \"assert prime_lcm_list([5, 7, 19], [1, 1, 1]) == 665\", \"assert prime_lcm_list([2, 5, 13, 17], [1, 1, 1, 1]) == 2210\", \"assert prime_lcm_list([2, 3, 5, 7, 13], [1, 1, 1, 1, 1]) == 2730\", \"assert prime_lcm...
{ "split": "train", "index": 68357, "acecode_id": "evol_29373", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a systemd service file name based on a given project name. The service file name should have the format '{project_name}.service'. Implement the function 'generate_service_file_name' that takes a string 'project_name' as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_service_file_name('my_project') == 'my_project.service'\", \"assert generate_service_file_name('test_service') == 'test_service.service'\", \"assert generate_service_file_name('example') == 'example.service'\", \"assert generate_service_file_name(''...
{ "split": "train", "index": 68358, "acecode_id": "bigcode_python_fns_4552", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `search_songs(songs: List[Dict[str, Union[str, datetime]]], query: str) -> List[Dict[str, Union[str, datetime]]]` that searches through a list of music entries for songs that match a given title or artist name. Each music entry is represented as a dictionar...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_songs([{'title': 'Song A', 'description': 'Desc A', 'published_date': '2023-01-01', 'audio_link': 'linkA', 'lyric_text': 'Lyrics A', 'artist': 'Artist A'}], 'Song A') == [{'title': 'Song A', 'description': 'Desc A', 'published_date': '2023-01-01', 'au...
{ "split": "train", "index": 68359, "acecode_id": "evol_30431", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Write a Python function that takes a string as input and returns a list of lexemes containing the characters 'x' and 'y' in immediate sequence, while ignoring any special characters, numbers, and spaces. The function should be case-sensitive, meaning it should differentiate bet...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_xy_lexemes('xy') == ['xy']\", \"assert find_xy_lexemes('No matches here!') == []\", \"assert find_xy_lexemes('x and y') == []\", \"assert find_xy_lexemes('@x@y!') == []\", \"assert find_xy_lexemes('Hello xy world!') == ['xy']\", \"assert find_xy_lexemes...
{ "split": "train", "index": 68360, "acecode_id": "evol_8770", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given a function that simulates a web request. The function should attempt to execute a request a certain number of times if it fails, with a specified delay between each attempt. Implement a function `make_request(url: str, method: str, max_retries: int, retry_interval...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert make_request('http://example.com', 'PUT', 5, 1) in ['Request Successful', 'Request Failed']\", \"assert make_request('http://example.com', 'DELETE', 0, 1) == 'Request Failed'\", \"assert make_request('http://example.com', 'GET', 10, 0) in ['Request Successfu...
{ "split": "train", "index": 68361, "acecode_id": "bigcode_python_fns_43335", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `weighting_system_z()` that simulates a Z-weighting filter represented as a polynomial transfer function. The function should return a tuple containing two lists: the first list represents the numerator of the transfer function, while the second list repres...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert weighting_system_z() == ([1], [1])\", \"assert weighting_system_z() == ([1], [1])\", \"assert weighting_system_z() == ([1], [1])\", \"assert weighting_system_z() == ([1], [1])\", \"assert weighting_system_z() == ([1], [1])\", \"assert weighting_system_z() ==...
{ "split": "train", "index": 68362, "acecode_id": "bigcode_python_fns_9121", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function in Python that finds the maximum number in a list without using the built-in max function. Your function should handle the following edge cases: return a message if the list is empty, correctly handle a list with one number, and consider duplicate elements with...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_number([15, 32, 76, 48, 90, 22]) == 90\", \"assert max_number([]) == 'The list is empty.'\", \"assert max_number([45]) == 45\", \"assert max_number([75, 75, 75]) == 75\", \"assert max_number([-10, -5, -1]) == -1\", \"assert max_number([1, 2, 3, 4, 5]) ==...
{ "split": "train", "index": 68363, "acecode_id": "evol_17509", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of HSV color values and classifies each color based on a simple thresholding mechanism. Each HSV color is represented as a tuple (H, S, V) where H is the hue (0-179), S is the saturation (0-255), and V is the value (0-25...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_colors([(0, 255, 255), (60, 100, 100), (120, 130, 150)]) == ['Vibrant', 'Dull', 'Vibrant']\", \"assert classify_colors([(180, 255, 255), (90, 127, 200), (300, 200, 255)]) == ['Vibrant', 'Dull', 'Vibrant']\", \"assert classify_colors([(0, 0, 0), (0, ...
{ "split": "train", "index": 68364, "acecode_id": "oss_13101", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the prices of items in a store. Your task is to implement a function that calculates the maximum profit you can achieve by buying and selling one item. You can only complete one transaction (i.e., buy one and sell one item). The fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxProfit([7, 1, 5, 3, 6, 4]) == 5\", \"assert maxProfit([7, 6, 4, 3, 1]) == 0\", \"assert maxProfit([2, 4, 1]) == 2\", \"assert maxProfit([1, 2]) == 1\", \"assert maxProfit([5]) == 0\", \"assert maxProfit([3, 2, 6, 5, 0, 3]) == 4\", \"assert maxProfit([1, 2...
{ "split": "train", "index": 68365, "acecode_id": "bigcode_python_fns_40484", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `max_value(nums: List[int]) -> int` that takes a list of integers `nums` as input and returns the maximum value in that list. If the list is empty, the function should return None.\nPlease reason step by step, then write a self-contained Python solution. Gi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_value([3, 5, 1, 2, 4]) == 5\", \"assert max_value([-1, -3, -2, -4]) == -1\", \"assert max_value([0, 0, 0]) == 0\", \"assert max_value([10]) == 10\", \"assert max_value([]) == None\", \"assert max_value([1, 2, 3, 4, 5]) == 5\", \"assert max_value([-5, -1,...
{ "split": "train", "index": 68366, "acecode_id": "evol_31128", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are working on a version control system and need to implement a feature that retrieves the repository name and the author's username from a given code repository URL. The repository URL follows the format `<authorname>/<reponame>`. Write a function `parseRepositoryURL` that...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parseRepositoryURL('benrdavison/brd_mod') == ('brd_mod', 'benrdavison')\", \"assert parseRepositoryURL('user123/projectA_module') == ('projectA_module', 'user123')\", \"assert parseRepositoryURL('alice/my_repo') == ('my_repo', 'alice')\", \"assert parseRepos...
{ "split": "train", "index": 68367, "acecode_id": "oss_21941", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a navigation expression represented as a dictionary, which contains either a 'from' or 'to' key. Each key maps to a value that can be of type 'qname', 'concept', 'set', or 'list'. Your task is to implement a function that extracts the concepts from the navigation ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert nav_get_element({'from': {'type': 'qname', 'value': 'concept1'}}, 'from', {'concept1': 'Concept 1'}) == {'Concept 1'}\", \"assert nav_get_element({'to': {'type': 'concept', 'value': 'Concept 2'}}, 'to', {'Concept 2': 'Concept 2'}) == {'Concept 2'}\", \"asser...
{ "split": "train", "index": 68368, "acecode_id": "bigcode_python_fns_28575", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `caesar_encrypt(message: str, key: int) -> str` that encrypts the input text `message` using the Caesar cipher encryption technique with a given shift value `key`. The function should maintain the case of each letter and leave non-alphabetic characters unch...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert caesar_encrypt('Hello World', 3) == 'Khoor Zruog'\", \"assert caesar_encrypt('abc', 1) == 'bcd'\", \"assert caesar_encrypt('xyz', 2) == 'zab'\", \"assert caesar_encrypt('1234', 10) == '1234'\", \"assert caesar_encrypt('', 5) == ''\", \"assert caesar_encrypt(...
{ "split": "train", "index": 68369, "acecode_id": "evol_592", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `inputs` and `shortcut`, implement a function that returns a new list where each element is the sum of the corresponding elements from `inputs` and `shortcut`. If the lists are of different lengths, ignore the extra elements in the longer list. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_shortcut([1, 2, 3], [4, 5, 6]) == ([5, 7, 9], [5, 7, 9])\", \"assert add_shortcut([1, 2], [3, 4, 5]) == ([4, 6], [4, 6])\", \"assert add_shortcut([], [1, 2, 3]) == ([], [])\", \"assert add_shortcut([1, 2, 3], []) == ([1, 2, 3], [1, 2, 3])\", \"assert add...
{ "split": "train", "index": 68370, "acecode_id": "bigcode_python_fns_14093", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function called `power` that computes the result of a base number raised to a specified exponent. The function should take two parameters: an integer `base` and a non-negative integer `exponent`. The function should return the computed power as an integer. For examp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert power(2, 3) == 8\", \"assert power(5, 0) == 1\", \"assert power(3, 2) == 9\", \"assert power(10, 1) == 10\", \"assert power(2, 10) == 1024\", \"assert power(1, 100) == 1\", \"assert power(0, 5) == 0\", \"assert power(7, 3) == 343\", \"assert power(4, 4) == 2...
{ "split": "train", "index": 68371, "acecode_id": "evol_10436", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function `calculate_arc_length(radius: float, angle: float) -> float` that calculates the arc length of a circle given its radius and the subtended angle in degrees. The arc length can be computed using the formula: arc_length = radius * (angle in radians). You s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_arc_length(13, 60) == 13 * (math.radians(60))\", \"assert calculate_arc_length(10, 90) == 10 * (math.radians(90))\", \"assert calculate_arc_length(5, 180) == 5 * (math.radians(180))\", \"assert calculate_arc_length(15, 30) == 15 * (math.radians(30)...
{ "split": "train", "index": 68372, "acecode_id": "evol_4511", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a host name and its weight as input parameters and returns a string representation of a weighted host in the format 'WeighedHost [host: <host_name>, weight: <weight>]' where <host_name> is the provided host name and <weight> is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_weighted_host('localhost', 1.0) == 'WeighedHost [host: localhost, weight: 1.0]'\", \"assert format_weighted_host('example.com', 2.5) == 'WeighedHost [host: example.com, weight: 2.5]'\", \"assert format_weighted_host('192.168.1.1', 0.75) == 'WeighedHos...
{ "split": "train", "index": 68373, "acecode_id": "oss_24701", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function to manage a library of neural probes used in neuroscience research. The library contains information about different types of probes, such as their names and the number of channels they have. Your goal is to create a function `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_probe('1x32_buzsaki').name == '1x32_buzsaki' and load_probe('1x32_buzsaki').channels == list(range(32))\", \"assert load_probe('1x16_probe').name == '1x16_probe' and load_probe('1x16_probe').channels == list(range(16))\", \"assert load_probe('1x32_buzsa...
{ "split": "train", "index": 68374, "acecode_id": "oss_11218", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given an integer n, write a function `bit_width(n: int) -> int` that computes the minimum number of bits required to represent the integer in binary. The representation should account for both positive and negative integers using two's complement format. If n is 0, the function...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bit_width(0) == 0\", \"assert bit_width(1) == 1\", \"assert bit_width(2) == 2\", \"assert bit_width(3) == 2\", \"assert bit_width(4) == 3\", \"assert bit_width(5) == 3\", \"assert bit_width(15) == 4\", \"assert bit_width(16) == 5\", \"assert bit_width(31) ==...
{ "split": "train", "index": 68375, "acecode_id": "bigcode_python_fns_30338", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the number of tasks completed by each employee in a company for a month. Your task is to implement a function that calculates the average number of tasks completed per employee, rounded to the nearest integer. If the list is empty, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_tasks([10, 20, 30]) == 20\", \"assert average_tasks([1, 2, 3, 4, 5]) == 3\", \"assert average_tasks([5, 15, 25, 35]) == 20\", \"assert average_tasks([]) == 0\", \"assert average_tasks([7]) == 7\", \"assert average_tasks([100, 200]) == 150\", \"assert...
{ "split": "train", "index": 68376, "acecode_id": "bigcode_python_fns_5686", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that checks whether the total sum of all elements in an integer array is within two specified limits, and also verifies if the sum of exactly half of the array's elements falls within the same limits. The length of the input array will always be even.\nPlease r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_within_bounds([0, 0, 0, 0], 0, 0) == True\", \"assert sum_within_bounds([-5, -5, 5, 5], -10, 10) == True\", \"assert sum_within_bounds([1, 1, 1, 1], 2, 4) == True\", \"assert sum_within_bounds([1, 2, 3, 4], 10, 20) == False\", \"assert sum_within_bounds(...
{ "split": "train", "index": 68377, "acecode_id": "evol_23677", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a dictionary containing sequence definitions. Each definition may contain the keys 'SEQ1_LEN', 'SEQ1_CTGLEN', 'SEQ2_LEN', and 'SEQ2_CTGLEN'. Your task is to implement a function `load_seq_sizes(def_vars: Dict[str, str]) -> Tuple[Dict[str, int], Dict[str, int]]` th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_seq_sizes({'SEQ1_LEN': 'file1.txt', 'SEQ2_LEN': 'file2.txt'}) == ({'chr1': 100, 'chr2': 200}, {'chr1': 150, 'chr2': 250})\", \"assert load_seq_sizes({'SEQ1_CTGLEN': 'file1.txt', 'SEQ2_CTGLEN': 'file2.txt'}) == ({'chr1': 100, 'chr2': 200}, {'chr1': 150, ...
{ "split": "train", "index": 68378, "acecode_id": "bigcode_python_fns_15286", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a simple cache system for storing string values. The function should take a list of strings as input and return a dictionary where each string is a key, and its corresponding value is the number of times that string appears...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cache_strings([]) == {}\", \"assert cache_strings(['apple', 'banana', 'apple']) == {'apple': 2, 'banana': 1}\", \"assert cache_strings(['cat', 'dog', 'cat', 'cat', 'dog']) == {'cat': 3, 'dog': 2}\", \"assert cache_strings(['hello', 'world', 'hello', 'hello']...
{ "split": "train", "index": 68379, "acecode_id": "oss_3918", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write an efficient program to calculate the Least Common Multiple (LCM) of a given list of integers. The list may contain up to 10^3 elements, each ranging between 1 and 10^9. Your implementation should focus on performance optimization. Implement a function `lcm(numbers: List[...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lcm([4, 6]) == 12\", \"assert lcm([21, 14, 7]) == 42\", \"assert lcm([10, 25, 5]) == 50\", \"assert lcm([12, 15, 20]) == 60\", \"assert lcm([9, 3, 18]) == 18\", \"assert lcm([1, 1, 1]) == 1\", \"assert lcm([2, 3, 5]) == 30\", \"assert lcm([8, 12, 16]) == 48\...
{ "split": "train", "index": 68380, "acecode_id": "evol_3617", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that simulates the parsing of command-line arguments for a music change point detection application. Your function should take a list of strings representing command-line arguments and return a dictionary with the parsed parameters. The fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_arguments(['--cfg', 'custom_settings.yaml']) == {'cfg': 'custom_settings.yaml', 'file': None}\", \"assert parse_arguments(['--file', 'audio.mp3']) == {'cfg': './settings.yaml', 'file': 'audio.mp3'}\", \"assert parse_arguments(['--cfg', 'config.yaml', '...
{ "split": "train", "index": 68381, "acecode_id": "bigcode_python_fns_10324", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a leaderboard ID as input and returns a formatted string that describes the leaderboard's unique identifier. The function should follow the signature `def get_leaderboard_description(leaderboardId: float) -> str:`. The returned...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_leaderboard_description(1.0) == 'Leaderboard ID: 1.0'\", \"assert get_leaderboard_description(2.5) == 'Leaderboard ID: 2.5'\", \"assert get_leaderboard_description(3.75) == 'Leaderboard ID: 3.75'\", \"assert get_leaderboard_description(4.2) == 'Leaderboa...
{ "split": "train", "index": 68382, "acecode_id": "bigcode_python_fns_1514", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D array representing a binary image (where 0 represents black pixels and 1 represents white pixels), implement a function that randomly flips the image horizontally with a 50% chance. The function should take the binary image as input and return the modified image. If ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert random_flip([[0]]) in [[[0]], [[1]]]\", \"assert random_flip([[1]]) in [[[1]], [[0]]]\", \"assert random_flip([[0, 0], [1, 1]]) in [[[0, 0], [1, 1]], [[0, 0], [1, 1]]]\", \"assert random_flip([[1, 0], [0, 1]]) in [[[0, 1], [1, 0]], [[1, 0], [0, 1]]]\", \"ass...
{ "split": "train", "index": 68383, "acecode_id": "bigcode_python_fns_48826", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the total area covered by different land cover types in a given block of raster data. The raster data is represented as a 2D array where each unique integer value corresponds to a specific land cover type. Your function should take the following ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_land_cover_area(0, 0, 3, 3, [[True, True, True], [True, True, True], [True, True, True]], [[1, 1, 1], [1, 1, 2], [2, 2, 2]], {1: 1, 2: 1}) == {1: 5, 2: 4}\", \"assert calculate_land_cover_area(0, 0, 3, 3, [[True, True, True], [True, True, True], [T...
{ "split": "train", "index": 68384, "acecode_id": "oss_25724", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given two integers, write a function `compute_hcf(x: int, y: int) -> int` that returns the highest common factor (HCF) of the two numbers. The HCF is the largest positive integer that divides both numbers without leaving a remainder.\nPlease reason step by step, then write a se...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_hcf(12, 18) == 6\", \"assert compute_hcf(100, 75) == 25\", \"assert compute_hcf(54, 24) == 6\", \"assert compute_hcf(21, 14) == 7\", \"assert compute_hcf(17, 19) == 1\", \"assert compute_hcf(0, 5) == 5\", \"assert compute_hcf(5, 0) == 5\", \"assert c...
{ "split": "train", "index": 68385, "acecode_id": "evol_26632", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that creates a decorator for a given function. The decorator should add attributes to the function that indicate whether it can be extended and provide a way to list all functions that extend it. The decorator should return a new func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extensible(lambda x: x)(5) == 5\", \"assert extensible(lambda x: x + 1)(5) == 6\", \"assert extensible(lambda x: x * 2)(5) == 10\", \"assert extensible(lambda: 'Hello, World!')() == 'Hello, World!'\", \"assert extensible(lambda x, y: x + y)(2, 3) == 5\", \"a...
{ "split": "train", "index": 68386, "acecode_id": "bigcode_python_fns_32226", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves all posts from a hypothetical database in-memory representation. The database is represented as a list of dictionaries, where each dictionary contains details of a post, such as 'id', 'title', and 'content'. Write a functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_all_posts([]) == []\", \"assert get_all_posts([{'id': 1, 'title': 'First Post', 'content': 'This is the content of the first post.'}]) == [{'id': 1, 'title': 'First Post', 'content': 'This is the content of the first post.'}]\", \"assert get_all_posts([{...
{ "split": "train", "index": 68387, "acecode_id": "bigcode_python_fns_47299", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program to control the timing of events based on a given beats per minute (BPM) value. Your goal is to write a function `calculate_beat_duration(bpm)` that takes an integer BPM as input and returns the duration of each beat in seconds. The duratio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_beat_duration(120) == 0.5\", \"assert calculate_beat_duration(60) == 1.0\", \"assert calculate_beat_duration(240) == 0.25\", \"assert calculate_beat_duration(30) == 2.0\", \"assert calculate_beat_duration(180) == 0.3333333333333333\", \"assert calc...
{ "split": "train", "index": 68388, "acecode_id": "oss_22669", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes two integers as input and returns their difference. The difference is calculated as the first integer minus the second integer. Write a function named 'subtract_two_numbers' that accepts two parameters, 'x' and 'y'.\nPlease reason step by step, t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert subtract_two_numbers(10, 5) == 5\", \"assert subtract_two_numbers(0, 0) == 0\", \"assert subtract_two_numbers(-5, -5) == 0\", \"assert subtract_two_numbers(100, 50) == 50\", \"assert subtract_two_numbers(1, 1) == 0\", \"assert subtract_two_numbers(-10, 5) ==...
{ "split": "train", "index": 68389, "acecode_id": "evol_3926", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings `layer_options` and a list of dictionaries `local_options`. Your task is to create a function that extracts the parameters from `local_options` that match the keys in `layer_options`. The function should return a dictionary containing only the pa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_matching_parameters(['conv1', 'conv2'], [{'conv1': 32, 'conv3': 64}, {'conv2': 64, 'conv4': 128}]) == {'conv1': 32, 'conv2': 64}\", \"assert get_matching_parameters(['dense'], [{'dense': 128, 'dropout': 0.5}, {'conv2': 64}]) == {'dense': 128}\", \"assert...
{ "split": "train", "index": 68390, "acecode_id": "bigcode_python_fns_18199", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a function `twoN(N)` that takes an integer `N` as input and returns `2*N`. Your task is to implement a function `final_value(N: int, K: int) -> int` that calculates the final value of `N` after performing a series of `K` iterations of the `twoN` function on the in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert final_value(1, 0) == 1\", \"assert final_value(1, 1) == 2\", \"assert final_value(1, 2) == 4\", \"assert final_value(1, 3) == 8\", \"assert final_value(2, 0) == 2\", \"assert final_value(2, 1) == 4\", \"assert final_value(2, 2) == 8\", \"assert final_value(2...
{ "split": "train", "index": 68391, "acecode_id": "oss_7950", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a bi-dimensional matrix and a number 'n', implement a function that returns the 'n' largest unique elements in the matrix along with their respective positions (in terms of row and column indices). The output should be a list of strings formatted as 'Value: X at position:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_largest_elements([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 2) == ['Value: 9 at position: Row-2 Col-2', 'Value: 8 at position: Row-2 Col-1']\", \"assert find_largest_elements([[1, 2], [3, 4]], 4) == ['Value: 4 at position: Row-1 Col-1', 'Value: 3 at position: R...
{ "split": "train", "index": 68392, "acecode_id": "evol_27605", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a boolean variable `magic_flag`, implement a function `no_conjugate_member(magic_flag: bool) -> Union[float, complex]` that returns a floating-point number if `magic_flag` is True, or returns the conjugate of a complex number (1.0j) if `magic_flag` is False. The function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert no_conjugate_member(True) == 1.0\", \"assert no_conjugate_member(True) == 1.0\", \"assert no_conjugate_member(True) == 1.0\", \"assert no_conjugate_member(True) == 1.0\", \"assert no_conjugate_member(True) == 1.0\", \"assert no_conjugate_member(True) == 1.0\...
{ "split": "train", "index": 68393, "acecode_id": "bigcode_python_fns_11301", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function that checks the keys of a given dictionary and determines if all keys are entirely in lower case, entirely in upper case, begin with a numeral, contain special characters, or if the dictionary is empty. The function should return 'Lower' if all keys are in ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_dict_case({'a': 'apple', 'b': 'banana'}) == 'Lower'\", \"assert check_dict_case({'A': 'apple', 'B': 'banana'}) == 'Upper'\", \"assert check_dict_case({}) == 'Empty'\", \"assert check_dict_case({'lowercase': 'value'}) == 'Lower'\", \"assert check_dict_c...
{ "split": "train", "index": 68394, "acecode_id": "evol_18503", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a message processing system that receives and decodes messages. Your task is to implement a function `process_message(msg: str) -> str` that takes a hexadecimal string `msg` as input and processes it according to the following rules:\n1. If the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_message('') == ''\", \"assert process_message('zz') == 'Invalid input message'\", \"assert process_message('ghijkl') == 'Invalid input message'\", \"assert process_message('') == ''\", \"assert process_message('') == ''\", \"assert process_message('x...
{ "split": "train", "index": 68395, "acecode_id": "oss_2284", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a file upload validation system for a web application. The system should ensure that only specific file types are allowed to be uploaded based on the upload type specified. The upload type can be one of the following: 'invoice', 'id', or 'evidence'....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert file_validate('image/jpeg', 'invoice') == True\", \"assert file_validate('image/png', 'invoice') == True\", \"assert file_validate('image/jpeg', 'id') == True\", \"assert file_validate('image/png', 'id') == True\", \"assert file_validate('image/jpeg', 'evide...
{ "split": "train", "index": 68396, "acecode_id": "oss_34354", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function that finds the mode(s) of a given list of integers. The function should return a list of the mode(s). If the input list contains any non-integer values, it should raise a ValueError. If there are multiple modes, return all of them in a list. Each mode shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_modes([3, 10, 9, 8, 3, 3, 8]) == [3]\", \"assert find_modes([1, 2, 2, 3, 3, 4]) == [2, 3]\", \"assert find_modes([5, 5, 5, 1, 1, 2]) == [5]\", \"assert find_modes([4, 4, 2, 2, 2, 3]) == [2]\", \"assert find_modes([7, 8, 8, 7, 9, 9]) == [7, 8, 9]\", \"as...
{ "split": "train", "index": 68397, "acecode_id": "evol_6929", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers and a limit, determine the smallest number of changes required to make the elements of a specified subset absent from the array. You need to implement a function called `smallest_change_in_subset(arr, limit, subset)` that takes in three parameters: an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert smallest_change_in_subset([1, 2, 3, 4, 5], 1, [5]) == 1\", \"assert smallest_change_in_subset([4, 5, 6, 7], 1, [8]) == 0\", \"assert smallest_change_in_subset([10, 9, 8, 7, 6, 5], 4, [5, 6, 7]) == 3\", \"assert smallest_change_in_subset([2, 4, 6, 8], 0, [3])...
{ "split": "train", "index": 68398, "acecode_id": "evol_35796", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `print_letters` that takes a list of words as input and recursively prints each letter of every word on a separate line. The function should not return any value. For example, given the input ['Hello', 'World'], the output should be: H, e, l, l, o, W, o, r,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_letters(['Welcome', 'AI', 'Prompt', 'Generation']) == None\", \"assert print_letters(['Hello']) == None\", \"assert print_letters(['Python', 'is', 'great']) == None\", \"assert print_letters(['']) == None\", \"assert print_letters(['SingleWord']) == No...
{ "split": "train", "index": 68399, "acecode_id": "evol_243", "num_tests": 16 }