I'm attempting to translate the Matlab code in this answer to Python. I'm halfway done, but I've never really written Matlab code and I'm having trouble finishing the final function.
Can I ask for help here regarding this not-complete code or would this be considered off-topic?