data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are given a string corpus of text and you need to implement a function `generate_markov_text` that uses a Markov chain model to generate new text. The function should take three parameters: a string `corpus` representing the input text corpus, a string `start_word` which is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_markov_text('All that glitters is not gold', 'glitters', 3) == 'glitters is not'\", \"assert generate_markov_text('In the middle of difficulty lies opportunity', 'middle', 5) == 'middle of difficulty lies opportunity'\", \"assert generate_markov_tex...
{ "split": "train", "index": 81100, "acecode_id": "oss_9491", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that generates a list of master node addresses based on a given discovery method. The function should take a string parameter, `master_discovery`, and return a string representing the master node list according to the following rules:\n- I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_master_list('master_http_loadbalancer') == 'exhibitor_address:2181'\", \"assert generate_master_list('other_discovery_method') == 'zk-1.zk:2181,zk-2.zk:2181,zk-3.zk:2181,zk-4.zk:2181,zk-5.zk:2181'\", \"assert generate_master_list('custom_method_1') ...
{ "split": "train", "index": 81101, "acecode_id": "oss_34128", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that accepts a list of integers and a target integer. The function should return the position of the last occurrence of the target integer in the list. If the target integer does not exist in the list, the function should return -1. If the input list is emp...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_position([], 5) == -2\", \"assert find_position([1, 2, 3], 4) == -1\", \"assert find_position([4, 5, 6, 7, 5], 5) == 4\", \"assert find_position([10, 20, 30, 20, 10], 20) == 3\", \"assert find_position([1, 1, 1, 1, 1], 1) == 4\", \"assert find_position(...
{ "split": "train", "index": 81102, "acecode_id": "evol_22072", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a caching mechanism for a simple database query system. The caching mechanism should store query results based on a unique cache key and efficiently retrieve them when the same query is made with the same key. Additionally, the mechanism should ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cache_query_results('SELECT * FROM users', {}, False) == ['result']\", \"assert cache_query_results('SELECT * FROM users', {'SELECT * FROM users': ['result']}, False) == ['result']\", \"assert cache_query_results('SELECT * FROM users', {'SELECT * FROM admins...
{ "split": "train", "index": 81103, "acecode_id": "oss_7883", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates uploading a data extract to a storage system. The function should take a context dictionary and an extract dictionary as input. The context dictionary contains a 'resources' key which has a 'data_lake' object. The extract d...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert upload_extract({'resources': {'data_lake': {}}}, {'filename': 'data1.csv', 'value': [[1, 2], [3, 4]]}) == 'storage/nwea_map/data1.csv'\", \"assert upload_extract({'resources': {'data_lake': {}}}, {'filename': 'report.xlsx', 'value': [[5, 6], [7, 8]]}) == 'st...
{ "split": "train", "index": 81104, "acecode_id": "bigcode_python_fns_16050", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string represents a place of performance code. A valid place of performance code must follow the format 'XX**###', where 'X' is any uppercase letter from 'A' to 'Z', '*' can be any character, and '#' must be a digit from '0' to '9'. Y...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_invalid_codes(['AB**12', 'XY**34', 'ZZ**99']) == 0\", \"assert count_invalid_codes(['AA**11', 'CC**22', 'DD**']) == 1\", \"assert count_invalid_codes(['AA**12', 'XX**34', 'YY**99']) == 0\", \"assert count_invalid_codes(['XX**99', 'AA**23', 'ZZ**3A']) =...
{ "split": "train", "index": 81105, "acecode_id": "bigcode_python_fns_22454", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a string `app_id` that represents the name of an application module or an application object within a module. Your task is to implement a function `locate_app(app_id: str) -> str` that will take this `app_id` as input and return a message indicating the result of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert locate_app(None) == 'Finding application in current working directory.'\", \"assert locate_app('my_module') == 'Locating application in module `my_module`.'\", \"assert locate_app('my_module:my_app') == 'Locating application object `my_app` in module `my_mod...
{ "split": "train", "index": 81106, "acecode_id": "bigcode_python_fns_24443", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that calculates the imaginary part of a complex number. The function should take a single argument, `x`, which represents a complex number in the form of a Python complex type (e.g., `1 + 2j`) and return its imaginary part as a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_imaginary_part(2 + 3j) == 3.0\", \"assert calculate_imaginary_part(0 + 1j) == 1.0\", \"assert calculate_imaginary_part(5 + 0j) == 0.0\", \"assert calculate_imaginary_part(-1 - 1j) == -1.0\", \"assert calculate_imaginary_part(3.5 + 4.5j) == 4.5\", \...
{ "split": "train", "index": 81107, "acecode_id": "oss_2146", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of elements that may contain duplicates, write a function `remove_duplicates` that converts the list to a tuple and removes all duplicates while preserving the order of elements. The function should be case-sensitive, meaning 'Apple' and 'apple' should be treated a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_duplicates([1, 2, 'apple', 'apple', 10, 'banana', 'carrot', 'carrot']) == (1, 2, 'apple', 10, 'banana', 'carrot')\", \"assert remove_duplicates(['cat', 'dog', 'cat', 'fish']) == ('cat', 'dog', 'fish')\", \"assert remove_duplicates(['a', 'A', 'b', 'B',...
{ "split": "train", "index": 81108, "acecode_id": "evol_17283", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a dictionary containing task results for multiple users. The input is a dictionary where each key is a task ID, and each value is another dictionary containing user IDs as keys and their corresponding results as values. You...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert summarize_results({\\\"task1\\\": {\\\"user1\\\": {\\\"data\\\": 1}, \\\"user2\\\": {\\\"data\\\": 2}}, \\\"task2\\\": {\\\"user1\\\": {\\\"data\\\": 3}}}) == {\\\"task1\\\": {\\\"user_count\\\": 2, \\\"total_results\\\": 2}, \\\"task2\\\": {\\\"user_count\\...
{ "split": "train", "index": 81109, "acecode_id": "bigcode_python_fns_14374", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a string `s`, write a function `smallest_substring` that returns the smallest substring that contains all unique characters from the original string. If there is no such substring, return an empty string.\nPlease reason step by step, then write a self-contained Python sol...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert smallest_substring('abcd') == 'abcd'\", \"assert smallest_substring('aa') == 'a'\", \"assert smallest_substring('ab') == 'ab'\", \"assert smallest_substring('abcdef') == 'abcdef'\", \"assert smallest_substring('xyzxyz') == 'xyz'\", \"assert smallest_substrin...
{ "split": "train", "index": 81110, "acecode_id": "evol_5440", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Given two strings, implement a function that reverses the first string and checks if it is equal to the second string. If the reversed first string is equal to the second string, return True. Otherwise, return False.\nPlease reason step by step, then write a self-contained Pyth...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_reversed_string('abc', 'cba') == True\", \"assert check_reversed_string('hello', 'olleh') == True\", \"assert check_reversed_string('Python', 'nohtyP') == True\", \"assert check_reversed_string('12345', '54321') == True\", \"assert check_reversed_strin...
{ "split": "train", "index": 81111, "acecode_id": "evol_35511", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `convert_to_integer(var)` that takes a single input `var`, which can be a string representation of a number or any other type. The function should attempt to convert `var` to an integer. If the conversion is successful, return the integer value. If the conversi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_integer('42') == 42\", \"assert convert_to_integer('0') == 0\", \"assert convert_to_integer('-7') == -7\", \"assert convert_to_integer('3.14') == None\", \"assert convert_to_integer('abc') == None\", \"assert convert_to_integer('') == None\", \"as...
{ "split": "train", "index": 81112, "acecode_id": "bigcode_python_fns_41507", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string containing only parentheses, write a function `is_balanced(input_string: str) -> bool` that determines whether the parentheses in the input string are balanced. A string is considered balanced if for every opening parenthesis '(', there is a corresponding closing...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_balanced('((()))') == True\", \"assert is_balanced('(()())') == True\", \"assert is_balanced('()') == True\", \"assert is_balanced('()()') == True\", \"assert is_balanced('((((()))))') == True\", \"assert is_balanced('(()(()))') == True\", \"assert is_bal...
{ "split": "train", "index": 81113, "acecode_id": "oss_4867", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers, `time_series` and `query`, write a function that computes the sliding dot product of `query` over `time_series`. The sliding dot product is defined as the sum of the products of the corresponding elements of `query` and a sliding window of the same ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sliding_dot_product([1, 2, 3], [3, 2, 1]) == [10.0]\", \"assert sliding_dot_product([0, 0, 0, 0], [1, 2]) == [0.0, 0.0, 0.0]\", \"assert sliding_dot_product([1, 1, 1, 1], [1, 1]) == [2.0, 2.0, 2.0]\", \"assert sliding_dot_product([-1, -2, -3], [1, 2]) == [-5...
{ "split": "train", "index": 81114, "acecode_id": "bigcode_python_fns_17898", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Implement a function `find_substrings(string_list, sub_string)` that takes a list of strings and a unique substring as inputs. The function should return a list of all strings from the input list that contain the substring, regardless of case sensitivity and even if the substri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_substrings(['hello', 'WORLD', 'google', 'apple', 'apPle'], '') == 'Substring is empty or null!'\", \"assert find_substrings(['hello', 'WORLD', 'google', 'apple', 'apPle'], None) == 'Substring is empty or null!'\", \"assert find_substrings(['hello', 'WOR...
{ "split": "train", "index": 81115, "acecode_id": "evol_5983", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that checks if a given input is an integer. The function should raise a TypeError if the input is not an integer, with a message specifying that the input is expected to be an integer. The function signature is as follows: `def is_int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_integer(5, 'test') is None\", \"assert is_integer(-10, 'negative integer') is None\", \"assert is_integer(0, 'zero integer') is None\", \"assert is_integer(42, 'answer') is None\", \"assert is_integer(1, 'one') is None\"]}" }
{ "split": "train", "index": 81116, "acecode_id": "bigcode_python_fns_46900", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a decoding cipher represented as a dictionary where each key-value pair corresponds to a character mapping, implement a function `decode_string(decoding_cipher, string)` that takes the decoding cipher and a string as inputs, and returns the decoded string by replacing eac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert decode_string({ 'x': 'a', 'y': 'b', 'z': 'c' }, 'xyz') == 'abc'\", \"assert decode_string({ 'x': 'a', 'y': 'b', 'z': 'c' }, 'abc') == ''\", \"assert decode_string({ 'x': 'a', 'y': 'b', 'z': 'c' }, '') == ''\", \"assert decode_string({ 'x': 'a', 'y': 'b', 'z'...
{ "split": "train", "index": 81117, "acecode_id": "evol_13750", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function `extract_ftp_url(s: str) -> dict` that extracts the components of an FTP URL from a given Unicode character string. The function should return a dictionary with the keys: 'user', 'password', 'host', 'port', and 'path', containing the respective components o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_ftp_url('ftp://user:pass@hostname.com:21/path/to/file') == {'user': 'user', 'password': 'pass', 'host': 'hostname.com', 'port': '21', 'path': 'path/to/file'}\", \"assert extract_ftp_url('ftp://username:password@ftp.example.com') == {'user': 'username...
{ "split": "train", "index": 81118, "acecode_id": "evol_12968", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a list of available pages for a dashboard. Each page is represented as a dictionary that contains a key 'graphics', which is a list of paths to graphics. Your function should return a new list of pages where each graphic pa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_dashboard_layout([{'graphics': ['/path/to/graphic1']}]) == [{'graphics': [{'path': '/path/to/graphic1', 'title': 'Graphic Title 1'}]}]\", \"assert get_dashboard_layout([{'graphics': ['/path/to/graphic2']}]) == [{'graphics': [{'path': '/path/to/graphic2',...
{ "split": "train", "index": 81119, "acecode_id": "bigcode_python_fns_8028", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with simulating a simple banking system. Implement a function `bank_account_operations(initial_balance, operations)` that takes an initial balance and a list of operations, where each operation is either a deposit or a withdrawal. Each deposit operation is repres...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bank_account_operations(1000, [('D', 200), ('W', 150)]) == 1050\", \"assert bank_account_operations(500, [('W', 600)]) == 500\", \"assert bank_account_operations(0, [('D', 100), ('W', 50)]) == 50\", \"assert bank_account_operations(100, [('W', 50), ('D', 100...
{ "split": "train", "index": 81120, "acecode_id": "oss_1112", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a Python function that identifies all shared vowels in three given strings, disregarding their case. The function should take three strings as input and return a set of vowels that are present in all three strings. The vowels considered are 'a', 'e', 'i', 'o', and 'u'.\nP...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert shared_vowels('apple', 'grape', 'orange') == {'a', 'e'}\", \"assert shared_vowels('sky', 'fly', 'cry') == set()\", \"assert shared_vowels('aeiou', 'AEIOU', 'aEiOu') == {'a', 'e', 'i', 'o', 'u'}\", \"assert shared_vowels('test', 'text', 'tact') == set()\", \"...
{ "split": "train", "index": 81121, "acecode_id": "evol_14701", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that manages a basic emote system for a chat application. The system allows users to register emotes represented by unique keywords and image paths. Your task is to implement the function `emote_system(operations: List[Tuple[str, str]...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert emote_system([('register', 'smile', 'smile.png'), ('get', 'smile')]) == ['smile.png']\", \"assert emote_system([('register', 'wink', 'wink.png'), ('get', 'sad')]) == ['']\", \"assert emote_system([('register', 'laugh', 'laugh.png'), ('get', 'laugh')]) == ['l...
{ "split": "train", "index": 81122, "acecode_id": "oss_14270", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a grid represented as a list of lists, where each element is either 0 or 1. Your task is to encode this grid using Run-Length Encoding (RLE) format. The RLE format compresses consecutive sequences of the same number into a single value followed by the count of tha...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert encodeGrid([[0, 0, 0], [1, 1, 1]]) == ['3 0', '3 1']\", \"assert encodeGrid([[1, 1, 1], [0, 0, 0], [1]]) == ['3 1', '3 0', '1 1']\", \"assert encodeGrid([[0, 0], [1, 1], [0]]) == ['2 0', '2 1', '1 0']\", \"assert encodeGrid([[0]]) == ['1 0']\", \"assert enco...
{ "split": "train", "index": 81123, "acecode_id": "bigcode_python_fns_3733", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Design a function to parse and reformat date strings in various formats. The function should be able to recognize and properly parse dates in the following formats: 1. dd-mm-yyyy 2. dd.mm.yyyy 3. yyyy-mm-dd 4. mm/dd/yyyy 5. yyyy/M/d. After parsing the input date string, the fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reformat_date('12-06-2020') == '12/06/2020'\", \"assert reformat_date('12.06.2020') == '12/06/2020'\", \"assert reformat_date('2020-06-12') == '12/06/2020'\", \"assert reformat_date('06/12/2020') == '12/06/2020'\", \"assert reformat_date('2020/06/12') == '12...
{ "split": "train", "index": 81124, "acecode_id": "evol_9571", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function that returns a new list containing only the unique elements from the input list, preserving their original order. The input list may contain duplicates, and the output list should not include any duplicates. You must implement the func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_elements([1, 2, 3, 1, 2, 4]) == [1, 2, 3, 4]\", \"assert unique_elements([5, 5, 5, 5]) == [5]\", \"assert unique_elements([]) == []\", \"assert unique_elements([10, 20, 10, 30, 20, 40]) == [10, 20, 30, 40]\", \"assert unique_elements([1, 2, 2, 3, 4, 4...
{ "split": "train", "index": 81125, "acecode_id": "bigcode_python_fns_25883", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `population_based_training(num_agents: int, num_arms: int, num_iterations: int) -> List[BanditAgent]` that simulates a population-based training of agents interacting with a multi-armed bandit. Each agent should utilize a deep learning model to choose which...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert population_based_training(10, 5, 100) is not None\", \"assert len(population_based_training(10, 10, 1000)) == 10\", \"assert len(population_based_training(1, 1, 1)) == 1\", \"assert len(population_based_training(5, 3, 50)) == 5\", \"assert len(population_bas...
{ "split": "train", "index": 81126, "acecode_id": "evol_32635", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string of words separated by underscores, convert the string into camelCase format. The first word should start with a lowercase letter, and each subsequent word should start with an uppercase letter. The input string will contain only lowercase letters and underscores,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert to_camel_case('hello_world') == 'helloWorld'\", \"assert to_camel_case('java_programming') == 'javaProgramming'\", \"assert to_camel_case('convert_to_camel_case') == 'convertToCamelCase'\", \"assert to_camel_case('python_is_fun') == 'pythonIsFun'\", \"assert...
{ "split": "train", "index": 81127, "acecode_id": "bigcode_python_fns_8614", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings, where each string is a tag that represents a category. Your goal is to determine if two lists of tags are identical. The first list, `list_a`, contains the tags that are supposed to be present, and the second list, `list_b`, contains the tags th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_tags_match(['tag1', 'tag2', 'tag3'], ['tag3', 'tag2', 'tag1']) == True\", \"assert check_tags_match(['tag1', 'tag2'], ['tag1']) == False\", \"assert check_tags_match([], []) == True\", \"assert check_tags_match(['tag1'], ['tag1']) == True\", \"assert c...
{ "split": "train", "index": 81128, "acecode_id": "bigcode_python_fns_2581", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `translate_string(s: str, lang: str) -> str` that takes a string `s` and a language identifier `lang`. The function should convert all lowercase letters in `s` to their uppercase equivalents, replace specific symbols with their respective names in the speci...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert translate_string('hello & world 1', 'french') == 'HELLO et WORLD un'\", \"assert translate_string('test @ 2', 'french') == 'TEST arobase deux'\", \"assert translate_string('lowercase & UPPERCASE', 'french') == 'LOWERCASE et UPPERCASE'\", \"assert translate_s...
{ "split": "train", "index": 81129, "acecode_id": "evol_18145", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a channel ID and a large integer as inputs. The function should return a dictionary containing the channel ID and half of the large integer. The function signature should be `def process_channel_data(channel_id: int, large: int...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_channel_data(1, 0) == {'channel_id': 1, 'half_large': 0.0}\", \"assert process_channel_data(2, 4) == {'channel_id': 2, 'half_large': 2.0}\", \"assert process_channel_data(3, 10) == {'channel_id': 3, 'half_large': 5.0}\", \"assert process_channel_data...
{ "split": "train", "index": 81130, "acecode_id": "bigcode_python_fns_35713", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string `s` and a list of keywords, implement a function `search_ignore_case(s: str, keywords: List[str]) -> List[str]` that returns a list of keywords found in the string `s`, ignoring case. The result should contain each keyword only once, regardless of how many times ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert search_ignore_case('Hello World', ['hello', 'world']) == ['hello', 'world']\", \"assert search_ignore_case('Python programming', ['java', 'python', 'C++']) == ['python']\", \"assert search_ignore_case('Case Insensitive Search', ['case', 'insensitive', 'searc...
{ "split": "train", "index": 81131, "acecode_id": "bigcode_python_fns_7807", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Develop a function that sorts an input list of positive integers into unique subgroups based on a specific rule. The rule is defined as two numbers belonging to the same subgroup if their difference is less than or equal to a specified threshold. Implement a function that takes...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert group_by_rule([1, 3, 5, 7, 9], 2) == [[1, 3, 5, 7, 9]]\", \"assert group_by_rule([10, 11, 12, 20, 21], 1) == [[10, 11, 12], [20, 21]]\", \"assert group_by_rule([1, 2, 3, 4, 5, 10, 11, 12], 1) == [[1, 2, 3, 4, 5], [10, 11, 12]]\", \"assert group_by_rule([2, 4...
{ "split": "train", "index": 81132, "acecode_id": "evol_27613", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `generate_tgt_mask(sz: int) -> List[List[float]]` that generates a square mask for a sequence of length `sz`. The mask should be a 2D list (a list of lists) where the masked positions are filled with negative infinity (`float('-inf')`) an...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_tgt_mask(1) == [[0.0]]\", \"assert generate_tgt_mask(2) == [[0.0, float('-inf')], [0.0, 0.0]]\", \"assert generate_tgt_mask(3) == [[0.0, float('-inf'), float('-inf')], [0.0, 0.0, float('-inf')], [0.0, 0.0, 0.0]]\", \"assert generate_tgt_mask(4) == [...
{ "split": "train", "index": 81133, "acecode_id": "bigcode_python_fns_701", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given an array of integers, write a function that finds the longest contiguous increasing subsequence in the array and returns the starting and ending indices of this subsequence. If there are multiple subsequences with the same maximum length, return the indices of the first o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert longest_increasing_subsequence([1,2,3,4,5]) == (0, 4)\", \"assert longest_increasing_subsequence([5,4,3,2,1]) == (0, 0)\", \"assert longest_increasing_subsequence([1,3,2,4,5]) == (2, 4)\", \"assert longest_increasing_subsequence([1,1,1,1]) == (0, 0)\", \"ass...
{ "split": "train", "index": 81134, "acecode_id": "evol_8645", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a string of comma-separated values representing states, write a function that takes this string as input and returns a list of valid states from a predefined set of states. The predefined set of states is: ['New York', 'California', 'Texas', 'Florida', 'Illinois']. If any...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_valid_states('New York,California') == ['New York', 'California']\", \"assert filter_valid_states('Texas,Florida') == ['Texas', 'Florida']\", \"assert filter_valid_states('Illinois,New York,California') == ['Illinois', 'New York', 'California']\", \"a...
{ "split": "train", "index": 81135, "acecode_id": "bigcode_python_fns_45289", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `delete_application_entity(uri: str, data_format: str) -> Tuple[int, str]` that simulates the deletion of an application entity (AE) from a framework. The function takes in two parameters: a string `uri` which represents the URI of the pa...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert delete_application_entity('http://example.com/cse', 'json') == (200, 'deleted_uri')\", \"assert delete_application_entity('http://example.com/cse', 'xml') == (200, 'deleted_uri')\", \"assert delete_application_entity('http://example.com/cse/app1', 'json') ==...
{ "split": "train", "index": 81136, "acecode_id": "bigcode_python_fns_42450", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `retrieve_graph` that simulates the retrieval of a graph based on specified parameters. The function should take the following parameters: `directed` (a boolean indicating if the graph is directed), `preprocess` (a string indicating the p...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retrieve_graph(True, 'auto', True, True, 'current') == {'directed': True, 'preprocess': 'auto', 'load_nodes': True, 'load_edge_weights': True, 'version': 'current'}\", \"assert retrieve_graph(False, 'manual', False, False, '20220414') == {'directed': False, ...
{ "split": "train", "index": 81137, "acecode_id": "bigcode_python_fns_39139", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `manipulate_data(data: dict) -> dict` that takes a dictionary `data` containing an 'id' and 'data' keys. The function should return a new dictionary where the 'data' value is converted to uppercase. The 'id' should be prefixed with 'Data-' to create a new 'id' ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manipulate_data({'id': '1', 'data': 'hello'}) == {'id': 'Data-1', 'data': 'HELLO'}\", \"assert manipulate_data({'id': '2', 'data': 'world'}) == {'id': 'Data-2', 'data': 'WORLD'}\", \"assert manipulate_data({'id': '3', 'data': 'openai'}) == {'id': 'Data-3', '...
{ "split": "train", "index": 81138, "acecode_id": "evol_31519", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `filter_string(input_str: str) -> str` that takes an input string and returns a new string containing only the characters whose ASCII values are between 15 and 34 (inclusive) or equal to 35. The characters outside this range should be removed.\nPlease reason st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_string('Sample#String') == '#'\", \"assert filter_string('1234567890') == ''\", \"assert filter_string('') == ''\", \"assert filter_string('ABC') == ''\", \"assert filter_string('abc') == ''\", \"assert filter_string('~`<>?') == ''\"]}" }
{ "split": "train", "index": 81139, "acecode_id": "evol_23011", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Implement a function `get_multiples(M: int, N: int) -> List[int]` that takes two integers, M and N, as input and returns a list containing the first M multiples of the positive integer N. If M is less than or equal to 0 or if N is less than or equal to 0, the function should re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_multiples(5, 7) == [7, 14, 21, 28, 35]\", \"assert get_multiples(0, 10) == []\", \"assert get_multiples(-3, 5) == []\", \"assert get_multiples(5, 0) == []\", \"assert get_multiples(4, 1) == [1, 2, 3, 4]\", \"assert get_multiples(3, 3) == [3, 6, 9]\", \"a...
{ "split": "train", "index": 81140, "acecode_id": "evol_2788", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that filters a list of Wi-Fi access points represented by dictionaries. Each access point has properties such as SSID (string) and security (string). Your function should return a list of access points that have open security (i.e., the se...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_open_access_points([{'SSID': 'AP1', 'security': 'WPA2'}, {'SSID': 'AP2', 'security': 'None'}, {'SSID': 'AP3', 'security': 'WPA'}, {'SSID': 'AP4', 'security': 'Open'}]) == [{'SSID': 'AP2', 'security': 'None'}, {'SSID': 'AP4', 'security': 'Open'}]\", \"...
{ "split": "train", "index": 81141, "acecode_id": "evol_8120", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that dynamically imports a specified module and returns an instance of a specified class from that module, initialized with given keyword arguments. Your function should handle the import and instantiation process based on the provide...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert dynamic_import_and_instantiate('datetime', 'datetime', year=2023, month=10, day=1).year == 2023\", \"assert dynamic_import_and_instantiate('json', 'JSONDecoder').decode('\\\"test\\\"') == 'test'\", \"assert dynamic_import_and_instantiate('itertools', 'count'...
{ "split": "train", "index": 81142, "acecode_id": "oss_29425", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a string `modelName`, write a function `getNamespace` that returns the namespace by removing the last segment of the input string when it is separated by colons (:). If the input string does not contain any colons, return an empty string. If the input string is empty, ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert getNamespace('namespace:subnamespace:node') == 'namespace:subnamespace'\", \"assert getNamespace('namespace:subnamespace') == 'namespace'\", \"assert getNamespace('namespace') == ''\", \"assert getNamespace('') == ''\", \"assert getNamespace('a:b:c:d:e') == ...
{ "split": "train", "index": 81143, "acecode_id": "bigcode_python_fns_37159", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates the behavior of a logging system. The function should take a list of integers as input and return a new list that contains only the even integers from the input list. The output list should maintain the original orde...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5, 6]) == [2, 4, 6]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([1, 3, 5]) == []\", \"assert filter_even_numbers([-1, -2, -3, -4]) == [-2, -4]\", \"assert filter_even_numbers(...
{ "split": "train", "index": 81144, "acecode_id": "oss_6172", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are working in a factory that produces items on a conveyor belt. The belt has N slots, and each slot contains a number representing the item's durability. Additionally, there are K robots placed on the belt to assist in the production process. Your task is to simulate the m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert min_steps_to_complete_task(4, 2, [2, 2, 2, 2]) == 8\", \"assert min_steps_to_complete_task(6, 3, [1, 1, 1, 1, 1, 1]) == 12\", \"assert min_steps_to_complete_task(10, 3, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]) == 20\", \"assert min_steps_to_complete_task(5, 2, [1, 1,...
{ "split": "train", "index": 81145, "acecode_id": "oss_11335", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given two strings s1 and s2, write a function to compute the Levenshtein distance between them. The Levenshtein distance is the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one string into the other. Implement a function ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert levenshtein('kitten', 'sitting') == 3\", \"assert levenshtein('flaw', 'lawn') == 2\", \"assert levenshtein('intention', 'execution') == 5\", \"assert levenshtein('abc', 'abc') == 0\", \"assert levenshtein('', 'nonempty') == 8\", \"assert levenshtein('nonempt...
{ "split": "train", "index": 81146, "acecode_id": "bigcode_python_fns_35666", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function named `validate_book_details` that takes five parameters: `title` (string), `author` (string), `publisher` (string), `isbn` (string), and `price` (float). The function should return True if the `isbn` is a 13-digit numeric string and the `price` is a positive ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_book_details('The Great Gatsby', 'F. Scott Fitzgerald', 'Scribner', '9780743273565', 10.99) == True\", \"assert validate_book_details('1984', 'George Orwell', 'Harcourt', '0451524934', 15.00) == False\", \"assert validate_book_details('To Kill a Moc...
{ "split": "train", "index": 81147, "acecode_id": "evol_32012", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes input details for a quality assurance check. The function should take in a `QajsonCheck` object and a list of input file paths. Your goal is to create a function that processes the input details and returns a dictionary...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_input_details(QajsonCheck('key1'), ['file1.txt', 'file2.txt']) == {'key': 'key1', 'input_files': ['file1.txt', 'file2.txt'], 'file_count': 2}\", \"assert get_input_details(QajsonCheck('key2'), []) == {'key': 'key2', 'input_files': [], 'file_count': 0}\",...
{ "split": "train", "index": 81148, "acecode_id": "oss_33826", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to compare two payloads represented as dictionaries and determine if they match according to specific criteria. Implement the function `check_payload(fb_payload, filter_payload)` which takes two parameters: `fb_payload`, a dictionary ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_payload({'key': 'value'}, None) == True\", \"assert check_payload({'key': 'value'}, {'key': 'value'}) == True\", \"assert check_payload({'key': 'value'}, {'another_key': 'value'}) == False\", \"assert check_payload({}, None) == True\", \"assert check_p...
{ "split": "train", "index": 81149, "acecode_id": "oss_15803", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that simulates a simple text encryption algorithm. The algorithm will take a string as input and perform the following steps: 1. Reverse the input string. 2. Replace each vowel (a, e, i, o, u) with the next vowel in the sequence (a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert encrypt_text('a') == 'e'\", \"assert encrypt_text('e') == 'i'\", \"assert encrypt_text('i') == 'o'\", \"assert encrypt_text('o') == 'u'\", \"assert encrypt_text('u') == 'a'\"]}" }
{ "split": "train", "index": 81150, "acecode_id": "oss_22796", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function `create_student` that takes in two parameters: `studentName` and `studentID`. The function should validate that both parameters are strings. If either of them is not a string, the function should raise a ValueError with the message 'Student name must be a s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_student('Alice', '12345') == {'studentName': 'Alice', 'studentID': '12345'}\", \"assert create_student('Bob', '67890') == {'studentName': 'Bob', 'studentID': '67890'}\", \"assert create_student('Charlie', '54321') == {'studentName': 'Charlie', 'studen...
{ "split": "train", "index": 81151, "acecode_id": "evol_9502", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with managing a namespace of variable aliases based on a sequence of mathematical expressions. Each expression can either be a function or a nested structure containing functions and their arguments. Your goal is to create a function `add_aliases_to_namespace(nam...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert add_aliases_to_namespace({}, ('expr1', 'alias1')) == {'expr1': 'alias1'}\", \"assert add_aliases_to_namespace({'expr1': 'alias1'}, ('expr1', 'alias1')) == {'expr1': 'alias1'}\", \"assert add_aliases_to_namespace({}, ('expr2', 'alias2'), ('expr3', 'alias3')) ...
{ "split": "train", "index": 81152, "acecode_id": "bigcode_python_fns_33521", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing an existing 'silver' dataset. You need to implement a function that merges this dataset with optional annotations, where each annotation specifies a modification to be applied to the corresponding entry in the silver dataset. If an a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_and_edit_dataset(['data1', 'data2', 'data3'], ['annotation1', 'annotation2', 'annotation3']) == ['annotation1', 'annotation2', 'annotation3']\", \"assert merge_and_edit_dataset(['data1', 'data2'], ['annotation1', None]) == ['annotation1', 'data2']\", \...
{ "split": "train", "index": 81153, "acecode_id": "oss_13439", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers and a target integer, write a function `find_target_index(arr, target)` that returns the index of the first occurrence of the target integer in the list. If the target integer is not found, the function should return -1. The function should have a time ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_target_index([1, 2, 3, 4, 5], 3) == 2\", \"assert find_target_index([5, 5, 5, 5, 5], 5) == 0\", \"assert find_target_index([1, 2, 3, 4, 5], 6) == -1\", \"assert find_target_index([], 1) == -1\", \"assert find_target_index([10, 20, 30, 40], 30) == 2\", \...
{ "split": "train", "index": 81154, "acecode_id": "oss_18432", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `sum_of_squares(numbers)` that returns the sum of the squares of the even numbers in the list. If there are no even numbers, return 0. The input list can contain both positive and negative integers. The function should have the followi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_of_squares([1, 2, 3, 4]) == 20\", \"assert sum_of_squares([0, -2, -4, 5]) == 20\", \"assert sum_of_squares([1, 3, 5]) == 0\", \"assert sum_of_squares([-1, -2, -3, -4]) == 20\", \"assert sum_of_squares([]) == 0\", \"assert sum_of_squares([2, 4, 6]) == 56\...
{ "split": "train", "index": 81155, "acecode_id": "bigcode_python_fns_16776", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `download_data` that simulates the downloading of data from a specified local directory. The function takes two parameters: `local_directory` (a string representing the path of the directory where data is to be downloaded) and `retrie...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert download_data('/data/folder1', 5) == 'Downloading 5 items from /data/folder1...'\", \"assert download_data('/data/folder2', 10) == 'Downloading 10 items from /data/folder2...'\", \"assert download_data('/user/files', 1) == 'Downloading 1 items from /user/fil...
{ "split": "train", "index": 81156, "acecode_id": "bigcode_python_fns_15640", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the degradation percentage of network interfaces based on historical data and current active interfaces. Implement a function `degradation_percent` that takes two parameters: `total_interfaces`, which is an integer representing the total number o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert degradation_percent(5, [1, 2, 3, 4, 5]) == 0.00\", \"assert degradation_percent(4, [1, 2]) == 50.00\", \"assert degradation_percent(3, [3]) == 66.67\", \"assert degradation_percent(0, []) == 0.00\", \"assert degradation_percent(10, [1, 3, 5, 7, 9]) == 50.00\...
{ "split": "train", "index": 81157, "acecode_id": "oss_5627", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given any number of sequences (lists or tuples), implement a function that finds the intersection of these sequences. The function should return a generator that yields the values that are present in all of the input sequences. The function signature is: `def intersection(*seqs...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list(intersection([1, 2, 3], [3, 4, 5], [2, 3, 6])) == [3]\", \"assert list(intersection(['a', 'b', 'c'], ['b', 'c', 'd'], ['c', 'd', 'e'])) == ['c']\", \"assert list(intersection([1, 2, 3], [1, 2, 3, 4], [1])) == [1]\", \"assert list(intersection([1], [2], ...
{ "split": "train", "index": 81158, "acecode_id": "oss_11249", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function that cleanses a given Python data structure for JSON serialization. The function should handle the following cases: \n\n1. If the input is a float, replace positive infinity with the string 'Infinity', negative infinity with the string '-I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert cleanse_data_structure(float('inf')) == 'Infinity'\", \"assert cleanse_data_structure(float('-inf')) == '-Infinity'\", \"assert cleanse_data_structure(float('nan')) == 'NaN'\", \"assert cleanse_data_structure(42) == 42\", \"assert cleanse_data_structure(b'He...
{ "split": "train", "index": 81159, "acecode_id": "bigcode_python_fns_8205", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the monthly cost of goods sold (COGS) over a specified number of days, based on an annual COGS value. Implement a function `calc_cogs_time_series(days: int, cogs_annual: float) -> List[float]` that takes two parameters: `days`, the total number o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calc_cogs_time_series(31, 1200) == [100.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\", \"assert calc_cogs_time_series(28, 1200) == [100.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
{ "split": "train", "index": 81160, "acecode_id": "bigcode_python_fns_41462", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Implement a function that takes three coefficients of a quadratic equation, a, b, and c, and returns the two roots of the equation ax^2 + bx + c = 0. The roots should be returned as a tuple of complex numbers. If the roots are real, they should still be returned as complex numb...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert solve_quad_equ(1, -3, 2) == (2+0j, 1+0j)\", \"assert solve_quad_equ(1, 2, 1) == (-1+0j, -1+0j)\", \"assert solve_quad_equ(1, 0, -1) == (1+0j, -1+0j)\", \"assert solve_quad_equ(1, -2, 1) == (1+0j, 1+0j)\", \"assert solve_quad_equ(1, -4, 4) == (2+0j, 2+0j)\", ...
{ "split": "train", "index": 81161, "acecode_id": "evol_27406", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates random polynomial functions based on given parameters. Your function should take in a list of x values, a list of coefficients for high-degree terms of a polynomial, a lower bound, and an upper bound for x values. The funct...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_polynomial([0, 1, 2], [1, 2, 3], -5, 5) is not None\", \"assert len(generate_polynomial([-1, 0, 1], [0.5, 1.5], -10, 10)) == 3\", \"assert all(y >= -5 for y in generate_polynomial([0, 0.5, 1], [0, 1], -5, 5))\", \"assert all(y <= 5 for y in generate...
{ "split": "train", "index": 81162, "acecode_id": "oss_23229", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are given a list of strings representing git branch names. Your task is to implement a function that takes this list and returns the current branch name based on the following criteria: if the list is empty, return 'unknown'. If the list contains duplicate branch names, ret...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_current_branch([]) == 'unknown'\", \"assert get_current_branch(['main']) == 'main'\", \"assert get_current_branch(['feature', 'develop', 'main']) == 'feature'\", \"assert get_current_branch(['develop', 'develop', 'feature', 'main']) == 'develop'\", \"ass...
{ "split": "train", "index": 81163, "acecode_id": "bigcode_python_fns_3231", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of foreign key relationships, where each relationship is represented as a tuple containing the foreign key name and the corresponding value. Your task is to create a dictionary where each key is the foreign key name, and each value is the name associated wi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_foreign_key_dict([('user_Id', 1), ('product_Id', 2)], {1: 'Alice', 2: 'Laptop'}, ['user_Id']) == {'product_Id': 'Laptop'}\", \"assert get_foreign_key_dict([('order_Id', 3), ('customer_Id', 4)], {3: 'Order1', 4: 'Bob'}, None) == {'order_Id': 'Order1', 'cu...
{ "split": "train", "index": 81164, "acecode_id": "bigcode_python_fns_42276", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two strings representing sequences of tokens, you need to implement a function that computes and returns the number of common tokens between the two sequences, the total number of tokens in the first sequence, and the total number of tokens in the second sequence. A token...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert token_counts('apple orange banana', 'orange banana grape') == (2, 3, 3)\", \"assert token_counts('cat dog', 'dog cat mouse') == (2, 2, 3)\", \"assert token_counts('hello world', 'world hello') == (2, 2, 2)\", \"assert token_counts('foo bar baz', 'qux quux co...
{ "split": "train", "index": 81165, "acecode_id": "bigcode_python_fns_7571", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `labotter_in(user_id: int) -> str` that simulates a user entering a lab. The function takes a user ID as input and returns a message indicating whether the user successfully entered the lab or not. The user can only enter the lab if t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert labotter_in(2) == '\\u3089\\u307c\\u3044\\u3093\\u3057\\u305f\\u3063\\u307d! \\\\n\\u3044\\u3093\\u6642\\u523b: 2023-10-01 12:00:00'\", \"assert labotter_in(4) == '\\u3089\\u307c\\u3044\\u3093\\u3057\\u305f\\u3063\\u307d! \\\\n\\u3044\\u3093\\u6642\\u523b: 2...
{ "split": "train", "index": 81166, "acecode_id": "bigcode_python_fns_20755", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that simulates the automation of accessing educational content on a web platform. Your function should take a type of content (either a lesson or a test), the subject of that content, and a list of available buttons on the web page. Based...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert automate_lesson_test('\\u0423\\u0420\\u041e\\u041a', 'Math', ['Math', 'Science']) is None\", \"assert automate_lesson_test('\\u0422\\u0415\\u0421\\u0422', 'Science', ['Math', 'Science']) is None\", \"assert automate_lesson_test('\\u0423\\u0420\\u041e\\u041a'...
{ "split": "train", "index": 81167, "acecode_id": "oss_7724", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a nested data structure that can contain dictionaries and lists, implement a function `traverse_nested_structure(data)` that returns a flattened list of all keys in the structure that are not None, excluding certain keys from the output. The keys to be excluded are define...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert traverse_nested_structure({'key1': 'value1', 'key2': 'value2', 'key3': None}) == ['.key1', '.key2']\", \"assert traverse_nested_structure([]) == []\", \"assert traverse_nested_structure({'a': 1, 'b': 2, 'c': 3}) == ['.a', '.b', '.c']\", \"assert traverse_nes...
{ "split": "train", "index": 81168, "acecode_id": "bigcode_python_fns_8934", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Given a 2-D array, implement a function that returns a list of coordinate pairs (x, y) representing the indices of all negative elements in the array. If there are no negative elements or if the array is empty, return an empty list.\nPlease reason step by step, then write a sel...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_negatives([[12, -5, 3], [-8, 10, -2], [1, 6, -4]]) == [(0, 1), (1, 0), (1, 2), (2, 2)]\", \"assert find_negatives([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) == []\", \"assert find_negatives([[-1, -1, -1], [-1, -1, -1], [-1, -1, -1]]) == [(0, 0), (0, 1), (0, 2),...
{ "split": "train", "index": 81169, "acecode_id": "evol_26743", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of book information and filters out books based on their publication year. The function should take two parameters: a list of dictionaries representing books and an integer representing a year. Each dictionary...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_books([{'title': 'Book1', 'author': 'Author1', 'publication_year': 2000}, {'title': 'Book2', 'author': 'Author2', 'publication_year': 2010}], 2005) == [{'title': 'Book2', 'author': 'Author2'}]\", \"assert filter_books([{'title': 'Book3', 'author': 'Au...
{ "split": "train", "index": 81170, "acecode_id": "oss_14147", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a temperature in Celsius, implement a function `celsius_to_fahrenheit(celsius)` that converts the temperature to Fahrenheit using the formula: Fahrenheit = (Celsius * 9/5) + 32. The function should return the Fahrenheit equivalent of the given Celsius temperature.\nPlease...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert celsius_to_fahrenheit(0) == 32.0\", \"assert celsius_to_fahrenheit(100) == 212.0\", \"assert celsius_to_fahrenheit(-40) == -40.0\", \"assert celsius_to_fahrenheit(37) == 98.6\", \"assert celsius_to_fahrenheit(25) == 77.0\", \"assert celsius_to_fahrenheit(-10...
{ "split": "train", "index": 81171, "acecode_id": "evol_9225", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that checks if a specific dataset is present in a given list of downloaded datasets. Implement a function named `is_dataset_downloaded` that takes in two parameters: a string `dataset` representing the name of the dataset (e.g., 'ml-100k'...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_dataset_downloaded('ml-100k', ['ml-100k', 'bx', 'movielens']) == True\", \"assert is_dataset_downloaded('bx', ['ml-100k', 'bx', 'movielens']) == True\", \"assert is_dataset_downloaded('movielens', ['ml-100k', 'bx']) == False\", \"assert is_dataset_downloa...
{ "split": "train", "index": 81172, "acecode_id": "bigcode_python_fns_9677", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that generates the first n natural numbers in the Fibonacci series. The Fibonacci series is defined as follows: the first two numbers are 0 and 1, and every subsequent number is the sum of the two preceding ones. Your function should return a list containin...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fib(0) == 'Incorrect input'\", \"assert fib(-1) == 'Incorrect input'\", \"assert fib(1) == [0]\", \"assert fib(2) == [0, 1]\", \"assert fib(3) == [0, 1, 1]\", \"assert fib(4) == [0, 1, 1, 2]\", \"assert fib(5) == [0, 1, 1, 2, 3]\", \"assert fib(6) == [0, 1, ...
{ "split": "train", "index": 81173, "acecode_id": "evol_20366", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `create_superuser` that takes two arguments: `username` (a string) and `password` (also a string). The function should check if a superuser with the given `username` already exists in a hypothetical user database represented by a list...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_superuser('admin', 'password123') == 'Superuser created successfully.'\", \"assert create_superuser('', 'password123') == 'Username and password must be provided.'\", \"assert create_superuser('admin', '') == 'Username and password must be provided.'\...
{ "split": "train", "index": 81174, "acecode_id": "oss_24269", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function `edit_distance(str1: str, str2: str) -> int` that calculates the edit distance between two given words `str1` and `str2`. The edit distance is defined as the minimum number of operations required to convert one word into the other, where an operation is def...
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('abc', 'abc') == 0\", \"assert edit_distance('abc', 'def') == 3\", \"assert edit_distanc...
{ "split": "train", "index": 81175, "acecode_id": "evol_30907", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings where each string may have leading and trailing whitespace. Write a function `strip_whitespace(strings: List[str]) -> List[str]` that removes the whitespace from the beginning and end of each string in the list. The function should return a new l...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert strip_whitespace([' hello ', ' world ', ' python ']) == ['hello', 'world', 'python']\", \"assert strip_whitespace([' leading space', 'trailing space ', ' both ']) == ['leading space', 'trailing space', 'both']\", \"assert strip_whitespace(['no spaces'...
{ "split": "train", "index": 81176, "acecode_id": "bigcode_python_fns_27313", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given two lists of integers A and B, compute the maximum distance between the elements of A and the elements of B, where the distance is defined as the absolute difference between an element from A and an element from B. If either list is empty, return 0. Implement a function `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_distance([1, 2, 3], [4, 5, 6]) == 5\", \"assert max_distance([10, 20, 30], [1, 2, 3]) == 29\", \"assert max_distance([1], [1]) == 0\", \"assert max_distance([], [1, 2, 3]) == 0\", \"assert max_distance([1, 2, 3], []) == 0\", \"assert max_distance([-1, 0,...
{ "split": "train", "index": 81177, "acecode_id": "bigcode_python_fns_30465", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a recursive function that takes a list of numbers and returns the smallest integer value within that list. If the list is empty or contains no integers, return the message 'empty list or no integers'.\nPlease reason step by step, then write a self-contained Python sol...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_min([500, 20, 8, 1000, 1024]) == 8\", \"assert find_min([]) == 'empty list or no integers'\", \"assert find_min(['a', 'b', 'c']) == 'empty list or no integers'\", \"assert find_min([3.5, 2.7, 1.2]) == 'empty list or no integers'\", \"assert find_min([10...
{ "split": "train", "index": 81178, "acecode_id": "evol_10228", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries where each dictionary contains data for a university, including the keys 'country', 'faculty', 'students', and 'graduates', write a function that calculates the ratio of graduates to students for each university, rounds it to two decimal points, and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert parse_university_data([{'country': 'United States', 'faculty': 'faculty of engineering', 'students': 15000, 'graduates': 1200}]) == [{'country': 'United States', 'faculty': 'faculty of engineering', 'students': 15000, 'graduates': 1200, 'ratio': 0.08, 'rank'...
{ "split": "train", "index": 81179, "acecode_id": "evol_17460", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string as input and returns its reverse. The reversal should work correctly for all types of characters, including letters, digits, and special characters. Write a function named `reverse_string` that accepts a single parameter, `input_string`,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_string('123abc!@#') == '#@!cba321'\", \"assert reverse_string('hello') == 'olleh'\", \"assert reverse_string('') == ''\", \"assert reverse_string('12345') == '54321'\", \"assert reverse_string('!@#$%^&*()') == ')(*&^%$#@!'\", \"assert reverse_string(...
{ "split": "train", "index": 81180, "acecode_id": "evol_23815", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with processing a list of syslog lines. Each syslog line is a string that ends with a newline character ('\\n'). Your goal is to create a function that takes a list of syslog lines and an event level (a string) as inputs. The function should return a list of proc...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_syslog_lines(['Error occurred\\\\n', 'Warning issued\\\\n', 'Info logged\\\\n'], 'ERROR') == ['Error occurred ERROR', 'Warning issued ERROR', 'Info logged ERROR']\", \"assert process_syslog_lines(['Valid log line\\\\n', 'Another valid line\\\\n'], 'I...
{ "split": "train", "index": 81181, "acecode_id": "bigcode_python_fns_14632", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a function that accepts an alphanumeric string as input and returns a tuple containing the sum of all the individual digits present in the string, the largest digit, and the smallest digit. The function should handle cases where the input is not a string, where the string...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_digits('a1b2c3d4e5') == (15, 5, 1)\", \"assert sum_digits('xyz') == 'No digits found in the string.'\", \"assert sum_digits('12345') == (15, 5, 1)\", \"assert sum_digits('abc') == 'No digits found in the string.'\", \"assert sum_digits('9876543210') == (...
{ "split": "train", "index": 81182, "acecode_id": "evol_27421", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that counts the characters in a given string that have vowels as their neighbors (immediate left and right). The function should return a dictionary with each of these characters as keys (in lowercase) and their respective counts as values. Vowels are defined a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert vowel_neighbor_counter('hello') == {}\", \"assert vowel_neighbor_counter('a') == {}\", \"assert vowel_neighbor_counter('aXe') == {'x': 1}\", \"assert vowel_neighbor_counter('x') == {}\", \"assert vowel_neighbor_counter('E') == {}\", \"assert vowel_neighbor_c...
{ "split": "train", "index": 81183, "acecode_id": "evol_19469", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that updates hyperparameters for a machine learning model. The function should take a dictionary of hyperparameters and update the internal state of a hyperparameter manager. The hyperparameters to be managed are 'batch_size', 'num_ep...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_hyperparameters({'batch_size': 32}) == {'batch_size': 32, 'num_epochs': None, 'epoch_to_generate': None, 'hidden_size': None, 'lr': None}\", \"assert update_hyperparameters({'num_epochs': 10}) == {'batch_size': None, 'num_epochs': 10, 'epoch_to_genera...
{ "split": "train", "index": 81184, "acecode_id": "oss_30374", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing the insertion sort algorithm, which sorts an array of integers in ascending order. Your function should take an array `arr` as input and print the intermediate steps of the sorting process after each insertion operation. The printed output shoul...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert print_insertion_sort([5, 2, 4, 6, 1, 3]) == None\", \"assert print_insertion_sort([1]) == None\", \"assert print_insertion_sort([3, 2, 1]) == None\", \"assert print_insertion_sort([4, 3, 2, 1]) == None\", \"assert print_insertion_sort([1, 2, 3, 4]) == None\"...
{ "split": "train", "index": 81185, "acecode_id": "oss_36919", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with monitoring a series of lines of text as they are received from a data source. Your goal is to implement a function `monitor_data(lines: List[str]) -> List[str]` that takes a list of strings `lines` and returns a list of strings formatted as 'timestamp,line'....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert monitor_data([]) == []\", \"assert monitor_data(['data1']) == ['0,data1']\", \"assert monitor_data(['data1', 'data2']) == ['0,data1', '1,data2']\", \"assert monitor_data(['data1', 'data2', 'data3']) == ['0,data1', '1,data2', '2,data3']\", \"assert monitor_da...
{ "split": "train", "index": 81186, "acecode_id": "bigcode_python_fns_12732", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `is_alphanumeric` that takes a string input and returns `True` if the string consists solely of alphanumeric characters (letters and numbers) and is not empty. Otherwise, it should return `False`. Alphanumeric characters include the letters A-Z, a-z, and th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_alphanumeric('Sample123') == True\", \"assert is_alphanumeric('') == False\", \"assert is_alphanumeric('HelloWorld') == True\", \"assert is_alphanumeric('12345') == True\", \"assert is_alphanumeric('Sample 123') == False\", \"assert is_alphanumeric('Sampl...
{ "split": "train", "index": 81187, "acecode_id": "evol_25123", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the heights of a group of people. Your task is to write a function that calculates the average height of the group. The average height should be returned as a float rounded to two decimal places. If the list is empty, return 0.00. I...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_height([160, 170, 180]) == 170.00\", \"assert average_height([150, 160, 170, 180]) == 165.00\", \"assert average_height([175]) == 175.00\", \"assert average_height([]) == 0.00\", \"assert average_height([200, 210, 220, 230, 240]) == 220.00\", \"asser...
{ "split": "train", "index": 81188, "acecode_id": "bigcode_python_fns_34260", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two 3D lists (or matrices) representing an image and a label map. The first list, `img`, is a 3D list where each element is a list of lists (representing the pixel values of the image), and the second list, `label`, is a 3D list of the same dimensions where each e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert transform_image_label([[[1, 2], [3, 4]]], [[[1, 0], [0, 1]]]) == ([[[1, 2], [3, 4]]], [[[1, 0], [0, 1]]])\", \"assert transform_image_label([[[1, 2], [3, 4]], [[5, 6], [7, 8]]], [[[1, 0], [0, 1]], [[1, 1], [0, 0]]]) == ([[[1, 2], [3, 4]], [[5, 6], [7, 8]]], ...
{ "split": "train", "index": 81189, "acecode_id": "bigcode_python_fns_16554", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are given a string representing a language code (e.g., 'en', 'fr-ca', 'es'). Your task is to implement a function `get_language_variant(lang_code: str) -> str` that returns the most supported language variant based on the following rules: \n1. If the provided language code ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_language_variant('en') == 'en'\", \"assert get_language_variant('fr-ca') == 'fr-ca'\", \"assert get_language_variant('fr') == 'fr'\", \"assert get_language_variant('es') == 'es'\", \"assert get_language_variant('es-mx') == 'es-mx'\", \"assert get_languag...
{ "split": "train", "index": 81190, "acecode_id": "bigcode_python_fns_5238", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines the playback time range based on certain input parameters. The function should take the following parameters: \n\n1. highlighted (bool): If set to True, the function should return a specific range of playback time that is ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_time_slider_range(True, False, False) == [1.0, 10.0]\", \"assert get_time_slider_range(True, True, True) == [1.0, 9.0]\", \"assert get_time_slider_range(False, False, False) == [1.0, 10.0]\", \"assert get_time_slider_range(True, True, True) == [1.0, 9.0]...
{ "split": "train", "index": 81191, "acecode_id": "bigcode_python_fns_11711", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a PowerShell script based on the provided SQL instance source, username, and password. The function should follow these rules: 1. The script should start with a message indicating the failure to read an additional mo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_powershell_script('C:\\\\Program Files\\\\SQL', 'admin', 'pass123') == 'helpers.color(\\\"[!] Could not read additional module source path at: C:\\\\Program Files\\\\SQL\\\") Get-SQLInstanceDomain -Username admin -Password pass123 | Get-SQLServerInf...
{ "split": "train", "index": 81192, "acecode_id": "oss_12427", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a minimal subject represented by a dictionary with the following keys: 'name', 'type', and 'values', implement a function that constructs a new subject object based on the provided parameters. The function should accept the following parameters: \n1. `minimal_subject` (di...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert minimal_subject_transformer({'name': 'Subject1', 'type': 'TypeA', 'values': [None, 'Value1', 'Value2']}, {'TypeA': {'minimal_attribute_names': ['Value1', 'Value2']}}, (10, 20), 5) == {'name': 'Subject1', 'type': 'TypeA', 'values': [None, 'Value1', 'Value2']}...
{ "split": "train", "index": 81193, "acecode_id": "bigcode_python_fns_35765", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given a list of integers representing the heights of bars in a histogram, write a function that calculates the maximum rectangular area that can be formed by the bars. The function should take a list of integers as input, where each integer represents the height of a bar, and r...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_histogram_area([2, 1, 5, 6, 2, 3]) == 10\", \"assert max_histogram_area([1, 1, 1, 1]) == 4\", \"assert max_histogram_area([4, 2, 0, 3, 2, 5]) == 6\", \"assert max_histogram_area([1]) == 1\", \"assert max_histogram_area([]) == 0\", \"assert max_histogram_...
{ "split": "train", "index": 81194, "acecode_id": "bigcode_python_fns_31891", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of integers, implement a function that returns a new list containing only the unique elements from the input list, sorted in ascending order. You need to define a function `unique_sorted(input_list: List[int]) -> List[int]` where `input_list` is a list of integers....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert unique_sorted([3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]) == [1, 2, 3, 4, 5, 6, 9]\", \"assert unique_sorted([10, 10, 10]) == [10]\", \"assert unique_sorted([]) == []\", \"assert unique_sorted([1, 2, 3]) == [1, 2, 3]\", \"assert unique_sorted([5, 4, 3, 2, 1]) == [1, ...
{ "split": "train", "index": 81195, "acecode_id": "oss_24029", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `list_primes(n)` that returns a list of all prime numbers between 1 and a given number `n` (inclusive). A prime number is defined as a natural number greater than 1 that cannot be formed by multiplying two smaller natural numbers. The function should return...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_primes(1) == []\", \"assert list_primes(2) == [2]\", \"assert list_primes(3) == [2, 3]\", \"assert list_primes(4) == [2, 3]\", \"assert list_primes(5) == [2, 3, 5]\", \"assert list_primes(10) == [2, 3, 5, 7]\", \"assert list_primes(11) == [2, 3, 5, 7, 1...
{ "split": "train", "index": 81196, "acecode_id": "evol_18588", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function called `find_middle_element` that takes a list of integers as an argument and returns the middlemost integer. If the list has an even number of elements, return the lower of the two middle values. The input list will always contain at least one integer.\nPl...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_middle_element([3, 6, 9, 11, 15]) == 9\", \"assert find_middle_element([1, 2, 3]) == 2\", \"assert find_middle_element([10, 20, 30, 40]) == 20\", \"assert find_middle_element([5]) == 5\", \"assert find_middle_element([7, 8, 9, 10, 11, 12]) == 9\", \"ass...
{ "split": "train", "index": 81197, "acecode_id": "evol_21864", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that takes a dictionary representing a ticket and retrieves its 'me' URL and 'scope'. The function should return a new dictionary that includes the 'me' URL, the list of scopes (as a list of strings), and a boolean indicating whether ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert process_ticket({'me': 'http://example.com', 'scope': 'ticket read write'}) == {'me': 'http://example.com', 'scopes': ['read', 'write'], 'has_ticket': True}\", \"assert process_ticket({'me': 'http://example.com', 'scope': 'ticket'}) == {'me': 'http://example....
{ "split": "train", "index": 81198, "acecode_id": "bigcode_python_fns_13834", "num_tests": 12 }
acecode
[ { "role": "user", "content": "Given a list of lists (2D array) where each inner list represents a block of data, and two integers `bn` and `skip`, your task is to merge these blocks into a single list of blocks. Each merged block should contain `bn` number of rows, while the number of columns should remain ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert merge_blocks([[1, 2, 3]], 1, 0) == [[1, 2, 3]]\", \"assert merge_blocks([[1, 2, 3], [4, 5, 6]], 4, 0) == []\", \"assert merge_blocks([[1]], 1, 0) == [[1]]\", \"assert merge_blocks([[1, 2, 3], [4, 5, 6]], 1, 2) == [[3], [6]]\", \"assert merge_blocks([[1, 2, 3...
{ "split": "train", "index": 81199, "acecode_id": "bigcode_python_fns_27533", "num_tests": 5 }