def write(self):
csv_file = os.path.join(self.outdir, '<STR_LIT>')<EOL>txt_file = os.path.join(self.outdir, '<STR_LIT>')<EOL>headers = self.key_terms<EOL>unresolved = []<EOL>with open(csv_file, '<STR_LIT:w>') as file:<EOL><INDENT>writer = csv.writer(file)<EOL>writer.writerow(headers)<EOL>for key in list(self._store.keys()):<EOL><INDENT>results = self._store[key]<EOL>if len(results) == <NUM_LIT:0>:<EOL><INDENT>unresolved.append(key)<EOL><DEDENT>else:<EOL><INDENT>row = [key]<EOL>for key_term in headers[<NUM_LIT:1>:]:<EOL><INDENT>element = results[<NUM_LIT:0>][key_term]<EOL>row.append(element)<EOL><DEDENT>writer.writerow(row)<EOL><DEDENT><DEDENT><DEDENT>if len(unresolved) > <NUM_LIT:0>:<EOL><INDENT>with open(txt_file, '<STR_LIT:w>') as file:<EOL><INDENT>for name in unresolved:<EOL><INDENT>file.write("<STR_LIT>".format(name))<EOL><DEDENT><DEDENT><DEDENT>
Write csv file of resolved names and txt file of unresolved names.