data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are given a list of 3D keypoints of the human body represented as a list of tuples, where each tuple contains three floating-point values representing the coordinates (x, y, z) of a joint. Your task is to implement a function `check_keypoints_validity(keypoints: List[Tuple[...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_keypoints_validity([(1.0, 2.0, 3.0), (4.0, 5.0, 6.0)]) == True\", \"assert check_keypoints_validity([(1.0, 2.0, float('nan')), (4.0, 5.0, 6.0)]) == False\", \"assert check_keypoints_validity([]) == True\", \"assert check_keypoints_validity([(0.0, 0.0, ...
{ "split": "train", "index": 79200, "acecode_id": "bigcode_python_fns_13017", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of numbers, write a function that takes this list as input and returns a new list where the elements at even indices remain unchanged, and the elements at odd indices are sorted in ascending order. The input list may contain both integer and decimal (floating-point...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_odd([1.5, 2.3, 3.1]) == [1.5, 2.3, 3.1]\", \"assert sort_odd([2, 1, 4, 3]) == [2, 1, 4, 3]\", \"assert sort_odd([0.5, 0.1, 0.3, 0.2]) == [0.5, 0.1, 0.3, 0.2]\", \"assert sort_odd([10, 9, 8, 7, 6]) == [10, 7, 8, 9, 6]\", \"assert sort_odd([-1, -2, -3, -4...
{ "split": "train", "index": 79201, "acecode_id": "evol_34998", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Write a function 'char_count' which takes a string representing a word as input and returns a dictionary showing the number of vowels, consonants, and special characters in the string. In this case, vowels are 'a', 'e', 'i', 'o', 'u', and 'y' ONLY when it is at the end of the g...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert(char_count('abcde') == {'Vowels': 2, 'Consonants': 3, 'Special characters': 0})\", \"assert(char_count('ACEDY') == {'Vowels': 3, 'Consonants': 2, 'Special characters': 0})\", \"assert(char_count('hello!') == {'Vowels': 2, 'Consonants': 3, 'Special characters...
{ "split": "train", "index": 79202, "acecode_id": "evol_29056", "num_tests": 8 }
acecode
[ { "role": "user", "content": "A decimal number is called deci-binary if each of its digits is either `0` or `1` without any leading zeros. For example, `101` and `1100` are deci-binary, while `112` and `3001` are not. Given a string `n` that represents a positive decimal integer, return the minimum number o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_partitions('100') == (1, [100])\", \"assert min_partitions('123') == (3, [111, 11, 1])\", \"assert min_partitions('10') == (1, [10])\", \"assert min_partitions('20') == (2, [10, 10])\", \"assert min_partitions('99') == (9, [11, 11, 11, 11, 11, 11, 11, 11...
{ "split": "train", "index": 79203, "acecode_id": "evol_28890", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a list of integers, your task is to implement a function that returns a new list containing only the unique elements from the original list, preserving the order of their first occurrence. You should ignore any duplicates that appear later in the list. Write a function `u...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 3, 2, 1]) == [1, 2, 3]\", \"assert unique_elements([4, 4, 4, 4]) == [4]\", \"assert unique_elements([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_elements([]) == []\", \"assert unique_elements([5, 3, 5, 2, 3, 1]) == [5, 3, 2, ...
{ "split": "train", "index": 79204, "acecode_id": "bigcode_python_fns_10593", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents a tweet with various attributes. Your task is to write a function `retrieve_tweets(tweets: List[Dict[str, Any]]) -> List[str]` that extracts the text of each tweet from the list and returns them as a list of...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retrieve_tweets([{'text': 'Hello World'}, {'text': 'Python is great'}, {'user': 'user1'}]) == ['Hello World', 'Python is great']\", \"assert retrieve_tweets([{'text': 'Tweet 1'}, {'text': 'Tweet 2'}]) == ['Tweet 1', 'Tweet 2']\", \"assert retrieve_tweets([{'...
{ "split": "train", "index": 79205, "acecode_id": "bigcode_python_fns_16305", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a parser for a simple programming language that supports only the \"begin\" keyword to indicate the start of a program. Your parser should be able to recognize and validate the syntax of a given input program. Write a function `parse_program` th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_program('begin') == True\", \"assert parse_program('begin ') == True\", \"assert parse_program('begin end') == False\", \"assert parse_program('start') == False\", \"assert parse_program('') == False\", \"assert parse_program(' ') == False\", \"asse...
{ "split": "train", "index": 79206, "acecode_id": "oss_529", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of sentences, where each sentence is a string. Your task is to write a function that computes the length of each sentence and returns a list containing the lengths of the sentences. The function should take a single parameter, a list of strings, and return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sentence_length(['Python', 'is', 'great']) == [6, 2, 5]\", \"assert sentence_length(['']) == [0]\", \"assert sentence_length(['A', 'B', 'C']) == [1, 1, 1]\", \"assert sentence_length(['Hello', 'world', 'this', 'is', 'LeetCode']) == [5, 5, 4, 2, 8]\", \"asser...
{ "split": "train", "index": 79207, "acecode_id": "bigcode_python_fns_19770", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `src1` and `src2`, of the same length, write a function `accumulate_product(src1, src2)` that returns a new list where each element at index `i` is the product of `src1[i]` and `src2[i]`. You can assume that the input lists will always have the same...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert accumulate_product([1, 2, 3], [4, 5, 6]) == [4, 10, 18]\", \"assert accumulate_product([-1, -2, -3], [1, 2, 3]) == [-1, -4, -9]\", \"assert accumulate_product([0, 1, 2], [10, 20, 30]) == [0, 20, 60]\", \"assert accumulate_product([2, 4, 6], [1, 3, 5]) == [2,...
{ "split": "train", "index": 79208, "acecode_id": "bigcode_python_fns_12042", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing temperature readings for each day of a year. Your task is to create a function that will take this list of temperatures and interpolate the readings to fit a new list of day-of-year indices. The new list may represent a different nu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert interpolate_temperatures([0, 10, 20, 30, 40, 50, 60, 70, 80, 90], [5, 6, 7]) == [50.0, 60.0, 70.0]\", \"assert interpolate_temperatures([0, 0, 0, 0], [1, 2, 3]) == [0.0, 0.0, 0.0]\", \"assert interpolate_temperatures([1, 1, 1, 1], [1, 2, 3]) == [1.0, 1.0, 1....
{ "split": "train", "index": 79209, "acecode_id": "bigcode_python_fns_35557", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given two images, represented as 2D arrays of pixel intensities, and you need to determine if they are similar or not. Two images are considered similar if they belong to the same class. Write a function `are_images_similar(image1: List[List[int]], image2: List[List[int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert are_images_similar([[0, 0], [0, 0]], [[1, 1], [1, 1]], 0, 1) == False\", \"assert are_images_similar([[0, 0], [0, 0]], [[0, 0], [0, 0]], 1, 1) == True\", \"assert are_images_similar([[255, 255], [255, 255]], [[255, 255], [255, 255]], 2, 2) == True\", \"asser...
{ "split": "train", "index": 79210, "acecode_id": "oss_24344", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings representing file paths, implement a function `is_no_entitled(requests: List[str]) -> List[bool]` that checks if any of the provided paths contain the substring 'source-status'. The function should return a list of boolean values indicating whether each ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_no_entitled(['source-status', 'other-path', 'source-status/file']) == [True, False, True]\", \"assert is_no_entitled(['test', 'source-status/test', 'example']) == [False, True, False]\", \"assert is_no_entitled(['source-status']) == [True]\", \"assert is_...
{ "split": "train", "index": 79211, "acecode_id": "bigcode_python_fns_45863", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `fetch_character(string: str, k: int) -> str` that returns the k-th character of the given string, where k is a 1-based index (k > 0). If k is less than or equal to 0 or if the string has fewer characters than k, the function should return an empty string. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fetch_character('Hello!', 3) == 'l'\", \"assert fetch_character('Hello!', 1) == 'H'\", \"assert fetch_character('Hello!', 0) == ''\", \"assert fetch_character('Hello!', -1) == ''\", \"assert fetch_character('Python', 2) == 'y'\", \"assert fetch_character('Py...
{ "split": "train", "index": 79212, "acecode_id": "evol_32545", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with cleaning a string or a list of strings by removing invalid characters and replacing them with a specific character. Given a string or a list of strings, your function should sanitize the input by only allowing valid characters specified in a set. Any charact...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sanitize_input('hello@world', {'h', 'e', 'l', 'o', 'w', 'r', 'd'}, 'X') == 'helloXworld'\", \"assert sanitize_input(['test1', 'test2$'], {'t', 'e', 's', '1', '2'}, 'X') == ['test1', 'test2X']\", \"assert sanitize_input('123abc', {'1', '2', '3', 'a', 'b', 'c'...
{ "split": "train", "index": 79213, "acecode_id": "bigcode_python_fns_38542", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a two-dimensional list of integers representing a digital elevation model (DEM), write a function `calculate_aspect(dem: List[List[int]], flat_values_are_zero: bool = False) -> List[List[int]]` that returns a new two-dimensional list where each element represents the aspe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_aspect([[10, 10], [10, 10]], flat_values_are_zero=True) == [[-9999, -9999], [-9999, -9999]]\", \"assert calculate_aspect([[10, 10, 10], [10, 10, 10], [10, 10, 10]], flat_values_are_zero=False) == [[0, 0, 0], [0, 0, 0], [0, 0, 0]]\", \"assert calcul...
{ "split": "train", "index": 79214, "acecode_id": "bigcode_python_fns_9912", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with counting the number of infected individuals in a population. Each individual in the population can either be infected or not. You need to implement a function `count_infected(population: List[bool]) -> int` that takes a list of boolean values representing th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_infected([True, False, True]) == 2\", \"assert count_infected([False, False, False]) == 0\", \"assert count_infected([True, True, True]) == 3\", \"assert count_infected([]) == 0\", \"assert count_infected([False, True, False, True, True]) == 3\", \"ass...
{ "split": "train", "index": 79215, "acecode_id": "bigcode_python_fns_6304", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary where the keys are unique and the values can be repeated, write a function that inverts the dictionary such that the original values become the keys and the original keys become the values. If a value is repeated in the original dictionary, concatenate the co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert invert_dictionary({'a': 1, 'b': 2, 'c': 1}) == {1: ['a', 'c'], 2: ['b']}\", \"assert invert_dictionary({'x': 5, 'y': 5, 'z': 10}) == {5: ['x', 'y'], 10: ['z']}\", \"assert invert_dictionary({'one': 1, 'two': 2, 'three': 3}) == {1: ['one'], 2: ['two'], 3: ['t...
{ "split": "train", "index": 79216, "acecode_id": "bigcode_python_fns_5260", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary of parameters that represents a configuration and a string that denotes the file type ('json', 'yaml', or 'pyini'). Write a function `write_config` that takes in an output file path, the dictionary of parameters, and the file type. The function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert write_config('config.yaml', {'key': 'value'}, 'yaml') is None\", \"assert write_config('config.json', {'name': 'test', 'version': 1}, 'json') is None\", \"assert write_config('config.ini', {'section': {'option': 'value'}}, 'pyini') is None\", \"assert write_...
{ "split": "train", "index": 79217, "acecode_id": "bigcode_python_fns_30826", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple function that simulates a document management system association. Your function should take an integer as input representing a document ID and return a string that describes a document association. The output string should be in the format ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_document_association(1) == 'DocumentAssociation: 1'\", \"assert create_document_association(5) == 'DocumentAssociation: 5'\", \"assert create_document_association(10) == 'DocumentAssociation: 10'\", \"assert create_document_association(-1) == 'Invalid...
{ "split": "train", "index": 79218, "acecode_id": "oss_17171", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a volume in microliters, which can either be provided as an integer or a string in the format 'value:unit', where 'unit' can be any valid volume unit. Your task is to create a function that converts this volume into microliters. If the input is an integer, return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_microliters(500) == 500\", \"assert convert_to_microliters('1:milliliters') == 1000\", \"assert convert_to_microliters('1:liters') == 1000000\", \"assert convert_to_microliters('2:cubic centimeters') == 2000\", \"assert convert_to_microliters('0:l...
{ "split": "train", "index": 79219, "acecode_id": "bigcode_python_fns_14414", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string input, return the string in lowercase. If the input is not a valid string or is None, return the string as is. If the input is None, return the default value '(not provided)'. Implement a function `lowercase_or_notify(input_string: str) -> str` that performs this...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lowercase_or_notify('HELLO') == 'hello'\", \"assert lowercase_or_notify('World') == 'world'\", \"assert lowercase_or_notify('Python3') == 'python3'\", \"assert lowercase_or_notify('LeetCode') == 'leetcode'\", \"assert lowercase_or_notify('') == ''\", \"asser...
{ "split": "train", "index": 79220, "acecode_id": "bigcode_python_fns_34158", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a version string representing a specific version of Python (e.g., '3.8', '3', or an empty string). Your task is to implement a function that returns the recommended Python executable name based on the following rules: \n\n1. If the version string is not empty, ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_python_executable('3.8') == 'python3.8'\", \"assert get_python_executable('3') == 'python3'\", \"assert get_python_executable('2.7') == 'python2.7'\", \"assert get_python_executable('') == 'python'\", \"assert get_python_executable('3.9') == 'python3.9'\...
{ "split": "train", "index": 79221, "acecode_id": "bigcode_python_fns_11172", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a summary report from a list of test cases. Each test case is represented as a dictionary containing the following keys: 'name' (a string representing the name of the test case), 'result' (a boolean indicating if the te...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_test_summary([{'name': 'Test1', 'result': True, 'tags': ['smoke', 'regression']}, {'name': 'Test2', 'result': False, 'tags': ['smoke']}, {'name': 'Test3', 'result': True, 'tags': ['regression']}]) == {'total_cases': 3, 'passed_cases': 2, 'failed_cas...
{ "split": "train", "index": 79222, "acecode_id": "bigcode_python_fns_48547", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Implement a function `is_valid_sequence(sequence: str) -> bool` that checks if a given string starts with the letter 'a' and ends with the letter 'b', ignoring any characters in between. If the string does not start with 'a' or does not end with 'b', the function should return ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_sequence('ab') == True\", \"assert is_valid_sequence('a123b') == True\", \"assert is_valid_sequence('abc') == False\", \"assert is_valid_sequence('a...b') == True\", \"assert is_valid_sequence('a-!@#b') == True\", \"assert is_valid_sequence('a b')...
{ "split": "train", "index": 79223, "acecode_id": "evol_15361", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given a Unix timestamp, write a function that converts the timestamp into a human-readable date string formatted as 'YYYY-MM-DD HH:MM'. The input will be an integer representing the Unix timestamp, and the output should be a string in the specified format. You may assume that t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert ts_to_datestr(0) == '1970-01-01 00:00'\", \"assert ts_to_datestr(1609459200) == '2021-01-01 00:00'\", \"assert ts_to_datestr(1633046400) == '2021-10-01 00:00'\", \"assert ts_to_datestr(1580515200) == '2020-02-01 00:00'\", \"assert ts_to_datestr(0) == '1970-0...
{ "split": "train", "index": 79224, "acecode_id": "bigcode_python_fns_8678", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that scales a list of experimental data points based on a given scaling factor. The function should take three parameters: a list of data points (floats), a scaling factor (float), and a threshold (float). The scaling process involves...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert scale_data([1.0, 2.0, 3.0], 2.0, 1.5) == [1.0, 4.0, 6.0]\", \"assert scale_data([0.5, 1.5, 2.5], 3.0, 1.0) == [0.5, 4.5, 7.5]\", \"assert scale_data([-1.0, 0.0, 1.0], 4.0, 0.0) == [-1.0, 0.0, 4.0]\", \"assert scale_data([2.0, 4.0, 0.0], 10.0, 3.0) == [2.0, 4...
{ "split": "train", "index": 79225, "acecode_id": "oss_27608", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that sorts a list of strings containing alphanumeric characters. The sorting should be done in a natural order where numeric substrings are treated as integers for sorting purposes. For example, 'item2' should come before 'item10' bec...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert natural_sort(['item2', 'item10', 'item1']) == ['item1', 'item2', 'item10']\", \"assert natural_sort(['file12', 'file2', 'file1']) == ['file1', 'file2', 'file12']\", \"assert natural_sort(['apple', 'banana', 'apple2', 'apple10', 'apple1']) == ['apple', 'apple...
{ "split": "train", "index": 79226, "acecode_id": "bigcode_python_fns_26663", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of strings, write a function that returns only the strings which start with an uppercase letter and end with a number. Additionally, ensure the function disregards any non-alphanumeric characters. Implement a function named `filter_strings` that takes a list of str...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_strings(['hello', 'World1', 'foo', 'bar', 'Test3', 'Array#', 'Baz2$']) == ['World1', 'Test3', 'Baz2']\", \"assert filter_strings(['apple5', 'Zebra$', '2cats', 'Lion7']) == ['Lion7']\", \"assert filter_strings(['123', 'A1', 'B2C']) == ['A1']\", \"asser...
{ "split": "train", "index": 79227, "acecode_id": "evol_7829", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes user profile data. The function should take a dictionary representing a user profile as input and return a dictionary containing the 'country_code' and 'country_name' if the country information exists in the profile. If the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_profile({'first_name': 'John', 'last_name': 'Doe', 'profile': {'country': {'code': 'US', 'name': 'United States'}}}) == {'country_code': 'US', 'country_name': 'United States', 'full_name': 'John Doe'}\", \"assert process_profile({'first_name': 'Jane'...
{ "split": "train", "index": 79228, "acecode_id": "oss_6725", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `first_unique_character(s: str) -> int` that finds the index of the first unique character in a given string `s`. If there are no unique characters, return -1. The function should handle edge cases such as empty strings and strings with all repetitive chara...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert first_unique_character('googlesearch') == 4\", \"assert first_unique_character('aabbcc') == -1\", \"assert first_unique_character('abcdef') == 0\", \"assert first_unique_character('!@#$$#@!') == -1\", \"assert first_unique_character('') == -1\", \"assert fir...
{ "split": "train", "index": 79229, "acecode_id": "evol_16106", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the deployment of a server using a specified model. The function should take a single argument, 'model', which is a string representing the model name. If the provided model name is not a valid option ('basic', 'advanced', ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert deploy_server('basic') == 'Server deployed with model: basic'\", \"assert deploy_server('advanced') == 'Server deployed with model: advanced'\", \"assert deploy_server('premium') == 'Server deployed with model: premium'\", \"assert deploy_server('advanced') ...
{ "split": "train", "index": 79230, "acecode_id": "bigcode_python_fns_29124", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a DNS resolver that supports caching of DNS records. Your goal is to create a function that can add DNS records to a cache and resolve DNS queries using the cached records. Implement a function `resolve_dns` that takes the following parameters: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert resolve_dns([('add', 'dns.example.com', 'A', ['192.168.1.1']), ('resolve', 'dns.example.com', 'A')]) == [['192.168.1.1']]\", \"assert resolve_dns([('add', 'dns.example.com', 'A', ['192.168.1.1']), ('resolve', 'dns.example.com', 'AAAA')]) == [['127.0.0.1']]\"...
{ "split": "train", "index": 79231, "acecode_id": "oss_16629", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with managing a list of answers. Implement a function `get_answer_at_index(answers: List[str], index: int) -> Optional[str]` that takes a list of strings `answers` and an integer `index`. The function should return the answer at the specified index if it exists; ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_answer_at_index(['Yes', 'No', 'Maybe'], 0) == 'Yes'\", \"assert get_answer_at_index(['Yes', 'No', 'Maybe'], 1) == 'No'\", \"assert get_answer_at_index(['Yes', 'No', 'Maybe'], 2) == 'Maybe'\", \"assert get_answer_at_index(['Yes', 'No', 'Maybe'], 3) == Non...
{ "split": "train", "index": 79232, "acecode_id": "oss_14269", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of a game. The game has a rule that a player can only play if their score is strictly greater than the average score of all players. Write a function that takes the list of scores and returns the number of players who can...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_eligible_players([80, 90, 60, 70, 50]) == 2\", \"assert count_eligible_players([100, 100, 100, 100]) == 0\", \"assert count_eligible_players([75, 60, 85, 90, 100]) == 3\", \"assert count_eligible_players([0, 0, 0, 0, 0]) == 0\", \"assert count_eligible...
{ "split": "train", "index": 79233, "acecode_id": "oss_7735", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `get_metric_computation_function(problem: str) -> Callable` that returns a specific metric computation function based on the provided problem type. The function takes a string `problem` as input and should handle the following cases: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_metric_computation_function('tsp') == tsp_metric_computation\", \"assert get_metric_computation_function('mcp') == general_metric_computation\", \"assert get_metric_computation_function('sbm') == general_metric_computation\", \"assert get_metric_computat...
{ "split": "train", "index": 79234, "acecode_id": "oss_12905", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function called `fibonacci_sequence` that takes an integer `n` as input and returns a list containing the first `n` numbers of the Fibonacci sequence. The Fibonacci sequence is defined as follows: the first two numbers are 0 and 1, and each subsequent number is the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fibonacci_sequence(1) == [0]\", \"assert fibonacci_sequence(2) == [0, 1]\", \"assert fibonacci_sequence(3) == [0, 1, 1]\", \"assert fibonacci_sequence(4) == [0, 1, 1, 2]\", \"assert fibonacci_sequence(5) == [0, 1, 1, 2, 3]\", \"assert fibonacci_sequence(6) =...
{ "split": "train", "index": 79235, "acecode_id": "evol_35259", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a client connection to a service. The function `connect_to_service` should take a single parameter `service_name` (a string) and return a message indicating whether the connection to the service was successful or not. The f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert connect_to_service('microservice') == 'Connection to microservice successful'\", \"assert connect_to_service('database') == 'Connection to database successful'\", \"assert connect_to_service('cache') == 'Connection to cache successful'\", \"assert connect_to...
{ "split": "train", "index": 79236, "acecode_id": "bigcode_python_fns_37130", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of anchors represented as pairs of integers, each pair indicating the start and end positions of an anchor in a one-dimensional space. You are also given a list of boolean flags indicating whether each anchor is valid, a total size of the space, and an allo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_anchors_inside([(1, 3), (4, 6)], [True, True], 10) == [True, True]\", \"assert check_anchors_inside([(1, 3), (4, 11)], [True, True], 10) == [True, False]\", \"assert check_anchors_inside([(1, -1), (0, 10)], [True, True], 10) == [False, True]\", \"asser...
{ "split": "train", "index": 79237, "acecode_id": "bigcode_python_fns_35149", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a function that converts a given monetary amount in USD to EUR using a fixed conversion rate. For this problem, assume the conversion rate from USD to EUR is 0.85. Implement a function called `convert_usd_to_eur(amount)` that takes an integer `amount` representing the amo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_usd_to_eur(1000) == 850.0\", \"assert convert_usd_to_eur(0) == 0.0\", \"assert convert_usd_to_eur(1) == 0.85\", \"assert convert_usd_to_eur(100) == 85.0\", \"assert convert_usd_to_eur(50) == 42.5\", \"assert convert_usd_to_eur(200) == 170.0\", \"asse...
{ "split": "train", "index": 79238, "acecode_id": "evol_19395", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a TV object that can be either turned on or off, and it can output sound through different sources. Your task is to implement a function that determines the supported features of the TV based on its state (on or off) and its sound output. The TV supports the follo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_supported_features(False, None) == 3\", \"assert get_supported_features(True, 'external_speaker') == 3\", \"assert get_supported_features(False, None) == 3\", \"assert get_supported_features(True, 'speaker') == 7\", \"assert get_supported_features(False,...
{ "split": "train", "index": 79239, "acecode_id": "bigcode_python_fns_49470", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a training scheduler for a machine learning classifier. Your goal is to create a function that manages the scheduling of training sessions for a classifier. The function should take in two parameters: a list of training durations (in seconds) an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert training_scheduler([2, 3, 1], 1) == [2, 6, 8]\", \"assert training_scheduler([], 1) == []\", \"assert training_scheduler([5, 5, 5], 2) == [5, 12, 19]\", \"assert training_scheduler([1], 3) == [1]\", \"assert training_scheduler([0, 0, 0], 1) == [0, 1, 2]\", \...
{ "split": "train", "index": 79240, "acecode_id": "oss_24020", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing the state of a smart light. The dictionary has the following structure: {'id': {'state': 'off' or 'on', 'brightness': int, 'color_temp': int}}. Implement a function `turn_on_light(lights: Dict[str, Dict[str, Union[str, int]]], light_id: s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert turn_on_light({'1': {'state': 'off', 'brightness': 0, 'color_temp': 0}}, '1', 100, 300) == {'1': {'state': 'on', 'brightness': 100, 'color_temp': 300}}\", \"assert turn_on_light({'1': {'state': 'off', 'brightness': 0, 'color_temp': 0}}, '2', 100, 300) == {'1...
{ "split": "train", "index": 79241, "acecode_id": "bigcode_python_fns_17106", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers that may contain duplicates. Your task is to write a function that removes duplicates from the list and returns the list in sorted order. The function should take a list of integers as input and output a new list that contains only unique intege...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates_and_sort([3, 1, 2, 3, 2]) == [1, 2, 3]\", \"assert remove_duplicates_and_sort([5, 5, 5]) == [5]\", \"assert remove_duplicates_and_sort([]) == []\", \"assert remove_duplicates_and_sort([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert remove_d...
{ "split": "train", "index": 79242, "acecode_id": "bigcode_python_fns_20461", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of strings containing alphanumeric characters, implement a function that returns the string that occurs most frequently in the array, considering case sensitivity. If there is a tie in frequency, return the string with the longest length. The input array is guara...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert most_common_string(['Apple', 'Banana', 'Apple', 'Orange', 'orange']) == 'Apple'\", \"assert most_common_string(['hello', 'world', 'hello', 'world', 'WORLD']) == 'hello'\", \"assert most_common_string(['cat', 'dog', 'Cat', 'dog', 'DOG']) == 'dog'\", \"assert ...
{ "split": "train", "index": 79243, "acecode_id": "evol_27231", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer n, implement a function `cubed_numbers(n)` that returns a list of the cubes of all integers from 1 to n, inclusive. You should utilize list comprehensions to achieve this.\nPlease reason step by step, then write a self-contained Python solution. Give yo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cubed_numbers(1) == [1]\", \"assert cubed_numbers(2) == [1, 8]\", \"assert cubed_numbers(3) == [1, 8, 27]\", \"assert cubed_numbers(4) == [1, 8, 27, 64]\", \"assert cubed_numbers(5) == [1, 8, 27, 64, 125]\", \"assert cubed_numbers(6) == [1, 8, 27, 64, 125, 2...
{ "split": "train", "index": 79244, "acecode_id": "evol_22505", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Design a Python function that prepends a given character to a specified string until it reaches a specified minimum length. If the given string already exceeds the minimum length, return an error message. Additionally, if the character provided is not a single symbol, return an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prepend_string('abc', 5, 'x') == 'xxabc'\", \"assert prepend_string('data', 8, '0') == '0000data'\", \"assert prepend_string('ready', 6, 'A') == 'Aready'\", \"assert prepend_string('code', 5, '-') == '-code'\", \"assert prepend_string('python', 7, '1') == '1...
{ "split": "train", "index": 79245, "acecode_id": "evol_4768", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function `is_perfect_number(n: int) -> bool` that determines if the provided integer `n` is a perfect number. A perfect number is a positive integer that is equal to the sum of its proper positive divisors, excluding the number itself. For example, 6 is a perfect nu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_perfect_number(6) == True\", \"assert is_perfect_number(28) == True\", \"assert is_perfect_number(496) == True\", \"assert is_perfect_number(8128) == True\", \"assert is_perfect_number(12) == False\", \"assert is_perfect_number(15) == False\", \"assert is...
{ "split": "train", "index": 79246, "acecode_id": "evol_21319", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_operations(a: int, b: int, c: int) -> Tuple[int, Union[float, str]]` that takes three integers as input and returns a tuple containing the product of the three numbers and the result of dividing the first number by the second and then by the thir...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_operations(1, 2, 3) == (6, 0.16666666666666666)\", \"assert calculate_operations(2, 3, 4) == (24, 0.16666666666666666)\", \"assert calculate_operations(0, 1, 2) == (0, 0.0)\", \"assert calculate_operations(5, 0, 1) == (0, 'Cannot divide by zero')\"...
{ "split": "train", "index": 79247, "acecode_id": "evol_20398", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of protocol file names and returns a list of the protocol file names that have a '.protocol' extension. Write a function `filter_protocols(protocols: List[str]) -> List[str]` that filters the input list and returns only ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_protocols(['file1.protocol', 'file2.txt', 'file3.protocol']) == ['file1.protocol', 'file3.protocol']\", \"assert filter_protocols(['image.png', 'document.doc', 'script.js']) == []\", \"assert filter_protocols(['test.protocol', 'example.protocol', 'dat...
{ "split": "train", "index": 79248, "acecode_id": "bigcode_python_fns_21976", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that filters a list of packages based on certain criteria. The function should take in three parameters: a list of all available packages, a list of standard packages, and a list of packages to exclude. Your goal is to filter out t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_packages(['numpy', 'pandas', 'requests', 'matplotlib', 'flask'], ['numpy', 'requests'], ['flask']) == ['pandas', 'matplotlib']\", \"assert filter_packages(['package1', 'package2', 'package3'], ['package1'], ['package2']) == ['package3']\", \"assert fi...
{ "split": "train", "index": 79249, "acecode_id": "oss_6278", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple training loop for a machine learning model. The function should take in the number of epochs and the number of batches per epoch, and it should simulate the training process by updating a best score and a best ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert train_model(0, 10) == (0.0, 1e6)\", \"assert train_model(10, 0) == (0.0, 1e6)\", \"assert train_model(1, 1) != (0.0, 0.0)\", \"assert train_model(3, 3) != (0.0, 0.0)\", \"assert train_model(0, 1) == (0.0, 1e6)\", \"assert train_model(1, 0) == (0.0, 1e6)\", \...
{ "split": "train", "index": 79250, "acecode_id": "oss_13302", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing a configuration with sections as keys and properties as their respective values in nested dictionaries. Write a function `get_property(config: Dict[str, Dict[str, str]], section: str, prop: str) -> str` that retrieves the value of a speci...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_property({'section1': {'prop1': 'value1'}}, 'section1', 'prop1') == 'value1'\", \"assert get_property({'section1': {'prop1': 'value1', 'prop2': 'value2'}}, 'section1', 'prop2') == 'value2'\", \"assert get_property({'section1': {'prop1': 'value1'}}, 'sect...
{ "split": "train", "index": 79251, "acecode_id": "bigcode_python_fns_4000", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents a dataset with a type and associated data. Your task is to implement a function `create_datasets(data_list: List[Dict[str, Any]], components: Dict[str, Any]) -> List[Dict[str, Any]]` that takes in two parame...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_datasets([{'type': 'A', 'data': 1}, {'type': 'B', 'data': 2}], {'A': 'modelA', 'B': 'modelB'}) == [{'type': 'A', 'data': 'modelA'}, {'type': 'B', 'data': 'modelB'}]\", \"assert create_datasets([{'type': 'C', 'data': 3}], {'C': 'modelC'}) == [{'type': ...
{ "split": "train", "index": 79252, "acecode_id": "bigcode_python_fns_7322", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a bounding box represented by a dictionary with coordinates {'x1': int, 'y1': int, 'x2': int, 'y2': int} and a scale factor represented by another dictionary {'x': float, 'y': float}, implement a function that scales the coordinates of the bounding box according to the pr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert scale_bounding_box({'x1': 1, 'y1': 2, 'x2': 3, 'y2': 4}, {'x': 2.0, 'y': 2.0}) == {'x1': 2, 'y1': 4, 'x2': 6, 'y2': 8}\", \"assert scale_bounding_box({'x1': 0, 'y1': 0, 'x2': 10, 'y2': 10}, {'x': 1.5, 'y': 1.5}) == {'x1': 0, 'y1': 0, 'x2': 15, 'y2': 15}\", \...
{ "split": "train", "index": 79253, "acecode_id": "bigcode_python_fns_13878", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a calibration function for a device that measures physical quantities. The function `calibrate` takes two parameters: `device`, a string representing the type of device being calibrated, and `target`, a numerical value representing the desired c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calibrate('Thermometer', 25.0) == 'Calibration successful'\", \"assert calibrate('Thermometer', 24.8) == 'Calibration failed'\", \"assert calibrate('Thermometer', 25.2) == 'Calibration failed'\", \"assert calibrate('Scale', 0.0) == 'Calibration successful'\"...
{ "split": "train", "index": 79254, "acecode_id": "oss_599", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `xml_to_json(xml_str: str) -> str` that converts a given XML string representing employee data into a JSON format. The XML string will contain one or more employee entries, each with an id, name, positions (including title and department), and contact informati...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert xml_to_json('<staff><employee><id>001</id><name>John Smith</name><positions><title>Manager</title><department>Sales</department></positions><contact><email>johnsmith@email.com</email><phone>1234567890</phone></contact></employee></staff>') == '{\\\"001\\\": ...
{ "split": "train", "index": 79255, "acecode_id": "evol_21224", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that identifies the file in a given list of file records that was least recently backed up. Each file record is represented as a tuple containing the filename (a string) and its last backup time (a string in the format 'YYYY-MM-DD HH:MM:SS...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_least_recently_backed_up_file([('file1.txt', '2023-10-01 10:00:00'), ('file2.txt', '2023-09-30 09:30:00'), ('file3.txt', '2023-10-02 11:00:00')]) == ('file2.txt', '2023-09-30 09:30:00')\", \"assert get_least_recently_backed_up_file([('fileA.txt', '2023-0...
{ "split": "train", "index": 79256, "acecode_id": "bigcode_python_fns_3098", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing a set of tasks with their corresponding time limits in seconds. Each task is identified by a unique string key. Write a function `handle_time_limits(tasks: Dict[str, int], max_wallclock_seconds: int) -> Tuple[bool, Dict[str, int]]` that w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_time_limits({'task1': 30000, 'task2': 90000}, 60000) == (True, {'task1': 30000, 'task2': 60000})\", \"assert handle_time_limits({'task1': 15000, 'task2': 20000}, 60000) == (False, {'task1': 15000, 'task2': 20000})\", \"assert handle_time_limits({'task...
{ "split": "train", "index": 79257, "acecode_id": "bigcode_python_fns_3591", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a hexadecimal number, return its binary representation as a string. The hexadecimal string will be valid and will always have a minimum length of 1. The function should convert the hexadecimal number to binary without any leading zeros in the output....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hex_to_binary('1') == '1'\", \"assert hex_to_binary('A') == '1010'\", \"assert hex_to_binary('10') == '10000'\", \"assert hex_to_binary('0') == '0'\", \"assert hex_to_binary('3') == '11'\", \"assert hex_to_binary('FF') == '11111111'\", \"assert hex_to_binary...
{ "split": "train", "index": 79258, "acecode_id": "bigcode_python_fns_3578", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of pairs, where each pair consists of a string key and an integer value. Your task is to sort the pairs by their keys in lexicographical order and return a list of strings in the format 'key,value' where key and value are separated by a comma. Write a funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sort_and_print_pairs([['apple', 5], ['banana', 3], ['cherry', 7], ['date', 2]]) == ['apple,5', 'banana,3', 'cherry,7', 'date,2']\", \"assert sort_and_print_pairs([['dog', 4], ['cat', 2], ['bird', 1]]) == ['bird,1', 'cat,2', 'dog,4']\", \"assert sort_and_prin...
{ "split": "train", "index": 79259, "acecode_id": "oss_18865", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates handling a list of events. Your function should accept a list of integers as input, where each integer represents an event. The function should process each event by doubling its value and returning a new list contai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_events([1, 2, 3]) == [2, 4, 6]\", \"assert process_events([0, 0, 0]) == [0, 0, 0]\", \"assert process_events([-1, -2, -3]) == [-2, -4, -6]\", \"assert process_events([10, 20, 30]) == [20, 40, 60]\", \"assert process_events([5]) == [10]\", \"assert pr...
{ "split": "train", "index": 79260, "acecode_id": "oss_21456", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that checks if a given string is a valid palindrome. A palindrome is a word, phrase, number, or other sequences of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization). Your function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('A man, a plan, a canal: Panama') == True\", \"assert is_palindrome('racecar') == True\", \"assert is_palindrome('hello') == False\", \"assert is_palindrome('') == True\", \"assert is_palindrome('A') == True\", \"assert is_palindrome('Was it a ...
{ "split": "train", "index": 79261, "acecode_id": "oss_10974", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with cleaning a citation string provided as input. The function should accept a string that may contain leading or trailing spaces and commas. Your goal is to remove any leading or trailing spaces and commas from this string. If the input string is 'None', the fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert clean_citation(None) == None\", \"assert clean_citation('') == ''\", \"assert clean_citation(' ') == ''\", \"assert clean_citation(' , ') == ''\", \"assert clean_citation('Example Citation') == 'Example Citation'\", \"assert clean_citation(' Example Ci...
{ "split": "train", "index": 79262, "acecode_id": "bigcode_python_fns_20657", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_factorial(n)` that calculates the factorial of a given non-negative integer n. The factorial of a number n is the product of all positive integers less than or equal to n. If n is less than 0, the function should return 'Invalid number'. For n eq...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_factorial(0) == 1\", \"assert calculate_factorial(1) == 1\", \"assert calculate_factorial(2) == 2\", \"assert calculate_factorial(3) == 6\", \"assert calculate_factorial(4) == 24\", \"assert calculate_factorial(5) == 120\", \"assert calculate_facto...
{ "split": "train", "index": 79263, "acecode_id": "evol_25718", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that accepts a list of distinct strings as input and returns the string with the greatest number of unique characters. If there is a tie, return the first word in lexicographical order. Character cases are considered separate only if a case sensitivity para...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_max(['dog', 'cat', 'fish'], False) == 'fish'\", \"assert find_max(['a', 'A', 'b', 'B'], True) == 'A'\", \"assert find_max(['abcd', 'abcde', 'abc'], False) == 'abcde'\", \"assert find_max(['one', 'two', 'three'], False) == 'three'\", \"assert find_max(['...
{ "split": "train", "index": 79264, "acecode_id": "evol_6353", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a string representing an S3 bucket name and another string representing an object key. Your task is to determine if the object key exists within the specified bucket. Write a function `exist_key(bucket: str, key: str) -> bool` that returns `True` if the object key...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert exist_key('my_bucket', 'existing_key') == True\", \"assert exist_key('my_bucket', 'non_existing_key') == False\", \"assert exist_key('wrong_bucket', 'existing_key') == False\", \"assert exist_key('my_bucket', 'another_key') == False\", \"assert exist_key('my...
{ "split": "train", "index": 79265, "acecode_id": "bigcode_python_fns_22901", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that handles errors in a command execution context. The function should take in two parameters: `ctx` (representing the context of the command's invocation) and `error` (representing the error raised during command execution). ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert handle_command_error({'command': True}, ValueError('An error occurred')) == 'Action performed'\", \"assert handle_command_error({'command': True}, TypeError('Another error occurred')) == 'Action performed'\", \"assert handle_command_error({'command': False},...
{ "split": "train", "index": 79266, "acecode_id": "oss_13593", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function that generates a random integer between 0 and 20, ensuring that the same random number isn't generated consecutively. The function should return the generated number each time it is called without any data structure to store previously generated numbers.\nPleas...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_random() >= 0 and generate_random() <= 20\", \"assert generate_random() >= 0 and generate_random() <= 20\", \"assert generate_random() >= 0 and generate_random() <= 20\", \"assert generate_random() >= 0 and generate_random() <= 20\", \"assert genera...
{ "split": "train", "index": 79267, "acecode_id": "evol_6821", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that represents a JSON object. Your task is to implement a function that takes this string as input and returns the parsed JSON object if it is valid. If the input string is not a valid JSON, your function should raise a JSONDecodeError. Write a function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_json('{\\\"key\\\": \\\"value\\\"}') == {'key': 'value'}\", \"assert parse_json('{\\\"number\\\": 123}') == {'number': 123}\", \"assert parse_json('{\\\"array\\\": [1, 2, 3]}') == {'array': [1, 2, 3]}\", \"assert parse_json('{\\\"boolean\\\": true}') =...
{ "split": "train", "index": 79268, "acecode_id": "bigcode_python_fns_21155", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer n and a list of edges, determine if the edges form a valid tree. A valid tree must have exactly n - 1 edges and must be connected (no cycles). Return a tuple containing a boolean indicating whether it is a valid tree and an integer representing the number of co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert valid_tree(5, [[0, 1], [0, 2], [0, 3], [1, 4]]) == (True, 1)\", \"assert valid_tree(3, [[0, 1], [0, 2]]) == (True, 1)\", \"assert valid_tree(4, [[0, 1], [1, 2], [2, 3]]) == (True, 1)\", \"assert valid_tree(2, [[0, 1]]) == (True, 1)\", \"assert valid_tree(5, ...
{ "split": "train", "index": 79269, "acecode_id": "evol_11705", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a positive integer n, write a function `generate_cubes(n)` that returns a list of the cubes of the first n natural numbers (starting from 1). The function should raise a ValueError if n is not a positive integer. The input n will be provided directly to the function as an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_cubes(1) == [1]\", \"assert generate_cubes(2) == [1, 8]\", \"assert generate_cubes(3) == [1, 8, 27]\", \"assert generate_cubes(4) == [1, 8, 27, 64]\", \"assert generate_cubes(5) == [1, 8, 27, 64, 125]\", \"assert generate_cubes(6) == [1, 8, 27, 64, ...
{ "split": "train", "index": 79270, "acecode_id": "oss_27433", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers, return a list containing only the even prime numbers from both lists, merged into a single list and sorted in descending order. Note that 2 is the only even prime number. Implement the function `get_even_prime_and_merge(l1: list, l2: list) -> list` ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_even_prime_and_merge([], []) == []\", \"assert get_even_prime_and_merge([2], [3]) == [2]\", \"assert get_even_prime_and_merge([1, 3, 5, 7], [9, 11, 13]) == []\", \"assert get_even_prime_and_merge([-2, -4, -6], [0, 2]) == [2]\", \"assert get_even_prime_an...
{ "split": "train", "index": 79271, "acecode_id": "evol_31737", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function that identifies all numbers within a specified range that are perfect squares and whose digit sum is also a perfect square. The function should take two parameters, 'startnum' and 'endnum', and return a list of these special numbers.\nPlease reason step by ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_special_numbers(10, 10) == []\", \"assert find_special_numbers(1, 1) == [1]\", \"assert find_special_numbers(15, 15) == []\", \"assert find_special_numbers(1, 15) == [1, 4, 9]\", \"assert find_special_numbers(5, 5) == []\"]}" }
{ "split": "train", "index": 79272, "acecode_id": "evol_31557", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple simulation of a car racing game where the player controls a car that can move left or right along a track. The game generates obstacles that move down the screen and the player must avoid them to increase their score. Your task is to implem...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_game(10, [(100, 550), (200, 580)]) == (10, False)\", \"assert simulate_game(5, [(300, 500), (400, 520)]) == (5, False)\", \"assert simulate_game(15, [(100, 550), (250, 580), (300, 600)]) == (15, False)\", \"assert simulate_game(0, [(100, 500)]) == (...
{ "split": "train", "index": 79273, "acecode_id": "oss_15949", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates if a given query string meets certain criteria. Your function should take in a single parameter, `query`, which is a string. The function should return True if the string meets the following conditions: 1) It is not empty, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_query('This is a valid query') == True\", \"assert validate_query('') == False\", \"assert validate_query('This query is way too long' * 20) == False\", \"assert validate_query('Valid123') == True\", \"assert validate_query('Invalid@Query') == False...
{ "split": "train", "index": 79274, "acecode_id": "oss_14606", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `s` consisting of characters 'U', 'D', 'L', and 'R', which represent moves on a 2D plane. Each character corresponds to a move in the following way: 'U' for up (increasing y-coordinate by 1), 'D' for down (decreasing y-coordinate by 1), 'L' for left (decr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert final_position('UDLR') == (0, 0)\", \"assert final_position('UUU') == (0, 3)\", \"assert final_position('RRR') == (3, 0)\", \"assert final_position('DDLL') == (-2, -2)\", \"assert final_position('UUDDLLRR') == (0, 0)\", \"assert final_position('UUDD') == (0,...
{ "split": "train", "index": 79275, "acecode_id": "oss_36511", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple product catalog system. Each product has a unique ID, a name, and a price. Your goal is to implement a function `manage_products(operations: List[Tuple[str, Union[int, str, float]]]) -> List[str]` where you will perform a series of operatio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_products([('add', 1, 'Apple', 0.99), ('add', 2, 'Banana', 0.59), ('remove', 1), ('show',)]) == ['2: Banana, 0.59']\", \"assert manage_products([('show',)]) == ['Store is empty.']\", \"assert manage_products([('add', 3, 'Orange', 0.79), ('remove', 3), ...
{ "split": "train", "index": 79276, "acecode_id": "oss_3892", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a function `germinate` that takes a set of permutations represented as tuples of integers as input and returns a new set of permutations. The function is intended to generate a set of permutations by repeatedly applying certain operations to the input set. The ope...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert germinate({(0, 1), (1, 0)}) == {(0, 1), (1, 0)}\", \"assert germinate({(0, 1, 2), (1, 2, 0)}) == {(0, 1, 2), (1, 2, 0), (2, 0, 1)}\", \"assert germinate({(0,), (0,)}) == {(0,)}\", \"assert germinate({(0, 1, 2), (2, 0, 1)}) == {(0, 1, 2), (2, 0, 1), (1, 2, 0)...
{ "split": "train", "index": 79277, "acecode_id": "oss_34245", "num_tests": 7 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python decorator named `log_execution` that logs the execution time of a function, logs the arguments passed to the function, and logs the return value of the function. The decorator should work for both synchronous and asynchronous functions. Imp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert log_execution(sync_function)(1, 2) == 3\", \"assert log_execution(sync_function)(0, 0) == 0\", \"assert log_execution(sync_function)(-1, 1) == 0\", \"assert log_execution(sync_function)(10, 5) == 15\", \"assert log_execution(sync_function)(100, 200) == 300\"...
{ "split": "train", "index": 79278, "acecode_id": "oss_37493", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `process_tree` that takes an instance of a tree-like data structure represented by a class called `RecursiveTreeNode`. Each instance of `RecursiveTreeNode` has two attributes: `child` (an instance of `RecursiveTreeNode` representing a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_tree(RecursiveTreeNode('node', RecursiveTreeNode('node', None)), 'prefix_') == ['prefix_node', 'prefix_node']\", \"assert process_tree(RecursiveTreeNode('leaf', None), 'test_') == ['test_leaf']\", \"assert process_tree(RecursiveTreeNode('root', Recur...
{ "split": "train", "index": 79279, "acecode_id": "oss_5908", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that can handle data serialization into plain text or YAML format. The function should take two parameters: `data`, which is the data to be serialized, and `format`, which specifies the serialization format (either `1` for plain text or `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert serialize_data({'name': 'John', 'age': 30}, 1) == \\\"{'name': 'John', 'age': 30}\\\"\", \"assert serialize_data(['apple', 'banana', 'cherry'], 1) == \\\"['apple', 'banana', 'cherry']\\\"\", \"assert serialize_data(123, 1) == '123'\", \"assert serialize_data...
{ "split": "train", "index": 79280, "acecode_id": "oss_37603", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of elements and returns a list containing only the prime numbers from the provided list. The function should first validate that each element in the input list is an integer before checking for primality. If the element is not an integer, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_prime_numbers([11, 12, 13, 14, 15, 16, 17, 18, 19]) == [11, 13, 17, 19]\", \"assert filter_prime_numbers([2, 3, 5, 7, 11]) == [2, 3, 5, 7, 11]\", \"assert filter_prime_numbers([4, 6, 8, 9, 10]) == []\", \"assert filter_prime_numbers([1, 0, -1, -2]) ==...
{ "split": "train", "index": 79281, "acecode_id": "evol_6257", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function that tracks the number of active logins for a user's account and checks if the user has exceeded their account login limit. The function should take in two parameters: the current number of active logins (an integer) and the maximum all...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_login_limit(1, 2) == 'You are within your account login limit.'\", \"assert check_login_limit(2, 2) == 'You are within your account login limit.'\", \"assert check_login_limit(3, 2) == 'You have reached your account login limit. Please log out from oth...
{ "split": "train", "index": 79282, "acecode_id": "oss_25828", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a 2D matrix of integers representing a grid of values. Your task is to implement a function that takes this matrix and returns a new matrix where the values in each row are reversed, while the order of the rows remains the same. Write a function `reverse_row_matri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_row_matrix([[1, 2, 3], [4, 5, 6]]) == [[3, 2, 1], [6, 5, 4]]\", \"assert reverse_row_matrix([[7, 8], [9, 10], [11, 12]]) == [[8, 7], [10, 9], [12, 11]]\", \"assert reverse_row_matrix([[1]]) == [[1]]\", \"assert reverse_row_matrix([[]]) == [[]]\", \"a...
{ "split": "train", "index": 79283, "acecode_id": "bigcode_python_fns_10985", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that calculates the average loss and accuracy for two models based on provided numerical data. Write a function `calculate_metrics(loss_list, accuracy_list)` that takes in two lists as input: \n1. `loss_list`: A list of three f...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_metrics([0.5, 0.3, 0.7], [0.85, 0.92]) == (0.5, 0.885)\", \"assert calculate_metrics([0.0, 0.0, 0.0], [0.0, 1.0]) == (0.0, 0.5)\", \"assert calculate_metrics([10.0, 20.0, 30.0], [1.0, 0.0]) == (20.0, 0.5)\", \"assert calculate_metrics([2.5, 3.5, 4....
{ "split": "train", "index": 79284, "acecode_id": "oss_8845", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of wine sales in the format of tuples (wine_type: str, quantity: int) and returns a dictionary representing the total quantity sold for each wine type. The function should aggregate the quantities for wine types that appear multiple times ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert aggregate_wine_sales([('Cabernet', 10), ('Merlot', 5), ('Cabernet', 15)]) == {'Cabernet': 25, 'Merlot': 5}\", \"assert aggregate_wine_sales([('Chardonnay', 20), ('Sauvignon', 30), ('Chardonnay', 10)]) == {'Chardonnay': 30, 'Sauvignon': 30}\", \"assert aggreg...
{ "split": "train", "index": 79285, "acecode_id": "evol_35993", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that evaluates a given predicate URI and returns a corresponding value based on predefined mappings. The function should take a string parameter `predicate_uri` and return a value according to the following rules: \n- If `predicate_ur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert evaluate_predicate('uri1') == 'Result for uri1'\", \"assert evaluate_predicate('uri2') == 100\", \"assert evaluate_predicate('uri3') == True\", \"assert evaluate_predicate('uri1') == 'Result for uri1'\", \"assert evaluate_predicate('uri2') == 100\", \"assert...
{ "split": "train", "index": 79286, "acecode_id": "oss_30111", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Create a function `validate_signature` that takes two parameters: a string `sig_header` and a bytes object `data`. The function should validate the signature using a secret key 'your_secret_key'. The signature is considered valid if it matches the HMAC SHA1 hash of the data usi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_signature('sha1=2fd4e1c67f41e2b1f367b7c2b14ee3d95b0c4b9f', b'hello') == False\", \"assert validate_signature('sha1=3b0c4b1c6d4b8e7d9b2e1c6f5e4b1c7b0c4b8e7d', b'test') == False\", \"assert validate_signature('sha1=5a0c4b8e7d6e5b3b0c4a1e2f7d9b5e4c3a7b...
{ "split": "train", "index": 79287, "acecode_id": "evol_28924", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a job represented as a list of tasks, where each task is identified by a unique taskId. Each task can have multiple outputs, and you can mark a task as done with a specified result code. Write a function `task_done(job: List[Dict[str, Any]], taskId: int, result: s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert task_done([{'taskId': 1, 'outputs': ['output1', 'output2']}], 1, 'OK') == {'output1': 'locator_1', 'output2': 'locator_1'}\", \"assert task_done([{'taskId': 1, 'outputs': ['output1', 'output2']}], 1, 'ERROR') == {'status': 'done', 'error': 'Task marked as do...
{ "split": "train", "index": 79288, "acecode_id": "bigcode_python_fns_37375", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of lists, where each inner list contains a sequence of bits (represented as 0s and 1s), write a function that converts each inner list of bits into a big-endian integer. The function should return a tuple of these integers. A big-endian integer means that the most ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert tuple_of_big_endian_int([[1, 0, 1], [0, 1, 1], [1, 1, 1, 0]]) == (5, 3, 14)\", \"assert tuple_of_big_endian_int([[0], [1, 0], [1, 1, 0, 1]]) == (0, 2, 13)\", \"assert tuple_of_big_endian_int([[1, 1, 1, 1], [0, 0, 0, 0], [1, 0, 1, 0]]) == (15, 0, 10)\", \"ass...
{ "split": "train", "index": 79289, "acecode_id": "bigcode_python_fns_23770", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with transforming a list of tuples into a list of dictionaries. Each tuple represents a record with named fields. Write a function `tuples_to_dicts(records: List[Tuple]) -> List[Dict[str, Any]]` that takes a list of tuples, where each tuple contains named fields,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert tuples_to_dicts([('name', 'age'), ('Alice', 30), ('Bob', 25)]) == [{'name': 'Alice', 'age': 30}, {'name': 'Bob', 'age': 25}]\", \"assert tuples_to_dicts([('id', 'value'), (1, 100), (2, 200)]) == [{'id': 1, 'value': 100}, {'id': 2, 'value': 200}]\", \"assert ...
{ "split": "train", "index": 79290, "acecode_id": "bigcode_python_fns_43338", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing a log entry represented as a dictionary. Implement a function named `process_log_entry` that takes a dictionary `entry` as input and performs the following operations: 1. It should return a string that contains formatted key-value pairs from the d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_log_entry({'time': '123.456', 'user': 'Alice', 'action': 'login'}) == ('user=Alice,action=login', 123)\", \"assert process_log_entry({'time': '0.001', 'user': 'Bob'}) == ('user=Bob', 0)\", \"assert process_log_entry({'action': 'logout', 'time': '1000...
{ "split": "train", "index": 79291, "acecode_id": "oss_2032", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the initiation of a multipart upload process. The function should accept three parameters: a string representing the name of a bucket, a string representing a unique object identifier, and a simulated upload ID. The functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert initiate_multipart_upload('bucket1', 'file1.txt', 'upload123') == 'upload123'\", \"assert initiate_multipart_upload('bucket2', 'image.png', 'upload456') == 'upload456'\", \"assert initiate_multipart_upload('bucket3', 'document.pdf', 'upload789') == 'upload78...
{ "split": "train", "index": 79292, "acecode_id": "bigcode_python_fns_7714", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function that takes a list of numbers and returns the average of the numbers in the list. The function should handle cases where the list is empty by returning None for the average.\nPlease reason step by step, then write a self-contained Python solution. Give your fin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert avg_and_sum([2, 3, 5, 7]) == 4.25\", \"assert avg_and_sum([1, 2, 3, 4, 5]) == 3.0\", \"assert avg_and_sum([10, 20, 30]) == 20.0\", \"assert avg_and_sum([5, 15]) == 10.0\", \"assert avg_and_sum([0, 0, 0]) == 0.0\", \"assert avg_and_sum([-1, -2, -3]) == -2.0\"...
{ "split": "train", "index": 79293, "acecode_id": "evol_11775", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representing a programming statement, identify whether it contains the name of a specified programming node. Your function should return True if the name is present in the statement, and False otherwise. Note that the comparison should be case-sensitive. Addition...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_language_binding_spec('int main() { return 0; }', 'main') == True\", \"assert search_language_binding_spec('def my_function(): pass', 'my_function') == True\", \"assert search_language_binding_spec('class MyClass: pass', 'MyClass') == True\", \"assert...
{ "split": "train", "index": 79294, "acecode_id": "bigcode_python_fns_16465", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a list of integers, and you need to implement a function that returns a new list containing only the unique elements from the original list, preserving their original order. Write a function `unique_elements(arr: List[int]) -> List[int]` where `arr` is the input l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 2, 3, 4, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_elements([5, 5, 5, 5]) == [5]\", \"assert unique_elements([]) == []\", \"assert unique_elements([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert unique_elements([1, 1, 2, 2, 3, 3]) =...
{ "split": "train", "index": 79295, "acecode_id": "bigcode_python_fns_12580", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `to_dict(obj, scrub=None, fields=None)` that takes a single object or a list of objects and serializes it to a JSON-compatible dictionary. If `scrub` is provided as a list of keys, those keys should be removed from the resulting dictionary. If `fields` is p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert to_dict(None) == {}\", \"assert to_dict({'name': 'Alice', 'age': 30}) == {'name': 'Alice', 'age': 30}\", \"assert to_dict([{'name': 'Alice', 'age': 30}, {'name': 'Bob', 'age': 25}]) == [{'name': 'Alice', 'age': 30}, {'name': 'Bob', 'age': 25}]\", \"assert to...
{ "split": "train", "index": 79296, "acecode_id": "bigcode_python_fns_48078", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are given a list of temperature readings in Celsius. Your task is to implement a function that calculates the average temperature from the list. The function should take a list of floating-point numbers as input, where each number represents a temperature reading. The funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_temperature([20.0, 22.5, 19.5, 21.0]) == 20.75\", \"assert average_temperature([-5.0, 0.0, 5.0]) == 0.00\", \"assert average_temperature([30.0]) == 30.00\", \"assert average_temperature([]) == 0.00\", \"assert average_temperature([10.0, 10.0, 10.0]) ...
{ "split": "train", "index": 79297, "acecode_id": "oss_9690", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines whether a given list of integers contains any duplicates. Your function should return True if there are any duplicates in the list and False if there are none. Implement the function `contains_duplicates(nums: List[int]) -...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert contains_duplicates([]) == False\", \"assert contains_duplicates([1]) == False\", \"assert contains_duplicates([1, 2, 3, 4, 5]) == False\", \"assert contains_duplicates([1, 2, 3, 4, 1]) == True\", \"assert contains_duplicates([5, 5, 5, 5]) == True\", \"asser...
{ "split": "train", "index": 79298, "acecode_id": "oss_34673", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a binary buffer represented as a bytes object. Your task is to implement a function that checks if the first 4 bytes of this buffer, when interpreted as an integer in little-endian format, equal to 1. Implement the function `check_fs_align(buf: bytes) -> bool`. Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_fs_align(b'\\\\x01\\\\x00\\\\x00\\\\x00') == True\", \"assert check_fs_align(b'\\\\x02\\\\x00\\\\x00\\\\x00') == False\", \"assert check_fs_align(b'\\\\x00\\\\x00\\\\x00\\\\x00') == False\", \"assert check_fs_align(b'\\\\x01\\\\x00\\\\x00') == False\",...
{ "split": "train", "index": 79299, "acecode_id": "oss_21860", "num_tests": 16 }