<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def dskw02(handle, center, surfid, dclass, fname, corsys, corpar, mncor1, mxcor1, mncor2, mxcor2, mncor3, mxcor3, first, last, vrtces, plates, spaixd, spaixi):
 """ Write a type 2 segment to a DSK file. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dskw02_c.html :param handle: Handle assigned to the opened DSK file :type handle: int :param center: Central body ID code :type center: int :param surfid: Surface ID code :type surfid: int :param dclass: Data class :type dclass: int :param fname: Reference frame :type fname: str :param corsys: Coordinate system code :type corsys: int :param corpar: Coordinate system parameters :type corpar: N-Element Array of floats :param mncor1: Minimum value of first coordinate :type mncor1: float :param mxcor1: Maximum value of first coordinate :type mxcor1: float :param mncor2: Minimum value of second coordinate :type mncor2: float :param mxcor2: Maximum value of second coordinate :type mxcor2: float :param mncor3: Minimum value of third coordinate :type mncor3: float :param mxcor3: Maximum value of third coordinate :type mxcor3: float :param first: Coverage start time :type first: float :param last: Coverage stop time :type last: float :param vrtces: Vertices :type vrtces: NxM-Element Array of floats :param plates: Plates :type plates: NxM-Element Array of ints :param spaixd: Double precision component of spatial index :type spaixd: N-Element Array of floats :param spaixi: Integer component of spatial index :type spaixi: N-Element Array of ints """

    handle = ctypes.c_int(handle)
    center = ctypes.c_int(center)
    surfid = ctypes.c_int(surfid)
    dclass = ctypes.c_int(dclass)
    fname  = stypes.stringToCharP(fname)
    corsys = ctypes.c_int(corsys)
    corpar = stypes.toDoubleVector(corpar)
    mncor1 = ctypes.c_double(mncor1)
    mxcor1 = ctypes.c_double(mxcor1)
    mncor2 = ctypes.c_double(mncor2)
    mxcor2 = ctypes.c_double(mxcor2)
    mncor3 = ctypes.c_double(mncor3)
    mxcor3 = ctypes.c_double(mxcor3)
    first  = ctypes.c_double(first)
    last   = ctypes.c_double(last)
    nv     = ctypes.c_int(len(vrtces))
    vrtces = stypes.toDoubleMatrix(vrtces)
    np     = ctypes.c_int(len(plates))
    plates = stypes.toIntMatrix(plates)
    spaixd = stypes.toDoubleVector(spaixd)
    spaixi = stypes.toIntVector(spaixi)
    libspice.dskw02_c(handle, center, surfid, dclass, fname, corsys, corpar,
                      mncor1, mxcor1, mncor2, mxcor2, mncor3, mxcor3, first,
                      last, nv, vrtces, np, plates, spaixd, spaixi)