def diag_indices_from(arr):
    if not arr.ndim >= 2:
        raise ValueError("input array must be at least 2-d")
    # For more than d=2, the strided formula is only valid for arrays with
    # all dimensions equal, so we check first.
    if not np.alltrue(np.diff(arr.shape) == 0):
        raise ValueError("All dimensions of input must be of equal length")

    return diag_indices(arr.shape[0], arr.ndim)
Print out some stats about registered endpoints.
dataset/ETHPy150Open nipy/nitime/nitime/utils.py/diag_indices_from--crossover with--dataset/ETHPy150Open timvideos/streaming-system/website/tracker/views.py/endpoint_stats