def METHOD_NAME(out_file, submission_collector):
    """
    Builds submissions archive, in szubrawcy format, in out_file from data
    provided by submission_collector. Argument out_file should be a file-like
    object.
    """
    submission_list = submission_collector.collect_list()
    tmpdir = tempfile.mkdtemp()
    try:
        contest_id = submission_collector.get_contest_id()
        files_dir = os.path.join(tmpdir, contest_id)
        os.mkdir(files_dir, 0o700)
        with open(os.path.join(files_dir, 'INDEX'), 'w') as f:
            index_csv = csv.writer(f)
            header = [
                'submission_id',
                'user_id',
                'username',
                'first_name',
                'last_name',
                'city',
                'school',
                'school_city',
                'problem_short_name',
                'score',
            ]
            index_csv.writerow(header)
            for s in submission_list:
                index_entry = [
                    s.submission_id,
                    s.user_id,
                    s.username,
                    s.first_name,
                    s.last_name,
                    s.city,
                    s.school,
                    s.school_city,
                    s.problem_short_name,
                    s.score,
                ]
                def encode(obj):
                    if obj is None:
                        return 'NULL'
                    else:
                        return force_str(obj, errors="ignore")
                index_csv.writerow([encode(col) for col in index_entry])
        for s in submission_list:
            filename = '%s:%s:%s.%s' % (
                s.submission_id,
                s.username,
                s.problem_short_name,
                s.solution_language,
            )
            dest = os.path.join(files_dir, filename)
            submission_collector.get_submission_source(dest, s.source_file)
        with tarfile.open(fileobj=out_file, mode='w:gz') as tar:
            tar.add(files_dir, arcname=contest_id)
    finally:
        shutil.rmtree(tmpdir)