def write_frames(filename, frames, compression=<NUM_LIT>, compression_level=<NUM_LIT:6>):
from LDAStools import frameCPP<EOL>stream = open_gwf(filename, '<STR_LIT:w>')<EOL>if isinstance(frames, frameCPP.FrameH):<EOL><INDENT>frames = [frames]<EOL><DEDENT>for frame in frames:<EOL><INDENT>stream.WriteFrame(frame, compression, compression_level)<EOL><DEDENT>
Write a list of frame objects to a file

    **Requires:** |LDAStools.frameCPP|_

    Parameters
    ----------
    filename : `str`
        path to write into

    frames : `list` of `LDAStools.frameCPP.FrameH`
        list of frames to write into file

    compression : `int`, optional
        enum value for compression scheme, default is ``GZIP``

    compression_level : `int`, optional
        compression level for given scheme