<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def get_mol_filename(chebi_id):
    '''Returns mol file'''
    mol = get_mol(chebi_id)

    if mol is None:
        return None

    file_descriptor, mol_filename = tempfile.mkstemp(str(chebi_id) +
                                                     '_', '.mol')
    mol_file = open(mol_filename, 'w')
    mol_file.write(mol.get_structure())
    mol_file.close()
    os.close(file_descriptor)

    return mol_filename