code: def parse_fasta_annotations(fastas, annot_tables, trans_table):
      if annot_tables is not False:
          annots = {}
          for table in annot_tables:
              for cds in open(table):
                  ID, start, end, strand = cds.strip().split()
                  annots[ID] = [start, end, int(strand)]
      for fasta in fastas:
          for seq in parse_fasta(fasta):
              if ('
                  print('
                  exit()
              if 'ID=' in seq[0]:
                  ID = seq[0].rsplit('ID=', 1)[1].split(';', 1)[0]
                  contig = seq[0].split()[0].split('>')[1].rsplit('_%s' % (ID), 1)[0]
              else:
                  contig = seq[0].split()[0].split('>')[1].rsplit('_', 1)[0]
              locus = seq[0].split()[0].split('>')[1]
              if ('
                  info = seq[0].split('
                  start, end, strand = int(info[1]), int(info[2]), info[3]
                  if strand == '1':
                      strand = 1
                  else:
                      strand = -1
                  product = [''.join(info[4].split()[1:])]
              else:
                  start, end, strand = annots[locus]
                  product = seq[0].split(' ', 1)[1]
              info = {'transl_table':[trans_table], \
                      'translation':[seq[1]], \
                      'product':product}
              yield contig, [locus, [start, end, strand], info]