<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def be2le_state_by_state(tpm):
 """Convert a state-by-state TPM from big-endian to little-endian or vice versa. Args: tpm (np.ndarray):
 A state-by-state TPM. Returns: np.ndarray: The state-by-state TPM in the other indexing format. Example: array([[ 0., 1., 2., 3.], [ 8., 9., 10., 11.], [ 4., 5., 6., 7.], [12., 13., 14., 15.]]) """

    le = np.empty(tpm.shape)
    N = tpm.shape[0]
    n = int(log2(N))
    for i in range(N):
        le[i, :] = tpm[be2le(i, n), :]
    return le