def diagsvd(s, M, N):
    part = diag(s)
    typ = part.dtype.char
    MorN = len(s)
    if MorN == M:
        return r_['-1', part, zeros((M, N-M), typ)]
    elif MorN == N:
        return r_[part, zeros((M-N, N), typ)]
    else:
        raise ValueError("Length of s must be M or N.")


# Orthonormal decomposition
Construct the sigma matrix in SVD from singular values and size M, N.
dataset/ETHPy150Open scipy/scipy/scipy/linalg/decomp_svd.py/diagsvd