from typing import Optional
from typing import Dict
from typing import Iterable


def stripped_by_keys(dictionary: Optional[Dict], keys_to_keep: Iterable) -> Dict:
    """Returns a dictionary containing keys and values from dictionary,
    but only keeping the keys in `keys_to_keep`.

    Returns empty dict if `dictionary` is None.

    Parameters
    ----------
    dictionary : Optional[Dict]
        Dictionary to strip down by keys.
    keys_to_keep : Iterable
        Which keys of the dictionary to keep.

    Returns
    -------
    Dict
        Dictionary containing only keys from `keys_to_keep`.
    """
    dictionary = {} if dictionary is None else dictionary
    dictionary = {key: value for key, value in dictionary.items() if key in keys_to_keep}
    return dictionary