def repeat_masker_iterator(fh, alignment_index=None,<EOL>header=True, verbose=False):
strm = fh<EOL>if type(fh).__name__ == "<STR_LIT:str>":<EOL><INDENT>strm = open(fh)<EOL><DEDENT>if verbose:<EOL><INDENT>try:<EOL><INDENT>total = os.path.getsize(strm.name)<EOL>pind = ProgressIndicator(totalToDo=total, messagePrefix="<STR_LIT>",<EOL>messageSuffix="<STR_LIT>" + strm.name)<EOL><DEDENT>except AttributeError as e:<EOL><INDENT>sys.stderr.write(str(e))<EOL>sys.stderr.write("<STR_LIT>")<EOL>verbose = False<EOL><DEDENT><DEDENT>if header:<EOL><INDENT>next(strm)<EOL>next(strm)<EOL><DEDENT>for line in strm:<EOL><INDENT>if verbose:<EOL><INDENT>pind.done = strm.tell()<EOL>pind.showProgress()<EOL><DEDENT>line = line.strip()<EOL>if line == "<STR_LIT>":<EOL><INDENT>continue<EOL><DEDENT>rto = retrotransposon.from_repeat_masker_string(line)<EOL>if alignment_index is not None:<EOL><INDENT>rto.pairwise_alignment =JustInTimePairwiseAlignment(alignment_index, rto.uniq_id)<EOL><DEDENT>yield rto<EOL><DEDENT>
Iterator for repeatmasker coordinate annotation files. These files describe
the location of repeat occurrences. There is (optionally) a two-line header
with the names of the fields (ignored by the iterator, if present). Each line
is a record of an occurrence. The description of fields for each line is
given in from_repeat_masker_string.

:param fh:              stream-like object, or string filename, to load the
                        annotations from
:param alignment_index: an IndexedFile for full alignments; keys should be
                        repeat-masker IDs
:param header:          if True, expect and discard the two-line header;
                        otherwise we will expect there is no header
:param verbose:         if True, output additional status messages about
                        progress to stderr.