HW2 map/reduce python code