Apply Function To Dictionary Values Python