code: def write_frames(filename, frames, compression=257, compression_level=6):
      
      from LDAStools import frameCPP
  
      # open stream
      stream = open_gwf(filename, 'w')
  
      # write frames one-by-one
      if isinstance(frames, frameCPP.FrameH):
          frames = [frames]
      for frame in frames:
          stream.WriteFrame(frame, compression, compression_level)
docs: 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