def mt_excel_files(store, case_obj, temp_excel_dir):
today = datetime.datetime.now().strftime('<STR_LIT>')<EOL>samples = case_obj.get('<STR_LIT>')<EOL>query = {'<STR_LIT>':'<STR_LIT>'}<EOL>mt_variants = list(store.variants(case_id=case_obj['<STR_LIT>'], query=query, nr_of_variants= -<NUM_LIT:1>, sort_key='<STR_LIT>'))<EOL>written_files = <NUM_LIT:0><EOL>for sample in samples:<EOL><INDENT>sample_id = sample['<STR_LIT>']<EOL>sample_lines = export_mt_variants(variants=mt_variants, sample_id=sample_id)<EOL>document_name = '<STR_LIT:.>'.join([case_obj['<STR_LIT>'], sample_id, today]) + '<STR_LIT>'<EOL>workbook = Workbook(os.path.join(temp_excel_dir,document_name))<EOL>Report_Sheet = workbook.add_worksheet()<EOL>row = <NUM_LIT:0><EOL>for col,field in enumerate(MT_EXPORT_HEADER):<EOL><INDENT>Report_Sheet.write(row,col,field)<EOL><DEDENT>for row, line in enumerate(sample_lines,<NUM_LIT:1>): <EOL><INDENT>for col, field in enumerate(line): <EOL><INDENT>Report_Sheet.write(row,col,field)<EOL><DEDENT><DEDENT>workbook.close()<EOL>if os.path.exists(os.path.join(temp_excel_dir,document_name)):<EOL><INDENT>written_files += <NUM_LIT:1><EOL><DEDENT><DEDENT>return written_files<EOL>
Collect MT variants and format line of a MT variant report
    to be exported in excel format

    Args:
        store(adapter.MongoAdapter)
        case_obj(models.Case)
        temp_excel_dir(os.Path): folder where the temp excel files are written to

    Returns:
        written_files(int): the number of files written to temp_excel_dir