def _rm_extract_sequence_and_name(alig_str_parts, s1_name, s2_name):
<EOL>if len(alig_str_parts) == <NUM_LIT:4>:<EOL><INDENT>nm = alig_str_parts[<NUM_LIT:0>]<EOL>seq = alig_str_parts[<NUM_LIT:2>]<EOL><DEDENT>elif len(alig_str_parts) == <NUM_LIT:5>:<EOL><INDENT>nm = alig_str_parts[<NUM_LIT:1>]<EOL>seq = alig_str_parts[<NUM_LIT:3>]<EOL><DEDENT>else:<EOL><INDENT>raise AlignmentIteratorError("<STR_LIT>" +<EOL>"<STR_LIT:U+0020>".join(alig_str_parts) + "<STR_LIT>" +<EOL>"<STR_LIT>" +<EOL>"<STR_LIT>" +<EOL>str(len(alig_str_parts)))<EOL><DEDENT>if _rm_name_match(nm, s1_name):<EOL><INDENT>return s1_name, seq<EOL><DEDENT>elif _rm_name_match(nm, s2_name):<EOL><INDENT>return s2_name, seq<EOL><DEDENT>else:<EOL><INDENT>raise AlignmentIteratorError("<STR_LIT>" +<EOL>"<STR_LIT:U+0020>".join(alig_str_parts) + "<STR_LIT>" +<EOL>"<STR_LIT>" + nm + "<STR_LIT>" +<EOL>"<STR_LIT>" +<EOL>"<STR_LIT>" + s1_name + "<STR_LIT>" +<EOL>s2_name + "<STR_LIT:)>")<EOL><DEDENT>
parse an alignment line from a repeatmasker alignment and return the name
of the sequence it si from and the sequence portion contained in the line.

:param alig_str_parts: the alignment string, split around whitespace as list
:param s1_name: the name of the first sequence in the alignment this line is
                from
:param s2_name: the name of the second sequence in the alignment this line is
                from
:return: a tuple of name and sequence string; name will always be either
         s1_name or s2_name
:raise AlignmentIteratorError: if the line doesn't have the expected number
                               of elements, or the name does not match
                               either of s1_name or s2_name