def generate_test_file(delim, rec_list, quoted=False):
    (fd, fqfn) = tempfile.mkstemp()
    fp = os.fdopen(fd,"w")

    for rec in rec_list:
        if quoted:
            for i in range(len(rec)):
                rec[i] = rec[i] % '"%s"'
        outrec = delim.join(rec)+'\n'
        fp.write(outrec)

    fp.close()
    return fqfn
dataset/ETHPy150Open kenfar/DataGristle/scripts/tests/test_gristle_determinator_cmd.py/generate_test_file/swapped operands of `%`