def _transpose2Dlist(mat):
    """transpose a matrix that is constructed as a list of lists in pure
    Python

    The inner lists represents rows.

    Parameters
    ----------
    mat : list of lists (2-d list)
        the 2D list represented as
        | [[a_00, a_01, ..., a_0n],
        |  [a_10, a_11, ..., a_1n],
        |            ...          ,
        |  [a_m0, a_m1, ..., a_mn]]

    Returns
    -------
    matT : list of lists (2-d list)
        transposed of ``mat``

    Notes
    -----
    The function assumes that all the inner lists are of the same lengths.
    It doesn't do any error checking.
    """
    cols = len(mat[0])
    matT = []
    for i in range(cols):
        matT.append([row[i] for row in mat])
    return matT