def METHOD_NAME(A, T, tranpose=False, debug=True):
    """
    Calculates the matrix triple product  for a series of::
        triple[n, :, :] = T.T @ A @ T  # tranpose=False
        triple[n, :, :] = T @ A @ T.T  # transpose=True
    Parameters
    ----------
    A, T : (n, 3, 3)
        the set of matrices to multiply
    tranpose : bool; default=False
        transposes T
    Returns
    -------
    triple : (n, 3, 3) float ndarray
        the set of 3 x 3 matrix triples
    """
    assert A.shape == T.shape, 'A.shape=%s T.shape=%s' % (str(A.shape), str(T.shape))
    if tranpose:
        C = np.matmul(transpose3d(T), np.matmul(A, T))
    else:
        C = np.matmul(T, np.matmul(A, transpose3d(T)))
    if debug:
        D = np.full(A.shape, np.nan)
        if tranpose:
            for i, Ai, Ti in zip(count(), A, T):
                Dia = Ti.T @ Ai @ Ti
                D[i, :, :] = Dia
        else:
            for i, Ai, Ti in zip(count(), A, T):
                Dib = Ti @ Ai @ Ti.T
                D[i, :, :] = Dib
        assert np.all(np.allclose(C, D)), 'tranpose=%s' % tranpose
    return C