def first(predicate_or_None, iterable, default=None):
    """
    Returns the first item of iterable for which predicate(item) is true.
    If predicate is None, matches the first item that is true.
    Returns value of default in case of no matching items.
    """
    return next(
        filter(predicate_or_None, iterable),
        default
    )