From Functools Import Reduce Python Function