def find(predicate, iterable, default=None):
    """Return the first item matching `predicate` in `iterable`, or `default` if no match.

    If you need all matching items, just use the builtin `filter` or a comprehension;
    this is a convenience utility to get the first match only.
    """
    return next(filter(predicate, iterable), default)