def seqs_from_file(ids, file_lines):
 for (label, seq) in parse_fasta(file_lines):
  if (id_from_fasta_label_line(label) in ids):
   (yield (label, seq))

def seqs_from_file ( ids , file_lines ) : for ( label , seq ) in parse_fasta ( file_lines ) : if ( id_from_fasta_label_line ( label ) in ids ) : ( yield ( label , seq ) )
extract labels and seqs from file .