def parse_superbox(self, fptr):
superbox = []<EOL>start = fptr.tell()<EOL>while True:<EOL><INDENT>if start >= self.offset + self.length:<EOL><INDENT>break<EOL><DEDENT>read_buffer = fptr.read(<NUM_LIT:8>)<EOL>if len(read_buffer) < <NUM_LIT:8>:<EOL><INDENT>msg = "<STR_LIT>"<EOL>warnings.warn(msg, UserWarning)<EOL>return superbox<EOL><DEDENT>(box_length, box_id) = struct.unpack('<STR_LIT>', read_buffer)<EOL>if box_length == <NUM_LIT:0>:<EOL><INDENT>num_bytes = os.path.getsize(fptr.name) - fptr.tell() + <NUM_LIT:8><EOL><DEDENT>elif box_length == <NUM_LIT:1>:<EOL><INDENT>read_buffer = fptr.read(<NUM_LIT:8>)<EOL>num_bytes, = struct.unpack('<STR_LIT>', read_buffer)<EOL><DEDENT>else:<EOL><INDENT>num_bytes = box_length<EOL><DEDENT>box = self._parse_this_box(fptr, box_id, start, num_bytes)<EOL>superbox.append(box)<EOL>if num_bytes > self.length:<EOL><INDENT>msg = '<STR_LIT>'<EOL>msg = msg.format(box_id, num_bytes)<EOL>warnings.warn(msg)<EOL><DEDENT>elif fptr.tell() > start + num_bytes:<EOL><INDENT>msg = ('<STR_LIT>'<EOL>'<STR_LIT>')<EOL>msg = msg.format(box_id=box_id,<EOL>num_bytes=fptr.tell() - (start + num_bytes))<EOL>warnings.warn(msg, UserWarning)<EOL><DEDENT>fptr.seek(start + num_bytes)<EOL>start += num_bytes<EOL><DEDENT>return superbox<EOL>
Parse a superbox (box consisting of nothing but other boxes.

        Parameters
        ----------
        fptr : file
            Open file object.

        Returns
        -------
        list
            List of top-level boxes in the JPEG 2000 file.