Did I find the right examples for you? yes no

# map

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).
```

```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)})

```

```    # 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)

```

```    # 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'])

```

```    # 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)

```

```    # and return the result.
if CANUSEGPU:
print map(fun, [2, 3], gpu=1)

```

```    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)
```

```    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)
```

```def draw():
background(0)
lights()
translate(width / 2, height / 2)
rotateY(map(mouseX, 0, width, 0, PI))
rotateZ(map(mouseY, 0, height, 0, -PI))
```

```def draw():
background(102)
translate(width / 2, height / 2)
zoom = map(mouseX, 0, width, 0.1, 4.5)
scale(zoom)
```

```    for i in range(stepCount):