from typing import Dict
from typing import Callable


def dict_subset(adict: Dict, predicate: Callable):
    """Return a dict that is a subset of ``adict`` using a filter function.

    The signature of the filter is: ``predicate(key, val) -> bool``
    """
    return {k: v for k, v in adict.items() if predicate(k, v)}