use six.iteritems instead of dict.iteritems