Python implementation of MapReduce