<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _filter_keys(d: dict, keys: set) -> dict: """ Select a subset of keys from a dictionary. """

        return {key: d[key] for key in keys if key in d}