def parse_annotations(annots, fmt, annot_tables, trans_table):
annotations = {} <EOL>if fmt is False:<EOL><INDENT>for contig, feature in parse_gbk(annots):<EOL><INDENT>if contig not in annotations:<EOL><INDENT>annotations[contig] = []<EOL><DEDENT>annotations[contig].append(feature)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>for contig, feature in parse_fasta_annotations(annots, annot_tables, trans_table):<EOL><INDENT>if contig not in annotations:<EOL><INDENT>annotations[contig] = []<EOL><DEDENT>annotations[contig].append(feature)<EOL><DEDENT><DEDENT>return annotations<EOL>
parse annotations in either gbk or Prodigal fasta format