data_source
large_stringclasses
1 value
prompt
listlengths
1
1
ability
large_stringclasses
1 value
reward_model
dict
extra_info
dict
acecode
[ { "role": "user", "content": "You are given a list of integers representing example indices. Your task is to write a function that takes this list as input and returns the sum of all the integers in the list. Each integer represents an example ID, and you should ignore any negative integers when calculating...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sum_example_indices([1, 2, 3, 4, 5]) == 15\", \"assert sum_example_indices([1, -1, 2, -2, 3]) == 6\", \"assert sum_example_indices([-1, -2, -3]) == 0\", \"assert sum_example_indices([0, 0, 0]) == 0\", \"assert sum_example_indices([10, 20, 30]) == 60\", \"ass...
{ "split": "train", "index": 4200, "acecode_id": "bigcode_python_fns_45185", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with determining if all questions in a given questionnaire group are not applicable based on the responses provided. Implement a function `is_all_questions_not_applicable(question_group: List[str], responses: List[str]) -> bool` that takes two lists of strings as...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_all_questions_not_applicable(['Question 1', 'Question 2', 'Question 3'], ['N/A', 'N/A', 'N/A']) == True\", \"assert is_all_questions_not_applicable(['Question 1'], ['N/A']) == True\", \"assert is_all_questions_not_applicable(['Question 1'], ['Yes']) == Fa...
{ "split": "train", "index": 4201, "acecode_id": "bigcode_python_fns_35475", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of book records where each book record contains an ISBN, title, and author, write a function `find_duplicate_titles` that returns a list of titles that are associated with more than one unique ISBN. The input is a list of tuples where each tuple consists of (isbn: ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_duplicate_titles([(123, 'Python Basics', 'Author A'), (456, 'Python Basics', 'Author B'), (789, 'Data Structures', 'Author C'), (101, 'Algorithms', 'Author D'), (102, 'Python Basics', 'Author E')]) == ['Python Basics']\", \"assert find_duplicate_titles(...
{ "split": "train", "index": 4202, "acecode_id": "bigcode_python_fns_22698", "num_tests": 13 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes in a notification request for a mobile application and sets up push notifications for a specified platform (iOS or Android). The function should validate whether the request contains the necessary parameters for the setup. The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert setup_push_notification({'platform': 'iOS', 'device_token': '123456', 'message': 'Hello World'}) == 'Success: Push notification setup for iOS.'\", \"assert setup_push_notification({'platform': 'Android', 'device_token': 'abcdef', 'message': 'Hello World'}) =...
{ "split": "train", "index": 4203, "acecode_id": "bigcode_python_fns_18878", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function `calculate_determinant(matrix)` that takes a 2D list (matrix) as input and returns the determinant of the matrix. The matrix will be a square matrix (number of rows equals number of columns) containing numerical values. You may assume that the input matrix ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_determinant([[1, 2], [3, 4]]) == -2\", \"assert calculate_determinant([[5]]) == 5\", \"assert calculate_determinant([[1, 0], [0, 1]]) == 1\", \"assert calculate_determinant([[2, 3], [5, 7]]) == -1\", \"assert calculate_determinant([[4, 6], [3, 8]])...
{ "split": "train", "index": 4204, "acecode_id": "evol_34327", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates bitwise operations on a set of flags represented as integers. Each flag can be thought of as a specific bit in an integer, where a bit value of 1 indicates that the flag is set, and a bit value of 0 indicates that it is...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert update_flags(5, [('set', 1), ('unset', 0), ('toggle', 2)]) == 2\", \"assert update_flags(0, [('set', 0), ('toggle', 0)]) == 0\", \"assert update_flags(1, [('toggle', 0)]) == 0\", \"assert update_flags(2, [('toggle', 1)]) == 0\", \"assert update_flags(3, [('u...
{ "split": "train", "index": 4205, "acecode_id": "oss_19071", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a list of integers and returns a new list containing only the even numbers from the original list. The function should maintain the order of the original numbers. Write a Python function `filter_even_numbers` that ta...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 15, 20, 25]) == [10, 20]\", \"assert filter_even_numbers([1, 3, 5, 7]) == []\", \"assert filter_even_numbers([0, 2, 4, 6]) == [0, 2, 4, 6]\", \"assert filter_even_numbers([2,...
{ "split": "train", "index": 4206, "acecode_id": "oss_36732", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string of text, write a function `word_count(text)` that extracts and counts the occurrences of unique words in the text. The function should ignore punctuation marks and treat words in a case-insensitive manner. Additionally, it should exclude common English stop words...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert word_count('The quick brown fox jumps over the lazy dog.') == {'quick': 1, 'brown': 1, 'fox': 1, 'jumps': 1, 'over': 1, 'lazy': 1, 'dog': 1}\", \"assert word_count('To be, or not to be, that is the question.') == {'be': 2, 'not': 1, 'that': 1, 'question': 1}...
{ "split": "train", "index": 4207, "acecode_id": "oss_33394", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Create a function find_unique_maximums that accepts three lists of integers x, y, and z as parameters. The function should return a new list containing only the unique maximum integer(s) from each provided list. If a list is empty, consider the maximum of that list to be 0. Not...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_unique_maximums([], [], []) == [0]\", \"assert find_unique_maximums([10, 10, 10], [20, 20], [30]) == [10, 20, 30]\", \"assert find_unique_maximums([100, 200], [200, 300], [300, 400]) == [200, 300, 400]\", \"assert find_unique_maximums([1], [1], [1]) == ...
{ "split": "train", "index": 4208, "acecode_id": "evol_28131", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a list of integers, write a function `convert_shape` that takes an integer list and returns a new list containing the shape of the given list. The shape of a list is defined as a tuple representing the dimensions of the list. For example, if the input list has 3 elements,...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_shape([1, 2, 3]) == (3,)\", \"assert convert_shape([]) == (0,)\", \"assert convert_shape([[1, 2], [3, 4, 5]]) == (2, 3)\", \"assert convert_shape([[1], [2], [3]]) == (3, 1)\", \"assert convert_shape([[1, 2, 3], [4, 5]]) == (2, 3)\", \"assert convert_...
{ "split": "train", "index": 4209, "acecode_id": "bigcode_python_fns_15444", "num_tests": 12 }
acecode
[ { "role": "user", "content": "You are tasked with checking if a given string contains the substring ' !!!'. Write a function named `contains_exclamation` that takes a single string argument and returns True if the substring ' !!!' is present in the string; otherwise, return False. \n\n### Input\n- A single ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert contains_exclamation('Hello World !!!') == True\", \"assert contains_exclamation('This is a test') == False\", \"assert contains_exclamation('Check this out !!! now') == True\", \"assert contains_exclamation('No exclamation here') == False\", \"assert contai...
{ "split": "train", "index": 4210, "acecode_id": "bigcode_python_fns_11149", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array `arr` consisting of only zeros and ones. Your task is to determine if it is possible to divide the array into three non-empty contiguous parts such that all of these parts represent the same binary value. If possible, return a list containing two integers...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert threeEqualParts([1,1,0,1,1]) == [-1, -1]\", \"assert threeEqualParts([1,0,1,0,0,1]) == [-1, -1]\", \"assert threeEqualParts([1,0,0,1,0,0,1,0]) == [-1, -1]\", \"assert threeEqualParts([1,1,0,0,1,0,0]) == [-1, -1]\", \"assert threeEqualParts([1,0,1,1,0]) == [-...
{ "split": "train", "index": 4211, "acecode_id": "evol_9312", "num_tests": 8 }
acecode
[ { "role": "user", "content": "Given a list of hexadecimal strings, implement a function that converts each valid hexadecimal number to its binary equivalent. If a hexadecimal string is invalid, it should be skipped, and an error message should be returned indicating the invalid input. The function should re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert hex_to_bin(['3F', '4A', 'G5']) == (['111111', '1001010'], ['Error: Invalid hexadecimal number G5'])\", \"assert hex_to_bin(['0', '1', '2', '3']) == (['0', '1', '10', '11'], [])\", \"assert hex_to_bin(['FF', '00', '1A', 'ZZ']) == (['11111111', '0', '11010'], ...
{ "split": "train", "index": 4212, "acecode_id": "evol_12331", "num_tests": 15 }
acecode
[ { "role": "user", "content": "Write a function `count_characters(s: str) -> dict` that takes a string `s` as input and returns a dictionary containing the frequency of each alphabetic character in the string. The keys of the dictionary should be lowercase letters, and the values should be the count of each ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_characters(\\\"Hello, World!\\\") == {'h': 1, 'e': 1, 'l': 3, 'o': 2, 'w': 1, 'r': 1, 'd': 1}\", \"assert count_characters(\\\"Programming\\\") == {'p': 1, 'r': 2, 'o': 1, 'g': 2, 'a': 1, 'm': 2, 'i': 1, 'n': 1}\", \"assert count_characters(\\\"aabbcc\...
{ "split": "train", "index": 4213, "acecode_id": "oss_7989", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a command generator for a software build system. The build system needs to compile a specified source file into an executable named 'fastrouter', and should allow for the inclusion of additional C flags, linker flags, and libraries. Implement a func...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert build_executable('fastrouter.c', ['-O3', '-Wall'], ['-L/usr/local/lib'], ['-lm']) == 'gcc -o fastrouter fastrouter.c -O3 -Wall -L/usr/local/lib -lm'\", \"assert build_executable('main.c', [], [], []) == 'gcc -o fastrouter main.c'\", \"assert build_executable...
{ "split": "train", "index": 4214, "acecode_id": "oss_2886", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary that may contain additional keys. Implement a function `validate_data_empty(_dict_: dict, strict: bool, suppress_warning: bool) -> None` that checks if the dictionary is empty. If the dictionary is not empty and `strict` is set to True, the function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert validate_data_empty({}, False, False) is None\", \"assert validate_data_empty({}, True, False) is None\", \"assert validate_data_empty({}, False, True) is None\", \"assert validate_data_empty({}, True, True) is None\", \"assert validate_data_empty({}, False,...
{ "split": "train", "index": 4215, "acecode_id": "bigcode_python_fns_39618", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are given a tuple `row` containing data elements. Your task is to write a function `simulate_database_operation(row)` that simulates a database operation based on specific elements of the tuple. The function should extract the elements at indices 2, 3, 6, and 7 from the `ro...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert simulate_database_operation(('dummy', 'data', 'A', 'B', 'ignored', 'ignored', 'C', 'D')) == False\", \"assert simulate_database_operation(('dummy', 'data', 'E', 'F', 'ignored', 'ignored', 'G', 'H')) == False\", \"assert simulate_database_operation(('dummy', ...
{ "split": "train", "index": 4216, "acecode_id": "oss_9936", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes a string as input and returns a dictionary where each key is a unique character from the string and its value is the number of times that character appears in the string. For example, for the input 'hello', the output should be {'h': 1, 'e': 1, '...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert char_count_dict('hello') == {'h': 1, 'e': 1, 'l': 2, 'o': 1}\", \"assert char_count_dict('abc') == {'a': 1, 'b': 1, 'c': 1}\", \"assert char_count_dict('aabbcc') == {'a': 2, 'b': 2, 'c': 2}\", \"assert char_count_dict('') == {}\", \"assert char_count_dict('A...
{ "split": "train", "index": 4217, "acecode_id": "evol_19860", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the scores of a group of students. Your task is to calculate the average score of the students, rounded to the nearest integer. If the average score is exactly halfway between two integers, round up to the larger integer. Write a fu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert average_score([90, 80, 70]) == 80\", \"assert average_score([100, 90, 80, 70]) == 85\", \"assert average_score([50, 50, 50, 50]) == 50\", \"assert average_score([1, 2, 3, 4, 5]) == 3\", \"assert average_score([10, 20, 30]) == 20\", \"assert average_score([5,...
{ "split": "train", "index": 4218, "acecode_id": "bigcode_python_fns_6662", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a list of dictionaries representing doorbells with their attributes, write a function that returns the count of doorbells that have 'motion_enabled' feature set to True. Each dictionary has the following structure: {'id': int, 'description': str, 'features': {'motions_ena...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_doorbells_with_motion_enabled([]) == 0\", \"assert count_doorbells_with_motion_enabled([{'id': 1, 'description': 'Front Door', 'features': {'motions_enabled': True}}]) == 1\", \"assert count_doorbells_with_motion_enabled([{'id': 1, 'description': 'Fron...
{ "split": "train", "index": 4219, "acecode_id": "bigcode_python_fns_7425", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function that identifies the locations of all consonants in a provided string. The function should handle various edge cases such as multiple spaces between words, punctuation marks, and numbers. The function should return a list of indices where consonants are found in...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert consonant_locations('12345') == []\", \"assert consonant_locations('') == []\", \"assert consonant_locations('Caf\\u00e9') == [0, 2]\", \"assert consonant_locations('!@#$%^&*()') == []\", \"assert consonant_locations('x') == [0]\"]}" }
{ "split": "train", "index": 4220, "acecode_id": "evol_20269", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates a list of all available Google API scopes for a given service. Google API scopes are strings that define the level of access and permissions that an application has when interacting with a specific Google API. You ne...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_google_api_scopes('gmail') == ['https://www.googleapis.com/auth/gmail.compose', 'https://www.googleapis.com/auth/gmail.readonly', 'https://www.googleapis.com/auth/gmail.send']\", \"assert generate_google_api_scopes('calendar') == ['https://www.googl...
{ "split": "train", "index": 4221, "acecode_id": "oss_36515", "num_tests": 13 }
acecode
[ { "role": "user", "content": "Implement a function `find_in_circular_linked_list(circular_list: List[Any], key: Any) -> bool` that searches for a specific element `key` in a circular singly linked list represented by a list `circular_list`. The list may contain mixed data types. The function should return `...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_in_circular_linked_list([], 1) == False\", \"assert find_in_circular_linked_list(['a', 'b', 'c'], 'b') == True\", \"assert find_in_circular_linked_list([1, 2, 3, 4], 5) == False\", \"assert find_in_circular_linked_list(['x', 10, 20.5, None], None) == Tr...
{ "split": "train", "index": 4222, "acecode_id": "evol_2327", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes financial data and calculates certain key metrics based on a given dictionary. The function should take a dictionary `a` as input, containing financial data with specific keys: 'fifty_two_week_high', 'price_earnings_...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_metrics({'fifty_two_week_high': '105.5', 'price_earnings_ratio': '20.5', 'C': '150', 'P': '100'}) == {'H52': 106, 'PE': 20.5, 'Cp': 150}\", \"assert calculate_metrics({'fifty_two_week_high': 'abc', 'price_earnings_ratio': '20.5', 'C': '150', 'P': '...
{ "split": "train", "index": 4223, "acecode_id": "oss_12143", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Implement a function `manage_students` that takes a list of operations to perform on a student hash table. The operations include inserting a student, deleting a student, and looking up a student by their ID. Each operation is represented as a tuple where the first element is a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert manage_students([('insert', '001', {'name': 'Alice', 'class': '10', 'grade': 'A'}), ('lookup', '001')]) == [{'name': 'Alice', 'class': '10', 'grade': 'A'}]\", \"assert manage_students([('insert', '002', {'name': 'Bob', 'class': '11', 'grade': 'B'}), ('insert...
{ "split": "train", "index": 4224, "acecode_id": "evol_13438", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Given a numerical array, implement a function `calculate_skewness(data)` that computes the skewness of the array without using any external libraries. Skewness is a measure of the asymmetry of the probability distribution of a real-valued random variable. The function should re...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_skewness([1, 2, 3]) == 0.0\", \"assert calculate_skewness([1, 2, 2, 3]) == 0.0\", \"assert calculate_skewness([1, 2, 3, 4, 5]) == 0.0\", \"assert calculate_skewness([1, 2, 3, 4, 5, 6]) == 0.0\", \"assert calculate_skewness([]) == None\", \"assert c...
{ "split": "train", "index": 4225, "acecode_id": "evol_5193", "num_tests": 9 }
acecode
[ { "role": "user", "content": "You are given a string representing the filename of a solver state file. Your task is to extract the name of the learned network model from this filename. The filename follows a specific format: it includes a prefix 'solver_' followed by a numeric identifier and ends with the e...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_learned_network_model('solver_1234.solverstate') == '1234'\", \"assert get_learned_network_model('solver_5678.solverstate') == '5678'\", \"assert get_learned_network_model('solver_1.solverstate') == '1'\", \"assert get_learned_network_model('solver_9999....
{ "split": "train", "index": 4226, "acecode_id": "bigcode_python_fns_25944", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary `versions` that contains version information for different packages. Each key of the dictionary is a package name (a string), and its value is another dictionary containing two keys: 'google_code' and 'pypi', both of which hold the current version of ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert verify_versions({'packageA': {'google_code': '1.0.0', 'pypi': '1.0.0'}}, {'name': 'packageA', 'version': '1.0.0'}) == ['packageA: google_code version is up-to-date, pypi version is up-to-date']\", \"assert verify_versions({'packageB': {'google_code': '2.0.0'...
{ "split": "train", "index": 4227, "acecode_id": "bigcode_python_fns_21139", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that lists all the names of objects in a collection that match a specified name pattern. The function should take a list of object names and a name pattern string as input, and return a list of names that match the pattern. The patter...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert list_matching_names(['transformA', 'transformB', 'shapeC'], 'transform*') == ['transformA', 'transformB']\", \"assert list_matching_names(['transformA', 'shapeB', 'shapeC'], 'shape*') == ['shapeB', 'shapeC']\", \"assert list_matching_names(['object1', 'objec...
{ "split": "train", "index": 4228, "acecode_id": "bigcode_python_fns_13593", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with defining a constant for the color green. Implement a function that returns the RGB value for the color green. The RGB value should be represented as a tuple of three integers, where the first integer represents the red channel, the second integer represents ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_green_color() == (0, 255, 0)\", \"assert get_green_color() == (0, 255, 0)\", \"assert get_green_color() == (0, 255, 0)\", \"assert get_green_color() == (0, 255, 0)\", \"assert get_green_color() == (0, 255, 0)\", \"assert get_green_color() == (0, 255, 0)\...
{ "split": "train", "index": 4229, "acecode_id": "bigcode_python_fns_22665", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that initializes a data structure to store configuration settings for a given application. The function should take a single parameter, `config`, which is a dictionary containing various configuration settings. Your goal is to set up a da...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert setup_application({'setting1': 'value1', 'setting2': 'value2'}) == True\", \"assert setup_application({'feature_enabled': True, 'max_users': 100}) == True\", \"assert setup_application({'version': '1.0', 'debug_mode': False}) == True\", \"assert setup_applic...
{ "split": "train", "index": 4230, "acecode_id": "bigcode_python_fns_24361", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are working on a project that involves mapping device codes to their friendly names. You are given a dictionary that maps alphanumeric device codes as keys to their friendly names as values. Your task is to write a Python function that takes a device code as input and retur...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_friendly_name('GM1913') == 'Oneplus 7 Pro'\", \"assert get_friendly_name('FC3170') == 'Mavic Air 2'\", \"assert get_friendly_name('G1000') == 'Unknown Device'\", \"assert get_friendly_name('A12345') == 'Unknown Device'\", \"assert get_friendly_name('ZZZZ...
{ "split": "train", "index": 4231, "acecode_id": "oss_15763", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a block of code. Your task is to write a function that formats this code block into a string output that includes the code itself, an optional title, and an optional caption. The output format should be as follows: If a title is provided, it ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_code_block('print(\\\"Hello World\\\")', 'Greeting Code', 'This prints Hello World') == 'Greeting Code\\\\nprint(\\\"Hello World\\\")\\\\nThis prints Hello World'\", \"assert format_code_block('a = 5\\\\nb = 10\\\\nc = a + b', 'Simple Addition', None)...
{ "split": "train", "index": 4232, "acecode_id": "bigcode_python_fns_16805", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of API keys represented as strings. Your task is to implement a function that takes this list of API keys and returns a new list containing only the keys that are valid. A valid API key consists of exactly 3 digits followed by a hyphen and then 3 uppercase ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_valid_api_keys(['123-ABC', '456-DEF', '12A-BCD', '12345-ABC']) == ['123-ABC', '456-DEF']\", \"assert filter_valid_api_keys(['000-AAA', '111-BBB', '222-CCC']) == ['000-AAA', '111-BBB', '222-CCC']\", \"assert filter_valid_api_keys(['123-ABC', '123-AB', ...
{ "split": "train", "index": 4233, "acecode_id": "bigcode_python_fns_43604", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a matrix represented as a 2D list of integers and a threshold value, write a function `get_nonzero_percentage(matrix: List[List[int]], threshold: int) -> float` that calculates the percentage of non-zero elements in the matrix that are greater than the given threshold. Th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_nonzero_percentage([[1, 2], [3, 4]], 0) == 100.0\", \"assert get_nonzero_percentage([[0, 0], [0, 0]], 0) == 0.0\", \"assert get_nonzero_percentage([[0, 0, 0], [0, 0, 0]], 1) == 0.0\", \"assert get_nonzero_percentage([[1, 1, 1], [1, 1, 1]], 0) == 100.0\",...
{ "split": "train", "index": 4234, "acecode_id": "bigcode_python_fns_45647", "num_tests": 8 }
acecode
[ { "role": "user", "content": "You are given a list `nk` containing three positive integers. Your task is to write a function `calculate_combinations(nk)` that calculates the number of combinations possible for a given set of items. The first integer `n` represents the total number of items, and the second i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_combinations([5, 3, 1]) == 10\", \"assert calculate_combinations([4, 2, 0]) == 6\", \"assert calculate_combinations([6, 3, 0]) == 20\", \"assert calculate_combinations([10, 5, 0]) == 252\", \"assert calculate_combinations([7, 0, 1]) == 1\", \"asser...
{ "split": "train", "index": 4235, "acecode_id": "oss_6203", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that performs Gumbel-Softmax sampling. The function should take in an array of log-probabilities and a temperature parameter, and return an array of samples drawn from the Gumbel-Softmax distribution. The Gumbel-Softmax distribution is defined as: \n\n y_i ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert gumbel_softmax([], 0.1) == []\", \"assert gumbel_softmax([0.1], 0.1) == [1.0]\", \"assert gumbel_softmax([0.0], 0.1) == [1.0]\", \"assert gumbel_softmax([-0.1], 0.1) == [1.0]\", \"assert gumbel_softmax([-100.0, 0.0, 100.0], 0.1) == [0.0000, 0.0000, 1.0000]\"...
{ "split": "train", "index": 4236, "acecode_id": "bigcode_python_fns_45458", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Implement a function `retrieve_patient_records(search_parameters: dict) -> List[dict]` that takes a dictionary of search parameters and returns a list of patient records matching those parameters from a simulated patient database. Each patient record is represented as a diction...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert retrieve_patient_records({'disease': 'Diabetes'}) == [{'id': 1, 'name': 'John Doe', 'age': 45, 'disease': 'Diabetes', 'medication': 'Metformin', 'history': 'No significant history'}]\", \"assert retrieve_patient_records({'medication': 'Aspirin'}) == [{'id': ...
{ "split": "train", "index": 4237, "acecode_id": "evol_13877", "num_tests": 7 }
acecode
[ { "role": "user", "content": "Consider two positive integers a and b that are called '2-friendly' if and only if gcd(a, b) = 2^t for some t > 0. Define a function count_2_friendly_pairs(n) that returns the count of pairs (p, q) of positive integers satisfying 1 ≤ p < q ≤ n and p and q are 2-friendly. For ex...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_2_friendly_pairs(1) == 0\", \"assert count_2_friendly_pairs(2) == 0\", \"assert count_2_friendly_pairs(3) == 0\", \"assert count_2_friendly_pairs(4) == 1\", \"assert count_2_friendly_pairs(5) == 1\", \"assert count_2_friendly_pairs(100) == 1031\"]}" }
{ "split": "train", "index": 4238, "acecode_id": "evol_19879", "num_tests": 6 }
acecode
[ { "role": "user", "content": "Develop a function that accepts two lists and returns a nested list of the indices of all elements from the second list that are found in the first list. If an element from the second list appears multiple times in the first list, include all indices. Implement the function wit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert find_indices([2, 9, 3, 1, 5, 7, 1, 7, 5], [1, 7, 5]) == [[3, 6], [5, 7], [4, 8]]\", \"assert find_indices([1, 2, 3, 4, 5], [6, 7]) == [[], []]\", \"assert find_indices([1, 2, 3, 2, 1], [1, 2]) == [[0, 4], [1, 3]]\", \"assert find_indices([], [1, 2]) == [[], ...
{ "split": "train", "index": 4239, "acecode_id": "evol_24952", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that takes a list of configuration dictionaries and returns a list of configuration names. Each configuration dictionary has the following keys: 'id', 'name', 'description', 'datastore_name', and 'datastore_version_name'. Your function sh...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_configuration_names([{'id': '1', 'name': 'ConfigA', 'description': 'First config', 'datastore_name': 'DB1', 'datastore_version_name': 'v1.0'}, {'id': '2', 'name': 'ConfigB', 'description': 'Second config', 'datastore_name': 'DB2', 'datastore_version_name...
{ "split": "train", "index": 4240, "acecode_id": "bigcode_python_fns_35364", "num_tests": 14 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that processes a list of traits and returns a dictionary containing the frequency of each trait in the list. Each trait is represented as a string. The function should ignore case sensitivity when counting the frequency of traits. Wri...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_traits(['brune', 'Blonde', 'brune', 'Blonde', 'Blonde']) == {'brune': 2, 'blonde': 3}\", \"assert count_traits(['BRUNE', 'blonde', 'Blonde', 'brune']) == {'brune': 2, 'blonde': 2}\", \"assert count_traits(['trait1', 'trait2', 'trait1', 'TRAIT2', 'Trait...
{ "split": "train", "index": 4241, "acecode_id": "oss_650", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string representing a host name or address. Write a function that determines if the given host is a local host. A local host is defined as either 'localhost' or '127.0.0.1'. The function should return True if the host is local and False otherwise. The function s...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_local_host('localhost') == True\", \"assert is_local_host('127.0.0.1') == True\", \"assert is_local_host('192.168.1.1') == False\", \"assert is_local_host('example.com') == False\", \"assert is_local_host('localhost.localdomain') == False\", \"assert is_l...
{ "split": "train", "index": 4242, "acecode_id": "bigcode_python_fns_32490", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to compute the 'firstX' set for a given non-terminal symbol in a context-free grammar. The 'firstX' set for a non-terminal symbol X is defined as the set of terminal symbols that appear as the first symbol in some string derivable fro...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert computeFirstXForNonTerminal('C', {'C': {'c'}}, {'productions': {'C': [['c']]}, 'terminals': ['c']}) == {'c'}\", \"assert computeFirstXForNonTerminal('D', {}, {'productions': {'D': [['epsilon']]}, 'terminals': []}) == {'epsilon'}\", \"assert computeFirstXForN...
{ "split": "train", "index": 4243, "acecode_id": "oss_20253", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that processes a string representing an HTML table of music track listings and extracts the names of the songs. The tracklist is represented as a table with rows and cells, where the song names are located in the second cell of eac...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_song_names('<table class=\\\"tracklist\\\"><tr><td>1</td><td>Song A</td></tr><tr><td>2</td><td>Song B</td></tr><tr><td>3</td><td>Song C</td></tr></table>') == ['Song A', 'Song B', 'Song C']\", \"assert extract_song_names('<table class=\\\"tracklist\\...
{ "split": "train", "index": 4244, "acecode_id": "oss_15410", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Write a Python function that takes a list of integers and returns a dictionary where the keys are the unique integers from the list and the values are their corresponding counts. The function should handle any exceptions that may arise during execution, such as non-integer inpu...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert count_numbers([1, 2, 2, 3, 3, 3]) == {1: 1, 2: 2, 3: 3}\", \"assert count_numbers([5, 5, 5, 5, 5]) == {5: 5}\", \"assert count_numbers([]) == {}\", \"assert count_numbers([0, 0, 1, 1, 2]) == {0: 2, 1: 2, 2: 1}\", \"assert count_numbers([-1, -1, -2, 2, 2]) ==...
{ "split": "train", "index": 4245, "acecode_id": "evol_13607", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of molecular weights represented as floats. Your task is to write a function that calculates the total molecular weight of the substances in the list after excluding specific weights represented by the values of salt and water. You should receive two other ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_weight([18.02, 58.44, 12.01], 58.44, 18.02) == 12.01\", \"assert calculate_total_weight([10.0, 20.0, 30.0], 5.0, 5.0) == 50.0\", \"assert calculate_total_weight([100.0, 200.0, 300.0], 100.0, 200.0) == 300.0\", \"assert calculate_total_weight(...
{ "split": "train", "index": 4246, "acecode_id": "bigcode_python_fns_14981", "num_tests": 11 }
acecode
[ { "role": "user", "content": "Given a list of numerical values, implement a function that returns a new list where each element represents the rank of the corresponding element in the input list, but inverted so that the highest number gets the lowest rank (1) and the lowest number gets the highest rank (N)...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert f([100, 50, 75]) == [1, 3, 2]\", \"assert f([1]) == [1]\", \"assert f([9, 8, 7, 6, 5]) == [1, 2, 3, 4, 5]\", \"assert f([1, 2, 3]) == [3, 2, 1]\", \"assert f([3, 1]) == [1, 2]\"]}" }
{ "split": "train", "index": 4247, "acecode_id": "evol_1030", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with building a function that simulates the generation of a shellcode payload for a cybersecurity tool. Implement a Python function `generate_payload` that takes the following parameters: \n- `msfpath`: A string representing the path to the Metasploit installatio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_payload('/usr/bin/', 'msfvenom', 'linux/x86/meterpreter/reverse_tcp', '192.168.1.1', 4444) == 'ruby /usr/bin/msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=192.168.1.1 LPORT=4444 EXITFUNC=thread -e x86/alpha_mixed -f raw BufferRegister=EAX'\", ...
{ "split": "train", "index": 4248, "acecode_id": "oss_18334", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the number of executors for a machine learning training job. Your task is to implement a function that takes this list and returns a string indicating the maximum number of executors used and the total number of executors across all...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_and_total_executors([2, 3, 5, 1]) == 'Max Executors: 5, Total Executors: 11'\", \"assert max_and_total_executors([0, 0, 0]) == 'Max Executors: 0, Total Executors: 0'\", \"assert max_and_total_executors([4, 4, 4, 4]) == 'Max Executors: 4, Total Executors:...
{ "split": "train", "index": 4249, "acecode_id": "bigcode_python_fns_34852", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of tuples representing rankings for a coding competition. Each tuple contains the following elements: (day, time, rank, user_id). The 'day' is an integer representing the day of the competition, 'time' is a string in the format 'HH:MM:SS' representing the t...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert get_rank_info(1, [(1, '12:00:00', 1, 1001), (1, '13:00:00', 2, 1002)]) == ('12:00:00', 1)\", \"assert get_rank_info(1, [(1, '12:30:00', 3, 1003), (2, '13:00:00', 2, 1002)]) == ('12:30:00', 3)\", \"assert get_rank_info(2, [(1, '12:00:00', 1, 1001), (2, '13:00...
{ "split": "train", "index": 4250, "acecode_id": "bigcode_python_fns_4216", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Create a function `multiplication_table(n)` that generates a multiplication table of size n by n. The function should return a list of lists, where each inner list represents a row of the multiplication table. Each element in the inner list should be the product of the correspo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert multiplication_table(1) == [[1]]\", \"assert multiplication_table(2) == [[1, 2], [2, 4]]\", \"assert multiplication_table(3) == [[1, 2, 3], [2, 4, 6], [3, 6, 9]]\", \"assert multiplication_table(4) == [[1, 2, 3, 4], [2, 4, 6, 8], [3, 6, 9, 12], [4, 8, 12, 16...
{ "split": "train", "index": 4251, "acecode_id": "evol_17834", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that calculates the total time taken for a process given its start time and end time in seconds. The function should take two integer inputs: 'start_time' and 'end_time', representing the time in seconds from the start of the day (00:00:0...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert calculate_total_time(3600, 7200) == 3600\", \"assert calculate_total_time(0, 0) == 0\", \"assert calculate_total_time(10000, 20000) == 10000\", \"assert calculate_total_time(500, 500) == 0\", \"assert calculate_total_time(30000, 30000) == 0\", \"assert calcu...
{ "split": "train", "index": 4252, "acecode_id": "bigcode_python_fns_13666", "num_tests": 14 }
acecode
[ { "role": "user", "content": "Given two arrays, determine if they contain the same elements in reverse order. The arrays may include different data types such as integers, strings, and nested arrays. Additionally, the arrays can have varying lengths. Implement a function that checks if the first array is th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert checkReverse([5, 8, 9, 'hello', [1, 2, 3]], [[1, 2, 3], 'hello', 9, 8, 5]) == True\", \"assert checkReverse([1, 2, 3], [3, 2, 1]) == True\", \"assert checkReverse(['a', 'b', 'c'], ['c', 'b', 'a']) == True\", \"assert checkReverse([1, 2, 3, [4, 5]], [[4, 5], ...
{ "split": "train", "index": 4253, "acecode_id": "evol_16575", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that encodes a request based on negotiation types and optional authentication information. Your function should take in three parameters: a list of negotiation types (strings), an optional authentication info string, and an optional publi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert encode_request(['type1', 'type2'], 'authString', 'pubKeyString') == 'Version: 2, NegoTokens: type1,type2, AuthInfo: authString, PubKeyAuth: pubKeyString'\", \"assert encode_request(['type1'], None, None) == 'Version: 2, NegoTokens: type1'\", \"assert encode_...
{ "split": "train", "index": 4254, "acecode_id": "bigcode_python_fns_18917", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that simulates the process of saving a thumbnail image received from a file upload. The function should take two parameters: a string representing the filename and a string representing the image data (in the form of a base64 string)....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert save_thumbnail('thumb1.jpg', 'data:image/jpeg;base64,...') == 'Thumbnail saved: thumb1.jpg'\", \"assert save_thumbnail('thumb2.png', 'data:image/png;base64,...') == 'Thumbnail saved: thumb2.png'\", \"assert save_thumbnail('thumb3.gif', 'data:image/gif;base64...
{ "split": "train", "index": 4255, "acecode_id": "bigcode_python_fns_46481", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a dictionary representing a scoring matrix for amino acids. Each key in the dictionary is a single-letter amino acid code, and the value is another dictionary representing the scores of that amino acid against other amino acids. Your task is to implement a functio...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_scoring_matrix({'A': {'A': 4, 'C': 0, 'D': -2, 'E': -1, 'F': 0}, 'B': {'A': 1, 'C': 1}, '*': {'A': -1, 'C': -1}}) == {'A': {'A': 4}}\", \"assert filter_scoring_matrix({'X': {'A': 2, 'C': 2}, 'C': {'A': 3, 'C': 3, 'D': 2, 'E': 1, 'F': 0}}) == {'C': {'A...
{ "split": "train", "index": 4256, "acecode_id": "bigcode_python_fns_14828", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given an array of positive integers `arr` (not necessarily distinct), return the lexicographically largest permutation that is smaller than `arr`, which can be made with exactly one swap. A swap exchanges the positions of two numbers `arr[i]` and `arr[j]`, but the swap cannot i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert prevPermOpt1([1,1,5]) == [1,1,5]\", \"assert prevPermOpt1([2,3,1,4]) == [2,1,3,4]\", \"assert prevPermOpt1([5,6,5]) == [5,5,6]\", \"assert prevPermOpt1([1,3,2,4]) == [1,2,3,4]\", \"assert prevPermOpt1([3,2,4,2]) == [3,2,2,4]\", \"assert prevPermOpt1([1,4,3,2...
{ "split": "train", "index": 4257, "acecode_id": "evol_10644", "num_tests": 9 }
acecode
[ { "role": "user", "content": "Write a function that converts a given temperature in Fahrenheit to Celsius. The function should take a single parameter, a float representing the temperature in Fahrenheit, and return the corresponding temperature in Celsius as a float.\nPlease reason step by step, then write ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert fahrenheit_to_celsius(32) == 0.0\", \"assert fahrenheit_to_celsius(212) == 100.0\", \"assert fahrenheit_to_celsius(0) == -17.77777777777778\", \"assert fahrenheit_to_celsius(100) == 37.77777777777778\", \"assert fahrenheit_to_celsius(50) == 10.0\", \"assert ...
{ "split": "train", "index": 4258, "acecode_id": "evol_26748", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a string `s`. Write a function `segment_and_unique_chars(s: str) -> Tuple[int, List[int]]:` that returns the number of segments in the string and the count of unique characters in each segment. A segment is defined to be a contiguous sequence of non-space characte...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert segment_and_unique_chars('Hello, my name is John') == (5, [5, 2, 4, 2, 4])\", \"assert segment_and_unique_chars('Hello') == (1, [4])\", \"assert segment_and_unique_chars('') == (0, [])\", \"assert segment_and_unique_chars('abc xyz 1234') == (3, [3, 3, 4])\",...
{ "split": "train", "index": 4259, "acecode_id": "evol_26742", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are given a list of dictionaries, where each dictionary represents a test case with the following keys: 'file_name' (a string representing the name of the file), 'test_name' (a string representing the name of the test), 'result' (an integer representing the expected HTTP st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert run_test({'file_name': 'test1', 'test_name': 'test_example', 'result': 200, 'body': 'OK'}) == {'test1': 'PASSED'}\", \"assert run_test({'file_name': 'test2', 'test_name': 'test_example', 'result': 404, 'body': 'Not Found'}) == {'test2': 'FAILED'}\", \"assert...
{ "split": "train", "index": 4260, "acecode_id": "bigcode_python_fns_35532", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes an array of integers and a specific integer. The function should remove all occurrences of that integer from the array and return the modified array. The order of the remaining elements should be preserved. Write a single function named 'remove_o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert remove_occurrences([1, 2, 3, 4, 2, 5], 2) == [1, 3, 4, 5]\", \"assert remove_occurrences([2, 2, 2, 2], 2) == []\", \"assert remove_occurrences([5, 6, 7, 8], 10) == [5, 6, 7, 8]\", \"assert remove_occurrences([], 1) == []\", \"assert remove_occurrences([0, 1,...
{ "split": "train", "index": 4261, "acecode_id": "evol_11220", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of file paths as strings and a boolean value `overwrite`. Your task is to implement a function `check_overwrite(file_paths: List[str], overwrite: bool) -> List[str]`. The function should check each file path in the list and return a list of messages indicat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_overwrite(['file5.txt'], False) == ['Filepath file5.txt does not exist.']\", \"assert check_overwrite(['file5.txt'], True) == ['Filepath file5.txt does not exist.']\", \"assert check_overwrite(['file1.txt'], False) == ['Filepath file1.txt already exist...
{ "split": "train", "index": 4262, "acecode_id": "bigcode_python_fns_35768", "num_tests": 10 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function `url_to_filename(base: str, url: str) -> str` that converts a web application endpoint into a corresponding file path. The function should take two parameters: `base`, which is a string representing the base directory path, and `url`, whi...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert url_to_filename('pages', '/home/') == 'pages/home/index.html'\", \"assert url_to_filename('pages', '/about') == 'pages/about'\", \"assert url_to_filename('pages', '/contact/') == 'pages/contact/index.html'\", \"assert url_to_filename('pages', 'blog/') == 'pa...
{ "split": "train", "index": 4263, "acecode_id": "bigcode_python_fns_27260", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a mass transition database from three datasets: literature data, inorganic data, and prediction data. Each dataset is represented as a list of dictionaries, where each dictionary contains the following keys: 'compound_id', 'mode', 'Q1 [m/z]', 'Q3 [m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_mass_transition_database([], [], []) == []\", \"assert create_mass_transition_database([], [{'compound_id': 2, 'mode': 'B', 'Q1 [m/z]': 110, 'Q3 [m/z]': 60, 'EP [V]': 10, 'CXP [V]': 54, 'DP [V]': 250, 'CE [V]': 140}], []) == [{'compound_id': 2, 'mode'...
{ "split": "train", "index": 4264, "acecode_id": "bigcode_python_fns_47332", "num_tests": 5 }
acecode
[ { "role": "user", "content": "Create a function in Python that takes a list of strings as input and outputs a dictionary. This dictionary should have keys as the unique words derived from the strings in the list and their frequency of appearance in the list as values. Additionally, if an integer n is provid...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert top_words(['Hello', 'world', 'hello'], 1) == {'hello': 2}\", \"assert top_words(['apple', 'banana', 'Apple', 'banana', 'Banana'], 2) == {'banana': 3, 'apple': 2}\", \"assert top_words(['Python is great', 'python is fun', 'I love python'], 2) == {'python': 3,...
{ "split": "train", "index": 4265, "acecode_id": "evol_10529", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that determines if a given path is a valid directory. A valid directory must be a string that starts with a '/' and contains at least one subdirectory. Implement a function called `is_valid_directory(path: str) -> bool` that returns True ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert is_valid_directory('/home/user/documents') == True\", \"assert is_valid_directory('/var/log') == True\", \"assert is_valid_directory('/etc/nginx/conf.d') == True\", \"assert is_valid_directory('/usr/bin') == True\", \"assert is_valid_directory('/usr/') == Fa...
{ "split": "train", "index": 4266, "acecode_id": "bigcode_python_fns_11342", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with calculating the maximum surplus generated from a series of redemptions and their associated costs. Given two lists: `redemptions` and `costs`, where each element in `redemptions` represents the amount redeemed by a trader and each element in `costs` represen...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_surplus([100, 100, 100], [100, 100, 100], 3) == 0.0\", \"assert max_surplus([30, 50], [20, 60], 5) == 25.0\", \"assert max_surplus([10, 20, 30], [15, 25, 35], 4) == 0.0\", \"assert max_surplus([1, 1, 1], [2, 2, 2], 3) == 0.0\", \"assert max_surplus([10, ...
{ "split": "train", "index": 4267, "acecode_id": "bigcode_python_fns_21389", "num_tests": 5 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function `pack_to_range` that takes a list of three integers `args` and an integer `node` as parameters. The function should create and return a `Range` object, which has two attributes: `left` and `right`. The `left` attribute should be the m...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert pack_to_range([1, 2, 3], 0).left == 1\", \"assert pack_to_range([1, 2, 3], 0).right == 3\", \"assert pack_to_range([-1, -2, -3], 0).left == -3\", \"assert pack_to_range([-1, -2, -3], 0).right == -1\", \"assert pack_to_range([0, 0, 0], 5).left == 5\", \"asser...
{ "split": "train", "index": 4268, "acecode_id": "oss_50", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of strings called `sequences`. Each string can consist of lowercase letters from the English alphabet. Your task is to write a function `compute_alphabet(sequences)` that returns a set containing all unique characters that appear in any of the strings in th...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert compute_alphabet(['abc', 'def', 'ghi']) == {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'}\", \"assert compute_alphabet(['hello', 'world']) == {'h', 'e', 'l', 'o', 'r', 'w', 'd'}\", \"assert compute_alphabet(['a', 'b', 'c', 'a', 'b', 'c']) == {'a', 'b', 'c'}\"...
{ "split": "train", "index": 4269, "acecode_id": "bigcode_python_fns_11924", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simplified function that simulates the creation of virtual machine (VM) images. The function should take a string representing the operating system name and return a dictionary containing the names of three image files: a disk image file, a boot i...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert create_vm_images('ubuntu') == {'disk_image': 'disk.img', 'boot_image': 'boot.img', 'cloudinit_iso': 'cloudinit.img'}\", \"assert create_vm_images('centos') == {'disk_image': 'disk.img', 'boot_image': 'boot.img', 'cloudinit_iso': 'cloudinit.img'}\", \"assert ...
{ "split": "train", "index": 4270, "acecode_id": "oss_29820", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers, and your task is to convert this list into a list of integers where each integer is represented by its long integer value. Your function should take a list of integers as input and return a list containing the same integers as output. Implement...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_to_longs([1, 2, 3]) == [1, 2, 3]\", \"assert convert_to_longs([-1, -2, -3]) == [-1, -2, -3]\", \"assert convert_to_longs([0]) == [0]\", \"assert convert_to_longs([10, 20, 30, 40]) == [10, 20, 30, 40]\", \"assert convert_to_longs([100, 200, 300]) == [...
{ "split": "train", "index": 4271, "acecode_id": "bigcode_python_fns_26296", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that extracts the name of a package from a given string representation of a `setup()` function call. The name of the package is defined within the `setup()` function call as the value of the `name` parameter. The input will be a st...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert extract_package_name(\\\"setup(name='example-package', version='1.0')\\\") == 'example-package'\", \"assert extract_package_name(\\\"setup( name = 'my-awesome-package' , version = '0.1')\\\") == 'my-awesome-package'\", \"assert extract_package_name(\\\"setu...
{ "split": "train", "index": 4272, "acecode_id": "oss_33463", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that takes an array of integers and returns a list of all prime numbers found in the array, along with the total count of prime numbers. The function should only return the prime numbers as a list and the total count as an integer. You may assume the input ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_and_output_primes([1, 2, 3, 4, 5]) == ([2, 3, 5], 3)\", \"assert generate_and_output_primes([10, 15, 20, 25]) == ([], 0)\", \"assert generate_and_output_primes([29, 31, 37, 41]) == ([29, 31, 37, 41], 4)\", \"assert generate_and_output_primes([4, 6, ...
{ "split": "train", "index": 4273, "acecode_id": "evol_22371", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a price represented as a numerical value. Write a function `price_operations(valor: float) -> Tuple[str, str]` that takes this price as input and returns a tuple containing two formatted strings: the first string should be the price halved formatted as currency, a...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert price_operations(10.00) == ('R$5.00', 'R$20.00')\", \"assert price_operations(0.00) == ('R$0.00', 'R$0.00')\", \"assert price_operations(5.50) == ('R$2.75', 'R$11.00')\", \"assert price_operations(1.00) == ('R$0.50', 'R$2.00')\", \"assert price_operations(10...
{ "split": "train", "index": 4274, "acecode_id": "oss_37377", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function `reverse_lexicographical_sort(input_list)` that takes a list of strings and/or numbers and returns a new list sorted in reverse lexicographical order. The function should handle special characters and numeric values, recognizing their place in the sorting o...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert reverse_lexicographical_sort(['b', 'a', 'd', 'c']) == ['d', 'c', 'b', 'a']\", \"assert reverse_lexicographical_sort([1, 3, 2, 5]) == ['5', '3', '2', '1']\", \"assert reverse_lexicographical_sort(['b', 'A', 'd', 'C']) == ['d', 'b', 'C', 'A']\", \"assert rever...
{ "split": "train", "index": 4275, "acecode_id": "evol_28341", "num_tests": 11 }
acecode
[ { "role": "user", "content": "You are tasked with analyzing binding site information for genes based on given parameters. You are provided with a list of dictionaries, where each dictionary contains the following keys: 'gene_id' (the unique identifier for a gene), 'binding_site_id' (the unique identifier fo...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert analyze_binding_sites([{'gene_id': 'gene1', 'binding_site_id': 'site1', 'chromosome': 'chr1', 'start': 100, 'end': 200, 'strand': '+'}]) == {'length_distribution': [100], 'chromosome_positions': [(100, 200)]}\", \"assert analyze_binding_sites([{'gene_id': 'g...
{ "split": "train", "index": 4276, "acecode_id": "oss_14796", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that generates a list of image file names based on a given prefix and a specified count. The function should take in two parameters: a string `fn_prefix` which represents the prefix of the image files, and an integer `count` which indicat...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_image_filenames('image', 3) == ['image1.png', 'image2.png', 'image3.png']\", \"assert generate_image_filenames('test', 5) == ['test1.png', 'test2.png', 'test3.png', 'test4.png', 'test5.png']\", \"assert generate_image_filenames('photo', 0) == []\", ...
{ "split": "train", "index": 4277, "acecode_id": "oss_16287", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Implement a function that arranges a collection of integer values in a strictly increasing sequence without utilizing any built-in sorting mechanisms. The function should take a list of integers as input and return a new list that contains the integers sorted in ascending order...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert bubbleSort([1, 6, 9, 5, 8, 10, 4, 2, 7, 3]) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\", \"assert bubbleSort([10, 9, 8, 7, 6, 5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\", \"assert bubbleSort([2, 3, 1]) == [1, 2, 3]\", \"assert bubbleSort([5]) == [5]\", \"a...
{ "split": "train", "index": 4278, "acecode_id": "evol_6946", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representation of a duration in the ISO 8601 format, write a function that checks whether this duration is greater than or equal to a specified minimum inclusive duration. The duration is represented as a string in the format 'PnYnMnDTnHnMnS', where 'P' indicates...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert check_duration_gte('P1Y1MT1H', 'P1Y') == True\", \"assert check_duration_gte('P1Y', 'P1Y') == True\", \"assert check_duration_gte('P1Y1D', 'P1Y') == True\", \"assert check_duration_gte('P2Y', 'P1Y') == True\", \"assert check_duration_gte('P0Y11M', 'P1Y') == ...
{ "split": "train", "index": 4279, "acecode_id": "bigcode_python_fns_20115", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a Python function that generates command-line arguments for a network testing tool based on the given parameters. The function should take in the following parameters: \n\n- `l4Type`: A string representing the layer 4 protocol type, which can be eit...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_iperf_args('UDP', 1000000) == '-u -b 1000000'\", \"assert generate_iperf_args('TCP', 0) == '-u'\", \"assert generate_iperf_args('UDP', 500) == '-u -b 500'\", \"assert generate_iperf_args('TCP', 100) == '-u'\", \"assert generate_iperf_args('UDP', 200...
{ "split": "train", "index": 4280, "acecode_id": "oss_30244", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given an integer `n`, return the result of performing the bitwise AND operation between the decimal value of the binary string formed by concatenating the binary representations of all integers from `1` to `n` in order (modulo `10^9 + 7`) and the integer `n`. The binary represe...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert concatenatedBinary(1) == 1\", \"assert concatenatedBinary(3) == 3\", \"assert concatenatedBinary(5) == 5\", \"assert concatenatedBinary(6) == 6\", \"assert concatenatedBinary(7) == 7\", \"assert concatenatedBinary(20) == 0\"]}" }
{ "split": "train", "index": 4281, "acecode_id": "evol_29766", "num_tests": 6 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that filters a list of ACES color transform names based on a given keyword. The function should take two arguments: a list of strings representing the ACES color transform names, and a string keyword. The function should return a new ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_ctl_transforms(['TransformA', 'TransformB', 'ColorCorrection'], 'Transform') == ['TransformA', 'TransformB']\", \"assert filter_ctl_transforms(['TransformA', 'TransformB', 'ColorCorrection'], 'color') == []\", \"assert filter_ctl_transforms(['Brightne...
{ "split": "train", "index": 4282, "acecode_id": "oss_2286", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given an array of integers where each integer represents the color of a sock. Your task is to determine how many pairs of socks with matching colors can be formed. A pair of socks is defined as two socks of the same color. Write a function `sock_pairs(arr: List[int]) ->...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert sock_pairs([10, 20, 20, 10, 10, 30, 50, 10, 20]) == 3\", \"assert sock_pairs([6, 5, 2, 3, 5, 2, 2, 1, 1, 5, 1, 3, 3, 3, 5]) == 6\", \"assert sock_pairs([1, 1, 1, 1]) == 2\", \"assert sock_pairs([1, 2, 3, 4]) == 0\", \"assert sock_pairs([1]) == 0\", \"assert ...
{ "split": "train", "index": 4283, "acecode_id": "bigcode_python_fns_28504", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that performs a specific transformation on a list of integers. The transformation involves adding a constant value to each element in the list. Your task is to implement the function `plus_n(arr: List[int], n: int) -> List[int]`, wher...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert plus_n([1, 2, 3], 2) == [3, 4, 5]\", \"assert plus_n([-1, -2, -3], 1) == [0, -1, -2]\", \"assert plus_n([0, 0, 0], 5) == [5, 5, 5]\", \"assert plus_n([10, 20, 30], 10) == [20, 30, 40]\", \"assert plus_n([1], 3) == [4]\", \"assert plus_n([], 5) == []\", \"ass...
{ "split": "train", "index": 4284, "acecode_id": "oss_20260", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Write a function `generate_password(length: int) -> str` that generates a cryptographically secure password of a specified length. The password must include at least one lowercase letter, one uppercase letter, one digit, and one special character. The function should return the...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_password(8) is not None\", \"assert len(generate_password(10)) == 10\", \"assert any(c.islower() for c in generate_password(12))\", \"assert any(c.isupper() for c in generate_password(12))\", \"assert any(c.isdigit() for c in generate_password(12))\...
{ "split": "train", "index": 4285, "acecode_id": "evol_21386", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of integers representing the weights of items in a bag. Your task is to implement a function that calculates the maximum weight that can be carried in the bag without exceeding a given weight limit. The function should take in two arguments: a list of integ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert max_weight([10, 20, 30], 50) == 50\", \"assert max_weight([10, 20, 30], 60) == 60\", \"assert max_weight([10, 20, 30], 20) == 20\", \"assert max_weight([5, 5, 5, 5], 10) == 10\", \"assert max_weight([5, 10, 15], 5) == 5\", \"assert max_weight([1, 2, 3, 4, 5]...
{ "split": "train", "index": 4286, "acecode_id": "bigcode_python_fns_40807", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that generates a random geometric graph. The function should take in two parameters: an integer `n_nodes` representing the number of nodes in the graph, and a list of tuples `coors` representing the coordinates of the nodes in the for...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_random_geometric_graph(5, [(0, 0), (1, 1), (2, 2), (3, 3), (4, 4)]) in range(0, 6)\", \"assert generate_random_geometric_graph(3, [(0, 0), (1, 1), (2, 2)]) in range(0, 3)\", \"assert generate_random_geometric_graph(0, []) == 0\", \"assert generate_r...
{ "split": "train", "index": 4287, "acecode_id": "oss_35552", "num_tests": 15 }
acecode
[ { "role": "user", "content": "You are tasked with creating a simple text formatting tool that validates and formats numerical input in real-time. Your goal is to implement a function `format_numerical_input` that takes a string representing the current text input and enforces the following formatting rules:...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert format_numerical_input('123') == '123'\", \"assert format_numerical_input('123a') == '123'\", \"assert format_numerical_input('123.45') == '123.45'\", \"assert format_numerical_input('.123') == '.123'\", \"assert format_numerical_input('0.5') == '0.5'\", \"a...
{ "split": "train", "index": 4288, "acecode_id": "oss_35983", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Given a 2D matrix representing an image, write a function `rotate180(image)` that rotates the image by 180 degrees. The image is represented as a list of lists, where each inner list represents a row of pixels. The function should return a new 2D matrix that is the original ima...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert rotate180([[1, 2], [3, 4]]) == [[4, 3], [2, 1]]\", \"assert rotate180([[5]]) == [[5]]\", \"assert rotate180([[1, 2, 3], [4, 5, 6]]) == [[6, 5, 4], [3, 2, 1]]\", \"assert rotate180([[1, 0], [0, 1]]) == [[1, 0], [0, 1]]\", \"assert rotate180([[1, 2], [3, 4], [...
{ "split": "train", "index": 4289, "acecode_id": "bigcode_python_fns_28226", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function to scale the width of an image based on a given scale factor. The function should take an input image represented as a 2D list (list of lists) where each element is an integer value (pixel intensity) and a scale factor (a float). The ...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert scaleImage([[0]], 1.0) == [[0]]\", \"assert scaleImage([[255]], 2.0) == [[255, 255]]\", \"assert scaleImage([[255, 255], [0, 0]], 0.5) == [[255], [0]]\", \"assert scaleImage([[0, 255], [128, 64]], 0.75) == [[0, 255], [128, 64]]\", \"assert scaleImage([[0]], ...
{ "split": "train", "index": 4290, "acecode_id": "oss_31294", "num_tests": 10 }
acecode
[ { "role": "user", "content": "Implement a function `median(l: list, cmp_func: callable) -> float or None` that calculates the median of a list `l` without sorting it or using built-in functions. The function should manage duplicates, handle tuples with an alternating number of elements, and utilize `cmp_fun...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert median([3, 1, 2, 4, 5], lambda a, b: a - b) == 3\", \"assert median([1, 2, 2, 4, 5], lambda a, b: a - b) == 2\", \"assert median(['a', 'b', 1, 2], lambda a, b: a - b) == None\", \"assert median([1.5, 2.5, 3.5, 4.5], lambda a, b: a - b) == 3.0\", \"assert med...
{ "split": "train", "index": 4291, "acecode_id": "evol_32895", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given a list of summoner spell names represented as strings. Your task is to implement a function that returns a new list containing only the names of the summoner spells that start with the letter 'F'. The function should preserve the order of the spells from the input...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert filter_f_spells(['Flash', 'Heal', 'Teleport', 'Fortify']) == ['Flash', 'Fortify']\", \"assert filter_f_spells(['Ignite', 'Barrier', 'Exhaust']) == []\", \"assert filter_f_spells(['Frost', 'Flame', 'Storm']) == ['Frost', 'Flame']\", \"assert filter_f_spells([...
{ "split": "train", "index": 4292, "acecode_id": "bigcode_python_fns_15337", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are given two lists of integers, `list1` and `list2`. Your task is to implement a function called `combine_lists` that concatenates these two lists into a single list. The resulting list should contain all the elements from `list1` followed by all the elements from `list2`....
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert combine_lists([1, 2, 3], [4, 5, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert combine_lists([], [1, 2, 3]) == [1, 2, 3]\", \"assert combine_lists([1, 2, 3], []) == [1, 2, 3]\", \"assert combine_lists(['a', 'b'], ['c', 'd']) == ['a', 'b', 'c', 'd']\", \"assert combin...
{ "split": "train", "index": 4293, "acecode_id": "bigcode_python_fns_33164", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with writing a function `install_site()` that simulates the installation of a web application in a virtual environment. The function does not take any parameters and should output a series of strings representing the steps taken during the installation process. T...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert install_site() == ['Created virtual environment', 'Installed requirements', 'Built application package', 'Uploaded application package', 'Installed uploaded application package']\", \"assert install_site() == ['Created virtual environment', 'Installed requir...
{ "split": "train", "index": 4294, "acecode_id": "bigcode_python_fns_49013", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a function that records the time associated with a job based on its status and available timestamps. The function should take a dictionary representing a job, which contains the following keys: 'JobStatus', 'CompletionDate', and 'EnteredCurrentS...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert record_time({'JobStatus': 3, 'CompletionDate': 10, 'EnteredCurrentStatus': 5}) == 10\", \"assert record_time({'JobStatus': 4, 'CompletionDate': 0, 'EnteredCurrentStatus': 5}) == 5\", \"assert record_time({'JobStatus': 6, 'CompletionDate': 0, 'EnteredCurrentS...
{ "split": "train", "index": 4295, "acecode_id": "bigcode_python_fns_20659", "num_tests": 16 }
acecode
[ { "role": "user", "content": "Given a string representation of a coordinate in the format 'XY' where 'X' is a single character representing the column (e.g., 'A', 'B', ..., 'Z') and 'Y' is a single digit representing the row (e.g., '1', '2', ..., '9'), implement a function that converts this string coordina...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert convert_coordinate('A1') == ('A', '1')\", \"assert convert_coordinate('B2') == ('B', '2')\", \"assert convert_coordinate('C3') == ('C', '3')\", \"assert convert_coordinate('D4') == ('D', '4')\", \"assert convert_coordinate('E5') == ('E', '5')\", \"assert con...
{ "split": "train", "index": 4296, "acecode_id": "bigcode_python_fns_1846", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with implementing a Python function that converts a specific representation of a tie into a JSON-like dictionary format. The tie is represented by two attributes: 'discriminator', which has a default value of 1, and 'kind', which has a default value of 'Tie'. You...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert tie_to_json() == {'discriminator': 1, 'kind': 'Tie'}\", \"assert tie_to_json() == {'discriminator': 1, 'kind': 'Tie'}\", \"assert tie_to_json() == {'discriminator': 1, 'kind': 'Tie'}\", \"assert tie_to_json() == {'discriminator': 1, 'kind': 'Tie'}\", \"asser...
{ "split": "train", "index": 4297, "acecode_id": "oss_4988", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a function that processes a string containing emoji-role pairs and returns a dictionary mapping emojis to their corresponding role IDs. The input string will contain emoji-role pairs formatted as specified below. Each pair will be on a new line, and...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert associate_emoji_to_roles('\\ud83d\\ude00 : 123456789012345678\\\\n:custom_emoji_id: : 987654321098765432\\\\n') == {'\\ud83d\\ude00': 123456789012345678, ':custom_emoji_id:': 987654321098765432}\", \"assert associate_emoji_to_roles('\\ud83d\\ude00 : 12345678...
{ "split": "train", "index": 4298, "acecode_id": "oss_2198", "num_tests": 16 }
acecode
[ { "role": "user", "content": "You are tasked with creating a command-line arguments generator for a disassembly tool. Your function should take three parameters that specify the user's options: whether to enable disassembly, the number of instructions to display, and whether to include a signature. Based on...
code
{ "style": "rule", "ground_truth": "{\"tests\": [\"assert generate_command_line_args(True, 50, False) == '-d -n 50'\", \"assert generate_command_line_args(False, 0, True) == '-s'\", \"assert generate_command_line_args(True, 0, True) == '-d -s'\", \"assert generate_command_line_args(False, 10, False) == '-n 10'\", \...
{ "split": "train", "index": 4299, "acecode_id": "oss_33722", "num_tests": 16 }