extract_blocks function

Extract blocks of a specified type from a list of blocks