mapreduce()

Applies the MapReduce algorithm to the given list. The given
mapper is applied to each element in the given list, generating
num_outputs outputs per element. These are then “shuffled” so that
reduceri receives the ith output of each mapper. The result
is a list containing the results of applying reducer to the collated
num_outputs outputs of the mappers.

N.B. This function does not create tasks, partition outputs
between reducers, or perform sorting on the inputs to reducers. To
create tasks, include spawn() or spawn_exec() in the definition of
mapper and reducer. Partitioning and sorting should be implemented
in mapper and reducer respectively.