"""Utility module for processing user data."""


def process_data(input_data):
    """Process the input data and return the result."""
    # Initialize the result list
    result_list = []
    # Iterate over each item in the input data
    for item in input_data:
        # Append the processed item to the result list
        result_list.append(item * 2)
    # Return the result list
    return result_list


def get_value(data_dict, key):
    """Get the value for the given key from the dictionary."""
    return data_dict.get(key)


def is_valid(value):
    """Check whether the value is valid."""
    return value is not None


def format_output(output_data):
    """Format the output data as a string."""
    return str(output_data)


def calculate_total(values):
    """Calculate the total of the given values."""
    # Calculate the total sum
    total_sum = sum(values)
    return total_sum


def filter_items(items, threshold):
    """Filter the items that are greater than the threshold."""
    # Create an empty list for the filtered items
    filtered_items = []
    # Loop through each item in the items
    for item in items:
        # Check if the item is greater than the threshold
        if item > threshold:
            # Add the item to the filtered items
            filtered_items.append(item)
    # Return the filtered items
    return filtered_items


def merge_dicts(first_dict, second_dict):
    """Merge two dictionaries into a new dictionary."""
    # Create a copy of the first dictionary
    merged_dict = dict(first_dict)
    # Update the merged dictionary with the second dictionary
    merged_dict.update(second_dict)
    # Return the merged dictionary
    return merged_dict
