def first_where(pred, iterable, default=None):
    """Returns the first element in an iterable that meets the given predicate.

    :param default: is the default value to use if the predicate matches none of the elements.
    """
    return next(six.moves.filter(pred, iterable), default)
Returns the first element in an iterable that meets the given predicate.

    :param default: is the default value to use if the predicate matches none of the elements.