def filter_dict(dictionary, keep_fields):
    """
    Filter a dictionary's entries.
    
    :param dictionary: Dictionary that is going to be filtered.
    :type dictionary: dict
    :param keep_fields: Dictionary keys that aren't going to be filtered.
    :type keep_fields: dict or list or set
    :return: Filtered dictionary.
    :rtype: dict
    """
    return {
        key: value
        for key, value in dictionary.items()
        if key in keep_fields
    }