Given an open FASTA file, yield tuples of (`header`, `sequence`).

def _fasta_iter(fasta):
    """
    Given an open FASTA file, yield tuples of (`header`, `sequence`).
    """
    # Adapted from Brent Pedersen.
    # http://www.biostars.org/p/710/#1412
    groups = (group for _, group in
              itertools.groupby(fasta, lambda line: line.startswith('>')))
    for group in groups:
        header = next(group)[1:].strip()
        sequence = ''.join(line.strip() for line in next(groups))
        yield header, sequence