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": "Given a user and a list of users that are its neighbors, implement a function `find_top_users(user, neighbors, measure, depth)` that returns a list of tuples containing the top `depth` users sorted by the measure computed between the given user and each of its neighbors. The me...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_top_users('A', ['B', 'C'], lambda x, y: len(x) + len(y), 5) == [('B', 2), ('C', 2)]\", \"assert find_top_users('X', ['Y', 'Z'], lambda x, y: 10 if x != y else 0, 1) == [('Y', 10)]\", \"assert find_top_users('A', ['B', 'C', 'D'], lambda x, y: 1.0, 3) == ...
{ "split": "train", "index": 64900, "acecode_id": "bigcode_python_fns_22028", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a m x n matrix where each element is either '0' or '1', write a function that finds the area of the largest square sub-matrix composed entirely of '1's. If such a square sub-matrix is found, return the area of the largest square. If no '1's are present, return 0.\nPlease ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_area([['0', '0', '0'], ['0', '0', '0'], ['0', '0', '0']]) == 0\", \"assert max_area([['1']]) == 1\", \"assert max_area([['1', '1'], ['1', '1']]) == 4\", \"assert max_area([['1', '0', '1'], ['1', '1', '1'], ['1', '0', '1']]) == 1\", \"assert max_area([['1...
{ "split": "train", "index": 64901, "acecode_id": "evol_26931", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the process of changing the category of a file in a dataset. The function should accept a dictionary of parameters where the keys are flags indicating the operation to be performed. The parameters include '--dsid' for the d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update({'--dsid': '123', '--fileid': '456', '--catid': '789'}) == 'Success: Changed file id \\\"456\\\" in dataset \\\"123\\\".'\", \"assert update({'--dsid': '123', '--fileid': '456'}) == 'Error: Missing parameter --catid.'\", \"assert update({'--dsid': '12...
{ "split": "train", "index": 64902, "acecode_id": "bigcode_python_fns_34409", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that searches for a specified word in a given text sequence, ignoring case and punctuation. The function should return the index of the first occurrence of the word in the text, or -1 if the word is not found. The search should be case-insensitive and shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_word('I am a programmer!', 'Programmer') == 3\", \"assert search_word('Hello, world!', 'hello') == 0\", \"assert search_word('Python is awesome.', 'awesome') == 2\", \"assert search_word('Data science is the future.', 'science') == 1\", \"assert searc...
{ "split": "train", "index": 64903, "acecode_id": "evol_21869", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with writing a Python function that calculates the total number of stars for a list of repositories. Each repository is represented as a dictionary with the keys 'name' (string), 'owner' (string), and 'stars' (integer). Your function should sum the 'stars' of all...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert total_stars([{'name': 'repo1', 'owner': 'user1', 'stars': 10}, {'name': 'repo2', 'owner': 'user2', 'stars': 0}, {'name': 'repo3', 'owner': 'user3', 'stars': 5}]) == 15\", \"assert total_stars([{'name': 'repo1', 'owner': 'user1', 'stars': 0}, {'name': 'repo2'...
{ "split": "train", "index": 64904, "acecode_id": "oss_28935", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with designing a simple system to represent animals in a zoo. Implement a function named `animal_details(animals: List[Tuple[str, str, str, int]]) -> List[str]` that takes a list of animals where each animal is represented as a tuple containing the species, habit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert animal_details([('Lion', 'Savanna', 'Carnivore', 14), ('Elephant', 'Grassland', 'Herbivore', 60)]) == ['Species: Lion, Habitat: Savanna, Diet: Carnivore, Lifespan: 14 years', 'Species: Elephant, Habitat: Grassland, Diet: Herbivore, Lifespan: 60 years']\", \"...
{ "split": "train", "index": 64905, "acecode_id": "evol_11417", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the behavior of a CPU. The CPU has a set of properties: the number of physical cores, total cores, minimum frequency, maximum frequency, and current frequency. Implement a function `cpu_info(physical_cores: int, total_c...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cpu_info(4, 8, 2.0, 4.0, 3.2, 3.5) == 'CPU Information:\\\\nPhysical Cores: 4\\\\nTotal Cores: 8\\\\nMin Frequency: 2.0 GHz\\\\nMax Frequency: 4.0 GHz\\\\nCurrent Frequency: 3.5 GHz'\", \"assert cpu_info(4, 8, 2.0, 4.0, 3.2, 4.5) == 'CPU Information:\\\\nPhy...
{ "split": "train", "index": 64906, "acecode_id": "oss_7493", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Given a string representing a column title as it appears in an Excel sheet, convert it to its corresponding column number. For example, 'A' corresponds to 1, 'B' corresponds to 2, ..., 'Z' corresponds to 26, 'AA' corresponds to 27, and so on. Implement a function `col_to_num(co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert col_to_num('A') == 1\", \"assert col_to_num('B') == 2\", \"assert col_to_num('Z') == 26\", \"assert col_to_num('AA') == 27\", \"assert col_to_num('AB') == 28\", \"assert col_to_num('AZ') == 52\", \"assert col_to_num('BA') == 53\", \"assert col_to_num('ZZ') =...
{ "split": "train", "index": 64907, "acecode_id": "bigcode_python_fns_7384", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple tournament selection process from a list of integers. The function will take in a list of integers representing the population and an integer representing the desired breeding size. In each round of the tournam...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert tournament_selection([10, 10, 10, 10], 2) in [[10, 10]]\", \"assert tournament_selection([1, 1, 2, 2], 1) in [[2]]\", \"assert tournament_selection([10, 20, 30, 40], 1) in [[40], [30], [20], [10]]\", \"assert tournament_selection([1, 100, 99], 1) in [[100], ...
{ "split": "train", "index": 64908, "acecode_id": "bigcode_python_fns_5563", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a mathematical expression represented as a string, implement a function that parses the expression and converts it into Reverse Polish Notation (RPN). The expression can include floating point numbers, negative values, and support for unary operators. The function should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_expr('3 + 4') == [3, 4, '+']\", \"assert parse_expr('10 + 2 * 6') == [10, 2, 6, '*', '+']\", \"assert parse_expr('100 * 2 + 12') == [100, 2, '*', 12, '+']\", \"assert parse_expr('100 * ( 2 + 12 )') == [100, 2, 12, '+', '*']\", \"assert parse_expr('100 ...
{ "split": "train", "index": 64909, "acecode_id": "evol_25181", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that extracts the public key algorithm from a JSON object that contains a list of keys. Each key in the list has a unique identifier (kid) and associated properties including the algorithm used. Your function should accept two paramet...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_algorithm('key1', [{'kid': 'key1', 'alg': 'RS256'}, {'kid': 'key2', 'alg': 'HS256'}]) == 'RS256'\", \"assert extract_algorithm('key2', [{'kid': 'key1', 'alg': 'RS256'}, {'kid': 'key2', 'alg': 'HS256'}]) == 'HS256'\", \"assert extract_algorithm('key3'...
{ "split": "train", "index": 64910, "acecode_id": "bigcode_python_fns_11123", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of detection IDs and a corresponding list of embeddings where each embedding consists of an index followed by its features. Your task is to filter the embeddings to only include those whose indices match the provided detection IDs. The output should be a li...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_embeddings([1, 2, 3], [[1.0, 0.1, 0.2], [2.0, 0.3, 0.4], [4.0, 0.5, 0.6]]) == [[0.1, 0.2], [0.3, 0.4]]\", \"assert filter_embeddings([5], [[1.0, 0.1], [2.0, 0.2], [5.0, 0.5]]) == [[0.5]]\", \"assert filter_embeddings([], [[1.0, 0.1], [2.0, 0.2]]) == [...
{ "split": "train", "index": 64911, "acecode_id": "bigcode_python_fns_24911", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a list of JavaScript file names separated by spaces. Your task is to implement a function that takes this string as input and returns a list of the file names, each formatted to comply with a specific coding style. The formatting rules are as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fix_js_style('file1.js file2.js') == ['file1.js', 'file2.js']\", \"assert fix_js_style('badstyleFile.js file3.js') == ['fixed_badstyleFile.js', 'file3.js']\", \"assert fix_js_style('file4.js badstyleFile2.js') == ['file4.js', 'fixed_badstyleFile2.js']\", \"a...
{ "split": "train", "index": 64912, "acecode_id": "bigcode_python_fns_19170", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a SQL update statement based on a given dictionary of parameters. The function should take a dictionary of parameters as input and return a formatted SQL update statement as a string. The input dictionary will contai...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_update_statement({\\\"name\\\": \\\"John\\\", \\\"age\\\": 30, \\\"city\\\": \\\"New York\\\"}) == 'UPDATE table_name SET name=%(name)s, age=%(age)s, city=%(city)s'\", \"assert generate_update_statement({\\\"username\\\": \\\"Alice\\\", \\\"email\\\...
{ "split": "train", "index": 64913, "acecode_id": "oss_8526", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that replaces all prime numbers in the list with their cubes, while keeping the non-prime numbers unchanged. Implement the function `replace_primes_with_cubes(nums: List[int]) -> List[int]` where `nums` is the input list of integers.\n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert replace_primes_with_cubes([2, 3, 4, 5, 6, 7, 8, 9, 10]) == [8, 27, 4, 125, 6, 343, 8, 9, 10]\", \"assert replace_primes_with_cubes([1, 4, 6, 8, 9, 10]) == [1, 4, 6, 8, 9, 10]\", \"assert replace_primes_with_cubes([11, 13, 14]) == [1331, 2197, 14]\", \"assert...
{ "split": "train", "index": 64914, "acecode_id": "evol_13454", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that counts the occurrence of unique palindromic words in a given string. A word is considered a palindrome if it reads the same forwards and backwards. The function should return a dictionary where the keys are the unique palindromic words and the values a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_palindromes('madam racecar level') == {'madam': 1, 'racecar': 1, 'level': 1}\", \"assert count_palindromes('hello world') == {}\", \"assert count_palindromes('noon civic radar') == {'noon': 1, 'civic': 1, 'radar': 1}\", \"assert count_palindromes('deif...
{ "split": "train", "index": 64915, "acecode_id": "evol_11944", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a sorted tuple representing a hand of dice in a game of Yahtzee. Your task is to implement a function that generates all possible combinations of dice that can be held from the hand. The function should return a set of tuples, where each tuple contains a sorted co...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert gen_all_holds((1, 2, 3)) == {(1,), (1, 2), (1, 2, 3), (1, 3), (2,), (2, 3), (3,)}\", \"assert gen_all_holds((1, 2, 2, 3)) == {(1,), (1, 2), (1, 2, 2), (1, 2, 2, 3), (1, 2, 3), (1, 3), (2,), (2, 2), (2, 2, 3), (2, 3), (3,)}\", \"assert gen_all_holds((3, 3, 3,...
{ "split": "train", "index": 64916, "acecode_id": "bigcode_python_fns_3046", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a function `calculate_impact_factors(s: str, impact_factor: dict) -> List[int]` that takes a string `s` and a dictionary `impact_factor` as input. The function is intended to calculate the impact factors of the characters in the string `s` based on the provided di...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_impact_factors('hello', {'h': 5, 'e': 3, 'l': 2, 'o': 7}) == [5, 3, 2, 2, 7]\", \"assert calculate_impact_factors('world', {'w': 4, 'o': 6, 'r': 3, 'l': 5, 'd': 2}) == [4, 6, 3, 5, 2]\", \"assert calculate_impact_factors('abc', {'a': 1, 'b': 2, 'c'...
{ "split": "train", "index": 64917, "acecode_id": "oss_13777", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the deployment of secret configurations. The function should take in a list of secret names and their corresponding values. For each secret, the function should print a message indicating whether the secret is new or if...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert deploy_secrets(['secret2', 'secret3'], [('secret1', 'SecretData'), ('secret2', 'NewSecretData'), ('secret3', 'SecretData')]) == None\", \"assert deploy_secrets([], [('secret1', 'SecretData')]) == None\", \"assert deploy_secrets(['secret1'], [('secret1', 'Upd...
{ "split": "train", "index": 64918, "acecode_id": "bigcode_python_fns_5127", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `calculate(operation: str, x: float, y: float) -> float` that performs a specified arithmetic operation on two numbers. The operation can be one of the following: 'add', 'subtract', 'multiply', 'divide', 'root', 'power', or 'logarithm'. The function should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate('add', 2, 3) == 5\", \"assert calculate('subtract', 5, 2) == 3\", \"assert calculate('multiply', 3, 4) == 12\", \"assert calculate('divide', 10, 2) == 5\", \"assert calculate('divide', 10, 0) == 'Error: Division by zero is not allowed'\", \"assert ...
{ "split": "train", "index": 64919, "acecode_id": "evol_24379", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing data from a weather sensor device. The device provides a dictionary containing various weather parameters, and you need to extract specific values from this data. Implement a function `extract_weather_data(data: dict) -> dict` that accepts a dictio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_weather_data({'battery': 3.12, 'illuminance': 9000, 'precipitation_type': 'NONE', 'rain_accumulation': 0, 'rain_rate': 0, 'report_interval': 1, 'solar_radiation': 130, 'uv': 10, 'wind_average': 4.6, 'wind_direction': 187, 'wind_gust': 7.4, 'wind_lull...
{ "split": "train", "index": 64920, "acecode_id": "bigcode_python_fns_40296", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a string representing a range header in the format 'bytes=start-end'. Your task is to parse this range header and return a list of pairs (start, stop) that represent the byte ranges specified in the header. If the header is invalid or does not conform to the expec...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_range_header('bytes=0-499', 1000) == [(0, 500)]\", \"assert parse_range_header('bytes=500-999', 1000) == [(500, 1000)]\", \"assert parse_range_header('bytes=1000-1500', 1000) == []\", \"assert parse_range_header('bytes=-500', 1000) == [(500, 1000)]\", ...
{ "split": "train", "index": 64921, "acecode_id": "bigcode_python_fns_6563", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a list of labels and a colorbar orientation (either 'vertical' or 'horizontal'). Your task is to create a function that returns the positions of the labels based on the colorbar's orientation and the provided parameters. The function should take the following inpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert label_positions(['Label 1', 'Label 2', 'Label 3'], 'vertical', 1.2, -0.3) == [0.0, 0.5, 1.0]\", \"assert label_positions(['A', 'B', 'C'], 'horizontal', 1.0, 0.5) == [0.0, 0.5, 1.0]\", \"assert label_positions(['A', 'B', 'C', 'D'], 'vertical', 1.0, -0.5) == [...
{ "split": "train", "index": 64922, "acecode_id": "bigcode_python_fns_30713", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a list of strings where each string represents a command. Your task is to implement a function `execute_commands(commands: List[str]) -> List[str]` that simulates the execution of these commands. Each command will return a response based on the following rules: 1....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert execute_commands(['start', 'stop', 'status']) == ['Command started', 'Command stopped', 'Command is running']\", \"assert execute_commands(['start', 'unknown_command', 'stop']) == ['Command started', 'Unknown command', 'Command stopped']\", \"assert execute_...
{ "split": "train", "index": 64923, "acecode_id": "bigcode_python_fns_14470", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of numerical sales data for different products. Some entries in the sales data may be missing (denoted by None). Your task is to implement a function that replaces any missing sales data with zero, calculates the average sales from the non-missing values, a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prepare_sales_data([100.0, 200.0, None, 400.0]) == ([100.0, 200.0, 0.0, 400.0], 233.33333333333334)\", \"assert prepare_sales_data([None, None, None]) == ([0.0, 0.0, 0.0], 0.0)\", \"assert prepare_sales_data([150.0, None, 300.0, 450.0]) == ([150.0, 0.0, 300....
{ "split": "train", "index": 64924, "acecode_id": "bigcode_python_fns_29892", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates a simple key-value store. The function, `key_value_store_operations`, will take a list of operations to perform on the store. The operations will be represented as tuples, where the first element is a string indicating ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert key_value_store_operations([('set', 'a', 1), ('set', 'b', 2), ('get', 'a')]) == {0: None, 1: None, 2: 1}\", \"assert key_value_store_operations([('set', 'a', 1), ('set', 'b', 2), ('get', 'c')]) == {0: None, 1: None, 2: None}\", \"assert key_value_store_opera...
{ "split": "train", "index": 64925, "acecode_id": "oss_10615", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that retrieves a specific setting for a service from a configuration dictionary. The configuration dictionary is structured such that each service has a corresponding setting represented as a key-value pair. Your task is to implement ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_service_setting({'serviceA_setting': 'valueA', 'serviceB_setting': 'valueB'}, 'serviceA') == 'valueA'\", \"assert get_service_setting({'serviceA_setting': 'valueA', 'serviceB_setting': 'valueB'}, 'serviceB') == 'valueB'\", \"assert get_service_setting({'...
{ "split": "train", "index": 64926, "acecode_id": "oss_23072", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `get_data(id: Optional[str] = None) -> Union[Dict[str, str], str]` that simulates the behavior of a basic data retrieval system. The function should accept an optional `id` parameter. If an `id` is provided, return the corresponding data from a predefined d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_data('1') == 'Data 1'\", \"assert get_data('2') == 'Data 2'\", \"assert get_data('3') == 'Data 3'\", \"assert get_data('4') == 'Data 4'\", \"assert get_data('5') == 'Data 5'\", \"assert get_data('6') == 'ID not found in data'\", \"assert get_data(None) =...
{ "split": "train", "index": 64927, "acecode_id": "evol_14012", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to visualize a progress bar for tracking the completion of various operations. The function `update_progress(progress, operation)` takes two parameters: `progress` (a float representing the completion percentage ranging from 0.0 to 1.0) a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_progress(0.0, 'Loading') == '[----------------------------------------]'\", \"assert update_progress(-0.1, 'Loading') == '[----------------------------------------]'\", \"assert update_progress(0.0, 'Operation B') == '[--------------------------------...
{ "split": "train", "index": 64928, "acecode_id": "oss_7264", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves city data based on a given position. The function should take a dictionary containing a 'position' key, which maps to a string representing coordinates. Your function should return the corresponding city data from a predefi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_city_data({'position': '0,0'}) == 'CityA'\", \"assert get_city_data({'position': '1,1'}) == 'CityB'\", \"assert get_city_data({'position': '5,5'}) == None\", \"assert get_city_data({'position': '7,7'}) == None\", \"assert get_city_data({'position': '10,1...
{ "split": "train", "index": 64929, "acecode_id": "bigcode_python_fns_16233", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a list of file changes represented as tuples, where each tuple contains a file name and its change type. The change types can be 'C' for Copied, 'M' for Modified, 'R' for Renamed, and 'T' for Type changed. Your task is to return a list of file names that have been...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert file_types_diff([('file1.txt', 'C'), ('file2.txt', 'M'), ('file3.txt', 'R'), ('file4.txt', 'T')]) == ['file2.txt', 'file4.txt']\", \"assert file_types_diff([('file1.txt', 'C'), ('file2.txt', 'C'), ('file3.txt', 'C')]) == []\", \"assert file_types_diff([('fil...
{ "split": "train", "index": 64930, "acecode_id": "bigcode_python_fns_31665", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a dictionary containing the parameters for a cylinder, write a function named `create_cylinder` that returns a string representation of a cylinder object. The dictionary may contain the following keys: 'radius', 'height', and 'color'. The function should format the output...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_cylinder({'radius': 5, 'height': 10, 'color': 'red'}) == 'Cylinder(radius: 5, height: 10, color: red)'\", \"assert create_cylinder({'radius': 3, 'height': 4}) == 'Cylinder(radius: 3, height: 4, color: None)'\", \"assert create_cylinder({'height': 7, '...
{ "split": "train", "index": 64931, "acecode_id": "bigcode_python_fns_48281", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the behavior of an alarm system in a cloud environment. The function, `update_alarms`, should take a list of boolean values representing the status of alarms, where True indicates that the alarm is active and False indi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_alarms([True, False, True]) == [False, True, False]\", \"assert update_alarms([False, False, False]) == [True, True, True]\", \"assert update_alarms([True, True, True]) == [False, False, False]\", \"assert update_alarms([True]) == [False]\", \"assert ...
{ "split": "train", "index": 64932, "acecode_id": "bigcode_python_fns_48868", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with developing a function that generates a unique file name within a specified list of existing file names. The function should take a desired file name and a list of existing file names as input. If the desired file name is unique (i.e., not present in the list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_unique_filename('file.txt', ['file.txt', 'file_1.txt', 'file_2.txt']) == 'file_3.txt'\", \"assert generate_unique_filename('document.pdf', ['file.txt', 'document.pdf', 'document_1.pdf']) == 'document_2.pdf'\", \"assert generate_unique_filename('imag...
{ "split": "train", "index": 64933, "acecode_id": "oss_21168", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `determine_actions(deficiencies: List[str], known_requirements: List[str], destination_requirements: List[str]) -> List[str]` that filters out actions from a list of deficiencies based on known and destination requirements. The function should return a list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert determine_actions(['action1', 'action2', 'action3'], ['action1', 'action2'], ['action1']) == ['action1']\", \"assert determine_actions(['action1', 'action4'], ['action1', 'action2'], ['action1']) == ['action1']\", \"assert determine_actions(['action3', 'acti...
{ "split": "train", "index": 64934, "acecode_id": "bigcode_python_fns_6070", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a nested dictionary as input and returns the sum of all the numeric values present within it. The function should be capable of handling dictionaries that contain other dictionaries as values. If the input is not a dictionary, the function should...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_dict_values({'a': 5, 'b': 7, 'c': 2, 'd': 9}) == 23\", \"assert sum_dict_values({'a': 1, 'b': {'c': 2, 'd': 3}, 'e': 4}) == 10\", \"assert sum_dict_values({'a': {'b': {'c': 1}}, 'd': 2}) == 3\", \"assert sum_dict_values({'x': 10, 'y': 20, 'z': 30}) == 60...
{ "split": "train", "index": 64935, "acecode_id": "evol_17071", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that extracts the copyright information from a given string representation of source code. The copyright information is typically found within comments at the beginning of the code. The function should return the copyright year and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_copyright_info_from_string('# Copyright 2015 Example Corp.\\\\n# License MIT') == ('2015', 'Example Corp.')\", \"assert extract_copyright_info_from_string('# License AGPL-3.0 or later') == None\", \"assert extract_copyright_info_from_string('def main...
{ "split": "train", "index": 64936, "acecode_id": "oss_246", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Given a 2D matrix representing pixel values of an image, implement a function `extract_submatrix(matrix: List[List[int]], y_limits: Tuple[int, int]) -> List[List[int]]` that extracts a submatrix defined by the row limits `y_limits`. The function should return the extracted subm...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_submatrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]], (0, 2)) == [[1, 2, 3], [4, 5, 6]]\", \"assert extract_submatrix([[1, 2], [3, 4]], (1, 2)) == [[3, 4]]\", \"assert extract_submatrix([[1, 2, 3], [4, 5, 6]], (0, 1)) == [[1, 2, 3]]\", \"assert extract_submat...
{ "split": "train", "index": 64937, "acecode_id": "bigcode_python_fns_15705", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers. Your task is to implement a function that takes this list and returns a new list containing only the even numbers from the original list, in the same order they appeared. If there are no even numbers, return an empty list. Implement the functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([1, 3, 5]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) == [2, 4, 6, 8]\", \"assert filter_even_numbers([-1, -2, -3, -4]) == [-2, -4]\", \"assert filter_even_numbers([0, 1,...
{ "split": "train", "index": 64938, "acecode_id": "bigcode_python_fns_48393", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that validates passwords based on specific criteria. The function should take a username and a password as inputs and return 'VALID' if the password meets the criteria, and 'INVALID' otherwise. The password criteria are as follows: 1. The...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_password('user1', 'Password1') == 'VALID'\", \"assert validate_password('user2', 'password') == 'INVALID'\", \"assert validate_password('user3', 'PASSWORD') == 'INVALID'\", \"assert validate_password('user4', 'Pass123') == 'INVALID'\", \"assert vali...
{ "split": "train", "index": 64939, "acecode_id": "oss_10189", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers and a target integer as input. The function should return a list of indices where the target appears in the list. If the target is not found, return an empty list. The function should be optimized to handle lists containing up ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_indices([1, 2, 3, 4, 5], 3) == [2]\", \"assert find_indices([1, 2, 3, 4, 5], 6) == []\", \"assert find_indices([7, 7, 7], 7) == [0, 1, 2]\", \"assert find_indices([1, 2, 3, 4, 5, 1, 2, 1], 1) == [0, 5, 7]\", \"assert find_indices([10, 20, 30, 40, 50], 1...
{ "split": "train", "index": 64940, "acecode_id": "evol_20815", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a recursive function that calculates the nth number in the Lucas series, where the sequence starts with 2 and 1, and each subsequent number is the sum of the previous two. The function should return the nth Lucas number, where n is a non-negative integer.\nPlease reason s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert lucas(0) == 2\", \"assert lucas(1) == 1\", \"assert lucas(2) == 3\", \"assert lucas(3) == 4\", \"assert lucas(4) == 7\", \"assert lucas(5) == 11\", \"assert lucas(6) == 18\", \"assert lucas(7) == 29\", \"assert lucas(8) == 47\", \"assert lucas(9) == 76\", \"...
{ "split": "train", "index": 64941, "acecode_id": "evol_33796", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers `X` and a list of indices `inds`. Your task is to create a new list `new_X` that contains only the elements from `X` at the specified indices in `inds`. Additionally, you should return a new list `new_y` which is formed by taking the elements fr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_subset([1, 2, 3, 4, 5], [0, 2]) == ([1, 3], [1, 3])\", \"assert create_subset([10, 20, 30, 40], [1, 3]) == ([20, 40], [20, 40])\", \"assert create_subset([5, 6, 7, 8, 9], [2, 4]) == ([7, 9], [7, 9])\", \"assert create_subset([1, 2, 3], [0, 1, 2]) == (...
{ "split": "train", "index": 64942, "acecode_id": "bigcode_python_fns_15195", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of integers, implement a function that calculates the percentage of numbers in the array that are both prime and greater than 5. The function should return the result as a string formatted to two decimal places followed by a percentage sign (%).\nPlease reason st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calc_percentage([3, 4, 7, 8, 9, 11]) == '33.33%'\", \"assert calc_percentage([2, 3, 5, 7, 11]) == '40.00%'\", \"assert calc_percentage([6, 10, 15, 20]) == '0.00%'\", \"assert calc_percentage([13, 17, 19, 23]) == '100.00%'\", \"assert calc_percentage([1, 2, 3...
{ "split": "train", "index": 64943, "acecode_id": "evol_12227", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple recommendation system based on user interests. You will implement a function `user_recommendations(user_terms: List[str]) -> List[str]` that takes a list of user-specific terms as input and returns a list of recommendations based on a rando...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert user_recommendations(['rock', 'comedy', 'mystery']) in [['Top Hits', 'Classic Rock', 'Jazz Essentials'], ['Best Comedy Shows', 'Drama Series', 'Stand-Up Specials'], ['Best Mystery Novels', 'Fantasy Series', 'Classic Literature']]\", \"assert user_recommendat...
{ "split": "train", "index": 64944, "acecode_id": "oss_29445", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You need to implement a function `display_messages(*messages: str) -> None` that accepts a variable number of string messages and prints each message prefixed with the tag 'INFO'. Each message should be printed on a new line. For example, if the input messages are 'Hello' and '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert display_messages('Hello', 'World') == None\", \"assert display_messages('Test message 1', 'Test message 2', 'Test message 3') == None\", \"assert display_messages('Single message') == None\", \"assert display_messages('First', 'Second') == None\", \"assert d...
{ "split": "train", "index": 64945, "acecode_id": "bigcode_python_fns_8394", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing a list of ElasticSearch domains to identify those that are publicly accessible and not deployed within a Virtual Private Cloud (VPC). Your goal is to implement a function `analyze_elasticsearch_domains(domains: List[Dict[str, Any]]) -> List[Tuple[s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_elasticsearch_domains([{ 'is_public': True, 'vpc': False }]) == [('~Internet~. ElasticSearch domain is publicly accessible. ElasticSearch domain is currently not deployed within a VPC. ~ElasticSearch~', {'is_public': True, 'vpc': False}, {'is_public'...
{ "split": "train", "index": 64946, "acecode_id": "oss_4831", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are given a directed graph represented by an adjacency list, where each node corresponds to a task and edges represent dependencies between these tasks. Write a function `get_direct_dependencies(graph: Dict[str, List[str]], task: str) -> List[str]` that returns a list of di...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_direct_dependencies({'A': ['B', 'C'], 'B': ['D'], 'C': [], 'D': []}, 'A') == ['B', 'C']\", \"assert get_direct_dependencies({'A': ['B', 'C'], 'B': ['D'], 'C': [], 'D': []}, 'B') == ['D']\", \"assert get_direct_dependencies({'A': ['B', 'C'], 'B': ['D'], '...
{ "split": "train", "index": 64947, "acecode_id": "bigcode_python_fns_29119", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a color matching algorithm for a digital art application. The algorithm should take a target color and find the closest matching color from a predefined set of colors. The colors are represented as RGB tuples, with each component ranging from 0 ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_closest_color((0.5, 0.5, 0.5), [(0.1, 0.1, 0.1), (0.3, 0.3, 0.3), (0.9, 0.9, 0.9)]) == (0.3, 0.3, 0.3)\", \"assert find_closest_color((0.2, 0.2, 0.2), [(0.0, 0.0, 0.0), (0.5, 0.5, 0.5), (0.1, 0.1, 0.1)]) == (0.1, 0.1, 0.1)\", \"assert find_closest_color...
{ "split": "train", "index": 64948, "acecode_id": "oss_27662", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a string `code` that represents a Python function definition, write a function `is_raise_from_itself(code: str) -> bool` that checks whether the function raises an exception from within itself. The function should return `True` if there are any raise statements that raise...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_raise_from_itself('def func(): raise func()') == True\", \"assert is_raise_from_itself('def func(): raise ValueError()') == False\", \"assert is_raise_from_itself('def func(): raise func()') == True\", \"assert is_raise_from_itself('def another_func(): ra...
{ "split": "train", "index": 64949, "acecode_id": "bigcode_python_fns_11130", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of tuples, where each tuple contains a label and a corresponding text, implement a function that retrieves the text associated with a specific label. If the label does not exist in the list, return 'Label not found'. Your function should have the following signatur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_text_for_label('A', [('A', 'Alpha'), ('B', 'Beta'), ('C', 'Gamma')]) == 'Alpha'\", \"assert get_text_for_label('B', [('A', 'Alpha'), ('B', 'Beta'), ('C', 'Gamma')]) == 'Beta'\", \"assert get_text_for_label('C', [('A', 'Alpha'), ('B', 'Beta'), ('C', 'Gamm...
{ "split": "train", "index": 64950, "acecode_id": "bigcode_python_fns_1548", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that calculates the number of unique lowercase consonants at odd indices in a string, excluding the first and the last character and any repeating consonants. The function should be defined as follows: def count_lower_unique(s): where s is a string composed of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_lower_unique('ABCDEFG') == 0\", \"assert count_lower_unique('dbcbeb') == 1\", \"assert count_lower_unique('aBcDgEfH') == 0\", \"assert count_lower_unique('xyzabc') == 1\", \"assert count_lower_unique('12345') == 0\", \"assert count_lower_unique('') == ...
{ "split": "train", "index": 64951, "acecode_id": "evol_22083", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Write a function `count_parameters` that takes a variable number of arguments and returns the number of arguments passed to it. The function should accept any type of argument (integers, strings, lists, etc.) and count them correctly. Implement the function such that it can han...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_parameters() == 0\", \"assert count_parameters(1) == 1\", \"assert count_parameters(1, 2, 3) == 3\", \"assert count_parameters('a', 'b', 'c', 'd') == 4\", \"assert count_parameters(1, 'test', [1, 2], (3, 4)) == 4\", \"assert count_parameters(True, None...
{ "split": "train", "index": 64952, "acecode_id": "evol_30855", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `find_highest_number` that returns the highest number in the list. If the list is empty, return None.\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_highest_number([1, 4, 5, 7, 9, 3]) == 9\", \"assert find_highest_number([-1, -4, -5, -7, -9, -3]) == -1\", \"assert find_highest_number([0, 0, 0]) == 0\", \"assert find_highest_number([10, 20, 30, 40, 50]) == 50\", \"assert find_highest_number([5]) == 5...
{ "split": "train", "index": 64953, "acecode_id": "evol_7774", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `find_primes_up_to(n)` that takes a non-negative integer `n` as input and returns a list of all prime numbers that are less than `n`. A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_primes_up_to(5) == [2, 3]\", \"assert find_primes_up_to(11) == [2, 3, 5, 7]\", \"assert find_primes_up_to(0) == []\", \"assert find_primes_up_to(1) == []\", \"assert find_primes_up_to(20) == [2, 3, 5, 7, 11, 13, 17, 19]\", \"assert find_primes_up_to(18)...
{ "split": "train", "index": 64954, "acecode_id": "evol_10526", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a positive integer n, write a function `carmichael_lambda(n)` that returns Carmichael's lambda function for that integer. The Carmichael's lambda function is defined as the smallest positive integer m such that a^m ≡ 1 (mod n) for all integers a that are coprime to n. If ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert carmichael_lambda(1) == 1\", \"assert carmichael_lambda(2) == 1\", \"assert carmichael_lambda(3) == 2\", \"assert carmichael_lambda(4) == 2\", \"assert carmichael_lambda(5) == 4\", \"assert carmichael_lambda(6) == 2\", \"assert carmichael_lambda(7) == 6\", \...
{ "split": "train", "index": 64955, "acecode_id": "bigcode_python_fns_21767", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of university associations and returns a list of dictionaries representing each association. Each dictionary should contain the following fields: 'id', 'association_name', 'incharge', 'about', and 'contacts'. The input w...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_association_list([(1, 'Science Club', 'Alice', 'A club for science enthusiasts.', 'alice@example.com'), (2, 'Art Society', 'Bob', 'A society for art lovers.', 'bob@example.com')]) == [{'id': 1, 'association_name': 'Science Club', 'incharge': 'Alice', ...
{ "split": "train", "index": 64956, "acecode_id": "oss_3005", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that counts the number of different types of reformulators based on their class definitions. Each reformulator class is either a valid subclass of `BaseReformulator` or falls under an 'Other' category if it does not inherit from `B...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_reformulator_types([int, str, list]) == {'Static': 0, 'Linear': 0, 'Attentive': 0, 'Memory': 0, 'Symbolic': 0, 'NTP': 0, 'GNTP': 0, 'Other': 3}\", \"assert get_reformulator_types([StaticReformulator, StaticReformulator]) == {'Static': 2, 'Linear': 0, 'At...
{ "split": "train", "index": 64957, "acecode_id": "oss_7573", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given two integers s_count and v_count, determine if a row or column should be considered a header based on a specific heuristic. A row or column is considered a header if the following condition holds: (s_count + 1) / (v_count + s_count + 1) >= 2 / 3. Implement a function `is_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_header(2, 1) == True\", \"assert is_header(1, 2) == False\", \"assert is_header(3, 2) == True\", \"assert is_header(5, 1) == True\", \"assert is_header(4, 2) == True\", \"assert is_header(2, 4) == False\", \"assert is_header(0, 3) == False\", \"assert is_...
{ "split": "train", "index": 64958, "acecode_id": "bigcode_python_fns_5320", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `input`, write a function `get_number_location(input: str) -> List[Tuple[int, int]]` that returns a list of tuples where each tuple represents the start and end indices (inclusive) of all numbers found in the string. A number is defined as one or more consecutive...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_number_location('abc123def456') == [(3, 5), (9, 11)]\", \"assert get_number_location('hello world') == []\", \"assert get_number_location('1a2b3c') == [(0, 0), (2, 2), (4, 4)]\", \"assert get_number_location('') == []\", \"assert get_number_location('99 ...
{ "split": "train", "index": 64959, "acecode_id": "bigcode_python_fns_17186", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given two lists of strings, List A and List B, implement a function `unmatched_subseqs(listA, listB)` that returns a list of strings from List B which are not a subsequence of any string in List A. A string B is a subsequence of A if it can be derived from A by deleting some (p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unmatched_subseqs(['abc', 'def', 'ghij'], ['a', 'ef', 'xyz']) == ['xyz']\", \"assert unmatched_subseqs(['abcd', 'efgh', 'ijkl'], ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm']) == ['m']\", \"assert unmatched_subseqs(['single', 'double', 't...
{ "split": "train", "index": 64960, "acecode_id": "evol_11941", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a simple function that simulates basic banking transactions. The function should take a list of transactions, where each transaction is represented as a tuple. Each tuple contains a string (either 'deposit' or 'withdraw') and an integer amount. ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert final_balance([('deposit', 1000), ('withdraw', 200)]) == 800\", \"assert final_balance([('deposit', 300), ('withdraw', 100), ('withdraw', 200)]) == 0\", \"assert final_balance([('deposit', 100), ('deposit', 100), ('withdraw', 150)]) == 50\", \"assert final_b...
{ "split": "train", "index": 64961, "acecode_id": "oss_16699", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that may contain leading or trailing whitespace and the word 'apple'. Your task is to implement a function that processes the input string by performing the following operations: 1. Remove any leading or trailing whitespace from the string. 2. Convert the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_vowels_in_processed_string(' apple ') == 3\", \"assert count_vowels_in_processed_string(' APPLE ') == 3\", \"assert count_vowels_in_processed_string('I love oranges') == 6\", \"assert count_vowels_in_processed_string(' ') == 0\", \"assert count_...
{ "split": "train", "index": 64962, "acecode_id": "oss_13437", "num_tests": 13 }
acecode
[ { "role": "user", "content": "A bag contains 4 red balls, 6 green balls, 5 blue balls, and an unknown number of yellow balls. The number of yellow balls is known to be between 4 and 5 (inclusive). Write a function that calculates the probability of randomly picking a red, blue, or yellow ball from the bag, ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert probability_yellow_ball(4) != probability_yellow_ball(5)\", \"assert probability_yellow_ball(4) > 0\", \"assert probability_yellow_ball(5) > 0\", \"assert probability_yellow_ball(4) < 1\", \"assert probability_yellow_ball(5) < 1\", \"assert isinstance(probab...
{ "split": "train", "index": 64963, "acecode_id": "evol_35012", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Write a function `find_all_occurrences(input_str: str, search_str: str) -> List[int]` that takes a string `input_str` and a substring `search_str`, and returns a list of all starting indices where `search_str` is found in `input_str`. If `search_str` does not occur in `input_st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_all_occurrences('hi world bye world', 'hi') == [0]\", \"assert find_all_occurrences('hi world bye world', 'hello') == []\", \"assert find_all_occurrences('', 'hello') == []\", \"assert find_all_occurrences('abcabcabc', 'abc') == [0, 3, 6]\", \"assert fi...
{ "split": "train", "index": 64964, "acecode_id": "evol_19341", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing model unit names. Your task is to write a function `count_unique_model_units(model_units)` that returns the count of unique model unit names. Model unit names are considered unique if they are case-insensitively equal, meaning 'Meter...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_unique_model_units(['meter', 'Meter', ' meter ', 'centimeter', ' Centimeter ', 'millimeter']) == 3\", \"assert count_unique_model_units(['inch', 'Inch', ' inch ', 'foot', ' Foot ', 'yard']) == 3\", \"assert count_unique_model_units([' liter', ...
{ "split": "train", "index": 64965, "acecode_id": "oss_9468", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns a new list containing the cubes of each integer in the input list, ensuring that the output list maintains the same order as the input list. The function should take a single argument, which is the list of integers, and it...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cube_integers([1, 2, 3]) == [1, 8, 27]\", \"assert cube_integers([-1, 0, 1]) == [-1, 0, 1]\", \"assert cube_integers([0]) == [0]\", \"assert cube_integers([2, 3, 4]) == [8, 27, 64]\", \"assert cube_integers([-2, -3, -4]) == [-8, -27, -64]\", \"assert cube_in...
{ "split": "train", "index": 64966, "acecode_id": "bigcode_python_fns_28842", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string that contains various sections, each represented by a line starting with a specific identifier followed by a colon. Each section contains key-value pairs separated by commas. Your task is to write a function that extracts the values for a specified key fr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_values('name: John, age: 30\\\\nname: Jane, age: 25', 'name') == ['John', 'Jane']\", \"assert extract_values('speed: 60, type: car\\\\ncolor: red, type: bike', 'type') == ['car', 'bike']\", \"assert extract_values('fruit: apple, color: red\\\\nfruit:...
{ "split": "train", "index": 64967, "acecode_id": "bigcode_python_fns_40477", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a progress display function for a tracking system. The function should take an integer representing the progress percentage (from 0 to 100) and return a string representing a progress bar. The progress bar should be displayed as a series of '#' ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert display_progress(None) == ''\", \"assert display_progress(0) == ''\", \"assert display_progress(10) == '#'\", \"assert display_progress(20) == '##'\", \"assert display_progress(30) == '###'\", \"assert display_progress(40) == '####'\", \"assert display_progr...
{ "split": "train", "index": 64968, "acecode_id": "oss_25099", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Determine the smallest pentagonal number that can be represented as the sum of two distinct pentagonal numbers in more than 100 unique ways. A pentagonal number is defined by the formula P_n = n * (3n - 1) / 2, where n is a positive integer.\nPlease reason step by step, then wr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pentagonal(1) == 1\", \"assert pentagonal(2) == 5\", \"assert pentagonal(3) == 12\", \"assert pentagonal(4) == 22\", \"assert pentagonal(5) == 35\", \"assert pentagonal(6) == 51\", \"assert pentagonal(7) == 70\", \"assert pentagonal(8) == 92\", \"assert pent...
{ "split": "train", "index": 64969, "acecode_id": "evol_23259", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating the processing of metadata from an experiment. Given a list of dictionaries, where each dictionary contains attributes of a data item related to the experiment (including 'cell', 'age', 'sex', 'treatment', 'dataType', 'antibody', and 'item_name'),...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_metadata([{'cell': 'A', 'age': '1', 'sex': 'M', 'treatment': 'T1', 'dataType': 'DnaseSeq', 'antibody': '', 'item_name': 'item1'}]) == [{'short_label': 'A|1|M|T1|item1', 'experiment_type': 'DnaseSeq'}]\", \"assert process_metadata([{'cell': 'B', 'age'...
{ "split": "train", "index": 64970, "acecode_id": "oss_1456", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function to compare software version numbers represented as tuples of integers. Each integer in the tuple corresponds to a different level of the version (e.g., major, minor, patch). The version numbers should be compared from left to right, with ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compare_versions((0, 1, 0), (0, 2, 0)) == -1\", \"assert compare_versions((1, 0, 0), (1, 0, 0)) == 0\", \"assert compare_versions((2, 0, 1), (2, 0, 0)) == 1\", \"assert compare_versions((1, 2, 3), (1, 2, 3)) == 0\", \"assert compare_versions((0, 0, 1), (0, 1...
{ "split": "train", "index": 64971, "acecode_id": "oss_35877", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a Python generator function that yields the first n non-consecutive pentagonal numbers, where n is a user input. The function should return a warning message if n is not valid (n is not an integer or n is a negative number).\nPlease reason step by step, then write a self...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list(pentagonal_numbers(1)) == [1]\", \"assert list(pentagonal_numbers(2)) == [1, 5]\", \"assert list(pentagonal_numbers(3)) == [1, 5, 12]\", \"assert list(pentagonal_numbers(4)) == [1, 5, 12, 22]\", \"assert list(pentagonal_numbers(5)) == [1, 5, 12, 22, 35]...
{ "split": "train", "index": 64972, "acecode_id": "evol_35646", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are given a string 'response' that represents the output of a remote procedure call (RPC). Your task is to implement a function `check_rpc_reply(response: str) -> bool` that checks if the string contains the phrase 'Save running-config successful'. The function should retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_rpc_reply('Configuration saved: Save running-config successful') == True\", \"assert check_rpc_reply('Save running-config successful') == True\", \"assert check_rpc_reply('The operation was a success.') == False\", \"assert check_rpc_reply('Success: Sa...
{ "split": "train", "index": 64973, "acecode_id": "bigcode_python_fns_33592", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that takes a JSON string as input and returns the value corresponding to the key 'name'. If the key 'name' does not exist, the function should return 'No name found'. Additionally, if the JSON string is malformed, the function should retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_name('{\\\"name\\\": \\\"John Doe\\\"}') == 'John Doe'\", \"assert get_name('{\\\"age\\\": 25}') == 'No name found'\", \"assert get_name('{\\\"name\\\": \\\"Jane Smith\\\", \\\"age\\\": 30}') == 'Jane Smith'\", \"assert get_name('{\\\"name\\\": \\\"\\\"}...
{ "split": "train", "index": 64974, "acecode_id": "evol_30876", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with filtering density matrices based on user-selected parameters in a quantum state visualization application. Your function should take four parameters: `statei`, `statej`, `Jt`, and `Tt`, which represent the quantum state identifiers and other corresponding pa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert visualize_density_matrices('A', 'B', 1, 300) == [{'statei': 'A', 'statej': 'B', 'Jt': 1, 'Tt': 300, 'density': 0.5}, {'statei': 'A', 'statej': 'B', 'Jt': 1, 'Tt': 300, 'density': 0.7}]\", \"assert visualize_density_matrices('C', 'D', 2, 400) == []\", \"asser...
{ "split": "train", "index": 64975, "acecode_id": "oss_12609", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_average(a: int, b: int, c: int) -> float` that takes three integer parameters and returns their average as a float. The average is calculated by summing the three integers and dividing by 3.\nPlease reason step by step, then write a self-containe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_average(5, 10, 15) == 10.0\", \"assert calculate_average(0, 0, 0) == 0.0\", \"assert calculate_average(-5, 0, 5) == 0.0\", \"assert calculate_average(1, 2, 3) == 2.0\", \"assert calculate_average(10, 20, 30) == 20.0\", \"assert calculate_average(-1...
{ "split": "train", "index": 64976, "acecode_id": "evol_33261", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of strings as input and returns a new list containing the concatenation of the 9th and 10th characters from each string. If a string is less than 10 characters long, it should be ignored. The function should also raise a ValueError if the ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_chars(['abcdefghij', 'klmnopqrst']) == ['ij', 'st']\", \"assert extract_chars(['hello', 'world']) == []\", \"assert extract_chars(['1234567890', '0987654321']) == ['90', '21']\", \"assert extract_chars(['abcdefgh', 'abcde']) == []\", \"assert extract...
{ "split": "train", "index": 64977, "acecode_id": "evol_30576", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Create a function called `employee_info` that takes three parameters: `name` (a string), `age` (an integer), and `department` (a string). The function should return a formatted string containing the employee's information in the format 'Name: {name}, Age: {age}, Department: {de...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert employee_info('Alice Smith', 28, 'Engineering') == 'Name: Alice Smith, Age: 28, Department: Engineering'\", \"assert employee_info('Bob Johnson', 35, 'Sales') == 'Name: Bob Johnson, Age: 35, Department: Sales'\", \"assert employee_info('Charlie Brown', 22, '...
{ "split": "train", "index": 64978, "acecode_id": "evol_6152", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a list of integers representing students' scores (ranging from 0 to 100 inclusive) and returns a list of corresponding letter grades with +/- distinctions. If a score is less than 0 or greater than 100, the function should return 'Invalid score'....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert grade_students([100, 99, 98, 97]) == ['A+', 'A+', 'A+', 'A+']\", \"assert grade_students([75, 78, 72]) == ['C', 'C+', 'C-']\", \"assert grade_students([-1, 105]) == ['Invalid score', 'Invalid score']\", \"assert grade_students([0, 59, 60]) == ['F', 'F', 'D-'...
{ "split": "train", "index": 64979, "acecode_id": "evol_23767", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of database connection identifiers and returns a dictionary containing server information for each connection. The server information should include the server name, server type, and server version. The functi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_server_info(['conn1']) == {'conn1': {'server_name': 'DB2', 'server_type': 'DBMS', 'server_version': '11.5'}}\", \"assert get_server_info(['conn2']) == {'conn2': {'server_name': 'MySQL', 'server_type': 'DBMS', 'server_version': '8.0'}}\", \"assert get_ser...
{ "split": "train", "index": 64980, "acecode_id": "oss_30939", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a string `message` and an integer `row` representing a row position on a display that is 16 characters wide. Write a function `position_cursor_right(message: str, row: int) -> int` that calculates the first position of `message` that needs to be right-aligned on t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert position_cursor_right('', 0) == 16\", \"assert position_cursor_right('', 1) == 16\", \"assert position_cursor_right('A', 0) == 15\", \"assert position_cursor_right('Hello', 0) == 11\", \"assert position_cursor_right('Python', 0) == 10\", \"assert position_cu...
{ "split": "train", "index": 64981, "acecode_id": "bigcode_python_fns_43350", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an array of strings, write a function that returns a new array containing only the strings that consist entirely of non-alphanumeric characters. The function should utilize a regular expression to identify these strings. Implement the function 'exclude_alphanumerics(arr)'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert exclude_alphanumerics(['123', 'abc', '789', 'xyz', '!@#', '$%&*', '++--']) == ['!@#', '$%&*', '++--']\", \"assert exclude_alphanumerics(['hello', 'world', '!!', '123abc']) == ['!!']\", \"assert exclude_alphanumerics(['', ' ', ' ', 'a1!', '@#$', '']) == ['...
{ "split": "train", "index": 64982, "acecode_id": "evol_18109", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Write a function that takes a string input and replaces every alternate character with its ASCII value. The function should return the modified string. For example, if the input is 'Hello world!', the output should be 'H101l111w111r108d33'.\nPlease reason step by step, then wri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert alternate_ascii_code('a') == 'a'\", \"assert alternate_ascii_code('') == ''\", \"assert alternate_ascii_code('ABCD') == 'A66C68'\", \"assert alternate_ascii_code('abcdefg') == 'a98c100e102g'\", \"assert alternate_ascii_code('X') == 'X'\"]}" }
{ "split": "train", "index": 64983, "acecode_id": "evol_23698", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a list of integers and a target integer. Your task is to determine if there are two distinct indices in the list such that the sum of the integers at those indices equals the target integer. Implement a function named `find_pair_with_sum` that takes in two paramet...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_pair_with_sum([1, 2, 3, 4, 5], 5) == True\", \"assert find_pair_with_sum([1, 2, 3, 4, 5], 10) == False\", \"assert find_pair_with_sum([0, -1, 2, -3, 1], -2) == True\", \"assert find_pair_with_sum([], 1) == False\", \"assert find_pair_with_sum([3, 3], 6)...
{ "split": "train", "index": 64984, "acecode_id": "bigcode_python_fns_22793", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes an integer input representing the number of seconds and returns a string indicating whether the duration is considered 'Short', 'Medium', or 'Long'. A duration is classified as follows: 'Short' if it is less than 10 seconds, 'M...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert classify_duration(5) == 'Short'\", \"assert classify_duration(10) == 'Medium'\", \"assert classify_duration(30) == 'Medium'\", \"assert classify_duration(60) == 'Medium'\", \"assert classify_duration(61) == 'Long'\", \"assert classify_duration(120) == 'Long'...
{ "split": "train", "index": 64985, "acecode_id": "bigcode_python_fns_43232", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a random walk in a 2D grid. A random walker starts at the origin point (0, 0) and can move in four possible directions: up (0, 1), down (0, -1), left (-1, 0), and right (1, 0). Given an integer n, representing the number of steps the walker will t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert has_returned_to_origin(0) == True\", \"assert has_returned_to_origin(2) == True\", \"assert has_returned_to_origin(4) == True\", \"assert has_returned_to_origin(6) == True\", \"assert has_returned_to_origin(8) == True\", \"assert has_returned_to_origin(10) =...
{ "split": "train", "index": 64986, "acecode_id": "bigcode_python_fns_32318", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that retrieves the current exception handling mode for a hypothetical runtime environment called N2Cube. The function should return a string representing the current mode, which can either be 'PRINT_AND_EXIT' or 'RET_ERR_CODE'. Implement ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_exception_mode() in ['PRINT_AND_EXIT', 'RET_ERR_CODE']\", \"assert get_exception_mode() == 'PRINT_AND_EXIT' or get_exception_mode() == 'RET_ERR_CODE'\", \"assert isinstance(get_exception_mode(), str)\", \"assert get_exception_mode() != 'UNKNOWN_MODE'\", ...
{ "split": "train", "index": 64987, "acecode_id": "bigcode_python_fns_1955", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `s` consisting of lowercase English letters. Your task is to determine whether the string is a palindrome or not. A palindrome is a string that reads the same backward as forward. Write a function `is_palindrome(s: str) -> bool` that returns `True` if `s`...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_palindrome('racecar') == True\", \"assert is_palindrome('hello') == False\", \"assert is_palindrome('a') == True\", \"assert is_palindrome('abba') == True\", \"assert is_palindrome('abcba') == True\", \"assert is_palindrome('abcd') == False\", \"assert is...
{ "split": "train", "index": 64988, "acecode_id": "bigcode_python_fns_30835", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the heights of a group of people standing in a straight line, write a function `count_visible_people(heights: List[int]) -> int` that returns the number of people who can be seen from the left side. A person can be seen if they are taller t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_visible_people([5, 3, 7, 3, 8]) == 3\", \"assert count_visible_people([1, 2, 3, 4, 5]) == 5\", \"assert count_visible_people([5, 4, 3, 2, 1]) == 1\", \"assert count_visible_people([10, 20, 10, 30, 20]) == 3\", \"assert count_visible_people([1]) == 1\",...
{ "split": "train", "index": 64989, "acecode_id": "bigcode_python_fns_20842", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with designing a function that simulates a simplified version of an API for managing recent states of a given entity. Your function should accept an entity ID in the form of a string and return a list of the last five states recorded for that entity. If there are...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_recent_states('sensor.temperature') == ['70F', '68F', '69F', '71F', '72F']\", \"assert get_recent_states('light.living_room') == ['off', 'on', 'off']\", \"assert get_recent_states('invalid_entity_id!') == []\", \"assert get_recent_states('') == []\", \"a...
{ "split": "train", "index": 64990, "acecode_id": "bigcode_python_fns_9007", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Given two integers x and y, implement a function that returns a value based on the following rules: If x is less than or equal to y, return the product of x and y. Otherwise, return the result of dividing x by y. Your function should be named `scalar_function` and take two para...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert scalar_function(2, 3) == 6\", \"assert scalar_function(4, 4) == 16\", \"assert scalar_function(5, 2) == 2.5\", \"assert scalar_function(1, 5) == 5\", \"assert scalar_function(-1, 3) == -3\", \"assert scalar_function(7, 6) == 1.1666666666666667\", \"assert sc...
{ "split": "train", "index": 64991, "acecode_id": "bigcode_python_fns_34877", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a 3-dimensional vector represented as a list of three integers [x, y, z], write a function `cross_product_matrix` that returns the 3x3 cross product matrix corresponding to that vector. The cross product matrix S(a) should be defined as follows: \n\nS(a) = [[0, -z, y], \n...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cross_product_matrix([1, 2, 3]) == [[0, -3, 2], [3, 0, -1], [-2, 1, 0]]\", \"assert cross_product_matrix([0, 0, 0]) == [[0, 0, 0], [0, 0, 0], [0, 0, 0]]\", \"assert cross_product_matrix([4, 5, 6]) == [[0, -6, 5], [6, 0, -4], [-5, 4, 0]]\", \"assert cross_pro...
{ "split": "train", "index": 64992, "acecode_id": "bigcode_python_fns_30286", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a text string, write a Python function that returns a dictionary where each key is a unique word from the string, and the value is the count of how many times each word appeared in the string. The input will be a single string consisting of words separated by spaces.\nPle...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_words('apple banana apple orange banana banana') == {'apple': 2, 'banana': 3, 'orange': 1}\", \"assert count_words('hello world hello') == {'hello': 2, 'world': 1}\", \"assert count_words('test test Test') == {'test': 2, 'Test': 1}\", \"assert count_wo...
{ "split": "train", "index": 64993, "acecode_id": "evol_15051", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates controlling a simple LED circuit. The function should take two inputs: the LED pin number (an integer) and the duration (a positive integer) for which the LED should remain on. The function will return a string indic...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert control_led(18, 3) == 'LED off'\", \"assert control_led(5, 1) == 'LED off'\", \"assert control_led(12, 10) == 'LED off'\", \"assert control_led(2, 5) == 'LED off'\", \"assert control_led(1, 0) == 'LED off'\", \"assert control_led(7, 2) == 'LED off'\", \"asse...
{ "split": "train", "index": 64994, "acecode_id": "oss_14369", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `tool` representing the name of a tool and a string `model` representing a model description. Your task is to create a help section for the tool by concatenating the tool name with the model description, separated by a colon. Implement the function `creat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_help_section('Galaxy Tool', 'CTD Model 1') == 'Help Section: Galaxy Tool:CTD Model 1'\", \"assert create_help_section('Data Analyzer', 'Model X') == 'Help Section: Data Analyzer:Model X'\", \"assert create_help_section('Image Processor', 'Image Model ...
{ "split": "train", "index": 64995, "acecode_id": "bigcode_python_fns_13475", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that retrieves the password associated with a specific host from a given configuration dictionary. The configuration dictionary contains entries where keys represent host identifiers starting with 'host' and their corresponding val...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_password({'password1': '<password1>', 'host1': 'sql11.freemysqlhosting.net', 'password2': '<password2>', 'host2': 'example.com'}, 'example.com') == 'password2'\", \"assert extract_password({'password1': '<password1>', 'host1': 'sql11.freemysqlhosting...
{ "split": "train", "index": 64996, "acecode_id": "oss_10362", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that takes a list of badge UIDs and returns a dictionary mapping each UID to its corresponding name. If a badge UID does not exist, it should be mapped to 'Unknown'. Write a function `map_badge_uids_to_names(badge_uids: List[str]) ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert map_badge_uids_to_names(['uid1', 'uid2', 'uid3']) == {'uid1': 'Badge 1', 'uid2': 'Badge 2', 'uid3': 'Unknown'}\", \"assert map_badge_uids_to_names(['uid4', 'uid5']) == {'uid4': 'Unknown', 'uid5': 'Badge 5'}\", \"assert map_badge_uids_to_names(['uid11']) == {...
{ "split": "train", "index": 64997, "acecode_id": "oss_26227", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates a device connection status in a network. Your function should take a list of devices represented as strings and return a list of those devices that are currently connected. Each device can either be connected or disconnecte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_connected_devices(['DeviceA', 'DeviceE', 'DeviceC']) == ['DeviceA', 'DeviceC']\", \"assert get_connected_devices(['DeviceX', 'DeviceY']) == []\", \"assert get_connected_devices(['DeviceA', 'DeviceB', 'DeviceC', 'DeviceD']) == ['DeviceA', 'DeviceB', 'Devi...
{ "split": "train", "index": 64998, "acecode_id": "bigcode_python_fns_20941", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given two lists of numbers, `fst` and `hv`, representing two components of a gradient. You also have a backup gradient stored in a list within a `GradientDescent` class instance. Your task is to implement a function that calculates the resulting list by summing the corr...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert gradient_descent_operation([1, 1, 1], [1, 1, 1], GradientDescent().set_backup([1, 1, 1])) == [3, 3, 3]\", \"assert gradient_descent_operation([0, 0, 0], [0, 0, 0], GradientDescent().set_backup([1, 2, 3])) == [1, 2, 3]\", \"assert gradient_descent_operation([...
{ "split": "train", "index": 64999, "acecode_id": "oss_25753", "num_tests": 16 }