Return a new dictionary comprising of keys
    for which ``predicate`` returns True, and their corresponding values.

    :param predicate: Predicate taking a dictionary key, or None

def filterkeys(predicate, dict_):
    """Return a new dictionary comprising of keys
    for which ``predicate`` returns True, and their corresponding values.

    :param predicate: Predicate taking a dictionary key, or None
    """
    predicate = bool if predicate is None else ensure_callable(predicate)
    ensure_mapping(dict_)
    return dict_.__class__((k, v) for k, v in iteritems(dict_) if predicate(k))