def extract_chunks(blob):
chunks = []<EOL>stream = BytesIO(blob.bytes)<EOL>current_pos = stream.tell()<EOL>stream.seek(<NUM_LIT:0>, <NUM_LIT:2>)<EOL>length = stream.tell()<EOL>stream.seek(current_pos, <NUM_LIT:0>)<EOL>while stream.tell() < length:<EOL><INDENT>chunks.append(read_chunk(stream))<EOL><DEDENT>return chunks<EOL>
Splits the blob into chucks grouped by kind.