def stock2one(stock):
lines = {}<EOL>for line in stock:<EOL><INDENT>line = line.strip()<EOL>if print_line(line) is True:<EOL><INDENT>yield line<EOL>continue<EOL><DEDENT>if line.startswith('<STR_LIT>'):<EOL><INDENT>continue<EOL><DEDENT>ID, seq = line.rsplit('<STR_LIT:U+0020>', <NUM_LIT:1>)<EOL>if ID not in lines:<EOL><INDENT>lines[ID] = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>seq = seq.strip()<EOL><DEDENT>lines[ID] += seq<EOL><DEDENT>for ID, line in lines.items():<EOL><INDENT>yield '<STR_LIT:\t>'.join([ID, line])<EOL><DEDENT>yield '<STR_LIT>'<EOL>
convert stockholm to single line format