<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def xposeg(matrix, nrow, ncol):
 """ Transpose a matrix of arbitrary size in place, the matrix need not be square. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/xposeg_c.html :param matrix: Matrix to be transposed :type matrix: NxM-Element Array of floats :param nrow: Number of rows of input matrix. :type nrow: int :param ncol: Number of columns of input matrix :type ncol: int :return: Transposed matrix :rtype: NxM-Element Array of floats """

    matrix = stypes.toDoubleMatrix(matrix)
    mout = stypes.emptyDoubleMatrix(x=ncol, y=nrow)
    ncol = ctypes.c_int(ncol)
    nrow = ctypes.c_int(nrow)
    libspice.xposeg_c(matrix, nrow, ncol, mout)
    return stypes.cMatrixToNumpy(mout)