def by_image_seq(blocks, image_seq):
    """Sort blocks by provided image_seq number.

    Argument:
    List:blocks       -- List of block objects to sort.
    Int:image_seq    -- image_seq number found in ec_hdr.
    
    Returns:
    List        -- List of block indexes matching image_seq number.
    """
    seq_blocks = []
    for block in blocks:
        if blocks[block].ec_hdr.image_seq == image_seq:
            seq_blocks.append(block)

    return seq_blocks