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": "Implement a function `is_palindrome(s: str) -> bool` that checks if the given string `s` is a palindrome. A string is considered a palindrome if it reads the same backward as forward, ignoring spaces and case sensitivity. The function should return `True` if `s` is a palindrome...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('malayalam') == True\", \"assert is_palindrome('A man a plan a canal Panama') == True\", \"assert is_palindrome('No lemon no melon') == True\", \"assert is_palindrome('Was it a car or a cat I saw') == True\", \"assert is_palindrome('racecar') =...
{ "split": "train", "index": 69200, "acecode_id": "evol_78", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a scrolling function that accepts two parameters, amount_x and amount_y, implement a function that simulates scrolling on a 2D grid. If both parameters are not provided, the function should default to scrolling 1 pixel horizontally. The function should update the current ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert scroll(0, 0) == (1, 0)\", \"assert scroll(-1, 0) == (9, 0)\", \"assert scroll(10, 0) == (0, 0)\", \"assert scroll(-1, -1) == (9, 9)\", \"assert scroll(0, 0) == (1, 0)\", \"assert scroll(-10, -10) == (0, 0)\", \"assert scroll(-2, 0) == (8, 0)\"]}" }
{ "split": "train", "index": 69201, "acecode_id": "bigcode_python_fns_21566", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that converts data into tags based on a given key and vocabulary. Your function should handle various data types and ensure that the tags are properly formatted. Implement the function `convert_to_tags(key, data, vocab)` where: \n- `key` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_tags('tags', {'tags': 'tag1'}, 'vocab') == ['tag1']\", \"assert convert_to_tags('tags', {'tags': ['tag1', 'tag2']}, 'vocab') == ['tag1', 'tag2']\", \"assert convert_to_tags('tags', {'tags': ''}, 'vocab') == []\", \"assert convert_to_tags('tags', {...
{ "split": "train", "index": 69202, "acecode_id": "oss_27599", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a user authentication system where certain actions require admin privileges. Specifically, you need to write a function `check_delete_permission(username: str, is_admin: bool) -> dict` that checks if a user has permissi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_delete_permission('test-user', True) == {'success': True}\", \"assert check_delete_permission('test-user', False) == {'success': False, 'error': {'code': 'unauthorized'}}\", \"assert check_delete_permission('admin-user', True) == {'success': True}\", \...
{ "split": "train", "index": 69203, "acecode_id": "bigcode_python_fns_17760", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with validating a cohort submission for a research project. Implement a function `validate_cohort(cohort: dict) -> bool` that checks if a given cohort dictionary contains the keys 'display_title' and 'cohort_phenotypic_features'. The function should return True i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_cohort({'display_title': 'Cohort A', 'cohort_phenotypic_features': ['Feature 1', 'Feature 2']}) == True\", \"assert validate_cohort({'display_title': 'Cohort B'}) == False\", \"assert validate_cohort({'cohort_phenotypic_features': ['Feature 1', 'Fea...
{ "split": "train", "index": 69204, "acecode_id": "bigcode_python_fns_39103", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that calculates the number of uppercase vowel characters located at prime number positions within a given string. The positions are considered to be 1-based indexing, meaning the first character in the string is at position 1. An uppercase vowel is defined ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_upper_prime('aBCdEf') == 1\", \"assert count_upper_prime('abcdefg') == 0\", \"assert count_upper_prime('abcdef') == 0\", \"assert count_upper_prime('B') == 0\", \"assert count_upper_prime('AEI') == 2\", \"assert count_upper_prime('OUI') == 2\", \"asser...
{ "split": "train", "index": 69205, "acecode_id": "evol_23946", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function `findMedianOfList(arr: List[int]) -> float` that takes a list of integers `arr` and returns the median of the numbers in the list. The median is defined as the middle value in an ordered integer list. If the size of the list is even, the median is the mean ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert findMedianOfList([2, 3, 4]) == 3.0\", \"assert findMedianOfList([2, 3]) == 2.5\", \"assert findMedianOfList([1]) == 1.0\", \"assert findMedianOfList([1, 3, 2]) == 2.0\", \"assert findMedianOfList([5, 2, 1, 4, 3]) == 3.0\", \"assert findMedianOfList([1, 2, 3,...
{ "split": "train", "index": 69206, "acecode_id": "evol_28836", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a function that generates the Fibonacci sequence up to the nth element, where n is provided as an argument to the function. The Fibonacci sequence starts with 0 and 1, and each subsequent number is the sum of the two preceding ones. Your implementation should return a li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci(0) == []\", \"assert fibonacci(1) == [0]\", \"assert fibonacci(2) == [0, 1]\", \"assert fibonacci(3) == [0, 1, 1]\", \"assert fibonacci(4) == [0, 1, 1, 2]\", \"assert fibonacci(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci(6) == [0, 1, 1, 2, 3, 5]\",...
{ "split": "train", "index": 69207, "acecode_id": "evol_36224", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple messaging system. You need to implement a function `publish_message(channels: Dict[str, List[str]], channel: str, message: str) -> List[str]` that takes in a dictionary of channels and their subscribers, a channel name, and a message to be ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert publish_message({'sports': ['Alice', 'Bob'], 'news': []}, 'sports', 'Game tonight!') == ['Sending message Game tonight! to Alice', 'Sending message Game tonight! to Bob']\", \"assert publish_message({'music': ['Charlie'], 'movies': ['Dave', 'Eve']}, 'music',...
{ "split": "train", "index": 69208, "acecode_id": "oss_31076", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of ranges where each range is represented as a tuple of three elements: (begin, end, skip). Your task is to convert these ranges into a symbolic representation. The symbolic representation should maintain the same structure but replace the integer values wi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_symbolic([(None, None, None)]) == [('0', '-1', '1')]\", \"assert convert_to_symbolic([(0, 5, None)]) == [('0', '4', '1')]\", \"assert convert_to_symbolic([(None, 10, None)]) == [('0', '9', '1')]\", \"assert convert_to_symbolic([(2, 4, 1)]) == [('2...
{ "split": "train", "index": 69209, "acecode_id": "bigcode_python_fns_42593", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of course names and a list of subject names, and returns a list of dictionaries where each dictionary contains the course name and its associated subject name. The function should pair each course with a subject in the o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pair_courses_and_subjects(['Math', 'Science'], ['Algebra', 'Biology']) == [{'course': 'Math', 'subject': 'Algebra'}, {'course': 'Science', 'subject': 'Biology'}]\", \"assert pair_courses_and_subjects(['Math', 'Science', 'History'], ['Algebra', 'Biology']) ==...
{ "split": "train", "index": 69210, "acecode_id": "oss_31872", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a segment of data. Your task is to combine all the segments into a single string. You need to implement a function `combine_segments(segments: List[str]) -> str` that takes a list of strings as input and returns the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert combine_segments([]) == ''\", \"assert combine_segments(['Hello', ' ', 'World', '!']) == 'Hello World!'\", \"assert combine_segments(['Leet', 'Code']) == 'LeetCode'\", \"assert combine_segments(['Python', 'is', 'fun']) == 'Pythonisfun'\", \"assert combine_se...
{ "split": "train", "index": 69211, "acecode_id": "bigcode_python_fns_2474", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the termination of a virtual instance. The function should take in two parameters: an instance ID (a string) and a list of currently active instance IDs (a list of strings). The function should return a string indicatin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert terminate_instance('i-12345', ['i-12345', 'i-67890', 'i-11111']) == 'terminated successfully'\", \"assert terminate_instance('i-99999', ['i-12345', 'i-67890', 'i-11111']) == 'instance not found'\", \"assert terminate_instance('i-67890', ['i-12345', 'i-67890'...
{ "split": "train", "index": 69212, "acecode_id": "bigcode_python_fns_38635", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that replaces all numerical digits in a given string with characters from a specific character set. The character to replace each digit will be selected sequentially from the character set. Your function should take two parameters: a string 'input_string...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_digits('abc123def456', ['A', 'B', 'C', 'D', 'E', 'F']) == 'abcABCdefDEF'\", \"assert replace_digits('hello2023', ['X', 'Y']) == 'helloXYXY'\", \"assert replace_digits('no_digits_here', ['A', 'B', 'C']) == 'no_digits_here'\", \"assert replace_digits('...
{ "split": "train", "index": 69213, "acecode_id": "evol_24961", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function called `get_filtered_products` that takes a list of product dictionaries and a list of transaction dictionaries as input. Each product dictionary contains details of the products with keys: 'id', 'name', 'product_type', and each transaction dictionary co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_filtered_products([{'id': 1, 'name': 'Toy Car', 'product_type': 'Toy'}, {'id': 2, 'name': 'Doll', 'product_type': 'Toy'}, {'id': 3, 'name': 'Book', 'product_type': 'Literature'}], [{'product_id': 1, 'timestamp': '2023-01-01T10:00:00'}, {'product_id': 2, ...
{ "split": "train", "index": 69214, "acecode_id": "evol_13564", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a string that contains multiple lines of text. Each line may contain some information related to coordinates, which are represented as comma-separated values within the string. Your task is to extract the values for the coordinates 'x', 'y', and 'z' from the text....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_coordinates(\\\"Header\\\\nThis is a test\\\\nCoordinates: x, y, z\\\\nValues: 0, -1, 100\\\") == [0, -1, 100]\", \"assert extract_coordinates(\\\"First Row\\\\nData\\\\nCoordinates\\\\n-5, -10, 20\\\") == [-5, -10, 20]\", \"assert extract_coordinate...
{ "split": "train", "index": 69215, "acecode_id": "bigcode_python_fns_1528", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `text`, a desired width `width`, and an optional fill character `fill` (default is a space), write a function that returns the string `text` centered within the specified `width`. If the length of `text` is greater than `width`, return `text` as is. If the text n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert center_text('Hello', 5) == 'Hello'\", \"assert center_text('A', 3) == ' A '\", \"assert center_text('More text', 15) == ' More text '\", \"assert center_text('', 5) == ' '\", \"assert center_text('LeetCode', 10) == ' LeetCode '\", \"assert center_tex...
{ "split": "train", "index": 69216, "acecode_id": "bigcode_python_fns_38728", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that evaluates a set of queries on a graph based on different scoring methods. The function `evaluate_graph_queries` takes the following parameters: \n- `graph_type` (string): The type of graph structure to use for the query ('A', 'B'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_graph_queries('A', [0.9, 0.8], [0.7, 0.6], ['query1', 'query2'], lambda x, y: x + y, 2) == [1.6, 1.4]\", \"assert evaluate_graph_queries('C', [1.0, 0.5], [0.5, 0.3], ['query5'], lambda x, y: x - y, 1) == [0.5]\", \"assert evaluate_graph_queries('A',...
{ "split": "train", "index": 69217, "acecode_id": "oss_32754", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a tuple `ms_inf` which contains a string representing the type of mesh element and a list containing three integers: `[npts, nele, ndims]` where `npts` is the number of points, `nele` is the number of elements, and `ndims` is the number of dimensions. Write a function `nc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ncells_after_subdiv(('tri', [3, 10, 2]), 2) == 40\", \"assert ncells_after_subdiv(('quad', [4, 5, 3]), 3) == 135\", \"assert ncells_after_subdiv(('pyr', [5, 6, 3]), 2) == 54\", \"assert ncells_after_subdiv(('tet', [4, 10, 3]), 1) == 10\", \"assert ncells_aft...
{ "split": "train", "index": 69218, "acecode_id": "bigcode_python_fns_48130", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a configuration setup for a database connection. Write a function `configure_database(path: str, host: str = 'localhost', port: int = 8080) -> dict` that takes a database file path, a host, and a port as input, and returns a dictionary containing th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert configure_database('test.db') == {'path': 'test.db', 'host': 'localhost', 'port': 8080}\", \"assert configure_database('mydb.db', '127.0.0.1') == {'path': 'mydb.db', 'host': '127.0.0.1', 'port': 8080}\", \"assert configure_database('data.db', '192.168.1.1', ...
{ "split": "train", "index": 69219, "acecode_id": "bigcode_python_fns_22009", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a CSR operation ('csrrw', 'csrrs', 'csrrc', 'csrrwi', 'csrrsi', 'csrrci'), a bitarray representing the value to be written to the CSR, a bitarray representing the current value of the CSR, and a bitarray representing the CSR's mask, implement a funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert predict_csr_val('csrrwi', 0b000011, 0b110011, 0b111100) == '0x3'\", \"assert predict_csr_val('csrrsi', 0b001100, 0b110011, 0b111100) == '0x3f'\", \"assert predict_csr_val('csrrw', 0b000000, 0b000000, 0b000000) == '0x0'\", \"assert predict_csr_val('csrrs', 0b...
{ "split": "train", "index": 69220, "acecode_id": "bigcode_python_fns_49473", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing checkpoint file sizes in bytes. Your task is to write a function `restore_ckpt_from_sizes(sizes: List[int]) -> int` that returns the total size of all the checkpoints in bytes. The function should take one argument: a list of intege...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert restore_ckpt_from_sizes([100, 200, 300]) == 600\", \"assert restore_ckpt_from_sizes([0, 0, 0]) == 0\", \"assert restore_ckpt_from_sizes([1, 1, 1]) == 3\", \"assert restore_ckpt_from_sizes([10, 20]) == 30\", \"assert restore_ckpt_from_sizes([50]) == 50\", \"a...
{ "split": "train", "index": 69221, "acecode_id": "bigcode_python_fns_7108", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with extracting information from a formatted text input containing details about a Python package. The input consists of multiple lines where the first line contains the number of GitHub stars (formatted as '<gh_stars><NUMBER>') and one of the lines contains the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_package_info('<gh_stars>42\\\\n################################################################################\\\\n# Python package __init__.py file.\\\\n#\\\\n# Author: John Doe\\\\n# Date: 12/20/2016\\\\n#\\\\n') == {'author': 'John Doe', 'github_...
{ "split": "train", "index": 69222, "acecode_id": "oss_25125", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of permission keys and matches them against a predefined set of permissions. Each permission key is in the format 'app_name_permission_name'. Your function should return the application name and the corresponding...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_permissions(['app1_read']) == ('app1', ['read'])\", \"assert process_permissions(['app2_write', 'app2_write']) == ('app2', ['write'])\", \"assert process_permissions(['app3_execute', 'app3_execute']) == ('app3', ['execute'])\", \"assert process_permi...
{ "split": "train", "index": 69223, "acecode_id": "oss_27649", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a string, split it into two halves. Implement a function `convert_to_ascii` that takes a string as input and returns a list of ASCII values for each character in the string. The first half of the string should be processed separately from the second half. If the string ha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_ascii('Python') == ([80, 121, 116], [104, 111, 110])\", \"assert convert_to_ascii('123456') == ([49, 50, 51], [52, 53, 54])\", \"assert convert_to_ascii('abcdef') == ([97, 98, 99], [100, 101, 102])\", \"assert convert_to_ascii('') == ([], [])\", \...
{ "split": "train", "index": 69224, "acecode_id": "evol_7498", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function `ordered_dict_operations(operations: List[Tuple[str, Any]]) -> List[Optional[Any]]` that simulates a simplified version of Python's `OrderedDict` data structure. The function takes a list of operations, where each operation is represented as a tuple. The fi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ordered_dict_operations([('set', ('a', 1)), ('set', ('b', 2)), ('get', ('a',))]) == [1]\", \"assert ordered_dict_operations([('set', ('x', 10)), ('set', ('y', 20)), ('length', ())]) == [2]\", \"assert ordered_dict_operations([('set', ('a', 1)), ('set', ('a',...
{ "split": "train", "index": 69225, "acecode_id": "oss_10680", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that converts a given integer into its binary representation as a string. The function should take a single integer as input and return its binary notation without the '0b' prefix. For example, if the input is 14, the output should be '1110'.\nPlease reason...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_binary(0) == '0'\", \"assert convert_to_binary(1) == '1'\", \"assert convert_to_binary(2) == '10'\", \"assert convert_to_binary(3) == '11'\", \"assert convert_to_binary(4) == '100'\", \"assert convert_to_binary(5) == '101'\", \"assert convert_to_b...
{ "split": "train", "index": 69226, "acecode_id": "evol_25030", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a rectangular grid of wells represented as a 2D list, where each cell contains either 1 (representing a unit of water) or 0 (representing an empty cell), write a function that calculates the number of bucket lowerings required to empty the grid. Each bucket has a fixed ca...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert well_emptying([[0, 0, 0], [0, 0, 0]], 1) == 0\", \"assert well_emptying([[1, 1, 1], [1, 1, 1]], 3) == 2\", \"assert well_emptying([[0, 1, 0], [1, 0, 1]], 2) == 2\", \"assert well_emptying([[1]], 1) == 1\", \"assert well_emptying([[1, 1, 1], [0, 0, 0]], 2) ==...
{ "split": "train", "index": 69227, "acecode_id": "evol_17000", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Write a function `generate_phone_number()` that generates a random 7-digit phone number. The first digit of the phone number must be between 2 and 9 (inclusive), while the remaining six digits can be any digit from 0 to 9. The function should return the generated phone number a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_phone_number() >= 2000000 and generate_phone_number() <= 9999999\", \"assert 2000000 <= generate_phone_number() <= 9999999\", \"assert generate_phone_number() >= 2000000 and generate_phone_number() <= 9999999\", \"assert 2000000 <= generate_phone_nu...
{ "split": "train", "index": 69228, "acecode_id": "evol_35924", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes an integer `k` as input and returns the name of the class that corresponds to the given integer based on the following mapping: If `k` is 1, return 'ClassA'. If `k` is 2, return 'ClassB'. If `k` is 3, return 'ClassC'. If `k...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classfinder(1) == 'ClassA'\", \"assert classfinder(2) == 'ClassB'\", \"assert classfinder(3) == 'ClassC'\", \"assert classfinder(4) == 'ClassD'\", \"assert classfinder(5) == 'ClassE'\", \"assert classfinder(0) == 'Invalid Class'\", \"assert classfinder(-1) =...
{ "split": "train", "index": 69229, "acecode_id": "oss_15867", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings representing fruit names, write a function that returns the name of the fruit that appears most frequently in the list. If there is a tie, return any one of the most common fruits. The input list will contain at least one fruit name.\nPlease reason step ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert most_common_fruit(['Apple', 'Orange', 'Apple', 'Pineapple', 'Grape', 'Apple']) == 'Apple'\", \"assert most_common_fruit(['Grape', 'Apple', 'Grape', 'Orange', 'Grape', 'Banana']) == 'Grape'\", \"assert most_common_fruit(['Mango', 'Peach', 'Mango', 'Peach', 'P...
{ "split": "train", "index": 69230, "acecode_id": "evol_30791", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a configuration dictionary for a PEP8 style checker. The function should adhere to the following rules: The dictionary should contain the keys 'DEFAULT_IGNORE' and 'DEFAULT_INDENT_SIZE' with default values of 'E24' a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_pep8_config() == {'DEFAULT_IGNORE': 'E24', 'DEFAULT_INDENT_SIZE': 4, 'DEFAULT_CONFIG': '/home/user/.config/pep8'}\", \"assert generate_pep8_config().get('DEFAULT_IGNORE') == 'E24'\", \"assert generate_pep8_config().get('DEFAULT_INDENT_SIZE') == 4\",...
{ "split": "train", "index": 69231, "acecode_id": "oss_10981", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that filters and returns a list of network interfaces based on their configuration type from a given dictionary. The function should take in a configuration dictionary and a type string as inputs, and return a list of interfaces that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_interfaces({'interfaces': {'eth0': {'dot1x': True}, 'eth1': {'dot1x_mab': True}}}, 'dot1x') == ['eth0']\", \"assert filter_interfaces({'interfaces': {'eth0': {'dot1x': True}, 'eth1': {'dot1x_mab': True}}}, 'dot1x_mab') == ['eth1']\", \"assert filter_i...
{ "split": "train", "index": 69232, "acecode_id": "oss_2534", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns a new list containing only the unique elements from the original list, preserving the original order of their first occurrence. If there are no unique elements, return an empty list. Your function should handle both positi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 3, 2, 1, 4, 5]) == [3, 4, 5]\", \"assert unique_elements([1, 1, 2, 2, 3, 3]) == []\", \"assert unique_elements([5, 6, 7, 8, 5, 6]) == [7, 8]\", \"assert unique_elements([]) == []\", \"assert unique_elements([10, 20, 30, 20, 10]) == [30...
{ "split": "train", "index": 69233, "acecode_id": "bigcode_python_fns_15783", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `find_multiples(num: int, start: int, end: int) -> List[int]` that returns a list of all multiples of a specific integer `num` that lie within the inclusive range from `start` to `end`. The function should return an empty list if there are no multiples in that ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_multiples(3, 10, 50) == [12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48]\", \"assert find_multiples(5, 1, 25) == [5, 10, 15, 20, 25]\", \"assert find_multiples(7, 1, 50) == [7, 14, 21, 28, 35, 42, 49]\", \"assert find_multiples(10, 1, 9) == []\", \"...
{ "split": "train", "index": 69234, "acecode_id": "evol_5714", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that checks if a given version of the ONNX runtime is compatible for dumping to an ONNX file for a machine learning model. The function should take two inputs: a string representing the ONNX runtime version and a boolean indicating...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_onnx_compatible('0.2.1', True) == True\", \"assert is_onnx_compatible('0.2.0', True) == True\", \"assert is_onnx_compatible('0.2.1', False) == False\", \"assert is_onnx_compatible('0.3.0', True) == False\", \"assert is_onnx_compatible('0.2.2', False) == F...
{ "split": "train", "index": 69235, "acecode_id": "oss_34482", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that formats a dictionary representing an API endpoint argument's documentation. The dictionary has two potential keys: 'description' and 'detailed_description'. The value of 'description' is a string that provides a brief overview of the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_argument_doc({'description': ' Test argument description '}) == {'description': 'Test argument description'}\", \"assert format_argument_doc({'description': ' Another test ', 'detailed_description': ' This is a more detailed description '}) == {...
{ "split": "train", "index": 69236, "acecode_id": "bigcode_python_fns_49224", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a list of the first `n` Fibonacci numbers. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the sum of the two preceding ones. Your function should take a single...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_fibonacci(0) == []\", \"assert generate_fibonacci(1) == [0]\", \"assert generate_fibonacci(2) == [0, 1]\", \"assert generate_fibonacci(3) == [0, 1, 1]\", \"assert generate_fibonacci(4) == [0, 1, 1, 2]\", \"assert generate_fibonacci(5) == [0, 1, 1, 2...
{ "split": "train", "index": 69237, "acecode_id": "oss_29090", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 1-dimensional array 'arr', implement a function that calculates the sum of the products of all unique pairs (i, j) where i < j. The function should use only a single loop and should not utilize any external libraries or functions for matrix operations. Return the comput...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_special_optimized([1, 2, 3]) == 11\", \"assert sum_special_optimized([0, 0, 0]) == 0\", \"assert sum_special_optimized([1, -1, 1]) == -1\", \"assert sum_special_optimized([5, 5, 5]) == 75\", \"assert sum_special_optimized([10]) == 0\", \"assert sum_speci...
{ "split": "train", "index": 69238, "acecode_id": "evol_28935", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a metric name conversion function for a monitoring system. The function should take a list of metric names and convert them to a specific format based on the following rules: \n- If the metric name starts with 'mem.', it should be converted to '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_metric_names(['mem.used_bytes', 'cpu.idle_percentage', 'disk.read_bytes']) == ['memory.used_bytes', 'processor.idle_percentage', 'disk.read_bytes']\", \"assert convert_metric_names(['net.packets_received', 'mem.cache_hits']) == ['network.packets_rece...
{ "split": "train", "index": 69239, "acecode_id": "oss_22427", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates evaluating an arithmetic expression and then prints the result. The function takes three inputs: a string representing the arithmetic expression, a list of operations (like addition, subtraction, etc.), and a flag indicatin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_and_print('3 + 4', ['+', '-'], True) == 7.0\", \"assert evaluate_and_print('10 - 2', ['-'], True) == 8.0\", \"assert evaluate_and_print('5 * 6', ['*'], True) == 30.0\", \"assert evaluate_and_print('8 / 2', ['/'], True) == 4.0\", \"assert evaluate_an...
{ "split": "train", "index": 69240, "acecode_id": "bigcode_python_fns_46101", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers `a_list` and an integer `W`. Your task is to find the maximum absolute difference between any element in the list and the integer `W`. If the length of the list is 1, you should return the absolute difference between the single element in the li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_abs_difference([5], 3) == 2\", \"assert max_abs_difference([-1, 0, 1], 2) == 3\", \"assert max_abs_difference([10, 20, 30], 15) == 15\", \"assert max_abs_difference([-5, -10, -15], -8) == 7\", \"assert max_abs_difference([0, 0, 0], 5) == 5\", \"assert ma...
{ "split": "train", "index": 69241, "acecode_id": "oss_16495", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of wire names, where each wire name consists of a prefix followed by a numeric suffix (e.g., 'SR1BEG1', 'LV18', 'GFAN0'). Your task is to implement a function that organizes these wire names into segments based on their prefixes. Each unique prefix should m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert group_wires_by_prefix(['A1', 'A2', 'B1', 'B2', 'C1']) == {'A': {'A1', 'A2'}, 'B': {'B1', 'B2'}, 'C': {'C1'}}\", \"assert group_wires_by_prefix(['ONE1', 'ONE2', 'TWO1', 'THREE1', 'THREE2']) == {'ONE': {'ONE1', 'ONE2'}, 'TWO': {'TWO1'}, 'THREE': {'THREE1', 'TH...
{ "split": "train", "index": 69242, "acecode_id": "bigcode_python_fns_22172", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of usernames, write a function that retrieves the details (ID, username, and email) of each user from a simulated database. The function should return a list of user details, where each user's details are represented as a dictionary. Assume the database is a simple...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_user_details(['john_doe', 'jane_doe']) == [{'id': 1, 'username': 'john_doe', 'email': 'john@example.com'}, {'id': 2, 'username': 'jane_doe', 'email': 'jane@example.com'}]\", \"assert get_user_details(['alice']) == [{'id': 3, 'username': 'alice', 'email':...
{ "split": "train", "index": 69243, "acecode_id": "evol_13439", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a context object `mctx` which has two attributes: `status()` and `subset`. The `status()` method returns a list where the first element is a string representing the current status of the context. The `subset` attribute is a list of filenames. Your task is to imple...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert modified(MockMctx(['file1', 'file2', 'file3'], ['file1 is modified, file3 is modified'])) == ['file1', 'file3']\", \"assert modified(MockMctx(['fileA', 'fileB', 'fileC'], ['fileA is updated'])) == ['fileA']\", \"assert modified(MockMctx(['test1', 'test2', 't...
{ "split": "train", "index": 69244, "acecode_id": "bigcode_python_fns_35821", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two 3D points represented as lists of three integers, `point1` and `point2`, write a function `euclidean_distance(point1, point2)` that calculates the Euclidean distance between these two points. The function should return the distance as a float. If either of the input p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert euclidean_distance([1, 2, 3], [4, 5, 6]) == 5.196152422706632\", \"assert euclidean_distance([0, 0, 0], [0, 0, 0]) == 0.0\", \"assert euclidean_distance([1, 1, 1], [1, 1, 1]) == 0.0\", \"assert euclidean_distance([1, 2, 3], [1, 2]) == None\", \"assert euclid...
{ "split": "train", "index": 69245, "acecode_id": "bigcode_python_fns_10646", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a username and an email as inputs and returns a dictionary representing a user. The dictionary should have two keys: 'username' and 'email', with their corresponding values being the inputs provided to the function. Additionall...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_user('john_doe', 'john@example.com') == {'username': 'john_doe', 'email': 'john@example.com'}\", \"assert create_user('alice123', 'alice@domain.com') == {'username': 'alice123', 'email': 'alice@domain.com'}\", \"assert create_user('bob_smith', 'bob.sm...
{ "split": "train", "index": 69246, "acecode_id": "oss_14981", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to handle user input validation for a simple quiz application. The function should take a user's answer as input and return an appropriate response based on the following rules:\n\n- If the user's answer is empty or contains only whit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_input('') == '\\u30a8\\u30e9\\u30fc\\uff1a\\u5165\\u529b\\u304c\\u7a7a\\u3067\\u3059\\u3002\\u3082\\u3046\\u4e00\\u5ea6\\u5165\\u529b\\u3057\\u3066\\u304f\\u3060\\u3055\\u3044'\", \"assert validate_input(' ') == '\\u30a8\\u30e9\\u30fc\\uff1a\\u516...
{ "split": "train", "index": 69247, "acecode_id": "oss_26240", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that converts a string of binary numbers into its hexadecimal equivalent. You must not use built-in conversion functions. The input string will consist only of '0's and '1's and its length can vary. Return the hexadecimal representation as a string.\nPlease rea...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert binary_to_hex('1101') == 'D'\", \"assert binary_to_hex('101010') == '2A'\", \"assert binary_to_hex('11111111') == 'FF'\", \"assert binary_to_hex('10000000') == '80'\", \"assert binary_to_hex('0000') == '0'\", \"assert binary_to_hex('0001') == '1'\", \"assert...
{ "split": "train", "index": 69248, "acecode_id": "evol_1101", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that checks whether a given email address is valid. A valid email address is defined as one that follows the general format: local_part@domain, where the local part can contain letters, digits, underscores, dots, plus signs, and hyphens, and the domain can ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_email('test@example.com') == True\", \"assert is_valid_email('user.name+tag+sorting@example.com') == True\", \"assert is_valid_email('user@subdomain.example.com') == True\", \"assert is_valid_email('user@domain.co.uk') == True\", \"assert is_valid_e...
{ "split": "train", "index": 69249, "acecode_id": "evol_34063", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two strings, s1 and s2. Your task is to implement a function min_edits(s1, s2) that returns the minimum number of edits required to make the two strings equal. An edit can be an insertion, deletion, or substitution of a single character.\nPlease reason step by ste...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_edits('kitten', 'sitting') == 3\", \"assert min_edits('flaw', 'lawn') == 2\", \"assert min_edits('intention', 'execution') == 5\", \"assert min_edits('', 'abc') == 3\", \"assert min_edits('abc', '') == 3\", \"assert min_edits('', '') == 0\", \"assert min...
{ "split": "train", "index": 69250, "acecode_id": "evol_18682", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer n, return a list of integers from 0 to n - 1 representing the indices of a full bitstring of length n. The function should generate and return this list. For example, if the input is 8, the output should be [0, 1, 2, 3, 4, 5, 6, 7]. Write a function `ge...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_bit_indices(1) == [0]\", \"assert generate_bit_indices(2) == [0, 1]\", \"assert generate_bit_indices(3) == [0, 1, 2]\", \"assert generate_bit_indices(4) == [0, 1, 2, 3]\", \"assert generate_bit_indices(5) == [0, 1, 2, 3, 4]\", \"assert generate_bit_...
{ "split": "train", "index": 69251, "acecode_id": "bigcode_python_fns_26686", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a URL routing system for a web application that manages races. Your task is to implement a function that takes a list of race year pairs and returns a dictionary containing the URL patterns for the race detail views corresponding to those year pairs...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_race_urls([(2010, 2011)]) == {'2010-2011': '<int:year1>-<int:year2>/<slug>/' }\", \"assert generate_race_urls([(2000, 2001), (2002, 2003)]) == {'2000-2001': '<int:year1>-<int:year2>/<slug>/', '2002-2003': '<int:year1>-<int:year2>/<slug>/' }\", \"ass...
{ "split": "train", "index": 69252, "acecode_id": "oss_25363", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dates and a corresponding list of sample values. Your task is to implement a function that returns a list of extrapolated values based on the last valid sample for each weekday. The function should take three parameters: 'dates', which is a list of strin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extrapolate_values(['2023-10-01'], [10], [0]) == [10]\", \"assert extrapolate_values(['2023-10-01', '2023-10-08'], [10, 20], [0]) == [20]\", \"assert extrapolate_values(['2023-10-01', '2023-10-08', '2023-10-08'], [10, 20, 20], [0]) == [20]\", \"assert extrap...
{ "split": "train", "index": 69253, "acecode_id": "bigcode_python_fns_30160", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a string as input and returns the same string reversed. The function should handle edge cases such as empty strings and strings with special characters. Your function should be named `reverse_string`. The input will be a si...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_string('hello') == 'olleh'\", \"assert reverse_string('') == ''\", \"assert reverse_string('12345') == '54321'\", \"assert reverse_string('!@#$$%^&*()') == ')(*&^%$$#@!'\", \"assert reverse_string('Python') == 'nohtyP'\", \"assert reverse_string('rac...
{ "split": "train", "index": 69254, "acecode_id": "oss_9577", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `repeat_string(n: int, s: str) -> str` that takes an integer `n` and a string `s` as input, and returns a new string that consists of the string `s` repeated `n` times. If `n` is less than or equal to 0, the function should return an empty string. The input `n`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert repeat_string(3, 'abc') == 'abcabcabc'\", \"assert repeat_string(0, 'Hello') == ''\", \"assert repeat_string(1, 'Test') == 'Test'\", \"assert repeat_string(5, '') == ''\", \"assert repeat_string(2, '123') == '123123'\", \"assert repeat_string(4, 'a') == 'aaa...
{ "split": "train", "index": 69255, "acecode_id": "bigcode_python_fns_33177", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `variable_representation(name: str, value: Optional[str] = None) -> str` that returns a string representation of a variable. The function should take a variable name as a string and an optional value as a string. If the value is not p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert variable_representation('a') == 'a: None'\", \"assert variable_representation('b', 'hi') == 'b: hi'\", \"assert variable_representation('x') == 'x: None'\", \"assert variable_representation('y', 'test') == 'y: test'\", \"assert variable_representation('var1'...
{ "split": "train", "index": 69256, "acecode_id": "oss_30327", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two vectors, you need to implement a function that calculates the Euclidean distance between them. The function `euclidean_distance` takes a single argument `vects`, which is a tuple containing two lists of equal length representing the vectors. The function should return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert euclidean_distance(([], [])) == 0.0\", \"assert euclidean_distance(([1, 2, 3], [4, 5, 6])) == 5.196152422706632\", \"assert euclidean_distance(([0, 0], [0, 0])) == 0.0\", \"assert euclidean_distance(([1], [1])) == 0.0\", \"assert euclidean_distance(([10, 0],...
{ "split": "train", "index": 69257, "acecode_id": "oss_17982", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that generates a personalized greeting message based on a given name. The function should take a single string parameter, `name`, and return a greeting message in the format 'Hello, <NAME>!', where '<NAME>' is replaced with the provided name. If the input name ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_greeting('Alice') == 'Hello, Alice!'\", \"assert generate_greeting('Bob') == 'Hello, Bob!'\", \"assert generate_greeting('Charlie') == 'Hello, Charlie!'\", \"assert generate_greeting('') == 'Hello, World!'\", \"assert generate_greeting('Daisy') == '...
{ "split": "train", "index": 69258, "acecode_id": "oss_20262", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates an event notification system. The function `get_event_data(events)` takes a list of event dictionaries, each containing a type and associated data. The function should yield the data of events that have the type 'notificati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list(get_event_data([{'type': 'notification', 'data': {'id': 1, 'message': 'Event 1'}}, {'type': 'update', 'data': {}}])) == [{'id': 1, 'message': 'Event 1'}]\", \"assert list(get_event_data([{'type': 'update', 'data': {}}, {'type': 'update', 'data': {}}])) ...
{ "split": "train", "index": 69259, "acecode_id": "oss_18155", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing command line arguments for a simple command line utility. Your function should accept a list of command line arguments, a dictionary of previously parsed options and their values, a dictionary of default values for options, and a list of options t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_arguments(['--option1'], {}, {'--option1': 'default_value'}, ['--option1']) == ([], {'--option1': None})\", \"assert parse_arguments(['--option2'], {}, {'--option2': 'default_value'}, ['--option1', '--option2']) == ([], {'--option2': None})\", \"assert...
{ "split": "train", "index": 69260, "acecode_id": "bigcode_python_fns_31897", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are given an m x n matrix initialized with all 0's and a list of operations ops. Each operation is represented by a pair of integers [a, b], where a is the number of rows to increment by 1 and b is the number of columns to increment by 1. Perform all the operations specifie...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert maxCount(3, 3, [[2, 2], [3, 3]]) == 4\", \"assert maxCount(5, 5, [[1, 1], [4, 4]]) == 1\", \"assert maxCount(2, 2, [[2, 2]]) == 4\", \"assert maxCount(1, 1, []) == 1\", \"assert maxCount(7, 8, [[3, 3]]) == 9\", \"assert maxCount(1, 10, [[1, 10]]) == 10\", \"...
{ "split": "train", "index": 69261, "acecode_id": "oss_21093", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a Python function to rotate a square 2D matrix clockwise by a given number of steps. If the input matrix is not square, the function should raise a ValueError. The number of steps may be greater than the number of layers in the matrix, so you should account for this by re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotate([[1, 2], [3, 4]], 0) == [[1, 2], [3, 4]]\", \"assert rotate([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]], 1) == [[13, 9, 5, 1], [14, 10, 6, 2], [15, 11, 7, 3], [16, 12, 8, 4]]\", \"assert rotate([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 4)...
{ "split": "train", "index": 69262, "acecode_id": "evol_17919", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Write a function that takes a list of mixed elements as input and outputs a string representation of all integer elements in the list. Each integer should be converted to a string and concatenated, separated by a comma and a space. Any non-integer elements should be ignored wit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert stringify_int_list([4, 'abc', 10, '15', None, 15, 1.2, 5]) == '4, 10, 15, 5'\", \"assert stringify_int_list([1, 2, 3]) == '1, 2, 3'\", \"assert stringify_int_list(['a', 'b', 'c']) == ''\", \"assert stringify_int_list([]) == ''\", \"assert stringify_int_list(...
{ "split": "train", "index": 69263, "acecode_id": "evol_32877", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing a tuple that contains various numerical values representing different metrics from a neural network's output. Your goal is to implement a function `get_first_metric` that takes a tuple `metrics` as input and returns the first element of the tuple....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_first_metric((5.2, 1.3, 4.8)) == 5.2\", \"assert get_first_metric((10.0, -2.4, 3.7)) == 10.0\", \"assert get_first_metric((-1.5, 2.2, 0.0)) == -1.5\", \"assert get_first_metric((0, 0, 0)) == 0\", \"assert get_first_metric((1.1, 2.2)) == 1.1\", \"assert g...
{ "split": "train", "index": 69264, "acecode_id": "oss_16041", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers `nums` and an integer `k`, return the number of continuous subarrays that are considered 'nice'. A subarray is nice if it contains exactly `k` odd numbers, the sum of its elements is divisible by `k`, the length of the subarray is less than or equal t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert numberOfSubarrays([1, 1, 2, 1, 1], 3) == 0\", \"assert numberOfSubarrays([2, 4, 6], 1) == 0\", \"assert numberOfSubarrays([1, 2, 3, 4, 5], 3) == 0\", \"assert numberOfSubarrays([2, 2, 2, 2], 1) == 0\", \"assert numberOfSubarrays([1, 2, 3, 4, 5, 6], 3) == 0\"...
{ "split": "train", "index": 69265, "acecode_id": "evol_18861", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are given a list of sequences, where each sequence is a list of integers. Your task is to pad each sequence to the same length, which is determined by the longest sequence in the list. If a sequence exceeds a specified maximum length, it should be truncated either from the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pad_sequences([[1, 2], [3, 4, 5]], maxlen=None, padding='post', truncating='post', value=0) == [[1, 2, 0], [3, 4, 5]]\", \"assert pad_sequences([[1, 2], [3, 4, 5]], maxlen=2, padding='post', truncating='post', value=0) == [[1, 2], [3, 4]]\", \"assert pad_seq...
{ "split": "train", "index": 69266, "acecode_id": "bigcode_python_fns_35214", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, write a function `find_odd_frequency_element(arr)` that returns the first integer that appears an odd number of times in the array. If no such integer exists, return None.\nPlease reason step by step, then write a self-contained Python solution. Give...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_odd_frequency_element([1, 1, 2, 2, 3, 3, 4]) == 4\", \"assert find_odd_frequency_element([5, 5, 5, 6, 6, 7]) == 5\", \"assert find_odd_frequency_element([10, 10, 10, 20, 20, 30]) == 10\", \"assert find_odd_frequency_element([0, 0, 1]) == 1\", \"assert f...
{ "split": "train", "index": 69267, "acecode_id": "evol_13449", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that calculates the mean, median, and mode of a given list of integers and identifies any outliers using the Z-score method. An outlier is defined as a value that has a Z-score greater than 2. Your function should take in a list of in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_statistics([10, 10, 10, 10]) == {'mean': 10.0, 'median': 10.0, 'mode': 10, 'outliers': []}\", \"assert calculate_statistics([1, 2, 3, 4, 5]) == {'mean': 3.0, 'median': 3.0, 'mode': 1, 'outliers': []}\", \"assert calculate_statistics([5, 5, 5, 5, 5,...
{ "split": "train", "index": 69268, "acecode_id": "evol_12847", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that determines the data type of elements in a given list. Your function should take a list as input and return a string indicating the type of elements stored in the list. If the list is empty, return 'No data'. If the list contai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert determine_datatype([]) == 'No data'\", \"assert determine_datatype([1, 2, 3]) == 'int'\", \"assert determine_datatype(['a', 'b', 'c']) == 'str'\", \"assert determine_datatype([1.0, 2.5, 3.2]) == 'float'\", \"assert determine_datatype([True, False]) == 'bool'...
{ "split": "train", "index": 69269, "acecode_id": "oss_10054", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `validate_email(email: str) -> bool` that checks if the provided email address is valid according to standard email formatting rules. The email is considered valid if it adheres to the general structure of 'local_part@domain'. The local part may contain let...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_email('test@email.com') == True\", \"assert validate_email('user.name+tag+sorting@example.com') == True\", \"assert validate_email('example@domain.co') == True\", \"assert validate_email('plainaddress') == False\", \"assert validate_email('@missingl...
{ "split": "train", "index": 69270, "acecode_id": "evol_18511", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are required to implement a Singleton class in Python that ensures a single instance of the class can be created. The class should have a method `instance()` that returns the single instance of the Singleton class. If the instance already exists, it should return that insta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert Singleton.instance() is Singleton.instance()\", \"assert Singleton.instance() is not None\", \"assert isinstance(Singleton.instance(), Singleton)\", \"assert Singleton.instance() is Singleton.instance()\", \"assert isinstance(Singleton.instance(), Singleton)...
{ "split": "train", "index": 69271, "acecode_id": "oss_10439", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a list of integers and returns a new list containing only the unique integers from the original list, preserving the order of their first appearance. Your function should not use any external libraries or modules. Implement...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 4, 4]) == [1, 3]\", \"assert unique_integers([5, 5, 5, 5]) == []\", \"assert unique_integers([]) == []\", \"assert unique_integers([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_integers([1, 1, 2, 2, 3]) == [3]\", \"asser...
{ "split": "train", "index": 69272, "acecode_id": "oss_13443", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a starting month represented as a string (e.g., 'January', 'February', etc.) and an integer representing the number of months to move forward, return the name of the month you will arrive at after moving forward from the starting month. The month names are case-sensitive ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_month('June', 6) == 'December'\", \"assert find_month('January', 0) == 'January'\", \"assert find_month('December', 1) == 'January'\", \"assert find_month('March', 9) == 'December'\", \"assert find_month('April', 8) == 'December'\", \"assert find_month(...
{ "split": "train", "index": 69273, "acecode_id": "evol_23839", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function named `lexeme_frequency` that takes a string `lexeme` and a list of strings `strings`. The function should return the frequency percentage of the specified lexeme within the concatenated string of all elements in the list. The comparison should be case-inse...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lexeme_frequency('banana', ['Banana', 'banana', 'BANANA', 'Banana smoothie']) == 80.0\", \"assert lexeme_frequency('orange', ['Apple', 'Banana', 'Grape']) == 0.0\", \"assert lexeme_frequency('word', ['word', 'Word', 'WORD']) == 100.0\", \"assert lexeme_frequ...
{ "split": "train", "index": 69274, "acecode_id": "evol_18618", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with rounding up a given integer `waveform_length` to the nearest multiple of a specified `waveform_granularity`. Additionally, it should ensure that the rounded-up length is at least a specified `min_waveform_length`. Implement a function `round_up_waveform_leng...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert round_up_waveform_length(5, 3, 10) == 10\", \"assert round_up_waveform_length(11, 3, 10) == 12\", \"assert round_up_waveform_length(7, 5, 12) == 12\", \"assert round_up_waveform_length(15, 4, 8) == 16\", \"assert round_up_waveform_length(2, 1, 5) == 5\", \"a...
{ "split": "train", "index": 69275, "acecode_id": "oss_25843", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a Python function that accepts a list of strings and returns a dictionary containing the frequency of each distinct character from each string. Additionally, for each string, the dictionary should include the character with the highest frequency. In case of a tie for the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert frequency_counter(['apple']) == {'apple': {'Frequency': {'a': 1, 'e': 1, 'l': 1, 'p': 2}, 'Max': 'p'}}\", \"assert frequency_counter(['banana']) == {'banana': {'Frequency': {'a': 3, 'b': 1, 'n': 2}, 'Max': 'a'}}\", \"assert frequency_counter(['cherry']) == {...
{ "split": "train", "index": 69276, "acecode_id": "evol_28789", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `raise_if(cond: bool, cls: type, msg: str) -> None` that raises an exception of type `cls` with the message `msg` if the boolean condition `cond` is true. If `cond` is false, the function should do nothing. The function should handle any standard exception ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert raise_if(False, ValueError, 'This is a value error') is None\", \"assert raise_if(False, IndexError, 'Index out of range') is None\", \"assert raise_if(False, KeyError, 'Key not found') is None\", \"assert raise_if(False, Exception, 'General exception') is N...
{ "split": "train", "index": 69277, "acecode_id": "bigcode_python_fns_4173", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing segment lengths in seconds. Your task is to implement a function that takes this list and returns the total length of all segments in minutes. You need to round down the result to the nearest whole number. For example, if the total ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_segment_length([60, 120, 300]) == 8\", \"assert total_segment_length([30, 30, 30]) == 1\", \"assert total_segment_length([59, 59, 59]) == 2\", \"assert total_segment_length([0]) == 0\", \"assert total_segment_length([61]) == 1\", \"assert total_segment...
{ "split": "train", "index": 69278, "acecode_id": "bigcode_python_fns_8708", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `check_range(min_val, max_val, num)` that takes in three integer parameters: `min_val`, `max_val`, and `num`. The function should return a boolean value based on the following conditions: If `num` is greater than or equal to `min_val`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_range(3, 7, 5) == True\", \"assert check_range(0, 10, 10) == True\", \"assert check_range(-5, 5, 0) == True\", \"assert check_range(3, 7, 2) == False\", \"assert check_range(0, 10, 11) == False\", \"assert check_range(-5, 5, 10) == False\", \"assert ch...
{ "split": "train", "index": 69279, "acecode_id": "oss_25661", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a class called `Student` that handles sensitive data, specifically a student's roll number. The class should be able to encrypt and decrypt the roll number using a simple algorithm. The roll number should be encrypted when it is set and decrypte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert Student('Alice', 'A123')._decrypt_roll_number() == 'A123'\", \"assert Student('Bob', 'B456')._decrypt_roll_number() == 'B456'\", \"assert Student('Charlie', 'C789')._decrypt_roll_number() == 'C789'\", \"assert Student('David', 'D000')._decrypt_roll_number() ...
{ "split": "train", "index": 69280, "acecode_id": "evol_25131", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that takes a positive integer n as input and returns the factorial of that integer. The factorial of a non-negative integer n is the product of all positive integers less than or equal to n. For example, factorial(5) should return 120, which is 5 x 4 x 3 x 2 x ...
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": 69281, "acecode_id": "evol_174", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two strings, s and t, write a function `isAnagram` that determines if t is an anagram of s. An anagram is defined as a word or phrase formed by rearranging the letters of another word or phrase, using all the original letters exactly once. Your function should return True...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert isAnagram('listen', 'silent') == True\", \"assert isAnagram('triangle', 'integral') == True\", \"assert isAnagram('apple', 'papel') == True\", \"assert isAnagram('rat', 'car') == False\", \"assert isAnagram('anagram', 'nagaram') == True\", \"assert isAnagram...
{ "split": "train", "index": 69282, "acecode_id": "oss_16328", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a recursive function that takes a nested list containing integers and floating-point numbers and returns the total sum of all the numbers in the nested list, regardless of the level of nesting. The function should handle arbitrary levels of nested lists.\nPlease reaso...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rec_sum([]) == 0\", \"assert rec_sum([1, 2, 3]) == 6\", \"assert rec_sum([1, [2, 3], 4]) == 10\", \"assert rec_sum([[1, 2], [3, 4]]) == 10\", \"assert rec_sum([1.5, [2.5, [3.5]]]) == 7.5\", \"assert rec_sum([1, 2, [3, [4, 5]]]) == 15\", \"assert rec_sum([1, ...
{ "split": "train", "index": 69283, "acecode_id": "evol_28571", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the loading of a generator model configuration. The function should take a configuration dictionary as input and return a string that describes the status of the loading process. The configuration dictionary contains the fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert load_generator_status({'seed': 42, 'ema': True, 'ema_decay': 0.99, 'ema_start': 100, 'use_ema': True}) == 'Generator loaded successfully'\", \"assert load_generator_status({'seed': 42, 'ema': False, 'ema_decay': 0.99, 'ema_start': 100, 'use_ema': False}) == ...
{ "split": "train", "index": 69284, "acecode_id": "bigcode_python_fns_29666", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given two lists, `operation_elements` and `number_elements`, implement a function that constructs and evaluates a mathematical expression based on these lists. The `operation_elements` list contains basic arithmetic operations (addition '+', subtraction '-', multiplication '*',...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_arithmetic_functions(['-', '+'], [10, 3, 2]) == 9\", \"assert execute_arithmetic_functions(['//', '**'], [8, 2, 3]) == 64\", \"assert execute_arithmetic_functions(['+', '//'], [10, 3, 2]) == 6\", \"assert execute_arithmetic_functions(['**', '+'], [2,...
{ "split": "train", "index": 69285, "acecode_id": "evol_23720", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that validates a list or dictionary of functionalities. The function should ensure that the input is a list or dictionary containing only instances of a specified type. If the input does not meet these criteria, the function should ra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_functionalities([1, 2, 3], int) == [1, 2, 3]\", \"assert validate_functionalities([], str) == []\", \"assert validate_functionalities({}, float) == []\", \"assert validate_functionalities('not a list or dict', int) == []\", \"assert validate_functio...
{ "split": "train", "index": 69286, "acecode_id": "oss_25617", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a string containing lowercase and uppercase alphabets, as well as punctuation marks and special characters, implement a function `find_least_freq_chars(text: str) -> List[str]` that returns a list containing the least frequent and second least frequent letters in the stri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_least_freq_chars('aabbcc') == ['a', 'b']\", \"assert find_least_freq_chars('abcdef') == ['a', 'b']\", \"assert find_least_freq_chars('!@#$%^&*()') == []\", \"assert find_least_freq_chars('abc!xyz!') == ['a', 'b']\", \"assert find_least_freq_chars('zzzyy...
{ "split": "train", "index": 69287, "acecode_id": "evol_33690", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of integers `target`, a starting integer `start`, and an ending integer `end`. Your task is to implement a function `perform_operation(target, start, end)` that modifies the `target` list based on the following rules: 1. Start with `s` initialized to 2. 2. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert perform_operation([2, 4, 6, 8, 10], 1, 10) == []\", \"assert perform_operation([11, 13, 17, 19], 5, 20) == [11, 13, 17, 19]\", \"assert perform_operation([6, 12, 18], 2, 20) == []\", \"assert perform_operation([4, 8, 12], 3, 10) == []\", \"assert perform_ope...
{ "split": "train", "index": 69288, "acecode_id": "oss_7414", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given a list of 2D points represented as tuples of (x, y) coordinates, your task is to write a function that calculates the angle (in degrees) between each point and a main reference point. The angle should be measured in the counter-clockwise direction from the positive x-axis...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_angles([(0, 1), (1, 0), (1, 1)], (0, 0)) == [90.0, 0.0, 45.0]\", \"assert calculate_angles([(2, 2), (5, 5), (10, 10)], (1, 1)) == [45.0, 45.0, 45.0]\", \"assert calculate_angles([(1, 1), (2, 2), (3, 3)], (0, 0)) == [45.0, 45.0, 45.0]\", \"assert ca...
{ "split": "train", "index": 69289, "acecode_id": "oss_11106", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Implement a function that takes a multi-dimensional list of mixed values (both numeric and non-numeric) and returns a sorted list of distinct numeric values. The function should remove all non-numeric values and handle duplicate numeric values by placing them next to each other...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sorted_numeric_values([[5, 'b', 3, 2, 1], [4, 'c', 3, 1, 2], [1, 'a', 2, 4, 5]]) == [1, 2, 3, 4, 5]\", \"assert sorted_numeric_values([[10, 'x', 8], [7, 'y', 5, 5]]) == [5, 7, 8, 10]\", \"assert sorted_numeric_values([['a', 'b', 'c'], [1, 2, 3]]) == [1, 2, 3...
{ "split": "train", "index": 69290, "acecode_id": "evol_17632", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing different maximum depths, you need to compute the norm_cut scores for each depth based on a predefined graph structure. The function should take in a list of integers (max_depths) and return a list of tuples where each tuple consists of an ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_norm_cut_scores([1, 2, 3]) == [(1, 0.5), (2, 0.3333333333333333), (3, 0.25)]\", \"assert compute_norm_cut_scores([0, 5, 10]) == [(0, 1.0), (5, 0.16666666666666666), (10, 0.09090909090909091)]\", \"assert compute_norm_cut_scores([4]) == [(4, 0.2)]\", ...
{ "split": "train", "index": 69291, "acecode_id": "bigcode_python_fns_13457", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that manages a list of contacts. Each contact is represented as a dictionary containing the following attributes: 'name', 'email', 'mobile', and 'message'. Your function should take a list of contacts and return a list of contact details,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_contacts([]) == []\", \"assert format_contacts([{'name': 'Alice', 'email': 'alice@example.com', 'mobile': 1234567890, 'message': 'Hello!'}]) == ['Name: Alice, Email: alice@example.com, Mobile: 1234567890, Message: Hello!']\", \"assert format_contacts(...
{ "split": "train", "index": 69292, "acecode_id": "oss_17377", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to poll the status of an operation until it is marked as 'DONE' or a specified timeout is reached. Implement a Python function `poll_operation_status` that takes the following parameters: \n- `operation`: A dictionary representing the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert poll_operation_status({'status': 'DONE'}, 1) == 'DONE'\", \"assert poll_operation_status({'status': 'PENDING'}, 0) == 'TIMEOUT'\", \"assert poll_operation_status({'status': 'DONE'}, 0) == 'DONE'\", \"assert poll_operation_status({'status': 'IN_PROGRESS'}, 0)...
{ "split": "train", "index": 69293, "acecode_id": "oss_9417", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Write a function `extract_keyword` that takes a URL as a string and a keyword as a string. The function should return True if the keyword is present in the URL, and False otherwise.\nPlease reason step by step, then write a self-contained Python solution. Give your final progra...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_keyword('https://www.test.com/where-is-the-key', 'key') == True\", \"assert extract_keyword('https://www.example.com/home', 'key') == False\", \"assert extract_keyword('http://example.org/path/to/resource', 'path') == True\", \"assert extract_keyword...
{ "split": "train", "index": 69294, "acecode_id": "evol_32112", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary where the keys are integers representing sample numbers and the values are their corresponding probabilities (positive integers). Your task is to create a function `normalize_probability(P)` that takes this dictionary as input and returns a tuple cont...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert normalize_probability({1: 2, 2: 3}) == ([1, 2], [0.4, 0.6])\", \"assert normalize_probability({1: 1, 2: 1, 3: 1}) == ([1, 2, 3], [0.3333333333333333, 0.3333333333333333, 0.3333333333333333])\", \"assert normalize_probability({1: 0, 2: 0}) == ([1, 2], [0.0, 0...
{ "split": "train", "index": 69295, "acecode_id": "bigcode_python_fns_27965", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to process a list of plate IDs. Each plate ID consists of a string representing a combination of letters and numbers. The function should partition the list of plate IDs into two separate lists based on a specific criterion. The crite...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert partition_plate_ids(['AB12', 'CD34', 'EF', '56GH', 'IJ78']) == (['EF'], ['AB12', 'CD34', '56GH', 'IJ78'])\", \"assert partition_plate_ids(['A', 'B', 'C', '12', '34', 'AB']) == (['A', 'B', 'C', 'AB'], [])\", \"assert partition_plate_ids(['XYZ', '123ABC', '456...
{ "split": "train", "index": 69296, "acecode_id": "oss_33129", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two numbers representing the length and width of a rectangle, write a function `calculate_rectangle_area(length: float, width: float) -> float` that calculates and returns the area of the rectangle. The function should handle positive, negative, and zero values for the le...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_rectangle_area(5, 4) == 20\", \"assert calculate_rectangle_area(0, 7) == 0\", \"assert calculate_rectangle_area(-3, 6) == -18\", \"assert calculate_rectangle_area(1000000, 1000000) == 1000000000000\", \"assert calculate_rectangle_area(3.5, 2.5) == ...
{ "split": "train", "index": 69297, "acecode_id": "oss_21576", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a Python list `spam` containing various elements. Your task is to write a Python function that performs the following operations on this list:\n\n1. Replace the elements at index 2 and 3 with 'CAT', 'MOOSE', and 'BEAR' respectively.\n2. Delete the element at index...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_operations(['APPLE', 'BANANA', 'ORANGE', 'PINEAPPLE']) == ['APPLE', 'BANANA', 'MOOSE', 'BEAR']\", \"assert list_operations(['ONE', 'TWO', 'THREE', 'FOUR']) == ['ONE', 'TWO', 'MOOSE', 'BEAR']\", \"assert list_operations(['A', 'B', 'C']) == ['A', 'B', 'MO...
{ "split": "train", "index": 69298, "acecode_id": "oss_32463", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that returns the path to a photo dataset based on the dataset version provided. The function should handle two dataset versions: 'lite' and 'full'. If the dataset version is 'lite', the function should return the path '/path/to/lit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert set_photo_dataset_path('lite') == '/path/to/lite/photos'\", \"assert set_photo_dataset_path('full') == '/path/to/full/photos'\", \"assert set_photo_dataset_path('lite') == '/path/to/lite/photos'\", \"assert set_photo_dataset_path('full') == '/path/to/full/ph...
{ "split": "train", "index": 69299, "acecode_id": "oss_24617", "num_tests": 14 }