Import reduce for Python 3