<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ckw01(handle, begtim, endtim, inst, ref, avflag, segid, nrec, sclkdp, quats, avvs):
 """ Add a type 1 segment to a C-kernel. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ckw01_c.html :param handle: Handle of an open CK file. :type handle: int :param begtim: The beginning encoded SCLK of the segment. :type begtim: float :param endtim: The ending encoded SCLK of the segment. :type endtim: float :param inst: The NAIF instrument ID code. :type inst: int :param ref: The reference frame of the segment. :type ref: str :param avflag: True if the segment will contain angular velocity. :type avflag: bool :param segid: Segment identifier. :type segid: str :param nrec: Number of pointing records. :type nrec: int :param sclkdp: Encoded SCLK times. :type sclkdp: Array of floats :param quats: Quaternions representing instrument pointing. :type quats: Nx4-Element Array of floats :param avvs: Angular velocity vectors. :type avvs: Nx3-Element Array of floats """

    handle = ctypes.c_int(handle)
    begtim = ctypes.c_double(begtim)
    endtim = ctypes.c_double(endtim)
    inst = ctypes.c_int(inst)
    ref = stypes.stringToCharP(ref)
    avflag = ctypes.c_int(avflag)
    segid = stypes.stringToCharP(segid)
    sclkdp = stypes.toDoubleVector(sclkdp)
    quats = stypes.toDoubleMatrix(quats)
    avvs = stypes.toDoubleMatrix(avvs)
    nrec = ctypes.c_int(nrec)
    libspice.ckw01_c(handle, begtim, endtim, inst, ref, avflag, segid, nrec,
                     sclkdp, quats, avvs)