def all_of(pred, iterable):
    """
    Returns ``True`` if ``pred`` returns ``True`` for all the elements in
    the ``iterable`` range or if the range is empty, and ``False`` otherwise.

        >>> all_of(lambda x: x % 2 == 0, [2, 4, 6, 8])
        True

    :param pred: a predicate function to check a value from the iterable range
    :param iterable: an iterable range to check in
    :returns: ``True`` if ``pred`` returns ``True`` for all the elements
    """
    return all((pred(i) for i in iterable))