def select_dict_keys(dictionary, keys):
    """Filters a dict by only including certain keys.

    :param dictionary: dictionary
    :param keys: keys to be selected
    :return: dictionary with selected keys
    """

    key_set = set(keys) & set(dictionary.keys())
    return {key: dictionary[key] for key in key_set}