def fastaIterator(fn, useMutableString=False, verbose=False):
fh = fn<EOL>if type(fh).__name__ == "<STR_LIT:str>":<EOL><INDENT>fh = open(fh)<EOL><DEDENT>if verbose:<EOL><INDENT>try:<EOL><INDENT>pind = __build_progress_indicator(fh)<EOL><DEDENT>except ProgressIndicatorError as e:<EOL><INDENT>sys.stderr.write("<STR_LIT>" +<EOL>"<STR_LIT>" + str(e))<EOL>verbose = False<EOL><DEDENT><DEDENT>prev_line = None<EOL>while True:<EOL><INDENT>seqHeader = __read_seq_header(fh, prev_line)<EOL>name = seqHeader[<NUM_LIT:1>:].strip()<EOL>seq_data, prev_line = __read_seq_data(fh)<EOL>if verbose:<EOL><INDENT>pind.done = fh.tell()<EOL>pind.showProgress(to_strm=sys.stderr)<EOL><DEDENT>yield Sequence(name, seq_data, useMutableString)<EOL>if prev_line == "<STR_LIT>":<EOL><INDENT>break<EOL><DEDENT><DEDENT>
A generator function which yields fastaSequence objects from a fasta-format
file or stream.

:param fn: a file-like stream or a string; if this is a string, it's
           treated as a filename, else it's treated it as a file-like
           object, which must have a readline() method.
:param useMustableString: if True, construct sequences from lists of chars,
                          rather than python string objects, to allow
                          more efficient editing. Use with caution.
:param verbose: if True, output additional status messages to stderr about
                progress