<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def seek(self, offset, whence=Seek.set):
 # type: (int, SupportsInt) -> int """Change stream position. Change the stream position to the given byte offset. The offset is interpreted relative to the position indicated by ``whence``. Arguments: offset (int):
 the offset to the new position, in bytes. whence (int):
 the position reference. Possible values are: * `Seek.set`: start of stream (the default). * `Seek.current`: current position; offset may be negative. * `Seek.end`: end of stream; offset must be negative. Returns: int: the new absolute position. Raises: ValueError: when ``whence`` is not known, or ``offset`` is invalid. Note: Zip compression does not support seeking, so the seeking is emulated. Seeking somewhere else than the current position will need to either: * reopen the file and restart decompression * read and discard data to advance in the file """

        _whence = int(whence)
        if _whence == Seek.current:
            offset += self._pos
        if _whence == Seek.current or _whence == Seek.set:
            if offset < 0:
                raise ValueError("Negative seek position {}".format(offset))
        elif _whence == Seek.end:
            if offset > 0:
                raise ValueError("Positive seek position {}".format(offset))
            offset += self._end
        else:
            raise ValueError(
                "Invalid whence ({}, should be {}, {} or {})".format(
                    _whence, Seek.set, Seek.current, Seek.end
                )
            )

        if offset < self._pos:
            self._f = self._zip.open(self.name)  # type: ignore
            self._pos = 0
        self.read(offset - self._pos)
        return self._pos