data_source large_stringclasses 1
value | prompt listlengths 1 1 | ability large_stringclasses 1
value | reward_model dict | extra_info dict |
|---|---|---|---|---|
acecode | [
{
"role": "user",
"content": "Given a list of integers, write a function that calculates the Laplace matrix for a 1-dimensional Cartesian grid based on the values in the list. The Laplace matrix is defined as a sparse matrix where each element at position (i, j) is given by the following rules: if i == j, t... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_laplace_matrix([1]) == [[2]]\", \"assert get_laplace_matrix([1, 2]) == [[2, -1], [-1, 2]]\", \"assert get_laplace_matrix([1, 2, 3]) == [[2, -1, 0], [-1, 2, -1], [0, -1, 2]]\", \"assert get_laplace_matrix([0, 0, 0, 0]) == [[2, -1, 0, 0], [-1, 2, -1, 0], [... | {
"split": "train",
"index": 67300,
"acecode_id": "bigcode_python_fns_25322",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with merging three lists of integers that represent channel state information (CSI) data from a wireless communication system. You will be given three lists of integers, each representing different types of CSI data: `bs2user_csi`, `bs2ris_csi`, and `ris2user_csi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_and_process_csi([1, 2, 3], [4, 5, 6], [7, 8, 9]) == [1, 2, 3, 4, 5, 6, 7, 8, 9]\", \"assert merge_and_process_csi([3, 2, 1], [6, 5, 4], [9, 8, 7]) == [1, 2, 3, 4, 5, 6, 7, 8, 9]\", \"assert merge_and_process_csi([10, 20, 30], [5, 15, 25], [1, 2, 3]) ==... | {
"split": "train",
"index": 67301,
"acecode_id": "oss_28343",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines the directory path for a user's uploaded files based on their username. The function should take two parameters: `username`, which is a string representing the user's username, and `filename`, which is a string representin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert user_directory_path('john_doe', 'file.txt') == 'uploads/john_doe/file.txt'\", \"assert user_directory_path('alice', 'document.pdf') == 'uploads/alice/document.pdf'\", \"assert user_directory_path('bob_smith', 'image.png') == 'uploads/bob_smith/image.png'\", ... | {
"split": "train",
"index": 67302,
"acecode_id": "oss_15397",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given two lists of distinct integers, A and B. Your task is to find any permutation of array A that maximizes the advantage with respect to array B. The advantage of a permutation is defined as the sum of elements from A that are greater than their corresponding element... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert maximizeAdvantage([2, 7, 11, 15], [1, 10, 4, 11]) in [[2, 11, 7, 15], [11, 2, 15, 7], [15, 7, 11, 2]]\", \"assert maximizeAdvantage([4, 5, 6], [1, 2, 3]) in [[4, 5, 6], [6, 5, 4], [5, 4, 6]]\", \"assert maximizeAdvantage([10, 20, 30], [15, 25, 5]) in [[20, 3... | {
"split": "train",
"index": 67303,
"acecode_id": "oss_33738",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are given a list `p` and a list `p_list`, along with a boolean value `condition`. Your task is to modify the first element of list `p` based on the value of `condition`. If `condition` is `True`, set `p[0]` to the second element of `p_list`. If `condition` is `False`, set `... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert correct_assignment([0, 0, 0], [10, 20, 30], True) == [20, 0, 0]\", \"assert correct_assignment([0, 0, 0], [10, 20, 30], False) == [10, 0, 0]\", \"assert correct_assignment([1, 2, 3], [5, 6, 7], True) == [6, 2, 3]\", \"assert correct_assignment([1, 2, 3], [5,... | {
"split": "train",
"index": 67304,
"acecode_id": "oss_9674",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that takes a string input representing a function name and a version number. Your function should return a message indicating that the specified function is deprecated since the given version. The message format should be: '<function_name... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert deprecate_function('old_function', '1.0', 'Use new_function instead.') == 'old_function is deprecated since version 1.0. Hint: Use new_function instead.'\", \"assert deprecate_function('legacy_method', '2.5') == 'legacy_method is deprecated since version 2.5... | {
"split": "train",
"index": 67305,
"acecode_id": "bigcode_python_fns_44916",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a Python function `process_response(response_text)` that takes a string `response_text` as input and performs the following tasks: 1. Extract the purchase order number enclosed within `<po-number>` tags from the `response_text`. 2. Extract the URL of a PDF file enclosed w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_response('<response><po-number>PO12345</po-number><link rel=\\\"artifact\\\" href=\\\"http://example.com/pdf123.pdf\\\"/></response>') == {'po_number': 'PO12345', 'pdf_url': 'http://example.com/pdf123.pdf'}\", \"assert process_response('<response><po... | {
"split": "train",
"index": 67306,
"acecode_id": "oss_14395",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `check_sequence(str_1: str, str_2: str) -> bool` that accepts two strings, `str_1` and `str_2`. The function should return True if `str_1` exists as a contiguous sequence of characters within `str_2`, and False otherwise.\nPlease reason step by step, then w... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_sequence('hello', 'hello world') == True\", \"assert check_sequence('world', 'hello world') == True\", \"assert check_sequence('hello', 'world') == False\", \"assert check_sequence('test', 'this is a test case') == True\", \"assert check_sequence('case... | {
"split": "train",
"index": 67307,
"acecode_id": "evol_17412",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function to validate email addresses for a registration system. Your function should take a list of email addresses and check for duplicates. If any email address appears more than once in the list, the function should return a list of those dupli... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_duplicate_emails(['a@example.com', 'b@example.com', 'c@example.com']) == []\", \"assert find_duplicate_emails([]) == []\", \"assert find_duplicate_emails(['unique@example.com']) == []\", \"assert find_duplicate_emails(['test1@test.com', 'test2@test.com'... | {
"split": "train",
"index": 67308,
"acecode_id": "oss_15280",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `roleplayRun` that simulates a role-playing game. The function should take three optional parameters: `name`, `role`, and `location`. If all three parameters are provided, the function should set the player's name, role, and starting loca... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert roleplayRun('Alice', 'Warrior', 'Castle') == {'name': 'Alice', 'role': 'Warrior', 'location': 'Castle'}\", \"assert roleplayRun('David', 'Paladin', 'City') == {'name': 'David', 'role': 'Paladin', 'location': 'City'}\", \"assert roleplayRun('Frank', 'Sorcerer... | {
"split": "train",
"index": 67309,
"acecode_id": "oss_15083",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a string s, implement a function that counts the number of distinct substrings that are palindromes. A substring is defined as a contiguous sequence of characters within the string. Return the count of distinct palindromic substrings.\nPlease reason step by step, then wri... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_palindromic_substrings('abc') == 0\", \"assert count_palindromic_substrings('aaa') == 3\", \"assert count_palindromic_substrings('') == 0\", \"assert count_palindromic_substrings('abcd') == 0\", \"assert count_palindromic_substrings('aabbcc') == 3\"]}"... | {
"split": "train",
"index": 67310,
"acecode_id": "evol_8782",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are given a mathematical expression as a string that can include parameters and an independent variable. Your task is to evaluate the expression at a given point while ensuring that the independent variable remains within a specified domain and the output is clipped to a gi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert evaluate_expression('p[0] * x + p[1]', [2.0, 3.0], 1.0, 'x', [0, 10], [0, 10]) == 5.0\", \"assert evaluate_expression('p[0] * x**2 + p[1]', [1.0, 0.0], 3.0, 'x', [0, 10], [0, 10]) == 9.0\", \"assert evaluate_expression('p[0] / x', [4.0], 2.0, 'x', [1, 10], [... | {
"split": "train",
"index": 67311,
"acecode_id": "bigcode_python_fns_27963",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function that takes a string as input and returns the total number of vowels present in that string. Vowels are defined as the characters 'a', 'e', 'i', 'o', and 'u', and should be counted regardless of case sensitivity.\nPlease reason step by step, then write a sel... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert count_vowels('hello world') == 3\", \"assert count_vowels('AEIOU') == 5\", \"assert count_vowels('') == 0\", \"assert count_vowels('abcdefg') == 2\", \"assert count_vowels('vowels are cool') == 6\", \"assert count_vowels('The quick brown fox jumps over the l... | {
"split": "train",
"index": 67312,
"acecode_id": "evol_24204",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function that takes a list of integers and returns a new list containing only the even integers from the input list. The function should preserve the order of the even integers as they appear in the input. Implement the function `filter_even_number... | 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([]) == []\", \"assert filter_even_numbers([2, 4, 6, 8]) == [2, 4,... | {
"split": "train",
"index": 67313,
"acecode_id": "oss_1819",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of class IDs and a user role which can either be 'Professor' or 'Student'. Your task is to implement a function that checks if a user with the given role has access to a specific class ID. A user has access if the class ID is within a predefined set for the... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_access([1, 2, 3, 4, 5], 'Professor', 3) == 'Access Granted'\", \"assert check_access([1, 2, 3, 4, 5], 'Professor', 6) == 'Access Denied'\", \"assert check_access([3, 4, 5, 6, 7], 'Student', 5) == 'Access Granted'\", \"assert check_access([3, 4, 5, 6, 7... | {
"split": "train",
"index": 67314,
"acecode_id": "bigcode_python_fns_43513",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Design a function that tracks the frequency of words in a given text. The function should be able to handle case sensitivity and punctuation marks. It should take a list of strings as input, where each string represents a segment of text. The function should return a dictionary... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_frequency_tracker(['Hello, world!', 'world']) == {'hello': 1, 'world': 2}\", \"assert word_frequency_tracker(['Hello John!', 'Hello! How is the world?']) == {'hello': 2, 'john': 1, 'how': 1, 'is': 1, 'the': 1, 'world': 1}\", \"assert word_frequency_trac... | {
"split": "train",
"index": 67315,
"acecode_id": "evol_1976",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of dictionaries representing a stock portfolio. Each dictionary contains the name of the stock and the number of shares held. Your task is to write a function that finds and returns the name of the stock with the minimum number of shares. If there are multi... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_min_shares_stock([{'name':'AAPL', 'shares': 100}, {'name':'MSFT', 'shares': 150}, {'name':'TSLA', 'shares': 50}]) == 'TSLA'\", \"assert find_min_shares_stock([{'name':'GOOG', 'shares': 20}, {'name':'AMZN', 'shares': 30}, {'name':'FB', 'shares': 20}]) ==... | {
"split": "train",
"index": 67316,
"acecode_id": "oss_33243",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `find_closest_vowel_subsequence(word: str) -> str` that captures the nearest single sound-forming vowel or vowel pair nestled between two consonants within a word, starting the search from the end of the word. The function should be case-sensitive and ignor... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_closest_vowel_subsequence('yogurt') == 'u'\", \"assert find_closest_vowel_subsequence('FULL') == 'U'\", \"assert find_closest_vowel_subsequence('ab') == ''\", \"assert find_closest_vowel_subsequence('heart') == 'ea'\", \"assert find_closest_vowel_subseq... | {
"split": "train",
"index": 67317,
"acecode_id": "evol_24844",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `process_packages` that processes a list of software packages, retrieves their associated blob data, and reads the package files from that blob. You are provided with the following information: \n - A list of packages where each packa... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_packages([{'merkle': 'abc123'}, {'merkle': 'def456'}], lambda m: {'data': 'blob data for ' + m} if m in ['abc123', 'def456'] else None, lambda b: {'file1': 'file_content1', 'file2': 'file_content2'}, lambda: [{'merkle': '0', 'name': 'builtin_package'... | {
"split": "train",
"index": 67318,
"acecode_id": "oss_34238",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file names in a directory. Each file name is represented as a string. Your task is to implement a function that filters this list to return a new list containing only the file names that have a '.bel' extension (case insensitive). Implement the function ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_bel_files(['document.bel', 'image.jpg', 'data.BEL', 'report.pdf', 'summary.Bel']) == ['document.bel', 'data.BEL', 'summary.Bel']\", \"assert filter_bel_files(['notes.txt', 'file.doc', 'script.py']) == []\", \"assert filter_bel_files(['archive.BEL', 'r... | {
"split": "train",
"index": 67319,
"acecode_id": "bigcode_python_fns_37424",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that ignores any errors raised during its execution. The function should accept a callable (function) and its arguments, execute the callable, and return None regardless of whether an error occurs during the execution of the callable ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ignore_error(lambda x: 1 / x, 0) is None\", \"assert ignore_error(lambda: int('abc')) is None\", \"assert ignore_error(lambda x, y: x + y, 1, 2) is None\", \"assert ignore_error(lambda: print('Hello'),) is None\", \"assert ignore_error(lambda: [][1],) is Non... | {
"split": "train",
"index": 67320,
"acecode_id": "bigcode_python_fns_45284",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of positive floating-point numbers representing distances between points in 3D space, write a function that computes the median of the distances. The input will be a list of distances, and the output should be a single floating-point number representing the median.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median_distance([1.0, 2.0, 3.0, 4.0, 5.0]) == 3.0\", \"assert median_distance([1.0, 3.0, 2.0]) == 2.0\", \"assert median_distance([1.0, 2.0]) == 1.5\", \"assert median_distance([5.0, 3.0, 4.0, 2.0, 1.0]) == 3.0\", \"assert median_distance([7.0, 8.0, 9.0, 10.... | {
"split": "train",
"index": 67321,
"acecode_id": "bigcode_python_fns_28565",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers representing search results from a model. Implement a function `get_residuals(search_results: List[int]) -> List[float]` that calculates the residuals of the predictions. A residual is defined as the difference between the actual value and the p... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_residuals([1, 2, 3]) == [-1.0, 0.0, 1.0]\", \"assert get_residuals([4, 5, 6]) == [-1.0, 0.0, 1.0]\", \"assert get_residuals([10, 20, 30]) == [-10.0, 0.0, 10.0]\", \"assert get_residuals([0]) == [0.0]\", \"assert get_residuals([7, 8, 9, 10]) == [-1.5, -0.... | {
"split": "train",
"index": 67322,
"acecode_id": "bigcode_python_fns_15771",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string `step_str` that represents a step in a path. Your task is to determine if this step is an 'extension'. An extension is defined as a step that starts with the character '('. If the string does not represent a valid step, you should raise a ValueError with ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_extension('()') == True\", \"assert is_extension('(step)') == True\", \"assert is_extension('(') == True\", \"assert is_extension('extension') == False\", \"assert is_extension('step') == False\", \"assert is_extension('1234') == False\", \"assert is_exte... | {
"split": "train",
"index": 67323,
"acecode_id": "bigcode_python_fns_10738",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing a collection of phrases. Write a function `manage_phrases(operations: List[Tuple[str, str]]) -> Tuple[List[str], str]` that takes a list of operations and returns a tuple containing two elements: a list of all phrases added and a random phrase from ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_phrases([('add', 'Hello, world!'), ('get_random', ''), ('get_all', '')]) == (['Hello, world!'], 'Hello, world!')\", \"assert manage_phrases([('add', 'Learning Python'), ('get_random', ''), ('add', 'Python is great'), ('get_all', '')]) == (['Learning P... | {
"split": "train",
"index": 67324,
"acecode_id": "oss_9836",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Given a string s, implement a function that returns the total number of characters in the string and a dictionary containing the frequency of each character (including spaces, punctuation, and special characters). The function should be case-sensitive, meaning 'A' and 'a' are c... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert char_frequency('Hello, World!') == (13, {'H': 1, 'e': 1, 'l': 3, 'o': 2, ',': 1, ' ': 1, 'W': 1, 'r': 1, 'd': 1, '!': 1})\", \"assert char_frequency('') == (0, {})\", \"assert char_frequency('Python 3.8') == (10, {'P': 1, 'y': 1, 't': 1, 'h': 1, 'o': 1, 'n':... | {
"split": "train",
"index": 67325,
"acecode_id": "evol_27786",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a custom validation logic for a user registration system. The system requires the following validation rules for user passwords: 1. The password must be at least 8 characters long. 2. The password must contain at least one uppercase letter, one ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert validate_password('Passw0rd!') == True\", \"assert validate_password('weakpass') == False\", \"assert validate_password('12345678') == False\", \"assert validate_password('StrongP@ss1') == True\", \"assert validate_password('Short1!') == False\", \"assert va... | {
"split": "train",
"index": 67326,
"acecode_id": "oss_22573",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with verifying callback handler methods in a class. Implement a function `verify_callback_methods` that takes a class object with the following attributes: `pkg` (a string representing the package name), `extends_path` (a string representing the path of the class... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert verify_callback_methods({'pkg': 'com.example.app', 'extends_path': '', 'methods': [{'name': 'onClickListener', 'args': ['View', 'android.os.Handler']}, {'name': 'onLongClickListener', 'args': ['View']}]}) == 'Invalid method: onLongClickListener'\", \"assert ... | {
"split": "train",
"index": 67327,
"acecode_id": "bigcode_python_fns_35151",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that calculates the percentage of current brightness relative to maximum brightness. The maximum brightness value is provided as a parameter, and the current brightness level is also provided as a parameter. Your function should re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_brightness_percentage(0, 100) == '0%'\", \"assert calculate_brightness_percentage(50, 100) == '50%'\", \"assert calculate_brightness_percentage(100, 100) == '100%'\", \"assert calculate_brightness_percentage(25, 100) == '25%'\", \"assert calculate_... | {
"split": "train",
"index": 67328,
"acecode_id": "oss_29525",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that simulates a simplified logging configuration system. The function should accept two parameters: `log` (a string representing the logger name) and `parent` (a string representing the parent logger name). The function should return a s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_logger_name('my_logger', None) == 'my_logger'\", \"assert get_logger_name(None, 'parent_logger') == 'parent_logger.child_logger'\", \"assert get_logger_name(None, None) == 'root_logger'\", \"assert get_logger_name('child_logger', 'parent_logger') == 'chi... | {
"split": "train",
"index": 67329,
"acecode_id": "oss_26831",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that extracts the name of the person or entity mentioned in a given copyright notice string. The copyright notice always follows the format: 'Copyright <YEAR> <NAME>'. Your function should take a string input representing the copyright no... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_copyright_holder('Copyright 2022 ACME Inc.') == 'ACME Inc.'\", \"assert extract_copyright_holder('Copyright 2025 OpenAI, LLC') == 'OpenAI, LLC'\", \"assert extract_copyright_holder('Copyright 1999 John Doe') == 'John Doe'\", \"assert extract_copyrigh... | {
"split": "train",
"index": 67330,
"acecode_id": "oss_128",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of package names, implement a function `filter_packages(packages: List[str], prefix: str) -> List[str]` that returns a new list containing only the package names that start with the specified prefix. The function should be case-sensitive. If no package names match ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_packages(['numpy', 'pandas', 'matplotlib'], 'pa') == ['pandas']\", \"assert filter_packages(['numpy', 'pandas', 'matplotlib'], 'nu') == ['numpy']\", \"assert filter_packages(['numpy', 'pandas', 'matplotlib'], 'm') == ['matplotlib']\", \"assert filter_... | {
"split": "train",
"index": 67331,
"acecode_id": "bigcode_python_fns_5413",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `check_strictly_ascending_order` that verifies if a given list of numerical values is arranged in a strictly ascending order. The function should return True if the list is strictly ascending (i.e., no two consecutive numbers are the same) and False ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert check_strictly_ascending_order([1, 2, 3, 4, 5]) == True\", \"assert check_strictly_ascending_order([1, 2, 3, 3, 5]) == False\", \"assert check_strictly_ascending_order([5, 6, 7]) == True\", \"assert check_strictly_ascending_order([1.1, 1.2, 1.3]) == True\", ... | {
"split": "train",
"index": 67332,
"acecode_id": "evol_35543",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that retrieves the van der Waals radius of an element based on its atomic number. Given an integer representing the atomic number, return the corresponding van der Waals radius as a float. The van der Waals radii for the atomic numbers 6 ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_vdw_radius(6) == 1.7\", \"assert get_vdw_radius(7) == 1.55\", \"assert get_vdw_radius(8) == 1.52\", \"assert get_vdw_radius(9) == 1.47\", \"assert get_vdw_radius(1) == -1.0\", \"assert get_vdw_radius(10) == -1.0\", \"assert get_vdw_radius(20) == -1.0\", ... | {
"split": "train",
"index": 67333,
"acecode_id": "bigcode_python_fns_20563",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a search query and a list of posts, where each post is represented as a dictionary containing a 'title' and a 'body'. Your function should return a list of posts that match the search query based on the following scoring sy... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert search_posts('python', [{'title': 'Learn Python', 'body': 'Python is great.'}, {'title': 'Java Basics', 'body': 'Learn Java.'}]) == [{'title': 'Learn Python', 'body': 'Python is great.'}]\", \"assert search_posts('java', [{'title': 'Learn Python', 'body': 'P... | {
"split": "train",
"index": 67334,
"acecode_id": "bigcode_python_fns_7569",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function called `reverse_loop(start, end)` that takes two integers, `start` and `end`. The function should print the numbers from `end` to `start` in reverse order, inclusive. If `end` is less than `start`, the function should print a message: 'End cannot be less th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert reverse_loop(1, 10) == '10\\\\n9\\\\n8\\\\n7\\\\n6\\\\n5\\\\n4\\\\n3\\\\n2\\\\n1\\\\n'\", \"assert reverse_loop(5, 5) == '5\\\\n'\", \"assert reverse_loop(10, 1) == 'End cannot be less than Start'\", \"assert reverse_loop(-5, -1) == '-1\\\\n-2\\\\n-3\\\\n-4\... | {
"split": "train",
"index": 67335,
"acecode_id": "evol_36011",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two integers `start` and `end` representing a range, write a Python function `sum_of_multiples_of_3(start, end)` that returns the sum of all integers within that range that are multiples of 3. The range is inclusive of both `start` and `end`. For example, if `start = 1` a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sum_of_multiples_of_3(1, 10) == 18\", \"assert sum_of_multiples_of_3(3, 9) == 18\", \"assert sum_of_multiples_of_3(1, 3) == 3\", \"assert sum_of_multiples_of_3(15, 30) == 135\", \"assert sum_of_multiples_of_3(1, 1) == 0\", \"assert sum_of_multiples_of_3(-5, ... | {
"split": "train",
"index": 67336,
"acecode_id": "oss_26756",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a configuration dictionary represented as a string, where the keys are configuration keys and the values are dictionaries containing various settings. Implement a function `update_config(config_str: str, src_key: str, new_value: dict) -> str` that updates the conf... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_config('{\\\"key1\\\": {\\\"settingA\\\": 1}, \\\"key2\\\": {\\\"settingB\\\": 2}}', 'key1', {\\\"settingC\\\": 3}) == '{\\\"key1\\\": {\\\"settingA\\\": 1, \\\"settingC\\\": 3}, \\\"key2\\\": {\\\"settingB\\\": 2}}'\", \"assert update_config('{\\\"ke... | {
"split": "train",
"index": 67337,
"acecode_id": "bigcode_python_fns_8996",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that accepts a list of distinct integers. The function should return the digit (0 through 9) that appears most frequently across all the integers. If there are multiple digits with the same highest frequency, return the smallest digit among them.\nPlease re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_frequent([12345, 67890, 54321]) == 1\", \"assert find_frequent([99999, 88888, 77777]) == 7\", \"assert find_frequent([101, 202, 303]) == 0\", \"assert find_frequent([100, 200, 300]) == 0\", \"assert find_frequent([123, 456, 789]) == 1\", \"assert find_f... | {
"split": "train",
"index": 67338,
"acecode_id": "evol_18889",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of tuples representing files and their associated metric values, implement a function that sorts the list based on the metric values in either ascending or descending order. Additionally, if a limit is provided, the function should return only the top 'limit' numbe... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert rank_files([('file1.py', 10), ('file2.py', 20)], 2, 15, False) == [('file1.py', 10), ('file2.py', 20)]\", \"assert rank_files([('file1.py', 10), ('file2.py', 20)], 1, 15, True) == [('file2.py', 20)]\", \"assert rank_files([('file1.py', 5), ('file2.py', 10), ... | {
"split": "train",
"index": 67339,
"acecode_id": "bigcode_python_fns_7555",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given an array of integers, you need to determine the minimum number of changes required to make the array non-decreasing from left to right. If the number of changes required exceeds a given limit, return -1. Implement the function `smallest_change(arr: List[int], limit: int) ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert smallest_change([5, 3, 2, 1], 3) == 3\", \"assert smallest_change([1, 3, 2, 4, 5], 1) == 1\", \"assert smallest_change([10, 20, 30, 25, 40], 1) == 1\", \"assert smallest_change([1, 1, 1, 1], 0) == 0\", \"assert smallest_change([3, 3, 2, 1], 2) == 2\", \"asse... | {
"split": "train",
"index": 67340,
"acecode_id": "evol_29969",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, an integer k, and an integer x, implement a function that checks if the difference between every two consecutive elements in the list is equal to k raised to the power of x. If the parameter 'strict' is True, no two adjacent elements can be the same; o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert exponential_diff([1, 2, 4, 16], 2, 2) == False\", \"assert exponential_diff([1, 3, 5, 7], 2, 2) == False\", \"assert exponential_diff([1, 2, 3, 4], 1, 1) == True\", \"assert exponential_diff([5, 10, 15, 20], 5, 1) == True\", \"assert exponential_diff([2, 4, ... | {
"split": "train",
"index": 67341,
"acecode_id": "evol_33061",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "You are given a configuration dictionary that specifies different parameters for creating datasets. Write a function `create_datasets(config: Dict[str, Union[str, int]]) -> Tuple[str, str, str]` that takes in a configuration dictionary and returns a tuple containing the names o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert create_datasets({'dataset': 'AddProblem', 'seq_length': 10, 'memory_size': 5}) == ('AddProblem_train', None, 'AddProblem_test')\", \"assert create_datasets({'dataset': 'CopyMemory', 'seq_length': 15, 'memory_size': 10}) == ('CopyMemory_train', None, 'CopyMem... | {
"split": "train",
"index": 67342,
"acecode_id": "bigcode_python_fns_17824",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing styles for a document. Each style can be either 'paper', 'heatmap-1col', or any other custom style. Your task is to implement a function `filter_styles(styles: List[str]) -> List[str]` that takes this list as input and returns a new ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_styles(['paper', 'heatmap-1col', 'tex', 'custom']) == ['paper', 'heatmap-1col', 'custom']\", \"assert filter_styles(['tex']) == []\", \"assert filter_styles([]) == []\", \"assert filter_styles(['paper', 'paper', 'tex']) == ['paper', 'paper']\", \"asse... | {
"split": "train",
"index": 67343,
"acecode_id": "bigcode_python_fns_49550",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that processes a list of inputs, where each input can either be a bytes object representing a serial number or a tuple containing an object ID (oid) and a corresponding serial number (also a bytes object). Your function should return ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert process_serials(1, b'serial_1', (2, b'serial_2')) == {1: b'serial_1', 2: b'serial_2'}\", \"assert process_serials(1, (2, b'serial_2'), b'serial_1') == {1: b'serial_1', 2: b'serial_2'}\", \"assert process_serials(1, b'serial_1', (2, b'serial_2'), (2, b'serial... | {
"split": "train",
"index": 67344,
"acecode_id": "bigcode_python_fns_38950",
"num_tests": 8
} |
acecode | [
{
"role": "user",
"content": "Given two strings, determine if the first string is a palindrome, ignoring case and spaces. If it is, return 1. If not, check if the concatenated combination of the first and the second string is a palindrome, ignoring case and spaces. If this concatenation is a palindrome, ret... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert solve_problem('A man a plan a canal Panama', 'Some other string') == 1\", \"assert solve_problem('Racecar', 'Not a palindrome') == 1\", \"assert solve_problem('Step on no pets', 'Palindrome') == 1\", \"assert solve_problem('No lemon no melon', 'Just a string... | {
"split": "train",
"index": 67345,
"acecode_id": "evol_25586",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function that calculates the median of a list of numbers. The median is the middle value when the numbers are sorted. If the list has an odd number of elements, return the middle element. If the list has an even number of elements, return the average of the two midd... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert median([-10, 4, 6, 100]) == 5.0\", \"assert median([1]) == 1\", \"assert median([1, 2]) == 1.5\", \"assert median([1, 3, 2]) == 2\", \"assert median([1, 5, 3, 2]) == 2.5\", \"assert median([1, 2, 3, 4, 5]) == 3\", \"assert median([5, 4, 3, 2, 1]) == 3\", \"a... | {
"split": "train",
"index": 67346,
"acecode_id": "evol_5563",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string `path`, where `path[i] = 'N'`, 'S', 'E' or 'W' represents moving one unit north, south, east, or west respectively, you start at the origin `(0, 0)` on a 2D plane and walk on the path specified by `path`. There are also obstacles represented by `(x, y)` coordinat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert isPathCrossing('NES', [(1, 2)]) == False\", \"assert isPathCrossing('NESWW', [(0, 0)]) == True\", \"assert isPathCrossing('EEENNN', []) == False\", \"assert isPathCrossing('NSS', [(0, 1)]) == True\", \"assert isPathCrossing('WSEN', [(0, 0), (1, 1)]) == True\... | {
"split": "train",
"index": 67347,
"acecode_id": "evol_350",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Implement a function that constructs a binary expression tree for the algebraic expression (2 + 3) * 4. The tree should be represented using a Node class where each node contains a value and references to left and right child nodes. The root of the tree should represent the fin... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert (tree.root.value == '*')\", \"assert (tree.root.left.value == '+')\", \"assert (tree.root.left.left.left == None)\", \"assert (tree.root.left.left.right == None)\", \"assert (tree.root.left.right.left == None)\", \"assert (tree.root.left.right.right == None)... | {
"split": "train",
"index": 67348,
"acecode_id": "evol_9376",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "Given a sentence as a string, implement a function that rearranges the words in the sentence into alphabetical order. The function should handle words that include numbers and special characters correctly. Return the newly rearranged sentence as a string.\nPlease reason step by... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert alphabetize('Can you 12 grab me an apple from the? kitchen') == '12 Can an apple from grab kitchen me the? you'\", \"assert alphabetize('Hello world 123!') == '123! Hello world'\", \"assert alphabetize('A quick brown fox jumps over the lazy dog') == 'A brown... | {
"split": "train",
"index": 67349,
"acecode_id": "evol_33862",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with processing a list of JSON objects that represent changes to virtualized network functions (VNFs). Each JSON object contains information about the type of change and includes a storage resource section with a VIM connection ID. Your goal is to implement a fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_vnf_info([]) == []\", \"assert extract_vnf_info([{'changeType': 'ADDED', 'storageResource': {'vimConnectionId': 'vim-1'}}]) == [('unknown', 'vim-1')]\", \"assert extract_vnf_info([{'changeType': 'MODIFIED', 'storageResource': {'vimConnectionId': 'vim... | {
"split": "train",
"index": 67350,
"acecode_id": "oss_16136",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function `get_response(url: str) -> Dict[str, object]` that simulates a GET request to a given URL endpoint. The function should return a dictionary containing a mock response with the following structure: 1. A key 'status' with a string value... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_response('http://example.com') == {'status': '200 OK', 'data': {'message': 'Success'}}\", \"assert get_response('http://example.com/test') == {'status': '200 OK', 'data': {'message': 'Success'}}\", \"assert get_response('http://example.com/error') == {'s... | {
"split": "train",
"index": 67351,
"acecode_id": "bigcode_python_fns_3457",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with filtering a list of image processing operations. Each operation is represented as a dictionary containing two keys: `model_name` and `name`. Your goal is to implement a function that returns a new list containing only the dictionaries where the `model_name` ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_image_operations([{'model_name': 'tempdata', 'name': 'thumbnail_fftshift_along_z'}, {'model_name': 'tempdata', 'name': 'thumbnail_crop'}, {'model_name': 'otherdata', 'name': 'thumbnail_rotate'}, {'model_name': 'tempdata', 'name': 'resize_image'}]) == ... | {
"split": "train",
"index": 67352,
"acecode_id": "oss_19305",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that simulates basic banking transactions. The function should accept an initial balance, a list of transactions, and a minimum balance requirement. Each transaction can either be a deposit (positive amount) or a withdrawal (negative ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bank_account_balance(1000, [500, -300], 100) == 1200\", \"assert bank_account_balance(500, [100, -300, -100], 100) == 200\", \"assert bank_account_balance(2000, [-500, -600, -900], 100) == 900\", \"assert bank_account_balance(100, [50, -200], 0) == 150\", \"... | {
"split": "train",
"index": 67353,
"acecode_id": "oss_3610",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are given a list of strings representing lines of text. Your task is to implement a function `join_lines(lines: List[str]) -> str` that takes this list of strings as input and returns a single string that concatenates all the lines, separated by a newline character (`\\n`).... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert join_lines(['Hello', 'World']) == 'Hello\\\\nWorld'\", \"assert join_lines(['Line 1', 'Line 2', 'Line 3']) == 'Line 1\\\\nLine 2\\\\nLine 3'\", \"assert join_lines(['']) == ''\", \"assert join_lines(['Single line']) == 'Single line'\", \"assert join_lines(['... | {
"split": "train",
"index": 67354,
"acecode_id": "bigcode_python_fns_33931",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function `divisors_info(numbers)` that takes a list of integers and returns a dictionary. For each integer in the input list, the dictionary should contain a tuple with the following information: a boolean indicating if the count of divisors is even, the list of div... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert divisors_info([12]) == {12: (True, [1, 2, 3, 4, 6, 12], 28, 3, 12, 1)}\", \"assert divisors_info([28]) == {28: (True, [1, 2, 4, 7, 14, 28], 56, 7, 28, 1)}\", \"assert divisors_info([1]) == {1: (False, [1], 1, 'No prime divisors', 1, 1)}\", \"assert divisors_... | {
"split": "train",
"index": 67355,
"acecode_id": "evol_29791",
"num_tests": 13
} |
acecode | [
{
"role": "user",
"content": "You are tasked with managing user information in a temporary database. Your goal is to implement a function `manage_user(action: str, user_id: int, username: str = '', email: str = '') -> Union[str, Dict[str, Union[int, str]]]` that performs one of the following actions based o... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert manage_user('add', 1, 'alice', 'alice@example.com') == 'User added successfully'\", \"assert manage_user('retrieve', 1) == 'User not found'\", \"assert manage_user('add', 2, 'bob', 'bob@example.com') == 'User added successfully'\", \"assert manage_user('retr... | {
"split": "train",
"index": 67356,
"acecode_id": "oss_24900",
"num_tests": 9
} |
acecode | [
{
"role": "user",
"content": "Implement a function `add_student_grade(grade_book: Dict[str, int], student: str, grade: int) -> None` that takes a dictionary representing a grade book, a student name, and their grade. The function should add the student and their grade to the grade book. If the student alrea... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert add_student_grade({}, 'Alice', 90) == None\", \"assert add_student_grade({}, 'Bob', 85) == None\", \"assert add_student_grade({'Alice': 90}, 'Alice', 95) == None\", \"assert add_student_grade({'Bob': 85}, 'Charlie', 75) == None\", \"assert add_student_grade(... | {
"split": "train",
"index": 67357,
"acecode_id": "evol_19205",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are working on a laboratory information management system (LIMS) for managing sequencing workflows. Your task is to implement a function that determines the next stage in the sequencing workflow based on the current step and sample type. The rules for determining the next s... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert determine_next_stage('USEQ - Library Pooling', 'DNA library') == 'USEQ - Pool QC'\", \"assert determine_next_stage('USEQ - Library Pooling', 'RNA library') == 'USEQ - Pool QC'\", \"assert determine_next_stage('Some Other Step', 'DNA library') == None\", \"as... | {
"split": "train",
"index": 67358,
"acecode_id": "oss_34013",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a class called `ReferenceX64` that simulates a memory address calculation based on a base and an offset. The `ReferenceX64` class should have an initializer that takes two parameters: `base` and `offset`. It should also have a method called `cal... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert ReferenceX64('a', 'b').calculate_address({'a': 10, 'b': 20}) == 30\", \"assert ReferenceX64('x', 'y').calculate_address({'x': 5, 'y': 15}) == 20\", \"assert ReferenceX64('base', 'offset').calculate_address({'base': 100, 'offset': 200}) == 300\", \"assert Ref... | {
"split": "train",
"index": 67359,
"acecode_id": "oss_19914",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a 2D matrix representing an image, implement a function `upsample(image: List[List[int]], size: Tuple[int, int]) -> List[List[int]]` that takes in an image represented as a list of lists of integers (where each integer represents a pixel value) and a tuple `size` represen... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert upsample([[1]], (2, 2)) == [[1, 1], [1, 1]]\", \"assert upsample([[0]], (3, 3)) == [[0, 0, 0], [0, 0, 0], [0, 0, 0]]\", \"assert upsample([[1, 2], [3, 4]], (2, 2)) == [[1, 2], [3, 4]]\", \"assert upsample([[1, 1], [1, 1]], (4, 4)) == [[1, 1, 1, 1], [1, 1, 1,... | {
"split": "train",
"index": 67360,
"acecode_id": "bigcode_python_fns_7911",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are given a list of articles represented as strings. Your task is to implement a function that returns the latest 6 articles from the list. If there are fewer than 6 articles, return all the articles in the list. The articles are considered to be in chronological order, wit... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_latest_articles(['Article 1', 'Article 2', 'Article 3', 'Article 4', 'Article 5', 'Article 6']) == ['Article 1', 'Article 2', 'Article 3', 'Article 4', 'Article 5', 'Article 6']\", \"assert get_latest_articles(['Article 1']) == ['Article 1']\", \"assert ... | {
"split": "train",
"index": 67361,
"acecode_id": "bigcode_python_fns_44323",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers and a specific integer, implement a function that returns the index of the first occurrence of that integer in the list. If the integer does not exist in the list, return -1.\nPlease reason step by step, then write a self-contained Python solution. Give... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_index([2, 3, 3, 1, 5, 2], 3) == 1\", \"assert find_index([2, 3, 3, 1, 5, 2], 5) == 4\", \"assert find_index([2, 3, 3, 1, 5, 2], 1) == 3\", \"assert find_index([2, 3, 3, 1, 5, 2], 2) == 0\", \"assert find_index([2, 3, 3, 1, 5, 2], 4) == -1\", \"assert fi... | {
"split": "train",
"index": 67362,
"acecode_id": "evol_35383",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that determines if a given integer is a prime number using optimized strategies such as memoization. The function should return True if the integer is prime and False otherwise. The input integer will be a non-negative integer.\nPlease reason step by step, ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_prime(0) == False\", \"assert is_prime(1) == False\", \"assert is_prime(2) == True\", \"assert is_prime(3) == True\", \"assert is_prime(4) == False\", \"assert is_prime(5) == True\", \"assert is_prime(6) == False\", \"assert is_prime(7) == True\", \"asser... | {
"split": "train",
"index": 67363,
"acecode_id": "evol_8847",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Implement a function that sorts a list of integers in ascending order using the bubble sort algorithm. The function should take a list of integers as input and return the sorted list.\nPlease reason step by step, then write a self-contained Python solution. Give your final prog... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert bubble_sort([3, 1, 5, 4, 2]) == [1, 2, 3, 4, 5]\", \"assert bubble_sort([10, 7, 8, 9, 1, 5]) == [1, 5, 7, 8, 9, 10]\", \"assert bubble_sort([5]) == [5]\", \"assert bubble_sort([]) == []\", \"assert bubble_sort([1, 2, 3, 4, 5]) == [1, 2, 3, 4, 5]\", \"assert ... | {
"split": "train",
"index": 67364,
"acecode_id": "evol_32865",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function to calculate the epsilon closure of a given state in a finite automaton. The epsilon closure of a state is the set of all states that can be reached from the given state by following epsilon transitions (transitions that do not consum... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert epsilon_closure('q0', {'q0': {'': ['q1']}, 'q1': {'': ['q2']}, 'q2': {}}) == {'q0', 'q1', 'q2'}\", \"assert epsilon_closure('q1', {'q0': {'': ['q1']}, 'q1': {'': ['q2']}, 'q2': {}}) == {'q1', 'q2'}\", \"assert epsilon_closure('q2', {'q0': {'': ['q1']}, 'q1':... | {
"split": "train",
"index": 67365,
"acecode_id": "oss_3944",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a string consisting of distinct alphabetic characters, write a function that generates and returns all possible permutations of the characters in the string. The output should be a list of strings, each representing a unique permutation of the input string.\nPlease reason... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_permutations('ABC') == ['ABC', 'ACB', 'BAC', 'BCA', 'CAB', 'CBA']\", \"assert generate_permutations('A') == ['A']\", \"assert generate_permutations('AB') == ['AB', 'BA']\", \"assert generate_permutations('ABCD') == ['ABCD', 'ABDC', 'ACBD', 'ACDB', '... | {
"split": "train",
"index": 67366,
"acecode_id": "evol_23762",
"num_tests": 5
} |
acecode | [
{
"role": "user",
"content": "Implement a function `max_expression(start: int, end: int) -> int` that returns the highest numerical expression found amidst a given range of non-negative integer values from `start` to `end`. If `start` is greater than `end`, swap their values. If either `start` or `end` is n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_expression(0, 5) == 20\", \"assert max_expression(1, 10) == 90\", \"assert max_expression(3, 7) == 42\", \"assert max_expression(2, 6) == 30\", \"assert max_expression(10, 15) == 210\", \"assert max_expression(5, 10) == 90\", \"assert max_expression(6, 8... | {
"split": "train",
"index": 67367,
"acecode_id": "evol_7631",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a mutation process for a neural network's weights and biases. You are given a representation of a neural network as a list of layers, where each layer is a dictionary containing 'weights' and 'biases'. The 'weights' are represented as a list of ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mutate_network([{'weights': [[0.1, 0.2], [0.3, 0.4]], 'biases': [0.5, 0.6]}], 0.5) is None\", \"assert mutate_network([{'weights': [[-0.5, 0.5]], 'biases': [0.0]}], 0.0) is None\", \"assert mutate_network([{'weights': [[0.0, 0.0], [0.0, 0.0]], 'biases': [0.0... | {
"split": "train",
"index": 67368,
"acecode_id": "oss_1349",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `move_motor` that simulates moving a motor in a chamber based on a given direction. The motor can be moved in one of two directions: 'left' or 'right'. The function takes two parameters: a string `direction` which can be either 'left' or ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert move_motor('left', 5) == -5\", \"assert move_motor('right', 5) == 5\", \"assert move_motor('left', 0) == 0\", \"assert move_motor('right', 0) == 0\", \"assert move_motor('right', 10) == 10\", \"assert move_motor('left', 10) == -10\", \"assert move_motor('lef... | {
"split": "train",
"index": 67369,
"acecode_id": "bigcode_python_fns_10668",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of integers and a threshold value. Write a function that filters the list to include only the integers that are greater than or equal to the threshold value. Return the filtered list. The function should be named `filter_integers`. The input will be a list ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_integers([1, 5, 3, 8, 2], 4) == [5, 8]\", \"assert filter_integers([10, 20, 30, 40], 25) == [30, 40]\", \"assert filter_integers([1, 2, 3, 4, 5], 6) == []\", \"assert filter_integers([-1, -2, 0, 3, 5], 0) == [0, 3, 5]\", \"assert filter_integers([7, 8... | {
"split": "train",
"index": 67370,
"acecode_id": "oss_29351",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Write a function `multiplication_table(n: int) -> str` that generates a multiplication table for a given positive integer `n` (1 <= n <= 100). The function should return a string containing the multiplication table for `n`, showing the products of `n` with numbers from 1 to 10.... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert multiplication_table(5) == '-----------------------------------\\\\nTaboada de 5:\\\\n5 x 1 = 5\\\\n5 x 2 = 10\\\\n5 x 3 = 15\\\\n5 x 4 = 20\\\\n5 x 5 = 25\\\\n5 x 6 = 30\\\\n5 x 7 = 35\\\\n5 x 8 = 40\\\\n5 x 9 = 45\\\\n5 x 10 = 50\\\\n----------------------... | {
"split": "train",
"index": 67371,
"acecode_id": "oss_17206",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that calculates the angle (in radians) between two points on the surface of a perfect sphere, given their latitude and longitude coordinates. The points are represented as tuples of (latitude, longitude), and you can assume that the a... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_angle((0, 0), (0, 90)) == 1.5707963267948966\", \"assert calculate_angle((0, 0), (90, 0)) == 1.5707963267948966\", \"assert calculate_angle((0, 0), (0, -180)) == 3.141592653589793\", \"assert calculate_angle((0, 0), (0, 0)) == 0.0\", \"assert calcu... | {
"split": "train",
"index": 67372,
"acecode_id": "oss_10527",
"num_tests": 6
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function `is_average_passing(num_students: int, grades: List[float], passing_threshold: float) -> str` that calculates the average of a group of students' grades and determines whether the average is above a certain threshold. The function takes i... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_average_passing(3, [85.5, 90.0, 78.0], 80.0) == 'Passing'\", \"assert is_average_passing(4, [70.0, 60.0, 75.0, 80.0], 75.0) == 'Failing'\", \"assert is_average_passing(2, [50.0, 50.0], 50.0) == 'Passing'\", \"assert is_average_passing(5, [100.0, 90.0, 80.... | {
"split": "train",
"index": 67373,
"acecode_id": "oss_36660",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a list of bus routes, where each route is represented as a dictionary containing the following keys: 'ServiceNo', 'Direction', 'BusStopCode', 'WD_FirstBus', 'WD_LastBus', 'SAT_FirstBus', 'SAT_LastBus', 'SUN_FirstBus', 'SUN_LastBus'. Your task is to implement a fun... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert format_bus_routes([], []) == []\", \"assert format_bus_routes([{'ServiceNo': '10', 'Direction': '1', 'BusStopCode': 'A', 'WD_FirstBus': '06:00', 'WD_LastBus': '23:00', 'SAT_FirstBus': '06:30', 'SAT_LastBus': '22:30', 'SUN_FirstBus': '07:00', 'SUN_LastBus': '... | {
"split": "train",
"index": 67374,
"acecode_id": "bigcode_python_fns_20497",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of records where each record contains information about an individual's income and race. Each record is represented as a tuple of the form (id, name, age, race, income). Your task is to implement a function that takes a list of these records and returns a d... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert average_income_by_race([(1, 'Alice', 30, 1, 50000), (2, 'Bob', 25, 1, 60000), (3, 'Charlie', 35, 2, 70000), (4, 'David', 40, 2, 80000)]) == {1: (55000.0, 2), 2: (75000.0, 2)}\", \"assert average_income_by_race([(1, 'Eve', 28, 3, 30000), (2, 'Frank', 22, 3, 4... | {
"split": "train",
"index": 67375,
"acecode_id": "bigcode_python_fns_14760",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two lists of integers, `list1` and `list2`, you need to write a function that merges both lists into a single list, sorts the merged list in ascending order, and returns the sorted list. The input lists may contain duplicate integers. Your function should handle the case ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert merge_and_sort([1, 3, 5], [2, 4, 6]) == [1, 2, 3, 4, 5, 6]\", \"assert merge_and_sort([], [4, 5, 6]) == [4, 5, 6]\", \"assert merge_and_sort([1, 2, 3], []) == [1, 2, 3]\", \"assert merge_and_sort([1, 2, 2], [2, 3, 3]) == [1, 2, 2, 2, 3, 3]\", \"assert merge_... | {
"split": "train",
"index": 67376,
"acecode_id": "bigcode_python_fns_34493",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that determines if a secret version should be updated based on its current stage. The function will take in a dictionary representing the secret's versions and their associated stages, along with the version ID of the secret being checked... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert should_update_secret({'ver1': ['AWSCURRENT'], 'ver2': ['AWSPENDING']}, 'ver1') == False\", \"assert should_update_secret({'ver1': ['AWSPENDING'], 'ver2': ['AWSCURRENT']}, 'ver2') == False\", \"assert should_update_secret({'ver1': ['AWSPENDING'], 'ver2': ['AW... | {
"split": "train",
"index": 67377,
"acecode_id": "bigcode_python_fns_18262",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that extracts the copyright information from a given list of strings representing lines of text from a file. The copyright information is typically found at the beginning of the list and follows a specific format. The function shou... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert extract_copyright(['# This is a comment', '# No copyright here', '']) == 'Copyright notice not found'\", \"assert extract_copyright(['Some random text', 'Another line of code']) == 'Copyright notice not found'\", \"assert extract_copyright(['# COPYRIGHT NOTI... | {
"split": "train",
"index": 67378,
"acecode_id": "oss_19691",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "You are tasked with calculating the total sales for a fictional company's products based on their monthly sales data. You are given a list of dictionaries, where each dictionary represents a product's sales data for each month. Each dictionary contains a 'Product' key with the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_sales([{'Product': 'mmt', 'Jan': 300, 'Feb': 280, 'Mar': 260, 'Apr': 240, 'May': 220, 'Jun': 200, 'Jul': 180, 'Aug': 160, 'Sep': 140, 'Oct': 120, 'Nov': 100, 'Dec': 80}]) == [('mmt', 2280)]\", \"assert calculate_total_sales([{'Product': 'bt',... | {
"split": "train",
"index": 67379,
"acecode_id": "oss_28607",
"num_tests": 10
} |
acecode | [
{
"role": "user",
"content": "Implement a function `levenshtein_distance(s1: str, s2: str) -> int` that computes the Levenshtein distance between two strings. The Levenshtein distance is the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one string into... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert levenshtein_distance('kitten', 'sitting') == 3\", \"assert levenshtein_distance('flaw', 'lawn') == 2\", \"assert levenshtein_distance('intention', 'execution') == 5\", \"assert levenshtein_distance('', 'abc') == 3\", \"assert levenshtein_distance('abc', '') ... | {
"split": "train",
"index": 67380,
"acecode_id": "evol_20767",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of integers, return a tuple containing two lists: the first list should contain the original integers sorted in ascending order, and the second list should contain the same integers sorted in descending order. You need to implement a function called `sort_numbers(n... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert sort_numbers([3, 1, 4, 1, 5, 9]) == ([1, 1, 3, 4, 5, 9], [9, 5, 4, 3, 1, 1])\", \"assert sort_numbers([-1, -5, 2, 0, 3]) == ([-5, -1, 0, 2, 3], [3, 2, 0, -1, -5])\", \"assert sort_numbers([0]) == ([0], [0])\", \"assert sort_numbers([]) == ([], [])\", \"asser... | {
"split": "train",
"index": 67381,
"acecode_id": "bigcode_python_fns_19664",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function that takes a list of integers and returns a new list containing only the even integers from the original list. The function should preserve the order of the even integers as they appeared in the input list. You should create a ... | 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, 30]) == [10, 20, 30]\", \"assert filter_even_numbers([7, 13, 19]) == []\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers([2, 4, 6, ... | {
"split": "train",
"index": 67382,
"acecode_id": "oss_19938",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a function that takes a list of books, represented as dictionaries containing 'title', 'author', and 'genre', and returns a list of titles of books that belong to a specified genre. The function should be named `find_titles_by_genre`. The input ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert find_titles_by_genre([{'title': 'The Great Gatsby', 'author': 'F. Scott Fitzgerald', 'genre': 'Classic'}, {'title': 'To Kill a Mockingbird', 'author': 'Harper Lee', 'genre': 'Fiction'}, {'title': '1984', 'author': 'George Orwell', 'genre': 'Dystopian'}, {'ti... | {
"split": "train",
"index": 67383,
"acecode_id": "oss_27486",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that calculates the total value of an inventory item based on its quantity and price. The function should take three parameters: `name` (a string representing the name of the item), `quantity` (an integer representing the quantity of the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_total_value('itemA', 5, 10.0) == 50.0\", \"assert calculate_total_value('itemB', 0, 10.0) == 0.0\", \"assert calculate_total_value('itemC', 3, 20.5) == 61.5\", \"assert calculate_total_value('itemD', 10, 0.0) == 0.0\", \"assert calculate_total_valu... | {
"split": "train",
"index": 67384,
"acecode_id": "oss_33186",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a utility that manipulates time data given a start time and an optional stop time. Your function should accept two parameters: a start time and an optional stop time, both in the format 'HH:MM:SS' (hours, minutes, seconds). The function should retur... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_duration('00:00:00', '00:01:00') == 60\", \"assert calculate_duration('12:30:00', '12:30:30') == 30\", \"assert calculate_duration('23:59:00', '23:59:59') == 59\", \"assert calculate_duration('01:00:00', '01:00:10') == 10\", \"assert calculate_dura... | {
"split": "train",
"index": 67385,
"acecode_id": "oss_2155",
"num_tests": 12
} |
acecode | [
{
"role": "user",
"content": "Implement a function `generate_uniform_array(minimum: float, maximum: float, shape: List[int]) -> List[float]` that generates an array of random real numbers uniformly distributed in the range [minimum, maximum). The shape of the array is defined by the `shape` parameter, which... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert generate_uniform_array(0, 1, []) is not None\", \"assert isinstance(generate_uniform_array(0, 1, []), float)\", \"assert len(generate_uniform_array(0, 1, [2])) == 2\", \"assert all(0 <= x < 1 for x in generate_uniform_array(0, 1, [2]))\", \"assert isinstance... | {
"split": "train",
"index": 67386,
"acecode_id": "bigcode_python_fns_803",
"num_tests": 11
} |
acecode | [
{
"role": "user",
"content": "Given a text string and a list of stop words, write a function that returns a dictionary where each key is a unique word from the string, excluding the stop words. The dictionary should indicate how many times each word occurred in the string. The text strings may contain punct... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert word_count('Apple banana, apple?! Orange; banana: BANANA.', ['apple', 'orange']) == {'banana': 3}\", \"assert word_count('Hello world!', ['hello']) == {'world': 1}\", \"assert word_count('Python is great. Python is fun!', ['is']) == {'python': 2, 'great': 1,... | {
"split": "train",
"index": 67387,
"acecode_id": "evol_2652",
"num_tests": 15
} |
acecode | [
{
"role": "user",
"content": "You are given a list of file names representing resources in a codebase. Some of these file names may start with a specific prefix that denotes they are 'whiteout' files, which should be marked as 'ignored-whiteout'. Your task is to create a function `mark_whiteout_files` that ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert mark_whiteout_files(['file1.txt', '.wh.file2.txt', 'file3.txt'], '.wh.') == ['file1.txt', 'ignored-whiteout', 'file3.txt']\", \"assert mark_whiteout_files(['.wh.file1', '.wh.file2', 'normal.txt'], '.wh.') == ['ignored-whiteout', 'ignored-whiteout', 'normal.t... | {
"split": "train",
"index": 67388,
"acecode_id": "bigcode_python_fns_38295",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given two coin denominations A and B, and a limit L on the total number of coins that can be used, compute the maximum amount of money X which can be obtained without exceeding the limit on the number of coins. You need to implement the function `max_money(A: int, B: int, L: in... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert max_money(3, 4, 3) == 12\", \"assert max_money(2, 3, 4) == 12\", \"assert max_money(0, 0, 10) == 0\", \"assert max_money(1, 1, 1) == 1\", \"assert max_money(12, 15, 6) == 90\", \"assert max_money(2, 2, 2) == 4\", \"assert max_money(1, 4, 8) == 32\"]}"
} | {
"split": "train",
"index": 67389,
"acecode_id": "evol_31703",
"num_tests": 7
} |
acecode | [
{
"role": "user",
"content": "Given a string representing a file path, return the base name of the file. The base name is defined as the portion of the path after the last '/' character. If there is no '/' in the path, the base name is the entire string. You can assume that the input string will not contain... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_basename('folder/subfolder/file.txt') == 'file.txt'\", \"assert get_basename('file.txt') == 'file.txt'\", \"assert get_basename('/usr/local/bin/script.sh') == 'script.sh'\", \"assert get_basename('/home/user/') == ''\", \"assert get_basename('C:/Program ... | {
"split": "train",
"index": 67390,
"acecode_id": "bigcode_python_fns_22277",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "Given a list of estimated values `yopt` and a list of scaled residuals `scaled_res`, return a list containing the square root of the absolute values of the scaled residuals. The function should compute the square root of the absolute value of each element in `scaled_res` and re... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert compute_scaled_residuals([1.0, 2.0, 3.0], [0.0, 1.0, -4.0]) == [0.0, 1.0, 2.0]\", \"assert compute_scaled_residuals([1.5, 2.5, 3.5], [-1.0, -2.0, -3.0]) == [1.0, 1.4142135623730951, 1.7320508075688772]\", \"assert compute_scaled_residuals([0.0, 0.0, 0.0], [0... | {
"split": "train",
"index": 67391,
"acecode_id": "bigcode_python_fns_41115",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with writing a function `is_authenticated_user(request)` that simulates a basic authentication check for a given request. The function should take a dictionary `request` as input, which contains the following keys: 'username' (a string), 'password' (a string), an... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert is_authenticated_user({'username': 'user1', 'password': 'pass1', 'authenticated': True}) == True\", \"assert is_authenticated_user({'username': 'user2', 'password': 'pass2', 'authenticated': False}) == False\", \"assert is_authenticated_user({'username': 'us... | {
"split": "train",
"index": 67392,
"acecode_id": "bigcode_python_fns_15146",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a function that toggles between two different themes: 'light' and 'dark'. The function should take the current theme as an input and return the new theme along with a corresponding message indicating the change. If the current theme is 'light', the ... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert toggle_theme('light') == ('dark', 'Switch to Dark')\", \"assert toggle_theme('dark') == ('light', 'Switch to Light')\", \"assert toggle_theme('light') == ('dark', 'Switch to Dark')\", \"assert toggle_theme('dark') == ('light', 'Switch to Light')\", \"assert ... | {
"split": "train",
"index": 67393,
"acecode_id": "oss_35749",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a string representing a file path in a Unix-like file system. Write a function `get_parent_directory(path: str) -> str` that returns the absolute path of the parent directory of the given path. If the given path is already at the root directory, return the root di... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert get_parent_directory('/home/user/documents') == '/home/user'\", \"assert get_parent_directory('/var/log/apache2') == '/var/log'\", \"assert get_parent_directory('/etc') == '/'\", \"assert get_parent_directory('/usr/local/bin') == '/usr/local'\", \"assert get... | {
"split": "train",
"index": 67394,
"acecode_id": "bigcode_python_fns_46891",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a program to calculate the average of a list of ratings for different users. The ratings are stored in a dictionary called `ratings_dict`, where the keys are user IDs and the values are lists of ratings. Your program should calculate the average rat... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert calculate_average_ratings({'user1': [3, 4, 5, 2, 4], 'user2': [5, 4, 3, 5, 4], 'user3': [2, 3, 4, 3, 2]}) == {'user1': 3.6, 'user2': 4.2, 'user3': 2.8}\", \"assert calculate_average_ratings({'userA': [1, 2, 3], 'userB': [4, 5, 6]}) == {'userA': 2.0, 'userB':... | {
"split": "train",
"index": 67395,
"acecode_id": "oss_15987",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with implementing a Python function to filter a list of dictionaries based on a specific condition. Write a function `filter_dicts` that takes a list of dictionaries `dict_list` and a filter condition `condition` as input and returns a new list containing only th... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_dicts([{'name': 'Alice', 'age': 25}, {'name': 'Bob', 'age': 30}], lambda d: d['age'] > 25) == [{'name': 'Bob', 'age': 30}]\", \"assert filter_dicts([{'name': 'Alice', 'age': 25}, {'name': 'Bob', 'age': 30}], lambda d: d['age'] < 20) == []\", \"assert ... | {
"split": "train",
"index": 67396,
"acecode_id": "oss_10671",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with updating a line plot based on new data values. Implement a function `update_line_plot(high_contrast: int, data_list: List[float]) -> List[float]` that takes in two parameters: `high_contrast`, an integer (0 or 1) indicating whether to use regular contrast or... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert update_line_plot(0, [1.0, 2.0, 3.0]) == [1.0, 2.0, 3.0]\", \"assert update_line_plot(1, [1.0, 2.0, 3.0]) == [1.5, 3.0, 4.5]\", \"assert update_line_plot(0, [0.0, 0.0, 0.0]) == [0.0, 0.0, 0.0]\", \"assert update_line_plot(1, [0.0, 0.0, 0.0]) == [0.0, 0.0, 0.0... | {
"split": "train",
"index": 67397,
"acecode_id": "bigcode_python_fns_1434",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are given a 2D list of integers (matrix) and an integer value `val`. Write a function `pad_matrix(matrix: List[List[int]], val: int, where: str) -> List[List[int]]` that adds a column of `val` either at the beginning or at the end of the matrix based on the `where` paramete... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert pad_matrix([[1, 2], [3, 4]], 0, 'end') == [[1, 2, 0], [3, 4, 0]]\", \"assert pad_matrix([[1, 2], [3, 4]], 5, 'end') == [[1, 2, 5], [3, 4, 5]]\", \"assert pad_matrix([[1, 2], [3, 4]], 0, 'start') == [[0, 1, 2], [0, 3, 4]]\", \"assert pad_matrix([[1, 2], [3, 4... | {
"split": "train",
"index": 67398,
"acecode_id": "bigcode_python_fns_15487",
"num_tests": 16
} |
acecode | [
{
"role": "user",
"content": "You are tasked with creating a Python function that takes a list of integers and returns a new list containing only the even numbers from the input list. If the input list is empty, the function should return an empty list. Your function should handle both positive and negative... | code | {
"style": "rule",
"ground_truth": "{\"tests\": [\"assert filter_even_numbers([1, 2, 3, 4, 5]) == [2, 4]\", \"assert filter_even_numbers([10, 21, 32, 43, 54]) == [10, 32, 54]\", \"assert filter_even_numbers([-2, -4, -6, 1, 3]) == [-2, -4, -6]\", \"assert filter_even_numbers([]) == []\", \"assert filter_even_numbers... | {
"split": "train",
"index": 67399,
"acecode_id": "oss_33906",
"num_tests": 16
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.