<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def isoform_to_gene_name(gtf_file, out_file, data):
 """ produce a table of isoform -> gene mappings for loading into EBSeq """

    if not out_file:
         out_file = tempfile.NamedTemporaryFile(delete=False).name
    if file_exists(out_file):
        return out_file
    db = gtf.get_gtf_db(gtf_file)
    line_format = "{transcript}\t{gene}\n"
    with file_transaction(data, out_file) as tx_out_file:
        with open(tx_out_file, "w") as out_handle:
            for feature in db.features_of_type('transcript'):
                transcript = feature['transcript_id'][0]
                gene = feature['gene_id'][0]
                out_handle.write(line_format.format(**locals()))
    return out_file