<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def m2q(r):
 """ Find a unit quaternion corresponding to a specified rotation matrix. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/m2q_c.html :param r: A rotation matrix to be factored :type r: 3x3-Element Array of floats :return: A unit quaternion representing the rotation matrix :rtype: 4-Element Array of floats """

    r = stypes.toDoubleMatrix(r)
    q = stypes.emptyDoubleVector(4)
    libspice.m2q_c(r, q)
    return stypes.cVectorToPython(q)