fix dataset.reduce iteritems for python3