def filter_dict(d: dict, keys: list) -> dict:
    """
    Given a dictionary, filter the contents and return a new dictionary containing the given keys

    Parameters
    ----------
    d : dict
        dictionary to filter
    keys : list
        list of keys to include in new dictionary

    Returns
    -------
    dict
        filtered dictionary

    """
    nd = {k: d[k] for k in d.keys() if k in keys}
    return nd