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 processing time information for class schedules. Implement a function `process_time_string` that takes a string containing time information in the format 'start_time-end_time', where both start_time and end_time are in 24-hour format with the suffix 'h' deno...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_time_string(date(2023, 9, 15), '10h-13h') == datetime(2023, 9, 15, 10, 0)\", \"assert process_time_string(date(2023, 9, 16), '09h-11h') == datetime(2023, 9, 16, 9, 0)\", \"assert process_time_string(date(2023, 9, 17), '15h-17h') == datetime(2023, 9, ...
{ "split": "train", "index": 77000, "acecode_id": "oss_23056", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `s` containing a series of components separated by colons (`:`). Your task is to write a function that removes adjacent empty components in the string and returns the modified string. The empty components are represented by consecutive colons. Write a fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_adjacent_empty_components('a::b:c::d') == 'a:b:c:d'\", \"assert remove_adjacent_empty_components('::a::b::') == 'a:b'\", \"assert remove_adjacent_empty_components('a:b:c') == 'a:b:c'\", \"assert remove_adjacent_empty_components('a:::b') == 'a:b'\", \"...
{ "split": "train", "index": 77001, "acecode_id": "oss_36343", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of mixed elements, including integers, strings, and None, implement a function `multiply_elements(my_list)` that returns the product of all valid integer values in the list. If an element cannot be converted to an integer (e.g., a string that cannot be parsed or No...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiply_elements(['1', '2', '3']) == 6\", \"assert multiply_elements([None, 'abc', 4, 5]) == 20\", \"assert multiply_elements([]) == 1\", \"assert multiply_elements([1, 2, 3, None, 4, '5']) == 120\", \"assert multiply_elements(['hello', 'world', 2, 3]) == 6...
{ "split": "train", "index": 77002, "acecode_id": "evol_10614", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that returns a sorted list of language codes supported by a web application. The function should accept a list of language codes as input, where each language code is a string representing a locale (e.g., 'en', 'fr', 'es'). The function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_supported_languages(['fr', 'es', 'de']) == ['de', 'en', 'es', 'fr']\", \"assert get_supported_languages(['en', 'fr', 'es']) == ['en', 'es', 'fr']\", \"assert get_supported_languages(['es', 'it', 'fr']) == ['en', 'es', 'fr', 'it']\", \"assert get_supporte...
{ "split": "train", "index": 77003, "acecode_id": "bigcode_python_fns_46865", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines the CSS class name for a given job offer state. The function should take a string representing the job offer state and return the corresponding CSS class name. The possible job offer states are 'active', 'inactive', and 'a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_css_class('active') == 'label-active'\", \"assert get_css_class('inactive') == 'label-inactive'\", \"assert get_css_class('archived') == 'label-archived'\", \"assert get_css_class('unknown') == 'label-unknown'\", \"assert get_css_class('ACTIVE') == 'labe...
{ "split": "train", "index": 77004, "acecode_id": "bigcode_python_fns_23124", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `median(l: list) -> float` that computes the median of a list of numeric elements. The function should accommodate lists of varying lengths, both odd and even, and should handle negative integers and floating-point numbers. The implementation should bypass any ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert median([3, 1, 2, 4, 5]) == 3\", \"assert median([2.5, -3.7, 5.1]) == 2.5\", \"assert median([1, 2, 3]) == 2\", \"assert median([1, 2, 3, 4]) == 2.5\", \"assert median([1]) == 1\", \"assert median([-1, -2, -3]) == -2\", \"assert median([-1, 0, 1]) == 0\", \"a...
{ "split": "train", "index": 77005, "acecode_id": "evol_35138", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a program that manipulates comment formatting within a given body of text. Write a function `comment_manipulation(body, comment_format, content)` that takes in the following parameters: \n - `body` (str): A string representing the body of text to be...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert comment_manipulation('Hello World', ['#'], 'This is a test content') == '# Hello World'\", \"assert comment_manipulation('Hello World', ['#'], '# Hello World') == 'No modification needed'\", \"assert comment_manipulation('Text with spaces ', ['#'], 'Some o...
{ "split": "train", "index": 77006, "acecode_id": "oss_6438", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with merging multiple lists of records based on a common key. Each record is represented as a dictionary, and you need to combine them into a single list of records where each record contains all fields from the input lists. The common key is 'timestamp', and if ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_records([[{'timestamp': '2023-01-01', 'value': 10}, {'timestamp': '2023-01-02', 'value': 20}], [{'timestamp': '2023-01-01', 'value': 30}, {'timestamp': '2023-01-03', 'value': 40}]]) == [{'timestamp': '2023-01-01', 'value': 30}, {'timestamp': '2023-01-0...
{ "split": "train", "index": 77007, "acecode_id": "bigcode_python_fns_8792", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two arrays of integers, where the first array contains the value two repeated fifteen times and the second array contains the value six repeated fifteen times, implement a function that merges these two arrays and sorts the resulting array using merge sort without using a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_sort([2]*15 + [6]*15) == [2]*15 + [6]*15\", \"assert merge_sort([2]*10 + [6]*10) == [2]*10 + [6]*10\", \"assert merge_sort([6]*15 + [2]*15) == [2]*15 + [6]*15\", \"assert merge_sort([2]*5 + [6]*25) == [2]*5 + [6]*25\", \"assert merge_sort([6]*5 + [2]*2...
{ "split": "train", "index": 77008, "acecode_id": "evol_32284", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `change_quota(cm_response, log=False, pack=False)` that simulates changing a quota based on a given `cm_response` and optionally logs the input and output. The function should have the following behavior: 1. If `log` is `True`, the functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert change_quota('Initial response', log=True, pack=True) == 'Initial response'\", \"assert change_quota('Initial response', log=False, pack=True) == 'Initial response'\", \"assert change_quota('Initial response', log=True, pack=False) == 'Initial response'\", \...
{ "split": "train", "index": 77009, "acecode_id": "oss_41", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple content management system for web pages. Write a function `create_content(address: str, owner: str, content: str) -> str` that simulates the creation of a new page with the given parameters. The function should take three arguments: a strin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_content('/about', 'Alice', '# About Us') == 'Page created at about by Alice with content: # About Us'\", \"assert create_content('/contact', 'Bob', '## Contact') == 'Page created at contact by Bob with content: ## Contact'\", \"assert create_content('...
{ "split": "train", "index": 77010, "acecode_id": "bigcode_python_fns_43200", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function that represents a date in a fantasy world, which can handle years outside the range of the standard Python `datetime` module (i.e., years less than 1 or greater than 9999). The function should accept three parameters: `day`, `month`, and `year`,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert represent_fantasy_date(1, 1, 0) == '1/1/0'\", \"assert represent_fantasy_date(29, 2, -1) == '29/2/-1'\", \"assert represent_fantasy_date(31, 12, 10000) == '31/12/10000'\", \"assert represent_fantasy_date(15, 5, 9999) == '15/5/9999'\", \"assert represent_fant...
{ "split": "train", "index": 77011, "acecode_id": "evol_14535", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a command-line argument parser that can accept an optional argument for indentation. The argument can be specified using '-i' or '--indent' followed by a number that indicates how many levels of indentation to apply. Your task is to implement a function `get_inden...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_indentation_level(['-i']) == 1\", \"assert get_indentation_level(['--indent', '2']) == 2\", \"assert get_indentation_level(['--indent', '3', '-i']) == 4\", \"assert get_indentation_level(['--indent', '0']) == 0\", \"assert get_indentation_level(['--inden...
{ "split": "train", "index": 77012, "acecode_id": "bigcode_python_fns_4382", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of boid positions and their velocities on a 2D plane, implement a function `update_boids(boids: List[Tuple[float, float]], velocities: List[Tuple[float, float]]) -> List[Tuple[float, float]]` that updates the positions of the boids based on their current velocities...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_boids([(0, 0), (1, 1)], [(1, 0), (0, 1)]) == [(1, 0), (1, 2)]\", \"assert update_boids([(2, 3), (4, 5)], [(1, 1), (2, 2)]) == [(3, 4), (6, 7)]\", \"assert update_boids([(0, 0)], [(0, 0)]) == [(0, 0)]\", \"assert update_boids([(10, 10)], [(2, 3)]) == [...
{ "split": "train", "index": 77013, "acecode_id": "oss_9321", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that returns all unique permutations of a given string. The string may contain uppercase and lowercase letters, special characters, and numbers. The function should be case-sensitive, meaning 'a' and 'A' are treated as different characters. For example, giv...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_permutations('abc') == {'abc', 'acb', 'bac', 'bca', 'cab', 'cba'}\", \"assert unique_permutations('aA') == {'aA', 'Aa'}\", \"assert unique_permutations('123') == {'123', '132', '213', '231', '312', '321'}\", \"assert unique_permutations('!@') == {'!@'...
{ "split": "train", "index": 77014, "acecode_id": "evol_4935", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function named is_prime_and_largest_prime_factor(n) that takes an integer n as input and returns a tuple (is_prime, largest_prime_factor). The first element is a boolean indicating whether n is a prime number. The second element is the greatest prime factor of n. If...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_prime_and_largest_prime_factor(1) == (False, 1)\", \"assert is_prime_and_largest_prime_factor(2) == (True, 2)\", \"assert is_prime_and_largest_prime_factor(3) == (True, 3)\", \"assert is_prime_and_largest_prime_factor(4) == (False, 2)\", \"assert is_prime...
{ "split": "train", "index": 77015, "acecode_id": "evol_28930", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple system to install a software reactor. The reactor can be represented as a string identifier. Write a function `install_reactor(reactor_name: str) -> str` that takes in the name of the reactor as a string and returns a confirmation message i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert install_reactor('QtReactor') == 'Reactor QtReactor installed successfully.'\", \"assert install_reactor('TestReactor') == 'Reactor TestReactor installed successfully.'\", \"assert install_reactor('') == 'No reactor name provided.'\", \"assert install_reactor...
{ "split": "train", "index": 77016, "acecode_id": "bigcode_python_fns_42517", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string containing HTML content and returns a list of all paragraph elements (<p> tags) that contain less than 50 characters. Each paragraph should be returned as a string, including the <p> tags. If no such paragraphs exist, return an empty lis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_short_paragraphs('<p>This is a short paragraph.</p>') == ['<p>This is a short paragraph.</p>']\", \"assert get_short_paragraphs('<p>This is a paragraph that is way too long to be considered short because it contains more than fifty characters.</p>') == [...
{ "split": "train", "index": 77017, "acecode_id": "evol_15769", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a Python function that converts time from a 24-hour format to a 12-hour format with AM/PM indicators. The function should also validate if the input time is in the correct 24-hour format. If the input is invalid, the function should throw an exception with an appropriate ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_time('00:00') == '12:00 AM'\", \"assert convert_time('12:00') == '12:00 PM'\", \"assert convert_time('13:00') == '01:00 PM'\", \"assert convert_time('23:59') == '11:59 PM'\", \"assert convert_time('01:00') == '01:00 AM'\", \"assert convert_time('06:3...
{ "split": "train", "index": 77018, "acecode_id": "evol_5459", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that returns the admin site title for a web application. The admin site title can be customized through given parameters, and if not specified, it defaults to 'Grappelli'. Implement a function that takes two optional parameters: `a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_admin_site_title() == ('Grappelli', 'Grappelli')\", \"assert get_admin_site_title(admin_headline='Custom Headline') == ('Custom Headline', 'Grappelli')\", \"assert get_admin_site_title(admin_title='Custom Title') == ('Grappelli', 'Custom Title')\", \"ass...
{ "split": "train", "index": 77019, "acecode_id": "oss_37063", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of command-line arguments and executes a specific action based on the first argument in the list. The function should return a string indicating which action was executed or if the action was invalid. The func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_action([]) == 'No action specified'\", \"assert execute_action(['action1']) == 'Executing action 1'\", \"assert execute_action(['action2']) == 'Executing action 2'\", \"assert execute_action(['action3']) == 'Invalid action specified'\", \"assert exec...
{ "split": "train", "index": 77020, "acecode_id": "oss_5507", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the combinations of n elements taken k at a time, ensuring that the function handles edge cases such as when n < k or either n or k is negative. The function should return the number of combinations as an integer. If any of the conditions fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_combinations(8, 3) == 56\", \"assert calculate_combinations(5, 0) == 1\", \"assert calculate_combinations(0, 0) == 1\", \"assert calculate_combinations(10, 2) == 45\", \"assert calculate_combinations(10, 10) == 1\", \"assert calculate_combinations(...
{ "split": "train", "index": 77021, "acecode_id": "evol_28696", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the shape of a given 2D list (matrix). The shape of a 2D list is a tuple of integers representing the number of rows and columns in the list. For example, a 2D list with 3 rows and 4 columns has a shape of (3, 4). Write a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_shape([[1, 2], [3, 4], [5, 6]]) == (3, 2)\", \"assert list_shape([[1, 2, 3, 4]]) == (1, 4)\", \"assert list_shape([[1], [2], [3], [4], [5]]) == (5, 1)\", \"assert list_shape([]) == (0, 0)\", \"assert list_shape([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == (3, ...
{ "split": "train", "index": 77022, "acecode_id": "oss_36839", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n, write a function `generate_tuples(n)` that returns a list of tuples. Each tuple should contain two elements: the first element being the index of the tuple in the list (starting from 0), and the second element being the square of the index. If n is 0, the fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_tuples(0) == []\", \"assert generate_tuples(1) == [(0, 0)]\", \"assert generate_tuples(2) == [(0, 0), (1, 1)]\", \"assert generate_tuples(3) == [(0, 0), (1, 1), (2, 4)]\", \"assert generate_tuples(4) == [(0, 0), (1, 1), (2, 4), (3, 9)]\", \"assert g...
{ "split": "train", "index": 77023, "acecode_id": "oss_3751", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to calculate the ordinal loss for a given input and target in a machine learning context. The ordinal loss measures the difference between predicted ordinal values and target ordinal values. \n\nYou will implement a function `ordinal_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ordinal_loss([[1.0, 0.0, 0.0], [0.5, 0.5, 0.5]], [1, 0]) == 0.0\", \"assert ordinal_loss([[0.0, 0.0, 0.0], [0.0, 0.0, 0.0]], [0, 0]) == 0.0\", \"assert ordinal_loss([[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]], [0, 0]) == 0.0\", \"assert ordinal_loss([[0.5, 0.5, 0.5],...
{ "split": "train", "index": 77024, "acecode_id": "oss_15416", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a string S and a substring p, implement a function that finds the last occurrence of the substring p within the string S. The function should return a tuple containing the substring p and its last position in S. If the substring p is not found, return None.\nPlease reason...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_final_apparition('Test string', 'x') == None\", \"assert find_final_apparition('Testing', 't') == ('t', 3)\", \"assert find_final_apparition('abcdabcd', 'b') == ('b', 5)\", \"assert find_final_apparition('abcdefg', 'z') == None\", \"assert find_final_ap...
{ "split": "train", "index": 77025, "acecode_id": "evol_11928", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a matrix of integers and a visited list initialized to the same dimensions as the matrix. Your task is to implement a function that processes the matrix and updates the visited list according to the following rules: For each row in the matrix, check the first elem...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_matrix([[1, 2], [0, 0]], [[1, 0], [2, 0]]) == [[1, 0], [0, 0]]\", \"assert process_matrix([[0, 0], [0, 0]], [[0, 0], [0, 0]]) == [[0, 0], [0, 0]]\", \"assert process_matrix([[2, 3], [1, 4]], [[2, 0], [2, 0]]) == [[2, 0], [1, 0]]\", \"assert process_m...
{ "split": "train", "index": 77026, "acecode_id": "oss_16566", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of smart home device registration packets represented as dictionaries. Each packet contains the following attributes: 'type_id', 'class_id', 'data_type_id', and 'major_ver'. Your function should return a list of tupl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_device_info([{'type_id': 'AC', 'class_id': 'HomeDevice', 'data_type_id': 'Fixed', 'major_ver': 1}]) == [('AC', 'HomeDevice', 'Fixed', 1)]\", \"assert extract_device_info([{'type_id': 'Light', 'class_id': 'HomeDevice', 'data_type_id': 'Variable', 'maj...
{ "split": "train", "index": 77027, "acecode_id": "oss_16994", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the logout process for a user session in a web application. The function should take a dictionary representing the current session state and a session ID, and return a string indicating the status of the logout process....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert logout_session({'1': 'user1', '2': 'user2'}, '1') == 'Session ended'\", \"assert logout_session({'1': 'user1', '2': 'user2'}, '2') == 'Session ended'\", \"assert logout_session({'1': 'user1', '2': 'user2'}, '3') == 'Session not found'\", \"assert logout_sess...
{ "split": "train", "index": 77028, "acecode_id": "bigcode_python_fns_47301", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a message in the form of a byte string, a public key as an integer, and a signature as a tuple of two integers (r, s). Your task is to implement a function `verify_signature(message: bytes, public: int, signature: Tuple[int, int], constants: Optional[Tuple[int, in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_signature(b'Test message', 123456789, (12345, 67890), (101, 100, 2)) == False\", \"assert verify_signature(b'Hello, World!', 987654321, (5000, 3000), (101, 100, 2)) == False\", \"assert verify_signature(b'Hello, World!', 987654321, (99999, 5000), (101...
{ "split": "train", "index": 77029, "acecode_id": "bigcode_python_fns_27443", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that checks if a given volume type is allowed based on a predefined list of allowed volume types. Write a function `is_volume_type_allowed(vol_type, allowed_types)` that takes two parameters: - `vol_type`: a string representing the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_volume_type_allowed('all', ['generated', 'persistent', 'volatile']) == True\", \"assert is_volume_type_allowed('generated', ['generated', 'persistent', 'volatile']) == True\", \"assert is_volume_type_allowed('persistent', ['generated', 'persistent', 'vola...
{ "split": "train", "index": 77030, "acecode_id": "oss_25017", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n greater than one, implement a function `is_powerful(n)` that determines whether n is a 'powerful' number. A powerful number is defined such that for every prime factor p of n, p^2 is also a factor of n. Return True if n is a powerful number, and False otherwi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_powerful(392) == True\", \"assert is_powerful(336) == True\", \"assert is_powerful(300) == True\", \"assert is_powerful(12) == True\", \"assert is_powerful(36) == True\", \"assert is_powerful(60) == True\", \"assert is_powerful(72) == True\", \"assert is_...
{ "split": "train", "index": 77031, "acecode_id": "evol_28523", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function that takes in a list of tuples, where each tuple contains two strings that are expected to be anagrams of each other. The function should determine whether they are indeed anagrams, ignoring case and special characters (including spaces). The function should re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_anagrams([('Martha', 'Hartma'), ('Listen', 'Silent')]) == [('Martha', 'Hartma', True), ('Listen', 'Silent', True)]\", \"assert check_anagrams([('Clint Eastwood', 'Old West Action')]) == [('Clint Eastwood', 'Old West Action', True)]\", \"assert check_an...
{ "split": "train", "index": 77032, "acecode_id": "evol_27680", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `fibonacci(N)` that returns a list of Fibonacci numbers starting from 0 and 1 up to, but not exceeding, the limit `N`. The input `N` will be a positive integer greater than 1. The returned list should include all Fibonacci numbers less than `N` in ascending...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(3) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(8) == [0, 1, 1, 2, 3, 5]\", \"assert fibonacci(10) == [0, 1, 1, 2, 3, 5, 8]\", \"assert fibonacci(13) == [0, 1, 1, 2, 3, 5, 8]\", \"assert fibonacci(21) == [0, 1, ...
{ "split": "train", "index": 77033, "acecode_id": "evol_5677", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of daily confirmed COVID-19 cases for a specific area, calculate the number of new cases over a specified date range. You are given a list of tuples where each tuple contains a date (in 'YYYY-MM-DD' format) and the total confirmed cases on that date for a specific ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_new_cases([('2020-06-01', 10), ('2020-06-02', 15), ('2020-06-03', 20)], '2020-06-01', '2020-06-03') == 10\", \"assert calculate_new_cases([('2020-06-01', 10), ('2020-06-02', 15), ('2020-06-03', 20)], '2020-06-02', '2020-06-03') == 5\", \"assert cal...
{ "split": "train", "index": 77034, "acecode_id": "bigcode_python_fns_7889", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that, given an array of integers, classifies each number as a prime number, a composite number, or a perfect square. For each category, the function should return the highest and lowest values, as well as the average value of each category. The function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_and_analyze([2, 3, 5, 7]) == {'prime': {'min': 2, 'max': 7, 'avg': 4.25}}\", \"assert classify_and_analyze([1, 0, -1]) == {'square': {'min': 0, 'max': 1, 'avg': 0.5}}\", \"assert classify_and_analyze([11, 13, 17]) == {'prime': {'min': 11, 'max': 17,...
{ "split": "train", "index": 77035, "acecode_id": "evol_7871", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with formatting a list of student grades based on a specified output format. Implement a function `show_grades(grades: List[int], format: str) -> str` that takes in a list of integers representing grades and a string format. The format can be either 'comma' or 's...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert show_grades([90, 80, 70], 'comma') == '90,80,70'\", \"assert show_grades([100, 95, 85], 'space') == '100 95 85'\", \"assert show_grades([75, 85, 95], 'comma') == '75,85,95'\", \"assert show_grades([65], 'space') == '65'\", \"assert show_grades([], 'comma') =...
{ "split": "train", "index": 77036, "acecode_id": "bigcode_python_fns_18951", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes in a list of integers and returns the mean value of the integers in the list. If the list is empty, the function should return 0. Implement a function `calculate_mean(nums)` that takes in a list of integers `nums` and re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_mean([]) == 0\", \"assert calculate_mean([1]) == 1.0\", \"assert calculate_mean([1, 2]) == 1.5\", \"assert calculate_mean([1, 2, 3]) == 2.0\", \"assert calculate_mean([10, 20, 30, 40]) == 25.0\", \"assert calculate_mean([-1, 0, 1]) == 0.0\", \"asse...
{ "split": "train", "index": 77037, "acecode_id": "oss_16087", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a logging function that logs messages based on specific conditions. Create a function `log_message` that takes a string `msg` and a boolean `to_file`. If `to_file` is `True`, the function should write the message to a file named 'log.txt'. If `t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_message('Test message 1', False) == 'Message printed to console.'\", \"assert log_message('Test message 2', True) == 'Message written to file.'\", \"assert log_message('Another test message', False) == 'Message printed to console.'\", \"assert log_messag...
{ "split": "train", "index": 77038, "acecode_id": "oss_21476", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing Python code snippets. Your task is to count the occurrences of specific keywords within these snippets. The keywords to be counted are provided in a separate list. Your function should return a dictionary where the keys are the keywo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_keywords_in_snippets(['def foo(): pass', 'class Bar: pass', 'import os', 'def bar():', 'def foo(): return 42'], ['import', 'def', 'class']) == {'import': 1, 'def': 3, 'class': 1}\", \"assert count_keywords_in_snippets(['class MyClass:', 'def my_method(...
{ "split": "train", "index": 77039, "acecode_id": "oss_11420", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the center of mass (COM) for a series of molecular positions over time. Given a list of positions, each represented as a list of 3D coordinates (x, y, z), and a corresponding list of atomic masses, write a function `calculate_center_of_mass(posit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_center_of_mass([[0, 0, 0], [1, 1, 1]], [1, 1]) == [[0.5, 0.5, 0.5]]\", \"assert calculate_center_of_mass([[0, 0, 0], [2, 0, 0]], [1, 3]) == [[1.5, 0.0, 0.0]]\", \"assert calculate_center_of_mass([[1, 2, 3], [4, 5, 6], [7, 8, 9]], [1, 2, 3]) == [[5....
{ "split": "train", "index": 77040, "acecode_id": "oss_19327", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `factorial` that computes the factorial of a given integer `n` (1 <= n <= 1000) using recursion. Ensure that your implementation can handle calls for large values of `n` without causing a stack overflow. The function should return the factorial as an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(8) == 40320\", \"assert factor...
{ "split": "train", "index": 77041, "acecode_id": "evol_29895", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the heights of bars in a histogram, write a function `maxRectangleArea(heights: List[int]) -> int` that computes the area of the largest rectangle that can be formed within the histogram. The width of each bar is considered to be 1 unit.\nP...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxRectangleArea([2, 1, 5, 6, 2, 3]) == 10\", \"assert maxRectangleArea([1, 1, 1, 1]) == 4\", \"assert maxRectangleArea([]) == 0\", \"assert maxRectangleArea([5, 2, 3, 4, 5]) == 10\", \"assert maxRectangleArea([6, 7, 5, 2, 4, 5, 9, 3]) == 16\", \"assert maxR...
{ "split": "train", "index": 77042, "acecode_id": "bigcode_python_fns_23087", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_expression(expression: List[Union[int, str]]) -> float` that takes a list of integers and strings representing an arithmetic expression in Reverse Polish Notation (RPN). The expression can include the operators '+', '-', '*', and '/' and should h...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_expression([2, 1, '+']) == 3\", \"assert calculate_expression([3, 4, '*', 5, '+']) == 17\", \"assert calculate_expression([8, 2, '/', 3, '+']) == 7\", \"assert calculate_expression([5, 1, 2, '+', 4, '*', '+', 3, '-']) == 14\", \"assert calculate_ex...
{ "split": "train", "index": 77043, "acecode_id": "evol_7081", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes an RNA-Seq analysis input and some optional parameters. Your function should return a dictionary containing the following fixed information: title, subtitle, logo_title, project_type, and analysis_type. The title should always ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_rna_seq('data.rna', 'param1_value', 'param2_value') == {'title': 'ZARP', 'subtitle': 'RNA-Seq processing pipeline developed by Zavolan Lab', 'logo_title': 'ZARP', 'project_type': 'Snakemake workflow', 'analysis_type': 'RNA-seq', 'param1': 'param1_val...
{ "split": "train", "index": 77044, "acecode_id": "oss_8867", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `create_book` that takes in four parameters: `title` (a string), `author` (a string), `pages` (an integer), and `genre` (a string). The function should return a dictionary representing a book with the keys 'title', 'author', 'pages', and 'genre', containing...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_book('To Kill a Mockingbird', 'Harper Lee', 281, 'Novel') == {'title': 'To Kill a Mockingbird', 'author': 'Harper Lee', 'pages': 281, 'genre': 'Novel'}\", \"assert create_book('1984', 'George Orwell', 328, 'Dystopian') == {'title': '1984', 'author': '...
{ "split": "train", "index": 77045, "acecode_id": "evol_16511", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 2D grayscale image represented as a list of lists (where each inner list represents a row of pixel values), and two integers minVal and maxVal, implement a function that scales the pixel values of the image to lie within the range [minVal, maxVal]. The pixel values are ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert scalingImage([[0, 255], [0, 255]], 0, 1) == [[0.0, 1.0], [0.0, 1.0]]\", \"assert scalingImage([[0, 128, 255], [64, 192, 32]], 0, 255) == [[0.0, 128.0, 255.0], [64.0, 192.0, 32.0]]\", \"assert scalingImage([[1, 2], [3, 4]], 1, 4) == [[1.0, 2.0], [3.0, 4.0]]\"...
{ "split": "train", "index": 77046, "acecode_id": "bigcode_python_fns_22711", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function `suggest_optimized_designs` that takes two templates and their A/B test results and suggests an optimized design based on the performance metrics. The function should accept the following parameters: `template_A: dict`, `template_B: dict`, `results: dict`. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert suggest_optimized_designs({'name': 'Template A', 'elements': {'color': 'blue', 'font': 'Arial'}}, {'name': 'Template B', 'elements': {'color': 'green', 'font': 'Times New Roman'}}, {'winner': 'A'}) == {'color': 'blue', 'font': 'Arial'}\", \"assert suggest_op...
{ "split": "train", "index": 77047, "acecode_id": "evol_21155", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that contains raw HTML text. Your task is to extract a list of IP addresses (proxies) from this HTML string. The proxies are located within a specific HTML element, where they are formatted in a comma-separated list inside a <textarea> tag. Your function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_proxy_list('<textarea>192.168.1.1</textarea>') == ['192.168.1.1']\", \"assert get_proxy_list('<textarea></textarea>') == []\", \"assert get_proxy_list('<textarea>203.0.113.1</textarea>') == ['203.0.113.1']\", \"assert get_proxy_list('<textarea>255.255.25...
{ "split": "train", "index": 77048, "acecode_id": "bigcode_python_fns_39362", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a non-negative integer `num` and a base `base`, implement a function `convert_to_base(num: int, base: int) -> str` that converts the integer `num` into a string representation in the specified base. The base must be between 2 and 36 inclusive, using the characters '0'-'9'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_base(0, 2) == '0'\", \"assert convert_to_base(255, 16) == 'FF'\", \"assert convert_to_base(10, 2) == '1010'\", \"assert convert_to_base(15, 10) == '15'\", \"assert convert_to_base(36, 36) == '10'\", \"assert convert_to_base(5, 5) == '10'\", \"asse...
{ "split": "train", "index": 77049, "acecode_id": "bigcode_python_fns_41253", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of genomic samples represented as strings. Each string can contain letters (A, C, G, T) representing the nucleotides in DNA. Your task is to implement a function that counts the number of valid genomic samples in the list. A valid genomic sample contains on...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_valid_samples(['ACGT', 'ACGZ', 'A', 'CCTAG', '']) == 3\", \"assert count_valid_samples(['', 'ACGT', '1234', 'GATC']) == 2\", \"assert count_valid_samples(['A', 'C', 'G', 'T', 'AA', 'CC', 'GG', 'TT']) == 8\", \"assert count_valid_samples(['ACGTACGT', 'A...
{ "split": "train", "index": 77050, "acecode_id": "bigcode_python_fns_4674", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary containing four sub-dictionaries: 'dict_demand', 'dict_supply', 'dict_calc_demand', and 'dict_calc_supply', each representing time series data for demand and supply of a commodity over a set of months, write a function that extracts and returns the maximum de...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_demand_supply_data({'dict_demand': {1: 10, 2: 30}, 'dict_supply': {1: 5, 2: 15}, 'dict_calc_demand': {1: 12, 2: 32}, 'dict_calc_supply': {1: 6, 2: 16}}, True, False) == (30, 5, None, None)\", \"assert extract_demand_supply_data({'dict_demand': {1: 30...
{ "split": "train", "index": 77051, "acecode_id": "bigcode_python_fns_31524", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given an integer `epsg`, return a string that represents the corresponding projection file text for a geographic coordinate system defined by the EPSG code. The function should map specific EPSG codes to their projection strings based on the following mappings: 4326 maps to 'PR...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_projection_file_text(4326) == 'PROJCS[\\\"WGS 84\\\", GEOGCS[\\\"GCS_WGS_1984\\\", DATUM[\\\"D_WGS_1984\\\", SPHEROID[\\\"WGS_1984\\\", 6378137, 298.257223563]]], PRIMEM[\\\"Greenwich\\\",0], UNIT[\\\"degree\\\",0.0174532925199433]]'\", \"assert get_proj...
{ "split": "train", "index": 77052, "acecode_id": "bigcode_python_fns_2717", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a reminder management system that collects reminders from a predefined list. Your goal is to create a function that takes a list of strings as input and returns a new list containing only non-empty reminders. The function should filter out any e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_non_empty_reminders(['Buy groceries', '', 'Call mom', '']) == ['Buy groceries', 'Call mom']\", \"assert filter_non_empty_reminders(['', '', '']) == []\", \"assert filter_non_empty_reminders(['Hello', 'World']) == ['Hello', 'World']\", \"assert filter_...
{ "split": "train", "index": 77053, "acecode_id": "oss_170", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of students in a class. Your task is to implement a function that calculates the average score of the students, rounded to two decimal places. If the list is empty, return 0.00. Write a function `calculate_average(scores:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average([70, 80, 90]) == 80.00\", \"assert calculate_average([100, 90, 85, 95]) == 92.50\", \"assert calculate_average([50]) == 50.00\", \"assert calculate_average([]) == 0.00\", \"assert calculate_average([0, 0, 0]) == 0.00\", \"assert calculate_a...
{ "split": "train", "index": 77054, "acecode_id": "bigcode_python_fns_4580", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `count_greater_than` that takes this list and an integer `n`, and returns the count of how many integers in the list are greater than `n`. For example, if the input list is [1, 5, 3, 7, 2] and `n` is 4, the output should be 2 because t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_greater_than([1, 5, 3, 7, 2], 4) == 2\", \"assert count_greater_than([1, 2, 3], 5) == 0\", \"assert count_greater_than([], 5) == 0\", \"assert count_greater_than([5, 5, 5, 5], 5) == 0\", \"assert count_greater_than([8, 6, 7, 5], 6) == 2\", \"assert cou...
{ "split": "train", "index": 77055, "acecode_id": "bigcode_python_fns_23517", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes three numbers as input and returns their sum. The function should handle both positive and negative integers, as well as zero. Your function should be named `sum_of_three` and should accept three parameters: `a`, `b`, and `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_three(1, 2, 3) == 6\", \"assert sum_of_three(-1, -1, -1) == -3\", \"assert sum_of_three(0, 0, 0) == 0\", \"assert sum_of_three(5, 10, 15) == 30\", \"assert sum_of_three(-5, 5, 0) == 0\", \"assert sum_of_three(1, -1, 1) == 1\", \"assert sum_of_three(-2...
{ "split": "train", "index": 77056, "acecode_id": "oss_17772", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string, write a function that analyzes the distribution of characters in the string. Your function should output the frequency of each character present in the string, excluding whitespace characters. The frequency should be displayed in descending order, with the most ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert character_frequency('aabbcc') == ['a: 2', 'b: 2', 'c: 2']\", \"assert character_frequency('abc') == ['a: 1', 'b: 1', 'c: 1']\", \"assert character_frequency('aaa bbb ccc') == ['a: 3', 'b: 3', 'c: 3']\", \"assert character_frequency('') == []\", \"assert char...
{ "split": "train", "index": 77057, "acecode_id": "oss_16692", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function `longestIncreasingSubsequence(arr)` that returns the length of the longest increasing subsequence in the array. An increasing subsequence is a sequence of numbers where each subsequent number is greater than the previous one. For...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longestIncreasingSubsequence([10, 22, 9, 33, 21, 50, 41, 60]) == 5\", \"assert longestIncreasingSubsequence([3, 10, 2, 1, 20]) == 3\", \"assert longestIncreasingSubsequence([3, 2]) == 1\", \"assert longestIncreasingSubsequence([10, 9, 8]) == 1\", \"assert lo...
{ "split": "train", "index": 77058, "acecode_id": "evol_5475", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a software description along with a list of owner names and their corresponding email addresses. Your task is to create a function that formats and displays this information in a specific manner. The function should take three strings as input: `description`, `own...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_owners('Icetea - test framework', 'John Doe, Jane Smith', 'john.doe@example.com, jane.smith@example.com') == 'Software Description: Icetea - test framework\\\\nOwners:\\\\n- John Doe (john.doe@example.com)\\\\n- Jane Smith (jane.smith@example.com)'\",...
{ "split": "train", "index": 77059, "acecode_id": "oss_14973", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns a new list containing the unique integers from the original list sorted in descending order. Do not use any built-in sorting functions. The result should not include any duplicate integers.\nPlease reason step by step,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_sorted_desc([4, 2, 6, 8, 5, 9, 1, 4, 2]) == [9, 8, 6, 5, 4, 2, 1]\", \"assert unique_sorted_desc([1, 1, 1, 1]) == [1]\", \"assert unique_sorted_desc([3, 2, 1]) == [3, 2, 1]\", \"assert unique_sorted_desc([]) == []\", \"assert unique_sorted_desc([5, 3,...
{ "split": "train", "index": 77060, "acecode_id": "evol_6737", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the factorial of a non-negative integer using recursion. The function should take a single parameter, an integer `n`, and return the factorial of `n`. The factorial of a number is defined as the product of all positive integers less than or ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert factorial(0) == 1\", \"assert factorial(1) == 1\", \"assert factorial(2) == 2\", \"assert factorial(3) == 6\", \"assert factorial(4) == 24\", \"assert factorial(5) == 120\", \"assert factorial(6) == 720\", \"assert factorial(7) == 5040\", \"assert factorial(...
{ "split": "train", "index": 77061, "acecode_id": "evol_30781", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple banking system. Your goal is to implement a function that takes in a list of transactions for multiple customers and processes these transactions. A transaction can be an addition of a customer with their initial balance, a deposit, or a ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_transactions([('add', 'Alice', 1000), ('add', 'Bob', 500), ('deposit', 'Alice', 500), ('withdraw', 'Bob', 200)]) == {'Alice': 1500, 'Bob': 300}\", \"assert process_transactions([('add', 'Alice', 1000), ('withdraw', 'Alice', 1100)]) == {'Alice': 1000}...
{ "split": "train", "index": 77062, "acecode_id": "oss_32350", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that performs basic arithmetic operations based on a given operator. The function should take three parameters: two integers `a` and `b`, and a string `operator`. The `operator` can be one of the following: '+', '-', '*', or '/'. Your...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate(10, 5, '+') == 15\", \"assert calculate(10, 5, '-') == 5\", \"assert calculate(10, 5, '*') == 50\", \"assert calculate(10, 5, '/') == 2\", \"assert calculate(10, 0, '/') == 'Division by zero'\", \"assert calculate(10, 5, '%') == 'Invalid operator'\...
{ "split": "train", "index": 77063, "acecode_id": "oss_30740", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a string template containing placeholders (denoted by '$') and a dictionary of values for those placeholders. The function should replace each placeholder in the template with its corresponding value from the dictionary and ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert substitute_template('Hello, $name!', {'name': 'Alice'}) == 'Hello, Alice!'\", \"assert substitute_template('My favorite color is $color.', {'color': 'blue'}) == 'My favorite color is blue.'\", \"assert substitute_template('The quick $animal jumps over the la...
{ "split": "train", "index": 77064, "acecode_id": "bigcode_python_fns_35655", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates an HTML report string based on a provided title and content. The function should take two parameters: a string `title` and a string `content`. The function should return a well-formatted HTML string that contains the title ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_html_report('Sample Report', 'This is a sample report content.') == '<html><body><h1>Sample Report</h1><p>This is a sample report content.</p></body></html>'\", \"assert generate_html_report('My Title', 'Here is my content.') == '<html><body><h1>My ...
{ "split": "train", "index": 77065, "acecode_id": "oss_33053", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with generating a sequence of tags that represent compatible Python versions. Each tag consists of the following format: `py*-none-<platform>` for a specific version of Python, and if an interpreter is provided, an additional tag in the format `<interpreter>-none...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_tags((3, 8), None, ['linux', 'win32']) == ['py3-8-none-linux', 'py3-8-none-win32', 'py3-8-none-any']\", \"assert generate_tags((3, 9), 'cp', ['darwin']) == ['py3-9-none-darwin', 'cp-none-any', 'py3-9-none-any']\", \"assert generate_tags((2, 7), None...
{ "split": "train", "index": 77066, "acecode_id": "bigcode_python_fns_21890", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the statistics of a scientific instrument's readings. The function should accept three parameters: a dictionary containing the maximum values of the X and Y parameters, a float representing the mean value reading, and a di...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_statistics({'x': 10, 'y': 20}, 15.0, {'x': 1, 'y': 2}) == {'max_xy': {'x': 10, 'y': 20}, 'mean_value': 15.0, 'min_xy': {'x': 1, 'y': 2}}\", \"assert calculate_statistics({'x': 5, 'y': 15}, 10.0, {'x': 0, 'y': 1}) == {'max_xy': {'x': 5, 'y': 15}, 'm...
{ "split": "train", "index": 77067, "acecode_id": "oss_6040", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `move_zeros(arr)` that takes in a list `arr` which may contain integers, strings, floats, and nested lists. The function should move all occurrences of the integer zero to the end of the list, while preserving the relative order of all non-zero elements. Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert move_zeros([0, 1, 2, 0, 3]) == [1, 2, 3, 0, 0]\", \"assert move_zeros([1, 2, 3]) == [1, 2, 3]\", \"assert move_zeros([0, 0, 0]) == [0, 0, 0]\", \"assert move_zeros([1, 0, 'a', 3.5, 0]) == [1, 'a', 3.5, 0, 0]\", \"assert move_zeros([]) == []\", \"assert move_...
{ "split": "train", "index": 77068, "acecode_id": "evol_4974", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Write a function `convert_currency(amount: float, from_currency: str, to_currency: str) -> float` that takes an amount of money, a source currency, and a target currency, and returns the converted amount. The function should simulate a currency conversion based on predefined ex...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_currency(100, 'USD', 'EUR') == 85.0\", \"assert convert_currency(100, 'EUR', 'USD') == 118.0\", \"assert convert_currency(100, 'USD', 'INR') == 7450.0\", \"assert convert_currency(100, 'INR', 'USD') == 1.3\", \"assert convert_currency(100, 'EUR', 'IN...
{ "split": "train", "index": 77069, "acecode_id": "evol_26044", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a class that models a physical property called 'Uniaxial Anisotropy'. This class should accept a strength parameter 'K1', a constant vector 'a', and a string 'name' upon initialization. Your job is to implement a function `create_anisotropy(K1: int,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_anisotropy(1, (0, 0, 1), 'MyAnisotropy') == {'K1': 1, 'a': (0, 0, 1), 'name': 'MyAnisotropy'}\", \"assert create_anisotropy(2, (1, 2, 3), 'TestAnisotropy') == {'K1': 2, 'a': (1, 2, 3), 'name': 'TestAnisotropy'}\", \"assert create_anisotropy(0, (0, 0, ...
{ "split": "train", "index": 77070, "acecode_id": "bigcode_python_fns_41583", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers with at least two elements. Write a function `closest_nums(nums)` that returns the two closest numbers in the list. The returned pair should be in ascending order. If there are multiple pairs with the same minimum difference, return the first on...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert closest_nums([1, 2]) == (1, 2)\", \"assert closest_nums([3, 8, 15, 17]) == (15, 17)\", \"assert closest_nums([4, 1, 2, 3]) == (1, 2)\", \"assert closest_nums([5, 5, 6]) == (5, 5)\", \"assert closest_nums([2, 2, 2]) == (2, 2)\", \"assert closest_nums([1, 1, 1...
{ "split": "train", "index": 77071, "acecode_id": "evol_3165", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a random sampling algorithm for hyperparameters in a machine learning model. Your goal is to implement a function that takes the number of experiments and a dictionary of hyperparameter sampling functions, and returns a list of dictionaries wher...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert random_search_hyperparams(1, {'a': lambda: 1}) == [{'a': 1}]\", \"assert random_search_hyperparams(2, {'b': lambda: 2}) == [{'b': 2}, {'b': 2}]\", \"assert random_search_hyperparams(3, {'c': 3}) == [{'c': 3}, {'c': 3}, {'c': 3}]\", \"assert random_search_hyp...
{ "split": "train", "index": 77072, "acecode_id": "oss_13787", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function that sorts the array in ascending order. The function should take a single parameter, which is the array of integers, and return a new array that contains the integers sorted from least to greatest.\nPlease reason step by step, t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_array([7, 19, 5, 4, 16]) == [4, 5, 7, 16, 19]\", \"assert sort_array([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert sort_array([10, 9, 8]) == [8, 9, 10]\", \"assert sort_array([0, -1, 1]) == [-1, 0, 1]\", \"assert sort_array([]) == []\", \"assert sort_...
{ "split": "train", "index": 77073, "acecode_id": "evol_15200", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that constructs an authorization header for a cPanel API request. The function should take in a cPanel username, an API token, an API endpoint, and a parameter value. It should return the constructed authorization header and the co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert construct_cpanel_api_request('user1', 'token1', 'https://example.com/api', 'param1') == ('Authorization: cpanel user1:token1', 'https://example.com/api?parameter=param1')\", \"assert construct_cpanel_api_request('user2', 'token2', 'https://example.com/api/en...
{ "split": "train", "index": 77074, "acecode_id": "oss_37690", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representation of XML data containing nested elements and attributes, write a function that parses this XML data to extract information about persons. The function should return a list of dictionaries, each containing the following keys: 'id', 'name', 'age', 'cit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_xml('<persons><person id=\\\"1\\\"><name>Jane Smith</name><age>28</age><city>Los Angeles</city><contacts><contact type=\\\"email\\\">jane@example.com</contact><contact type=\\\"phone\\\">123-456-7890</contact></contacts></person></persons>') == [{'id':...
{ "split": "train", "index": 77075, "acecode_id": "evol_3921", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if the daily sales of a product are equal. Write a function `are_sales_equal(sales: List[int]) -> bool` that takes in a list of integers `sales`, representing the daily sales of a product over a period of time. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_sales_equal([100, 100, 100]) == True\", \"assert are_sales_equal([200, 200, 200, 200]) == True\", \"assert are_sales_equal([50, 50, 50, 50, 50]) == True\", \"assert are_sales_equal([10, 20, 10]) == False\", \"assert are_sales_equal([300]) == True\", \"as...
{ "split": "train", "index": 77076, "acecode_id": "oss_28387", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that converts a file time to a datetime object. The file time is represented as an integer indicating the number of microseconds since a specific epoch date, which is January 1, 2000. Your function should take this integer input and r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_file_time_to_datetime(0) == datetime.datetime(2000, 1, 1)\", \"assert convert_file_time_to_datetime(1000000) == datetime.datetime(2000, 1, 1, 0, 0, 1)\", \"assert convert_file_time_to_datetime(5000000) == datetime.datetime(2000, 1, 1, 0, 0, 5)\", \"a...
{ "split": "train", "index": 77077, "acecode_id": "oss_12264", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function that checks if a given string consists solely of consonants and matches a user-defined pattern of consonants. The function should take two parameters: a string `s` and a string `pattern`. It should return `True` if `s` contains only consonants and matches t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert consonant_pattern_matcher('bcdfbcdf', 'bcdf') == True\", \"assert consonant_pattern_matcher('jkljkl', 'jkl') == True\", \"assert consonant_pattern_matcher('tvwxtvwx', 'tvwx') == True\", \"assert consonant_pattern_matcher('xyz', 'xyz') == True\", \"assert con...
{ "split": "train", "index": 77078, "acecode_id": "evol_20669", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a directed graph represented as an adjacency list, implement a function that performs a Depth-First Search (DFS) traversal starting from a given vertex. The function should return a list of nodes in the order they were first discovered during the traversal. You can assume...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dfs_traversal({1: [2], 2: [3], 3: [4], 4: []}, 1) == [1, 2, 3, 4]\", \"assert dfs_traversal({1: [], 2: [], 3: []}, 1) == [1]\", \"assert dfs_traversal({1: [2], 2: [3], 3: [1]}, 1) == [1, 2, 3]\", \"assert dfs_traversal({5: [6], 6: [7]}, 5) == [5, 6, 7]\", \"...
{ "split": "train", "index": 77079, "acecode_id": "bigcode_python_fns_27094", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a given package name exists within a predefined list of valid packages. The function should take a string representing the package name as input and return True if the package exists in the list, and False otherwise. The pr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_package_existence('sunpy') == True\", \"assert check_package_existence('numpy') == True\", \"assert check_package_existence('pandas') == True\", \"assert check_package_existence('matplotlib') == True\", \"assert check_package_existence('scikit-learn') ...
{ "split": "train", "index": 77080, "acecode_id": "bigcode_python_fns_29164", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a list of integers as input and returns a list containing only the unique integers from the input list, preserving the order of their first appearance. If there are no unique integers, return an empty list. Write a funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_unique_numbers([1, 2, 2, 3, 4, 4, 5]) == [1, 3, 5]\", \"assert get_unique_numbers([5, 5, 5, 5]) == []\", \"assert get_unique_numbers([]) == []\", \"assert get_unique_numbers([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert get_unique_numbers([1, 1, 2, 2, ...
{ "split": "train", "index": 77081, "acecode_id": "oss_22719", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `circular_sum(arr: List[int]) -> int` to compute the maximum sum of a contiguous subarray within a circular array. The input is an array `arr` which may contain both positive and negative integers. The output should be a single integer...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert circular_sum([-1, -2, -3]) == -1\", \"assert circular_sum([5, -3, 5]) == 10\", \"assert circular_sum([-2, -3, -1]) == -1\", \"assert circular_sum([1, 2, 3, 4, 5]) == 15\", \"assert circular_sum([-1, -2, 5, -3, 4]) == 6\", \"assert circular_sum([3, 2, 1]) == ...
{ "split": "train", "index": 77082, "acecode_id": "bigcode_python_fns_34297", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given an integer n, return the nth Fibonacci number where the Fibonacci sequence is defined as follows: fib(0) = 0, fib(1) = 1, fib(2) = 1, fib(3) = 2, fib(4) = 3, and so on. Your implementation should not use any loops or external libraries. The function should only return the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fib_functools(0) == 0\", \"assert fib_functools(1) == 1\", \"assert fib_functools(2) == 1\", \"assert fib_functools(3) == 2\", \"assert fib_functools(4) == 3\", \"assert fib_functools(5) == 5\", \"assert fib_functools(6) == 8\", \"assert fib_functools(7) == ...
{ "split": "train", "index": 77083, "acecode_id": "bigcode_python_fns_45919", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates the behavior of a command-line interface tool by executing a given command string and returning its output. The function should take a string as input, which represents a command, and return the output of that comman...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert azcli('echo Hello World') == b'Hello World'\", \"assert azcli('echo Test Command') == b'Test Command'\", \"assert azcli('echo LeetCode') == b'LeetCode'\", \"assert azcli('echo Python is great') == b'Python is great'\", \"assert azcli('echo 12345') == b'12345...
{ "split": "train", "index": 77084, "acecode_id": "oss_21583", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of students in a class. Write a function `transform_scores(scores: List[int]) -> List[str]` that transforms each score based on the following rules: if the score is less than 50, it should be transformed to 'Fail'; if the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_scores([30, 60, 85]) == ['Fail', 'Pass', 'Excellent']\", \"assert transform_scores([50, 75, 80, 40]) == ['Pass', 'Pass', 'Excellent', 'Fail']\", \"assert transform_scores([49, 50, 51, 74, 76]) == ['Fail', 'Pass', 'Pass', 'Pass', 'Excellent']\", \"a...
{ "split": "train", "index": 77085, "acecode_id": "bigcode_python_fns_39121", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that generates a random string of length n. The string should meet the following conditions: 1. It should consist of lowercase and uppercase alphabetic characters and digits. 2. The generated string should not have any repeated consecutive characters. 3. The ou...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_string(0) == ''\", \"assert len(generate_string(1)) == 1\", \"assert len(generate_string(5)) == 5\", \"assert len(generate_string(10)) == 10\", \"assert len(generate_string(20)) == 20\", \"assert generate_string(3) != generate_string(3)\", \"assert ...
{ "split": "train", "index": 77086, "acecode_id": "evol_13385", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `version_up(current_filepath)` that increments the version number in a given file path string. The file path follows the format 'filename_vX.extension', where 'X' is the version number and can be any non-negative integer. If the versi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert version_up('project_v2.txt') == 'project_v3.txt'\", \"assert version_up('project_v1.txt') == 'project_v2.txt'\", \"assert version_up('project.txt') == 'project_v1.txt'\", \"assert version_up('my_project_v10.doc') == 'my_project_v11.doc'\", \"assert version_u...
{ "split": "train", "index": 77087, "acecode_id": "oss_32886", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes three parameters: an array of integers, a target integer, and a boolean flag. If the flag is true, the function should return the index of the first occurrence of the target integer in the array. If the flag is false, the function should return t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_value([1, 2, 3, 4, 5], 3, True) == 2\", \"assert find_value([1, 2, 3, 4, 5], 6, True) == -1\", \"assert find_value([1, 2, 3, 4, 5], 3, False) == True\", \"assert find_value([1, 2, 3, 4, 5], 6, False) == False\", \"assert find_value([1, 2, 2, 4, 5], 2, T...
{ "split": "train", "index": 77088, "acecode_id": "evol_681", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that determines the CSS class name for a step in a multi-step wizard based on the current step and the step being evaluated. The function should take two parameters: `step` (an integer representing the step number) and `current` (an i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert wizard_active(1, 1) == 'selected'\", \"assert wizard_active(2, 1) == 'next-selected'\", \"assert wizard_active(3, 1) == ''\", \"assert wizard_active(1, 2) == ''\", \"assert wizard_active(2, 2) == 'selected'\", \"assert wizard_active(3, 2) == 'next-selected'\...
{ "split": "train", "index": 77089, "acecode_id": "bigcode_python_fns_41698", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given an array of binary numbers (0s and 1s). You need to implement a function that allows you to perform two operations on this array: toggle all elements in a specified range to either 0 or 1, and query the sum of elements in a specified range. Write a function `perfo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert perform_operations([0, 1, 0, 0, 1, 0, 1], [('toggle', 1, 3, 1), ('toggle', 2, 5, 0), ('query', 2, 6, 0)]) == [1]\", \"assert perform_operations([1, 0, 1, 1], [('toggle', 0, 3, 0), ('query', 0, 3, 0)]) == [0]\", \"assert perform_operations([0, 0, 0, 0], [('to...
{ "split": "train", "index": 77090, "acecode_id": "evol_25613", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function called `merge_arrays`. This function takes two sorted lists of integers, `list1` and `list2`, as input and returns a new list that contains all the elements from both lists, sorted in ascending order. The input lists may contain dupli...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_arrays([1, 3, 5], [2, 4, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_arrays([], [2, 4, 6]) == [2, 4, 6]\", \"assert merge_arrays([1, 3, 5], []) == [1, 3, 5]\", \"assert merge_arrays([1, 2, 2], [2, 3, 4]) == [1, 2, 2, 2, 3, 4]\", \"assert merge_arrays([...
{ "split": "train", "index": 77091, "acecode_id": "oss_17426", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `enqueue(queue: List[str], item: str) -> None` that adds an item to the end of a queue represented as a list of strings. The function should modify the queue in place. You can assume that the input queue is a valid list and the item to be added is a string....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert enqueue([], 'First in Queue') == None\", \"assert enqueue(['First in Queue'], 'Second in Queue') == None\", \"assert enqueue(['First in Queue', 'Second in Queue'], 'Third in Queue') == None\", \"assert enqueue(['A', 'B', 'C'], 'D') == None\", \"assert enqueu...
{ "split": "train", "index": 77092, "acecode_id": "evol_6190", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Construct a Python function that reverses an array up to a specified index and organizes the remaining part of the array in ascending order. The function should handle edge cases such as an empty array, an array with a single element, or a position that exceeds the array's limi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_and_sort([], 0) == []\", \"assert reverse_and_sort([1], 1) == [1]\", \"assert reverse_and_sort([1, 2, 3], 2) == [2, 1, 3]\", \"assert reverse_and_sort([1, 2, 3], 4) == [3, 2, 1]\", \"assert reverse_and_sort([3, 2, 1], 2) == [2, 3, 1]\", \"assert reve...
{ "split": "train", "index": 77093, "acecode_id": "evol_6204", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to generate a modified FizzBuzz sequence up to a given number. In this modified FizzBuzz sequence, numbers are printed from 1 to the given number, but for multiples of 4, 'quad' is printed instead of the number, and for multiples of 6...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modified_fizz_buzz(1) == ' 1\\\\n'\", \"assert modified_fizz_buzz(2) == ' 1\\\\n2\\\\n'\", \"assert modified_fizz_buzz(3) == ' 1\\\\n2\\\\n3\\\\n'\", \"assert modified_fizz_buzz(4) == ' 1\\\\n2\\\\n3\\\\nquad\\\\n'\", \"assert modified_fizz_buzz(5) == ' 1\\\...
{ "split": "train", "index": 77094, "acecode_id": "oss_31300", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `remove_punctuation(input_string: str) -> str` that removes all punctuation marks from a given string, excluding question marks and exclamation points, while maintaining the original sequence of non-alphanumeric characters. The function should return the modifi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_punctuation('Hello, world! How are you?') == 'Hello world! How are you?'\", \"assert remove_punctuation('What is this? Is it a test!') == 'What is this? Is it a test!'\", \"assert remove_punctuation('No punctuation here') == 'No punctuation here'\", \...
{ "split": "train", "index": 77095, "acecode_id": "evol_15906", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes no parameters and returns a dictionary containing two attributes: 'error_type' and 'device_id'. The 'error_type' attribute should be initialized with a list of error types: 'latest', 'data_app_anr', and 'data_app_crash'. The 'd...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initialize_error_manager() == {'error_type': ['latest', 'data_app_anr', 'data_app_crash'], 'device_id': 'device123'}\", \"assert initialize_error_manager()['error_type'] == ['latest', 'data_app_anr', 'data_app_crash']\", \"assert initialize_error_manager()['...
{ "split": "train", "index": 77096, "acecode_id": "oss_29136", "num_tests": 3 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks whether a given day, represented as an integer, is valid or not. A day is considered valid if it falls within the range of 1 to 31 (inclusive). Write a function `is_valid_day(day: int) -> bool` that takes an integer `day` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_day(1) == True\", \"assert is_valid_day(15) == True\", \"assert is_valid_day(31) == True\", \"assert is_valid_day(0) == False\", \"assert is_valid_day(-1) == False\", \"assert is_valid_day(32) == False\", \"assert is_valid_day(30) == True\", \"asser...
{ "split": "train", "index": 77097, "acecode_id": "bigcode_python_fns_18595", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of process IDs and a function that retrieves the process name for a given process ID, implement a function `get_process_names(pid_list: List[int]) -> List[Optional[str]]` that returns a list of process names corresponding to the provided process IDs. If a process I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_process_names([1, 2, 3]) == ['init', 'bash', 'python']\", \"assert get_process_names([4, 5]) == ['sshd', None]\", \"assert get_process_names([]) == []\", \"assert get_process_names([20, 21]) == [None, None]\", \"assert get_process_names([25]) == [None]\"...
{ "split": "train", "index": 77098, "acecode_id": "bigcode_python_fns_32517", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given the width and height of an image, write a function called `img_aspect_ratio` that returns the image's aspect ratio. If the image has a common aspect ratio, return the aspect ratio in the format 'x:y' (where x and y are both integers), otherwise, return the aspect ratio as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert img_aspect_ratio(1920, 1080) == '16:9'\", \"assert img_aspect_ratio(1280, 720) == '16:9'\", \"assert img_aspect_ratio(800, 600) == '4:3'\", \"assert img_aspect_ratio(1024, 768) == '4:3'\", \"assert img_aspect_ratio(640, 480) == '4:3'\", \"assert img_aspect_r...
{ "split": "train", "index": 77099, "acecode_id": "bigcode_python_fns_2490", "num_tests": 12 }