The np.std() function computes the standard deviation over all the entries of the flattened matrix. So for instance, given an array a = np.array([[1,2],[3,4],[5,6]]), the std is computed over the 6 entries rather than the 3 points.
I think this line of code in the DLTcalib() function is the correct template to compute the mean distance: err = np.sqrt(np.mean(np.sum((uv2[0:2, :].T - uv)**2, 1)).