OK for the correction. 
Note that thisline  could be more concisely rewritten as 
threshold = sv[sv < alpha / m * np.arange(m)].max()