<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def diags2(symmat):
 """ Diagonalize a symmetric 2x2 matrix. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/diags2_c.html :param symmat: A symmetric 2x2 matrix. :type symmat: 2x2-Element Array of floats :return: A diagonal matrix similar to symmat, A rotation used as the similarity transformation. :rtype: tuple """

    symmat = stypes.toDoubleMatrix(symmat)
    diag = stypes.emptyDoubleMatrix(x=2, y=2)
    rotateout = stypes.emptyDoubleMatrix(x=2, y=2)
    libspice.diags2_c(symmat, diag, rotateout)
    return stypes.cMatrixToNumpy(diag), stypes.cMatrixToNumpy(rotateout)