def map(intValue): print intValue, 1 def reduce(*args): store = {} for intValue, count in args: store[computeBin(intValue)] += count