<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def table_to_gwf(table, filename, name, **kwargs):
 """Create a new `~frameCPP.FrameH` and fill it with data Parameters table : `~astropy.table.Table` the data to write filename : `str` the name of the file to write into **kwargs other keyword arguments (see below for references) See Also -------- gwpy.io.gwf.create_frame gwpy.io.gwf.write_frames for documentation of keyword arguments """

    from LDAStools.frameCPP import (FrEvent, GPSTime)

    # create frame
    write_kw = {key: kwargs.pop(key) for
                key in ('compression', 'compression_level') if key in kwargs}
    frame = io_gwf.create_frame(name=name, **kwargs)

    # append row by row
    names = table.dtype.names
    for row in table:
        rowd = dict((n, row[n]) for n in names)
        gps = LIGOTimeGPS(rowd.pop('time', 0))
        frame.AppendFrEvent(FrEvent(
            str(name),
            str(rowd.pop('comment', '')),
            str(rowd.pop('inputs', '')),
            GPSTime(gps.gpsSeconds, gps.gpsNanoSeconds),
            float(rowd.pop('timeBefore', 0)),
            float(rowd.pop('timeAfter', 0)),
            int(rowd.pop('eventStatus', 0)),
            float(rowd.pop('amplitude', 0)),
            float(rowd.pop('probability', -1)),
            str(rowd.pop('statistics', '')),
            list(rowd.items()),  # remaining params as tuple
        ))

    # write frame to file
    io_gwf.write_frames(filename, [frame], **write_kw)