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": "Write a function in Python to calculate the least common multiple (LCM) of two positive integers. The LCM of two integers a and b is the smallest positive integer that is divisible by both a and b. You should implement a single function `lcm(a: int, b: int) -> int`, where `a` a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lcm(4, 5) == 20\", \"assert lcm(12, 15) == 60\", \"assert lcm(7, 3) == 21\", \"assert lcm(9, 6) == 18\", \"assert lcm(8, 12) == 24\", \"assert lcm(2, 5) == 10\", \"assert lcm(14, 28) == 28\", \"assert lcm(3, 9) == 9\", \"assert lcm(1, 100) == 100\", \"assert... | {
"split": "train",
"index": 79300,
"acecode_id": "evol_19418",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple module management system. Your goal is to create a function called `manage_modules` that takes a list of operations and returns the final list of modules after performing the operations. The operations will be represented as a list of s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_modules(['add math', 'add science', 'remove math', 'list']) == ['science']\", \"assert manage_modules(['add math', 'add science', 'add math', 'remove biology', 'remove science']) == ['math']\", \"assert manage_modules(['add math', 'list', 'add science... | {
"split": "train",
"index": 79301,
"acecode_id": "oss_25055",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that initializes the configuration of pins for an OLED display. The function, named `initialize_oled_pins`, should take in six parameters representing the pin numbers: `pin_dc`, `pin_cs`, `pin_rst`, `pin_sck`, `pin_mosi`, and `pin_mis... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_oled_pins(1, 2, 3, 4, 5, 6) == {'pin_dc': 'OUT', 'pin_cs': 'OUT', 'pin_rst': 'OUT', 'pin_sck': 'OUT', 'pin_mosi': 'OUT', 'pin_miso': 'IN'}\", \"assert initialize_oled_pins(10, 20, 30, 40, 50, 60) == {'pin_dc': 'OUT', 'pin_cs': 'OUT', 'pin_rst': 'O... | {
"split": "train",
"index": 79302,
"acecode_id": "oss_37481",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings where each string represents the content of a file. Your task is to implement a function that compares the contents of the first two strings in the list based on the following rules: \n- If the contents of the two strings are equal, return 1. \n-... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compare_file_contents(['10', '10']) == 1\", \"assert compare_file_contents(['10', '20']) == 30\", \"assert compare_file_contents(['10', 'abc']) == 0\", \"assert compare_file_contents(['abc', '20']) == 0\", \"assert compare_file_contents(['10', '']) == 0\", \... | {
"split": "train",
"index": 79303,
"acecode_id": "oss_5607",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Construct a Python function to generate every potential combination of strings with a length of k utilizing the provided character sets. There are three character sets that will alternate based on the string index: set1 = {'α', 'β', 'ψ'}, set2 = {'ا', 'ب', 'پ'}, set3 = {'あ', 'い... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_combinations(1) == [[ '\\u03b1', '\\u03b2', '\\u03c8' ]]\", \"assert generate_combinations(2) == [[ '\\u03b1', '\\u03b2', '\\u03c8' ], [ '\\u0627', '\\u0628', '\\u067e' ]]\", \"assert generate_combinations(3) == [[ '\\u03b1', '\\u03b2', '\\u03c8' ],... | {
"split": "train",
"index": 79304,
"acecode_id": "evol_27725",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that calculates the sum of all the integers in the list. The function should take a single parameter, which is the list of integers, and return the cumulative total.\nPlease reason step by step, then write a self-contained Python solut... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert total_components([1, 2, 3, 4, 5]) == 15\", \"assert total_components([0, 0, 0, 0, 0]) == 0\", \"assert total_components([-1, -2, -3]) == -6\", \"assert total_components([10, 20, 30]) == 60\", \"assert total_components([-5, 5]) == 0\", \"assert total_componen... | {
"split": "train",
"index": 79305,
"acecode_id": "evol_5542",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that can parse a given configuration string for a Python package management system. The input string will contain key-value pairs representing different configuration settings. Your goal is to extract this information and return it as a d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_config('packages = [] ,\\\\ninclude_package_data = False,\\\\nplatforms = \\\"linux\\\",\\\\ninstall_requires = [\\\"requests\\\", \\\"numpy\\\"]') == {'packages': [], 'include_package_data': False, 'platforms': 'linux', 'install_requires': ['requests'... | {
"split": "train",
"index": 79306,
"acecode_id": "oss_16941",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with parsing a list of VMX file strings to extract the display name and the UUID values from each file. Each VMX file string is formatted as follows: 'displayName = <name>' and 'vc.uuid = <uuid>'. Your goal is to implement a function that takes in a list of such ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_vmx_data(['displayName = VM1', 'vc.uuid = 123e4567-e89b-12d3-a456-426614174000']) == {'123e4567e89b12d3a456426614174000': 'VM1'}\", \"assert extract_vmx_data(['displayName = VM2', 'vc.uuid = 987e6543-e21b-45e6-b123-456789abcdef']) == {'987e6543e21b45... | {
"split": "train",
"index": 79307,
"acecode_id": "bigcode_python_fns_34716",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are given a string `encrypted_text` that contains a message encoded using a simple substitution cipher known as ROT13, where each letter in the plaintext is replaced by the letter 13 positions down the alphabet. Your task is to implement a function `decrypt_message(encrypte... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert decrypt_message('Uryyb Jbeyq') == 'Hello World'\", \"assert decrypt_message('Gur dhvpx oebja sbk whzcf bire gur ynml qbt') == 'The quick brown fox jumps over the lazy dog'\", \"assert decrypt_message('Ura qvqa') == 'Hen didn'\", \"assert decrypt_message('Fhp... | {
"split": "train",
"index": 79308,
"acecode_id": "oss_8906",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with generating the SQL representation of a database table column based on its attributes. Write a function `generate_column_sql(name: str, data_type: str, primary_key: bool = False, autoincrement: bool = False) -> str` that takes the following parameters: \n- `n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_column_sql('id', 'INTEGER', True, True) == 'id INTEGER PRIMARY KEY AUTOINCREMENT'\", \"assert generate_column_sql('username', 'VARCHAR(50)', False, False) == 'username VARCHAR(50)'\", \"assert generate_column_sql('created_at', 'TIMESTAMP', False, Fa... | {
"split": "train",
"index": 79309,
"acecode_id": "oss_16083",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string of numerical characters, write a function that removes all consecutive duplicate digits from the string, returning a new string that contains only the first occurrence of each consecutive digit. For example, the input string '1112333444' should return '1234'.\nPl... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert remove_repetitive_digits('1112333444') == '1234'\", \"assert remove_repetitive_digits('222333') == '23'\", \"assert remove_repetitive_digits('123') == '123'\", \"assert remove_repetitive_digits('1122334455') == '12345'\", \"assert remove_repetitive_digits('9... | {
"split": "train",
"index": 79310,
"acecode_id": "evol_7257",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a search term. Your task is to create a function that formats this search term for a directory name by replacing all spaces with underscores and converting the entire string to lowercase. The function should also check if the formatted direct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_directory_name('Cats and Dogs') == 'cats_and_dogs'\", \"assert format_directory_name(' Hello World ') == 'hello_world'\", \"assert format_directory_name('Python Programming') == 'python_programming'\", \"assert format_directory_name('OpenAI GPT-3') ... | {
"split": "train",
"index": 79311,
"acecode_id": "oss_30050",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Create a function that filters out words containing six characters or more from a list of words. The function should return a new list containing only the words that have fewer than six characters. For example, given the input list ['Hello', 'Good', 'Where', 'Been', 'World', 'H... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_words(['Python', 'is', 'fun']) == ['is', 'fun']\", \"assert filter_words(['OpenAI', 'ChatGPT', 'AI']) == ['AI']\", \"assert filter_words(['apple', 'banana', 'pear', 'kiwi']) == ['apple', 'pear', 'kiwi']\", \"assert filter_words(['longerword', 'short',... | {
"split": "train",
"index": 79312,
"acecode_id": "evol_20047",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function that finds the rarest element in a given list of integers. If there are multiple elements that are the rarest, return the first one encountered in the order of appearance in the list.\nPlease reason step by step, then write a self-contained Python solution.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rarest_element([1, 2, 2, 3, 3, 3, 4, 4, 4, 5]) == 1\", \"assert rarest_element([1, 1, 2, 2, 3, 4, 4, 5, 5, 6, 6, 6, 7]) == 3\", \"assert rarest_element([7, 8, 7, 9, 9, 10, 10, 10]) == 8\", \"assert rarest_element([1, 2, 3, 4, 5]) == 1\", \"assert rarest_elem... | {
"split": "train",
"index": 79313,
"acecode_id": "evol_7001",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_password_strength(password: str) -> Tuple[bool, str]` that checks the strength of a given password based on specific guidelines. The password must adhere to the following rules: it should be at least 10 characters long and not exceed 64 characters, c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_password_strength('Password1!') == (True, 'Strong password.')\", \"assert check_password_strength('short1!') == (False, 'Password is too short. It should be at least 10 characters long.')\", \"assert check_password_strength('LowerAndUpper1!') == (True,... | {
"split": "train",
"index": 79314,
"acecode_id": "evol_17669",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves a list of supported Autonomous Database versions from Oracle Cloud Infrastructure based on given parameters. Your function should accept a compartment ID and a database workload type as inputs and return a list of Autonomou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_supported_db_versions('ocid1.compartment.oc1..example1', 'OLTP') == ['19.0.0', '19.1.0', '21.0.0']\", \"assert get_supported_db_versions('ocid1.compartment.oc1..example2', 'DW') == ['18.0.0', '19.0.0', '20.0.0']\", \"assert get_supported_db_versions('oci... | {
"split": "train",
"index": 79315,
"acecode_id": "bigcode_python_fns_3232",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function `parse_arguments(*args)` that parses a variable number of arguments and returns a tuple containing the x values, y values, and a style string based on the following rules: \n1. If only one argument is provided, it is considered as the y va... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_arguments([1, 2], 'line') == (None, [1, 2], 'line')\", \"assert parse_arguments([1, 2, 3], [4, 5, 6], 'scatter') == ([1, 2, 3], [4, 5, 6], 'scatter')\", \"assert parse_arguments([1], 'dashed') == (None, [1], 'dashed')\", \"assert parse_arguments(1, 2, ... | {
"split": "train",
"index": 79316,
"acecode_id": "bigcode_python_fns_2693",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a command string and returns its individual components as a list. The command string can contain multiple arguments separated by spaces. Your function should handle quoted strings correctly, meaning that any arguments e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_command('echo \\\"Hello World\\\"') == ['echo', 'Hello World']\", \"assert parse_command('ls -l /path/to/directory') == ['ls', '-l', '/path/to/directory']\", \"assert parse_command('git commit -m \\\"Initial commit\\\"') == ['git', 'commit', '-m', 'Ini... | {
"split": "train",
"index": 79317,
"acecode_id": "bigcode_python_fns_17185",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary where the keys are gene identifiers and the values are their respective gene sequences. Each gene sequence is a string that must have a standard length of 27 characters. Write a function `validate_genome(genomes: Dict[str, str]) -> int` that counts an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_genome({'gene1': 'A' * 27, 'gene2': 'C' * 27, 'gene3': 'G' * 27}) == 0\", \"assert validate_genome({'gene1': 'A' * 26, 'gene2': 'C' * 27, 'gene3': 'G' * 27}) == 1\", \"assert validate_genome({'gene1': 'A' * 28, 'gene2': 'C' * 27, 'gene3': 'G' * 27})... | {
"split": "train",
"index": 79318,
"acecode_id": "bigcode_python_fns_38121",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dataset represented as a tuple of two elements: a list of features and a corresponding list of labels. Write a function `split_dataset(data: Tuple[List[List[Any]], List[Any]], train_ids: List[int], test_ids: List[int], valid_ids: Optional[List[int]] = None) -> D... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert split_dataset(([[1, 2], [3, 4], [5, 6]], [0, 1, 2]), [0, 1], [2]) == {'train': ([[1, 2], [3, 4]], [0, 1]), 'test': ([[5, 6]], [2]), 'valid': None}\", \"assert split_dataset(([[1, 2], [3, 4], [5, 6]], [0, 1, 2]), [0], [1], [2]) == {'train': ([[1, 2]], [0]), '... | {
"split": "train",
"index": 79319,
"acecode_id": "bigcode_python_fns_17575",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates setting a persistent cache location. The function should take a single string argument representing the path to the cache and return a message indicating whether the cache location has been set successfully or if the path i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_persistent_cache('valid/path/to/cache') == 'Cache location set to valid/path/to/cache'\", \"assert set_persistent_cache('') == 'Invalid cache path'\", \"assert set_persistent_cache('invalid?path') == 'Invalid cache path'\", \"assert set_persistent_cache(... | {
"split": "train",
"index": 79320,
"acecode_id": "bigcode_python_fns_16980",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `move_pacman(pacman: Pacman, direction: str) -> None` that modifies the position of Pacman based on the given direction. The `Pacman` class has attributes `x` and `y` which represent its current position. The function should update Pacman's position by movi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert (p := Pacman(0, 0)).move('UP') or (p.x == 0 and p.y == -1)\", \"assert (p := Pacman(0, 0)).move('DOWN') or (p.x == 0 and p.y == 1)\", \"assert (p := Pacman(0, 0)).move('LEFT') or (p.x == -1 and p.y == 0)\", \"assert (p := Pacman(0, 0)).move('RIGHT') or (p.x ... | {
"split": "train",
"index": 79321,
"acecode_id": "evol_24398",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that initializes a `Resource` object in a cloud computing environment. The function, named `initialize_resource`, should take the following parameters: `service_type` (a string representing the type of service), `allow_create` (a boolean ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert initialize_resource('metering', True, False, False) == {'resource_key': None, 'resources_key': None, 'base_path': '/meters/%(meter)s', 'service_type': 'metering', 'allow_create': True, 'allow_retrieve': False, 'allow_update': False}\", \"assert initialize_re... | {
"split": "train",
"index": 79322,
"acecode_id": "oss_36416",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a dictionary where each key corresponds to a list of integers. Write a function that retrieves all unique pairs of integers from the combined lists across all keys. The function should return a list of unique pairs, where the order of integers in each pair does no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_unique_pairs({'a': [1, 2], 'b': [2, 3], 'c': [3, 4]}) == [(1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)]\", \"assert get_unique_pairs({'x': [5, 6], 'y': [6, 7], 'z': [5, 7]}) == [(5, 6), (5, 7), (6, 7)]\", \"assert get_unique_pairs({'p': [8, 9], 'q': [9... | {
"split": "train",
"index": 79323,
"acecode_id": "evol_11090",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `insert_into_bst(root: Optional[Node], key: int) -> Node` that inserts a new key into a Binary Search Tree (BST). The function should take the root of the BST and the key to be inserted as parameters. If the root is None, the function should create a new no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert insert_into_bst(None, 10).val == 10\", \"assert insert_into_bst(None, 15).val == 15\", \"assert insert_into_bst(Node(10), 5).left.val == 5\", \"assert insert_into_bst(Node(10), 20).right.val == 20\", \"assert insert_into_bst(Node(10), 15).right.val == 15\", ... | {
"split": "train",
"index": 79324,
"acecode_id": "evol_6670",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a positive integer `n`. Your task is to write a function that calculates the sum of the squares of all the '1' digits in the binary representation of `n` that are in odd positions (0-indexed from the right). An odd position is defined as the 1st, 3rd, 5th, etc., b... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_odd_position_one_squares(15) == 2\", \"assert sum_of_odd_position_one_squares(3) == 1\", \"assert sum_of_odd_position_one_squares(1) == 0\", \"assert sum_of_odd_position_one_squares(0) == 0\", \"assert sum_of_odd_position_one_squares(9) == 1\", \"asse... | {
"split": "train",
"index": 79325,
"acecode_id": "oss_34355",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings where each string represents a read from a genomic sequencing output. Each read is formatted as 'ReadID\tDirection\tStart\tCIGAR\tMDtag'. Implement a function that takes this list of reads as input and returns a dictionary where the keys are the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_answers_by_qname(['Read1\\t+\\t100\\t4M\\t0', 'Read2\\t-\\t200\\t4M\\t1', 'Read3\\t+\\t300\\t4M\\t2']) == {'Read1': ('+', '100', '4M', '0'), 'Read2': ('-', '200', '4M', '1'), 'Read3': ('+', '300', '4M', '2')}\", \"assert get_answers_by_qname(['Header', '... | {
"split": "train",
"index": 79326,
"acecode_id": "bigcode_python_fns_13943",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing the heights of units in a sequence. Write a function `sequence_properties(units: List[int]) -> Dict[str, Any]` that returns a dictionary containing the following properties: 1) 'max_height' - the maximum height of the units, 2) 'min... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sequence_properties([3, 1, 4, 1, 5]) == {'max_height': 5, 'min_height': 1, 'average_height': 2.8}\", \"assert sequence_properties([10, 20, 30, 40]) == {'max_height': 40, 'min_height': 10, 'average_height': 25.0}\", \"assert sequence_properties([5]) == {'max_... | {
"split": "train",
"index": 79327,
"acecode_id": "bigcode_python_fns_38162",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of integers, `input_list` and `condition_list`, of the same length. Your task is to implement a function `zero_out_list` that takes these two lists as input and returns a new list where the elements of `input_list` are set to 0 wherever the corresponding... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert zero_out_list([1, 2, 3, 4], [True, False, True, False]) == [0, 2, 0, 4]\", \"assert zero_out_list([5, 6, 7, 8], [False, False, False, False]) == [5, 6, 7, 8]\", \"assert zero_out_list([1, 2, 3], [True, True, True]) == [0, 0, 0]\", \"assert zero_out_list([1, ... | {
"split": "train",
"index": 79328,
"acecode_id": "oss_15045",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a sentence, write a function `longestWord(sentence)` that finds and returns the longest word in the sentence. A word is defined as a sequence of characters separated by spaces. If there are multiple words with the same maximum length, the function should return the first ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert longestWord('The quick brown fox') == 'quick'\", \"assert longestWord('Hello world') == 'Hello'\", \"assert longestWord('A B C D E F G') == 'A'\", \"assert longestWord('Python programming is fun') == 'programming'\", \"assert longestWord('') == ''\", \"asser... | {
"split": "train",
"index": 79329,
"acecode_id": "oss_26250",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that reorders a sequence of positive integers and negative integers based on the lengths of their positive binary equivalents in ascending order. If two integers have binary lengths that are the same, sort them according to their absolute decimal values. The f... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_by_binary_len([0, 1, 2, 3, 4]) == [0, 1, 2, 3, 4]\", \"assert sort_by_binary_len([-4, -16, 1, 2, 3]) == [1, 2, 3, -4, -16]\", \"assert sort_by_binary_len([-5, 5, -6, 6]) == [-5, 5, -6, 6]\", \"assert sort_by_binary_len([10, -10, 1, -1, 4]) == [1, -1, 4,... | {
"split": "train",
"index": 79330,
"acecode_id": "evol_4222",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that manages a list of route table entries in a network simulation environment. Each route table entry is represented as a dictionary with the following keys: 'destination', 'next_hop', and 'interface'. Your function should perform tw... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_route_table([], '192.168.1.1', '192.168.1.254', 'eth0') == [{'destination': '192.168.1.1', 'next_hop': '192.168.1.254', 'interface': 'eth0'}]\", \"assert manage_route_table([{'destination': '192.168.1.1', 'next_hop': '192.168.1.254', 'interface': 'eth... | {
"split": "train",
"index": 79331,
"acecode_id": "oss_17079",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a simple function that converts a Markdown formatted string into HTML format. Your function should take a single string parameter `markdown_text`, which represents the Markdown content. The function should return a string containing the converted HT... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert convert_markdown('# Header 1') == '<h1>Header 1</h1>'\", \"assert convert_markdown('## Header 2') == '<h2>Header 2</h2>'\", \"assert convert_markdown('### Header 3') == '<h3>Header 3</h3>'\", \"assert convert_markdown('This is **bold** text.') == 'This is <s... | {
"split": "train",
"index": 79332,
"acecode_id": "bigcode_python_fns_20915",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "Create a function `find_books_by_author(books: List[Tuple[str, float, str]], author_name: str) -> List[str]` that takes a list of books, where each book is represented as a tuple containing the book's name, price, and author. The function should return a list of names of all bo... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_books_by_author([('Book1', 200, 'Author1'), ('Book2', 300, 'Author1'), ('Book3', 400, 'Author2')], 'Author1') == ['Book1', 'Book2']\", \"assert find_books_by_author([('Book1', 150, 'Author2'), ('Book4', 250, 'Author3')], 'Author1') == []\", \"assert fin... | {
"split": "train",
"index": 79333,
"acecode_id": "evol_26879",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You need to implement a function that simulates adding a new enum type to a list of enums represented by their serial numbers. The function should take three parameters: an integer 'idx' (the serial number of the new enum), a string 'name' (the name of the enum), and an integer... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_enum(-1, 'NewEnum', 0) == 0\", \"assert add_enum(0, 'FirstEnum', 1) == 0\", \"assert add_enum(0, 'ZeroEnum', 0) == 0\", \"assert add_enum(0, 'FirstAgain', 1) == 0\", \"assert add_enum(0, 'NewFirst', 0) == 0\"]}"
} | {
"split": "train",
"index": 79334,
"acecode_id": "bigcode_python_fns_45358",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that generates an embedded list for ontology terms by combining two lists: synonym terms and definition terms. Your function should take two lists as input: `synonym_terms` and `definition_terms`, which represent the embedded lists for on... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_ontology_embedded_list(['syn1', 'syn2'], ['def1', 'def2']) == ['syn1', 'syn2', 'def1', 'def2']\", \"assert build_ontology_embedded_list(['a', 'b'], ['c', 'd', 'e']) == ['a', 'b', 'c', 'd', 'e']\", \"assert build_ontology_embedded_list([], ['only_def'])... | {
"split": "train",
"index": 79335,
"acecode_id": "bigcode_python_fns_18567",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, implement a function that processes the lists according to the following rules: If the lengths of the two lists are equal, return a new list where each element is the sum of the corresponding elements from both lists. If the first list is shorter th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_lists([1, 2, 3], [4, 5, 6]) == [5, 7, 9]\", \"assert process_lists([1, 2], [4, 5, 6]) == [3, 3, 6]\", \"assert process_lists([1, 2, 3, 7], [4, 5, 6]) == [4, 10, 18, 7]\", \"assert process_lists([3], [1, 2]) == [-2, 2]\", \"assert process_lists([1, 2,... | {
"split": "train",
"index": 79336,
"acecode_id": "evol_9778",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines whether a given user ID can be deleted based on a predefined set of rules. The function should take a user ID as input and return `True` if the user ID can be deleted, and `False` otherwise. A user ID can be deleted if... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert can_delete_user('userabcd') == True\", \"assert can_delete_user('admin123') == False\", \"assert can_delete_user('user1234') == False\", \"assert can_delete_user('admin5678') == False\", \"assert can_delete_user('test0001') == False\", \"assert can_delete_us... | {
"split": "train",
"index": 79337,
"acecode_id": "bigcode_python_fns_47538",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two points in a 2D plane represented as dictionaries with 'x' and 'y' keys, which correspond to their coordinates. Your goal is to determine whether the area defined by these two points is valid. A valid area is defined by the top-left corner being to the left and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_valid_capture_area({'x': 1, 'y': 3}, {'x': 4, 'y': 1}) == True\", \"assert is_valid_capture_area({'x': 0, 'y': 0}, {'x': 0, 'y': 0}) == False\", \"assert is_valid_capture_area({'x': 4, 'y': 4}, {'x': 3, 'y': 5}) == False\", \"assert is_valid_capture_area(... | {
"split": "train",
"index": 79338,
"acecode_id": "bigcode_python_fns_33567",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, determine if the first list is equal to the reverse of the second list. Implement a function `are_reversed(arr1, arr2)` that takes in two lists and returns `True` if the first list is identical to the reversed version of the second list, and `False`... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_reversed([5, 8, 9], [9, 8, 5]) == True\", \"assert are_reversed([1, 2, 3], [3, 2, 1]) == True\", \"assert are_reversed([1, 2, 3], [1, 2, 3]) == False\", \"assert are_reversed([0, 0, 0], [0, 0, 0]) == True\", \"assert are_reversed([], []) == True\", \"ass... | {
"split": "train",
"index": 79339,
"acecode_id": "evol_28484",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing different types of connectors. Write a function `get_connectors_by_type(type: str, connectors: List[str]) -> List[str]` that returns a list of connectors that match the specified type. The input `connectors` is a list containing vari... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_connectors_by_type('USB', ['USB', 'HDMI', 'USB-C', 'VGA', 'USB-3.0']) == ['USB', 'USB-C', 'USB-3.0']\", \"assert get_connectors_by_type('HDMI', ['USB', 'HDMI', 'USB-C', 'VGA', 'USB-3.0']) == ['HDMI']\", \"assert get_connectors_by_type('VGA', ['USB', 'HDM... | {
"split": "train",
"index": 79340,
"acecode_id": "bigcode_python_fns_35346",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the factorial of a non-negative integer 'n'. If the input is not a non-negative integer, the function should return an error message 'Error: Input should be a non-negative integer.' Otherwise, the function should return the factorial of 'n'.... | 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": 79341,
"acecode_id": "evol_17323",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes a JSON schema to generate a table structure. The function should take the following inputs: a list of column definitions (each column definition is a dictionary containing the 'name', 'columnType', and 'maximumSize'), and a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_table_schema([{'name': 'key', 'columnType': 'STRING', 'maximumSize': 100}, {'name': 'description', 'columnType': 'STRING', 'maximumSize': 250}], [{'key': '1', 'description': 'Test description'}]) == ('key,description', [{'key': '1', 'description': 'T... | {
"split": "train",
"index": 79342,
"acecode_id": "bigcode_python_fns_15751",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that processes a list of strings representing code snippets. Each code snippet may contain various types of statements including variable assignments and function calls. Your task is to extract the maximum value assigned to the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_info(['wcropy.max = 200', 'outbin.observe(track_changes)']) == {'wcropy_max': 200, 'observe_function': 'track_changes'}\", \"assert extract_info(['wcropy.max = 50', 'outbin.observe(print_data)']) == {'wcropy_max': 50, 'observe_function': 'print_data'... | {
"split": "train",
"index": 79343,
"acecode_id": "oss_8963",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that updates the login status of a user to 'logged out' in a database. The function will take in a database connection and a username as parameters. Your goal is to ensure that when the function is called, the user's login status is u... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert user_logged_out('dummy_connection', 'john_doe') == 'User john_doe logged out successfully'\", \"assert user_logged_out('dummy_connection', 'jane_smith') == 'User jane_smith logged out successfully'\", \"assert user_logged_out('dummy_connection', 'alice_johns... | {
"split": "train",
"index": 79344,
"acecode_id": "bigcode_python_fns_40658",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a directed graph represented as an adjacency list. Each node in the graph is identified by a unique integer. Your task is to implement a function that calculates the number of distinct paths from a given starting node to a target node. A path is defined as a seque... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_paths({1: [2], 2: [3], 3: []}, 1, 3) == 1\", \"assert count_paths({1: [2, 3], 2: [3], 3: []}, 1, 3) == 2\", \"assert count_paths({1: [2], 2: [3], 3: [4], 4: []}, 1, 4) == 1\", \"assert count_paths({1: [2], 2: [], 3: [4], 4: []}, 1, 4) == 0\", \"assert ... | {
"split": "train",
"index": 79345,
"acecode_id": "bigcode_python_fns_16961",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that returns the sum of all even numbers in the list. If there are no even numbers, the function should return 0. The function should be defined as follows: `def sum_of_evens(numbers: List[int]) -> int:` where `numbers` is a list of in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_evens([1, 2, 3, 4, 5]) == 6\", \"assert sum_of_evens([10, 15, 20, 25]) == 30\", \"assert sum_of_evens([1, 3, 5, 7]) == 0\", \"assert sum_of_evens([]) == 0\", \"assert sum_of_evens([2, 4, 6, 8]) == 20\", \"assert sum_of_evens([-2, -4, -6]) == -12\", \"... | {
"split": "train",
"index": 79346,
"acecode_id": "bigcode_python_fns_26239",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that determines whether a given string is a palindrome. A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization). Write a fu... | 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('Was it a car or a cat I saw?') == True\", \"assert is_palindrome('No lemon, no melon')... | {
"split": "train",
"index": 79347,
"acecode_id": "oss_37136",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates the setting of a vehicle's throttle position based on a given latency timeout condition. The function is called `set_throttle_position_on_timeout` and takes two parameters: an object `current_throttle` that provides a c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert set_throttle_position_on_timeout(mock_current_throttle, mock_arguments) is None\", \"assert mock_current_throttle.get_current() == mock_arguments.worst_throttle()\", \"assert set_throttle_position_on_timeout(mock_current_throttle, mock_arguments) is None\", ... | {
"split": "train",
"index": 79348,
"acecode_id": "oss_27577",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `apply_function` that takes a callable function `f`, a nested list `obj`, and additional nested lists as `rest`. The function should apply `f` to all elements in the nested lists, but only if the elements are integers. If `f` modifies an ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert apply_function(lambda x: x + 1, [[1, 2], [3]], inplace=False) == [[2, 3], [4]]\", \"assert apply_function(lambda x: x * 2, [[1, 2], [3]], inplace=False) == [[2, 4], [6]]\", \"assert apply_function(lambda x: x - 1, [[4, 5], [6]], inplace=False) == [[3, 4], [5... | {
"split": "train",
"index": 79349,
"acecode_id": "bigcode_python_fns_20796",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of strings, implement a function that reads a specified number of strings from the list and returns them as a new list. The function should accept an integer `n` which indicates how many strings to read from the list. If `n` is greater than the length of the list, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert read_strings(['hello', 'world', 'leetcode'], 2) == ['hello', 'world']\", \"assert read_strings(['hello', 'world', 'leetcode'], 0) == []\", \"assert read_strings(['hello', '', 'leetcode'], 3) == ['hello', '', 'leetcode']\", \"assert read_strings([], 2) == []\... | {
"split": "train",
"index": 79350,
"acecode_id": "bigcode_python_fns_786",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that checks if the current time in milliseconds exceeds a specified time in milliseconds. The function should take two parameters: a list of integers where the first element represents the expected time in milliseconds and a timestamp rep... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_time_exceeds([1000], 2000) == None\", \"assert check_time_exceeds([2000], 1000) == 'ASSERT_SECONDS_ABSOLUTE_FAILED'\", \"assert check_time_exceeds([500], 500) == 'ASSERT_SECONDS_ABSOLUTE_FAILED'\", \"assert check_time_exceeds([3000], 4000) == None\", \... | {
"split": "train",
"index": 79351,
"acecode_id": "bigcode_python_fns_22247",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a collection of models, each identified by a name and an index. The models can be combined using addition and union operations. Your task is to implement a function that takes a combined model and returns a list of submodel names based on different slicing operati... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert combined_model[1:].submodel_names == ['b', 'c', 'd', 'e']\", \"assert combined_model[:].submodel_names == ['a', 'b', 'c', 'd', 'e']\", \"assert combined_model[0:].submodel_names == ['a', 'b', 'c', 'd', 'e']\", \"assert combined_model[0:1].submodel_names == [... | {
"split": "train",
"index": 79352,
"acecode_id": "bigcode_python_fns_15802",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given an array of exactly six integers, write a function `find_max_value(arr)` that returns the maximum value from the array.\nPlease reason step by step, then write a self-contained Python solution. Give your final program in a single ```python code block."
}
] | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_max_value([3, 5, 4, 2, 7, 10]) == 10\", \"assert find_max_value([-1, -5, -3, -2, -4, -6]) == -1\", \"assert find_max_value([1, 2, 3, 4, 5, 6]) == 6\", \"assert find_max_value([10, 9, 8, 7, 6, 5]) == 10\", \"assert find_max_value([0, 0, 0, 0, 0, 0]) == 0... | {
"split": "train",
"index": 79353,
"acecode_id": "evol_8636",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a Python dictionary with integer keys where values can be a mix of integers, float numbers, and strings, write a function that converts the dictionary into a list of tuples. Each tuple should be in the order: key, value. Additionally, the function should return another li... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert dictionary_to_lists({1: 'a', 2: 3.5, 3: 4, 4: 'b'}) == ([(1, 'a'), (2, 3.5), (3, 4), (4, 'b')], [(1, 'a'), (4, 'b')])\", \"assert dictionary_to_lists({}) == ([], [])\", \"assert dictionary_to_lists({1: 1, 2: 'test', 3: 0.5}) == ([(1, 1), (2, 'test'), (3, 0.5... | {
"split": "train",
"index": 79354,
"acecode_id": "evol_22184",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called count_positive_multiples that receives an array of integers and strings. The function should return the number of elements whose cumulative sum (considering the first element as negative if it's negative) is greater than zero and is a multiple of eit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_positive_multiples([]) == 0\", \"assert count_positive_multiples([3, 3, '6', '6']) == 1\", \"assert count_positive_multiples([0, '0', '0']) == 0\", \"assert count_positive_multiples([4, 4, '8', 'eight']) == 1\", \"assert count_positive_multiples([-2, -... | {
"split": "train",
"index": 79355,
"acecode_id": "evol_35548",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Consider a function P(m, n) that represents the count of unique elements in an m × n multiplication table. Your task is to implement a function that returns the number of unique elements in such a multiplication table. For example, for a 3 × 4 multiplication table, the unique e... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert P(3, 4) == 8\", \"assert P(1, 1) == 1\", \"assert P(64, 64) == 1263\", \"assert P(12, 345) == 1998\", \"assert P(3, 1) == 3\"]}"
} | {
"split": "train",
"index": 79356,
"acecode_id": "evol_2916",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `add_numbers` that takes two integers as parameters and returns their sum. The function should not be part of any class structure. The function signature is as follows: `def add_numbers(a: int, b: int) -> int:`.\nPlease reason step by step, then writ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_numbers(3, 4) == 7\", \"assert add_numbers(-1, 1) == 0\", \"assert add_numbers(0, 0) == 0\", \"assert add_numbers(10, 20) == 30\", \"assert add_numbers(-5, -10) == -15\", \"assert add_numbers(100, 200) == 300\", \"assert add_numbers(50, 50) == 100\", \"a... | {
"split": "train",
"index": 79357,
"acecode_id": "evol_15049",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Write a function `process_list(nums: List[int]) -> List[int]` that processes the list of integers by doubling each number that is even, and tripling each number that is odd. Return the new list of processed integers. For example, given the inpu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_list([1, 2, 3, 4]) == [3, 4, 9, 8]\", \"assert process_list([0, 5, 10, 15]) == [0, 15, 20, 45]\", \"assert process_list([-1, -2, -3, -4]) == [-3, -4, -9, -8]\", \"assert process_list([2, 4, 6]) == [4, 8, 12]\", \"assert process_list([1, 1, 1]) == [3,... | {
"split": "train",
"index": 79358,
"acecode_id": "bigcode_python_fns_24074",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of mixed data types (integers and floats), implement a function that retrieves the minimum and maximum values from the list, as well as calculates the mean and median. The function should return the results in a dictionary format. The list can be of any length and ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert stats([1, 2, 3, 4, 5]) == {'Min': 1, 'Max': 5, 'Mean': 3.0, 'Median': 3}\", \"assert stats([1.5, 2.5, 3.5]) == {'Min': 1.5, 'Max': 3.5, 'Mean': 2.5, 'Median': 2.5}\", \"assert stats([-1, 0, 1]) == {'Min': -1, 'Max': 1, 'Mean': 0.0, 'Median': 0}\", \"assert s... | {
"split": "train",
"index": 79359,
"acecode_id": "evol_25307",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function `find_top_k_highest` that takes in three parameters: a list of integers `nums`, an integer `k`, and a boolean `ascending`. The function should return a list of the top `k` highest integers in `nums`. If `ascending` is set to `True`, th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_top_k_highest([3, 1, 4, 1, 5, 9, 2, 6, 5], 3, False) == [9, 6, 5]\", \"assert find_top_k_highest([1, 1, 1, 1], 2, True) == [1]\", \"assert find_top_k_highest([], 3, False) == []\", \"assert find_top_k_highest([10, 20, 30, 10, 20, 30], 4, True) == [10, 2... | {
"split": "train",
"index": 79360,
"acecode_id": "bigcode_python_fns_48134",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `pluck(arr, cond_fn)` that filters a list of integers based on two conditions: 1) each integer must be a prime number, and 2) each integer must be divisible by a single-digit prime number (2, 3, 5, or 7). The function should first remove any None values and... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pluck([2, 3, 5, 7, None], lambda x: x % 2 == 0) == [2]\", \"assert pluck([11, 13, 17, 19, None], lambda x: x % 3 == 0) == []\", \"assert pluck([2, 4, 6, 8, 10], lambda x: x % 2 == 0) == [2]\", \"assert pluck([29, 31, 37, 41], lambda x: x % 5 == 0) == []\", \... | {
"split": "train",
"index": 79361,
"acecode_id": "evol_23146",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `calculate_triangle_properties(side_length: float) -> Tuple[float, float]` that takes the length of a side of an equilateral triangle and returns a tuple containing the perimeter and area of the triangle. The perimeter is calculated as the sum of all three ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_triangle_properties(1) == (3.0, 0.4330127018922193)\", \"assert calculate_triangle_properties(2) == (6.0, 1.7320508075688772)\", \"assert calculate_triangle_properties(4) == (12.0, 6.928203230275509)\", \"assert calculate_triangle_properties(8) == ... | {
"split": "train",
"index": 79362,
"acecode_id": "evol_17884",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a decorator function called `time_measured` that measures and returns the execution time of any given function. The decorator should print out the measured time in seconds when the function is called, but it should not return the execution time valu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isinstance(time_measured(lambda: 1)(), int)\", \"assert isinstance(time_measured(lambda x: x + 1)(1), int)\", \"assert isinstance(time_measured(lambda x, y: x * y)(2, 3), int)\", \"assert isinstance(time_measured(lambda x: x**2)(4), int)\", \"assert isinstan... | {
"split": "train",
"index": 79363,
"acecode_id": "bigcode_python_fns_30016",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Consider two positive integers A and B. We define a relationship between them, denoted as 'connected' (A ↔ B), if they satisfy either of the following conditions: (1) A and B are of the same length and differ by exactly one digit. (2) By appending a single digit to the left of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert are_connected(123, 173) == True\", \"assert are_connected(23, 223) == True\", \"assert are_connected(123, 23) == True\", \"assert are_connected(123, 124) == True\", \"assert are_connected(456, 456) == False\", \"assert are_connected(5, 15) == True\", \"asser... | {
"split": "train",
"index": 79364,
"acecode_id": "evol_7516",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a string of characters, write a python function that outputs a list of all distinct permutations of the characters, while ensuring that each permutation has an equal number of vowels and consonants. Your function should handle both lowercase and uppercase characters. If t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert permute_equal_vowels_and_consonants('abc') == []\", \"assert permute_equal_vowels_and_consonants('abcde') == []\", \"assert permute_equal_vowels_and_consonants('xxyyzz') == []\", \"assert permute_equal_vowels_and_consonants('abcdeee') == []\", \"assert permu... | {
"split": "train",
"index": 79365,
"acecode_id": "evol_16696",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a dictionary representing the availability of keys on an input device, determine which type of input method to return based on the available keys. You will receive a dictionary with keys representing input sources and their corresponding availability status, as well as an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert determine_input_method({'keyboard': ['KEY_A', 'KEY_B', 'KEY_C'], 'mouse': None}, 'output', 'full') == 'NumpadCharInput'\", \"assert determine_input_method({'keyboard': ['KEY_0', 'KEY_1', 'KEY_2', 'KEY_F1', 'KEY_F2'], 'mouse': None}, 'output', 'number') == 'N... | {
"split": "train",
"index": 79366,
"acecode_id": "bigcode_python_fns_254",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `trait_colors(rows)` that takes a list of dictionaries, where each dictionary represents a row containing a list of traits. Each trait is a dictionary with a key 'trait' that holds the name of the trait. Your function should return a dict... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert trait_colors([{'traits': [{'trait': 'color1'}, {'trait': 'heading'}, {'trait': 'color2'}]}, {'traits': [{'trait': 'color1'}, {'trait': 'color3'}]}]) == {'color1': '#FF5733', 'color2': '#33FF57', 'color3': '#3357FF'}\", \"assert trait_colors([{'traits': [{'tr... | {
"split": "train",
"index": 79367,
"acecode_id": "bigcode_python_fns_21637",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a base URL and a query URL, write a function that ensures the query URL is an absolute URL. If the query URL does not already start with 'http', prepend the base URL to it. If the query URL starts with a '/', append it without an additional '/' to avoid double slashes. If... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ensure_absolute_url('http://example.com', 'path/to/resource') == 'http://example.com/path/to/resource'\", \"assert ensure_absolute_url('http://example.com', '/path/to/resource') == 'http://example.com/path/to/resource'\", \"assert ensure_absolute_url('http:/... | {
"split": "train",
"index": 79368,
"acecode_id": "bigcode_python_fns_8420",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of postal code entries and returns a dictionary that maps each postal code to its corresponding area address. Each entry in the list is represented as a tuple with two elements: the first element is the postal code (... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert map_postal_codes([('123-4567', 'Tokyo'), ('123-4567', 'Osaka')]) == {'123-4567': 'Osaka'}\", \"assert map_postal_codes([('987-6543', 'Kyoto'), ('123-4567', 'Tokyo'), ('987-6543', 'Hokkaido')]) == {'987-6543': 'Hokkaido', '123-4567': 'Tokyo'}\", \"assert map_... | {
"split": "train",
"index": 79369,
"acecode_id": "bigcode_python_fns_14575",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a simple caching system using Python's generator functions. Your goal is to create a function `add_to_cache` that accepts an iterable of items and adds each item to a cache list. The function should yield each item as it is added to the cache. T... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert list(add_to_cache(['Item 1', 'Item 2', 'Item 3'])) == ['Item 1', 'Item 2', 'Item 3']\", \"assert list(add_to_cache(['A', 'B'])) == ['A', 'B']\", \"assert list(add_to_cache([])) == []\", \"assert list(add_to_cache(['Single Item'])) == ['Single Item']\", \"ass... | {
"split": "train",
"index": 79370,
"acecode_id": "oss_2602",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `submit_paper(title: str, abstract: str, keywords: str, author: User) -> Paper` that simulates the submission of an academic paper. The function should create a new `Paper` instance based on the given title, abstract, keywords, and author. The `Paper` insta... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isinstance(submit_paper('Quantum Computing', 'Exploring the quantum realm.', 'quantum, computing', User('asmith', 'asmith@example.com', 'password456', 'Alice', 'Smith')), Paper)\", \"assert submit_paper('Machine Learning Basics', 'An introduction to machine ... | {
"split": "train",
"index": 79371,
"acecode_id": "evol_10174",
"num_tests": 14
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that processes licensing information for a software application. The function should take a dictionary representing licensing information as input and return a string that summarizes the licensing details in a human-readable format. The d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_licensing_info({'type': 'MHLM', 'status': 'starting', 'version': 'R2020b', 'token': 'abc@nlm', 'emailaddress': 'abc@nlm', 'sourceId': 'abc@nlm'}) == 'Type: MHLM, Status: starting, Version: R2020b, Token: abc@nlm, Email: abc@nlm, Source ID: abc@nlm'\",... | {
"split": "train",
"index": 79372,
"acecode_id": "bigcode_python_fns_1037",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `edit_distance(str1: str, str2: str) -> int` that calculates the minimum number of operations required to convert `str1` into `str2`. The allowed operations are insertion, deletion, and substitution of a single character. The function should return the edit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert edit_distance('kitten', 'sitting') == 3\", \"assert edit_distance('flaw', 'lawn') == 2\", \"assert edit_distance('intention', 'execution') == 5\", \"assert edit_distance('a', 'b') == 1\", \"assert edit_distance('', '') == 0\", \"assert edit_distance('', 'abc... | {
"split": "train",
"index": 79373,
"acecode_id": "evol_28005",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of integers and returns a new list containing only the unique integers from the original list, maintaining the order of their first appearance. Implement the function `unique_integers(lst: List[int]) -> List[int]... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_integers([1, 2, 2, 3, 1, 4]) == [1, 2, 3, 4]\", \"assert unique_integers([5, 5, 5, 5]) == [5]\", \"assert unique_integers([]) == []\", \"assert unique_integers([10, 20, 10, 30, 20, 40]) == [10, 20, 30, 40]\", \"assert unique_integers([1, 2, 3, 4, 5]) ... | {
"split": "train",
"index": 79374,
"acecode_id": "bigcode_python_fns_49752",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers. Your task is to implement a function that returns the maximum sum of a contiguous subarray within the given list. A contiguous subarray is defined as a subarray of the original array where the elements are adjacent in the array. The input list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_subarray_sum([-2, 1, -3, 4, -1, 2, 1, -5, 4]) == 6\", \"assert max_subarray_sum([5, 4, -1, 7, 8]) == 23\", \"assert max_subarray_sum([-1, -2, -3, -4]) == -1\", \"assert max_subarray_sum([0]) == 0\", \"assert max_subarray_sum([1, 2, 3]) == 6\", \"assert m... | {
"split": "train",
"index": 79375,
"acecode_id": "bigcode_python_fns_47776",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function that takes a list of integers as input and returns a new list with the elements in reverse order. You must achieve this without using any built-in reverse functions or slicing methods. For example, given the list [1, 2, 3], the function should return [3,... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_array([1, 2, 3]) == [3, 2, 1]\", \"assert reverse_array([10, 20, 30, 40]) == [40, 30, 20, 10]\", \"assert reverse_array([5]) == [5]\", \"assert reverse_array([]) == []\", \"assert reverse_array([2, 4, 6, 8]) == [8, 6, 4, 2]\", \"assert reverse_array(... | {
"split": "train",
"index": 79376,
"acecode_id": "evol_11405",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of dictionaries representing data records. Each dictionary contains a 'name' key (a string) and an 'age' key (an integer). Your function should return a new list of dictionaries where the 'name' value is transfor... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert transform_records([{ 'name': 'Alice', 'age': 30 }, { 'name': 'Bob', 'age': 25 }]) == [{ 'name': 'Alice (30)' }, { 'name': 'Bob (25)' }]\", \"assert transform_records([{ 'name': 'Charlie', 'age': None }, { 'name': 'Dave', 'age': 40 }]) == [{ 'name': 'Dave (40... | {
"split": "train",
"index": 79377,
"acecode_id": "bigcode_python_fns_12102",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two strings representing dates in the format 'MM/DD/YYYY', write a function that calculates the number of days between these two dates. The function should return the absolute number of days, regardless of the order of the dates provided.\nPlease reason step by step, then... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert days_between('01/01/2021', '07/04/2021') == 184\", \"assert days_between('02/15/2020', '02/15/2021') == 366\", \"assert days_between('12/31/2020', '01/01/2021') == 1\", \"assert days_between('01/01/2020', '01/01/2020') == 0\", \"assert days_between('07/04/20... | {
"split": "train",
"index": 79378,
"acecode_id": "evol_7407",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a job queue that prioritizes jobs based on their type and priority level. Your goal is to implement a function `manage_jobs(jobs)` that takes in a list of tuples `jobs`, where each tuple contains a job type (a string) and its priority (an integer). ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_jobs([('job1', 2), ('job2', 1), ('job3', 3)]) == ['job2', 'job1', 'job3']\", \"assert manage_jobs([('jobA', 5), ('jobB', 5), ('jobC', 2)]) == ['jobC', 'jobA', 'jobB']\", \"assert manage_jobs([]) == []\", \"assert manage_jobs([('jobX', 10), ('jobY', 1)... | {
"split": "train",
"index": 79379,
"acecode_id": "oss_979",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, implement a function that computes two values: the sum of squares of unique non-zero integers and the sum of distinct non-zero integers multiplied by the product of their signs. The signs are defined as follows: 1 for positive numbers, -1 for negativ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert complex_math_operations([-5, -5, 5]) == (0, 50)\", \"assert complex_math_operations([0, 5, 10]) == None\", \"assert complex_math_operations([]) == None\", \"assert complex_math_operations([1, -1, 1, -1]) == (0, 2)\", \"assert complex_math_operations([0, -2, ... | {
"split": "train",
"index": 79380,
"acecode_id": "evol_24060",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that builds a URL for an API request. The function should take two parameters: an endpoint (a string) and a server description (also a string). If the server description is an empty string, the function should return None. If the server d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert build_url('api/items', 'https://example.com') == 'https://example.com/api/items'\", \"assert build_url('api/items', '') is None\", \"assert build_url('users', 'http://localhost') == 'http://localhost/users'\", \"assert build_url('posts', 'https://api.example... | {
"split": "train",
"index": 79381,
"acecode_id": "bigcode_python_fns_10837",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a single character, return its ASCII value. You need to implement a function called `get_ascii_value` that takes a single character as input and returns the ASCII value of that character. Your function should correctly handle uppercase letters, lowercase letters, and spec... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_ascii_value('A') == 65\", \"assert get_ascii_value('z') == 122\", \"assert get_ascii_value('1') == 49\", \"assert get_ascii_value('!') == 33\", \"assert get_ascii_value(' ') == 32\", \"assert get_ascii_value('~') == 126\", \"assert get_ascii_value('b') =... | {
"split": "train",
"index": 79382,
"acecode_id": "oss_6126",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that implements a simple plugin registration system. The function should accept a list of tuples, where each tuple contains the name of a plugin (a string) and the number of stars it has received (an integer). Your function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert plugin_system([('TestPlugin', 5), ('AnotherPlugin', 3)]) == {'total_plugins': 2, 'plugins_list': ['TestPlugin', 'AnotherPlugin'], 'total_stars': 8}\", \"assert plugin_system([('PluginA', 10), ('PluginB', 0)]) == {'total_plugins': 2, 'plugins_list': ['PluginA... | {
"split": "train",
"index": 79383,
"acecode_id": "oss_17985",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that determines the next pickup event date based on the current date. You are given a list of pickup event dates as strings in 'YYYY-MM-DD' format. Your function should return the next pickup event date as a string. If there are no up... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_next_pickup_event(['2023-11-01', '2023-11-10', '2023-11-20'], '2023-10-31') == '2023-11-01'\", \"assert get_next_pickup_event(['2023-11-01', '2023-11-10', '2023-11-20'], '2023-11-01') == '2023-11-10'\", \"assert get_next_pickup_event(['2023-11-01', '2023... | {
"split": "train",
"index": 79384,
"acecode_id": "bigcode_python_fns_27652",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a python function that converts a number from base 10 to base 8. The function should handle negative numbers and floating-point numbers, ensuring that the output for floating-point numbers is formatted to 4 decimal places. The function should be defined as follows: def ba... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert base10_to_base8(10) == '12'\", \"assert base10_to_base8(-10) == '-12'\", \"assert base10_to_base8(0) == '0'\", \"assert base10_to_base8(8) == '10'\", \"assert base10_to_base8(15.625) == '17.5'\", \"assert base10_to_base8(-15.625) == '-17.5'\", \"assert base1... | {
"split": "train",
"index": 79385,
"acecode_id": "evol_20064",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Given a list of bus stops represented as a list of dictionaries, where each dictionary contains a 'code' (string) and 'buses' (list of strings), implement a function `update_stop_list(stops, new_stop)` that updates the list of stops with a new stop. If the new stop's code alrea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_stop_list([], {'code': 'A', 'buses': ['B1', 'B2']}) == [{'code': 'A', 'buses': ['B1', 'B2']}]\", \"assert update_stop_list([{'code': 'A', 'buses': ['B1']}], {'code': 'A', 'buses': ['B2']}) == [{'code': 'A', 'buses': ['B1', 'B2']}]\", \"assert update_s... | {
"split": "train",
"index": 79386,
"acecode_id": "bigcode_python_fns_5850",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `verify_string(s: str) -> bool` that checks if a given string starts with a UTF-8 compatible special character (non-alphanumeric), followed by exactly 3 letters (either lowercase or uppercase), includes at least one uppercase letter, and ends with at least 2 bu... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_string('!abc1') == False\", \"assert verify_string('$aBc4567') == False\", \"assert verify_string('^abc01') == False\", \"assert verify_string('*ABC5678') == False\", \"assert verify_string('!xyz 12') == False\", \"assert verify_string('!abc 123') == ... | {
"split": "train",
"index": 79387,
"acecode_id": "evol_20954",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `create_property(node_id)` that simulates the creation of a property in a graph model. The input to the function will be a unique identifier for a node, represented as a string `node_id`. The function should return a tuple containing the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_property('node1') == ('node1', 'rdf:type', 'rdf:Property')\", \"assert create_property('node2') == ('node2', 'rdf:type', 'rdf:Property')\", \"assert create_property('testNode') == ('testNode', 'rdf:type', 'rdf:Property')\", \"assert create_property('a... | {
"split": "train",
"index": 79388,
"acecode_id": "bigcode_python_fns_7236",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `edit_diary_entry(entry: dict, attribute: str, new_value: any) -> dict` that allows you to edit a specific attribute of a diary entry represented as a dictionary. The dictionary will contain the keys: 'date', 'title', 'text', 'mood', and 'weather'. The func... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert edit_diary_entry({'date': '2023-10-01', 'title': 'My Day', 'text': 'It was a good day.', 'mood': 'happy', 'weather': 'sunny'}, 'title', 'My Awesome Day') == {'date': '2023-10-01', 'title': 'My Awesome Day', 'text': 'It was a good day.', 'mood': 'happy', 'wea... | {
"split": "train",
"index": 79389,
"acecode_id": "evol_31459",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Write a Python function `find_lcm_in_array(lst)` that takes a list of integers `lst` and returns the least common multiple (LCM) of all the numbers in the list. The function should handle the following error cases: if the list is empty, return None; if any element in the list i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_lcm_in_array([2, 3, 5]) == 30\", \"assert find_lcm_in_array([4, 6, 8]) == 24\", \"assert find_lcm_in_array([1, 2, 3, 4, 5]) == 60\", \"assert find_lcm_in_array([10]) == 10\", \"assert find_lcm_in_array([7, 14, 21]) == 42\", \"assert find_lcm_in_array([-... | {
"split": "train",
"index": 79390,
"acecode_id": "evol_31834",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that validates whether a given version string is compatible with a list of supported Python versions and a set of version constraints. Implement the function `validate_python_version(version, supported_versions, python_requires)` w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_python_version('3.7', ['3.6', '3.7', '3.8', '3.9'], '>=2.7, <4') == True\", \"assert validate_python_version('3.10', ['3.6', '3.7', '3.8', '3.9'], '>=2.7, <4') == False\", \"assert validate_python_version('3.6', ['3.6', '3.7', '3.8', '3.9'], '>=2.7,... | {
"split": "train",
"index": 79391,
"acecode_id": "oss_29487",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing package versions in a system. Given a list of package version strings formatted as 'package_name==version', you need to parse this list and return a dictionary where each key is a package name, and the associated value is a list of versions for that... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert parse_package_versions(['numpy==1.18.1', 'pandas==1.0.3']) == {'numpy': ['1.18.1'], 'pandas': ['1.0.3']}\", \"assert parse_package_versions(['scipy==1.4.1', 'scipy==1.4.2']) == {'scipy': ['1.4.1', '1.4.2']}\", \"assert parse_package_versions(['matplotlib==3.... | {
"split": "train",
"index": 79392,
"acecode_id": "oss_22777",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that sorts a mixed list of integers and decimal values using a binary search tree (BST) approach. The function should return the list arranged in a specific order, which starts with the smallest element, followed by the largest of the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert unique_BST_sort([1, 2, 3, 4]) == [1, 4, 2, 3]\", \"assert unique_BST_sort([5, 5, 5, 5]) == [5, 5, 5, 5]\", \"assert unique_BST_sort([]) == []\", \"assert unique_BST_sort([-2, 1.5, 3.5, -1]) == [-2, 3.5, -1, 1.5]\", \"assert unique_BST_sort([10, 20, 30, 40]) ... | {
"split": "train",
"index": 79393,
"acecode_id": "evol_24896",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a command-line flag option represented as a string. Your task is to determine if the flag '--on' is present in the input string. If '--on' is present, you should return a message indicating that the flag is active. If '--on' is not present, return a message statin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_flag('--on') == 'Flag is active.'\", \"assert check_flag('--off') == 'Flag is missing.'\", \"assert check_flag('--on --opt') == 'Flag is active.'\", \"assert check_flag('--opt --on') == 'Flag is active.'\", \"assert check_flag('') == 'Flag is missing.'... | {
"split": "train",
"index": 79394,
"acecode_id": "bigcode_python_fns_48988",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that resolves a JSON identifier to its corresponding value. The function should handle invalid identifiers by returning a default value. Write a Python function `resolve_json_id` that takes two parameters: `json_id` (string): The JSON... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert resolve_json_id('valid-id-1', 'Default') == 'Value1'\", \"assert resolve_json_id('valid-id-2', 'Default') == 'Value2'\", \"assert resolve_json_id('valid-id-3', 'Default') == 'Value3'\", \"assert resolve_json_id('invalid_id', 'Default') == 'Default'\", \"asse... | {
"split": "train",
"index": 79395,
"acecode_id": "oss_17686",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the nth term of the Lucas sequence. The Lucas sequence is defined as follows: L(0) = 2, L(1) = 1, and for n > 1, L(n) = L(n-1) + L(n-2). Your function should take a single integer n (0 ≤ n ≤ 30) and return the nth term of the Lucas sequence.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert lucas_sequence(0) == 2\", \"assert lucas_sequence(1) == 1\", \"assert lucas_sequence(2) == 3\", \"assert lucas_sequence(3) == 4\", \"assert lucas_sequence(4) == 7\", \"assert lucas_sequence(5) == 11\", \"assert lucas_sequence(6) == 18\", \"assert lucas_seque... | {
"split": "train",
"index": 79396,
"acecode_id": "evol_16076",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with simulating a web scraping scenario where you need to check for specific error messages after attempting to log into a website. Your goal is to implement a function that simulates this scenario and handles potential error messages appropriately. The function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert handle_login_error('https://example.com/home', 'Missing client_id parameter.') == 'Error handling failed.'\", \"assert handle_login_error('https://example.com/error', 'Some other error.') == 'Error handling failed.'\", \"assert handle_login_error('https://ex... | {
"split": "train",
"index": 79397,
"acecode_id": "oss_18440",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves a list of music tracks based on a specified music genre from a simulated music library. The music library is represented as a list of dictionaries, where each dictionary contains information about a music track, including i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_music_tracks_by_genre([{'name': 'Track 1', 'duration': 210, 'genre': 'Rock', 'album': 'Album A'}, {'name': 'Track 2', 'duration': 240, 'genre': 'Pop', 'album': 'Album B'}], 'Rock') == ['Track 1']\", \"assert get_music_tracks_by_genre([{'name': 'Track 3',... | {
"split": "train",
"index": 79398,
"acecode_id": "oss_3271",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that generates a list of Brier score metrics for given time intervals. The function should take a list of integers representing time intervals and a floating-point number representing a censored indicator (defaulting to 1.0). For each... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_brier_scores([1, 2, 3]) == ['bs_at_1', 'bs_at_2', 'bs_at_3']\", \"assert generate_brier_scores([5]) == ['bs_at_5']\", \"assert generate_brier_scores([10, 20, 30]) == ['bs_at_10', 'bs_at_20', 'bs_at_30']\", \"assert generate_brier_scores([]) == []\",... | {
"split": "train",
"index": 79399,
"acecode_id": "bigcode_python_fns_49344",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.