code: def _to_bz2file(self, file_generator):
          
          with bz2.BZ2File(file_generator.to_path, mode="wb") as outfile:
              for f in file_generator:
                  outfile.write(f.writestr(file_generator.to_format).encode())
docs: Convert file to bz2-compressed file.
          :return: None
          :rtype: :py:obj:`None`