Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)
reduce(function, sequence[, initial]) -> value

Apply a function of two arguments cumulatively to the items of a sequence,
from left to right, so as to reduce the sequence to a single value.
For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
((((1+2)+3)+4)+5).  If initial is present, it is placed before the items
of the sequence in the calculation, and serves as a default when the
sequence is empty.

src/b/l/blaze-0.1/blaze/llvm_array.py   blaze(Download)
from llvm.core import Type, Constant
import llvm_cbuilder.shortnames as C
from .py3help import reduce
# Different Array Types
    if all(hasattr(x, '__index__') for x in shape):
        shape = [x.__index__() for x in shape]
        total = reduce(operator.mul, shape, _sizeof(eltype))
        arg = Constant.int(intp_type, total)

src/b/l/blaze-0.1/blaze/kernelgen.py   blaze(Download)
import llvm.core as lc
import llvm_cbuilder.shortnames as C
from .py3help import reduce
    with position(builder, entry):
        # sentry valid ranges
        valid = reduce(builder.and_, [compare_signed(builder, '<', s, e)
                                      for s, e in zip(begins, ends)])
        builder.cbranch(valid, cond, end)