def METHOD_NAME(detect_result):
    """Collect attention and ffn blocks from detect result."""
    import itertools
    ffn_block_lst = []
    attention_block_lst = []
    for block_lst, pattern in detect_result:
        for block in block_lst:
            # Group the first block as attention blocks and
            # the remaining blocks belong to ffn block.
            if block:
                attention_block_lst.append(block[0])
                ffn_block = list(itertools.chain(*block[1:]))
                if ffn_block:
                    ffn_block_lst.append(ffn_block)
    return attention_block_lst, ffn_block_lst