Optimized Dynamic Programming (Dynamic Time Warp) as a Python external