from typing import Dict
from typing import List


def filter_dict(source: Dict, fields: List[str]) -> Dict:
    """
    Only includes the specified keys from the source dict
    """

    try:
        return {k: v for k, v in source.items() if k in fields}
    except AttributeError:
        return source