add reduce import for py3 compatibility