Did I find the right examples for you? yes no

All Samples(98887)  |  Call(98867)  |  Derive(0)  |  Import(20)
map(function, sequence[, sequence, ...]) -> list

Return a list of the results of applying the function to the items of
the argument sequence(s).  If more than one sequence is given, the
function is called with an argument list consisting of the corresponding
item of each sequence, substituting None for missing values when not all
sequences have the same length.  If the function is None, return a list of
the items of the sequence (or a list of tuples if more than one sequence).

src/p/l/playdoh-0.3/examples/map_shared.py   playdoh(Download)
if __name__ == '__main__':
    # Execute two function evaluations with a large NumPy array in shared data.
    map(fun, [rand(100000,2), rand(100000,2)], cpu=2,
        shared_data={'x0': rand(100000,2)})
 

src/p/l/playdoh-0.3/examples/map_lambda.py   playdoh(Download)
    # Execute ``lambda(1)`` and ``lambda(2)`` in parallel on two CPUs on this machine
    # and return the result.
    print map(lambda x:x*x, [1,2], cpu=2)
 

src/p/l/playdoh-0.3/examples/map_dependencies.py   playdoh(Download)
    # to transfer on the machines executing the task. It is only needed when using
    # remote machines, and not when using CPUs on the local machine.
    print map(fun, [1,2], codedependencies=['external_module.py'])
 
 

src/p/l/playdoh-0.3/examples/map.py   playdoh(Download)
    # Execute ``fun(1)`` and ``fun(2)`` in parallel on two CPUs on this machine
    # and return the result.
    print map(fun, [1,2], cpu=2)
 
 

src/p/l/playdoh-0.3/examples/gpu.py   playdoh(Download)
    # and return the result.
    if CANUSEGPU:
        print map(fun, [2, 3], gpu=1)
 
 

src/p/r/processing.py-HEAD/examples.py/Fisica/densities.py   processing.py(Download)
    for i in range(ballCount):
        b = FCircle(25)
        b.setPosition(40, map(i, 0, ballCount-1, 40, height-40))
        b.setDensity(map(i, 0, ballCount-1, 0.1, 0.9))
        b.setVelocity(100, 0)
        b.setDamping(0.0)
        b.setNoStroke()
        b.setFill(map(i, 0, ballCount-1, 120, 0))
    for i in range(ballCount):
        b = FCircle(25)
        b.setPosition(width/2, map(i, 0, ballCount-1, 40, height-40))
        b.setVelocity(0, 0)
        b.setDamping(0.0)

src/p/r/processing.py-HEAD/examples.py/Fisica/restitutions.py   processing.py(Download)
    for i in range(ballCount):
        b = FCircle(25)
        b.setPosition(map(i, 0, ballCount-1, 40, width-40), height/6)
        b.setRestitution(map(i, 0, ballCount-1, 0.0, 1.0))
        b.setNoStroke()
        b.setFill(map(i, 0, ballCount-1, 60, 255), 80, 120)

src/p/r/processing.py-HEAD/examples.py/3D/Form/Vertices.py   processing.py(Download)
def draw():
    background(0)
    lights()
    translate(width / 2, height / 2)
    rotateY(map(mouseX, 0, width, 0, PI))
    rotateZ(map(mouseY, 0, height, 0, -PI))

src/p/r/processing.py-HEAD/examples.py/Basics/Shape/ScaleShape.py   processing.py(Download)
def draw():
    background(102)
    translate(width / 2, height / 2)
    zoom = map(mouseX, 0, width, 0.1, 4.5)
    scale(zoom)

src/p/r/processing.py-HEAD/examples.py/Fisica/anchors.py   processing.py(Download)
    for i in range(stepCount):
        box = FBox(boxWidth, 10)
        box.setPosition(map(i, 0, stepCount - 1, boxWidth, width-boxWidth), puenteY)
        box.setNoStroke()
        box.setFill(120, 200, 190)

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next