from typing import Dict
from typing import Any


def normalize_dict(from_dict: Dict[str, Any], key_mapping: Dict[str, str]) -> Dict[str, Any]:
    """
    Return a subset of the values in ``from_dict`` re-keyed according to the
    mapping in ``key_mapping``.  The key mapping dict has the format of
    ``key_mapping[new_key] = old_key``.
    """
    to_dict = {}

    for new_key, old_key in key_mapping.items():
        if old_key in from_dict:
            to_dict[new_key] = from_dict[old_key]

    return to_dict