Parse an alignment block from the given file handle.

    Block looks like:
    [0_(1)=fa2cma(8){go=10000,gx=2000,pn=1000.0,lf=0,rf=0}:
    (209)***********************************************...

    ... sequences, numbered 1-8 ...

    _0].

def _parse_blocks(instream):
    """Parse an alignment block from the given file handle.

    Block looks like:
    [0_(1)=fa2cma(8){go=10000,gx=2000,pn=1000.0,lf=0,rf=0}:
    (209)***********************************************...

    ... sequences, numbered 1-8 ...

    _0].

    """
    ilines = sugar.unblank(instream)
    for line in ilines:
        if line.startswith('['):
            # Start of block
            level, one, name, seqcount, params = _parse_block_header(line)
            qlen, qchars = _parse_block_postheader(next(ilines))
            # Pass control to the sequence parser
            sequences = list(_parse_sequences(ilines, qlen))
            # Validation
            if not len(sequences) == seqcount:
                logging.warn("Expected %d sequences in block %s, found %d",
                             seqcount, name, len(sequences))
            yield {'level': level,
                   'one': one,
                   'name': name,
                   # 'seqcount': seqcount,
                   'params': params,
                   'query_length': qlen,
                   'query_chars': qchars,
                   'sequences': sequences,
                   }