def seek(self, offset, whence=0):
        # Only simple writing is supported
        assert(self.mode == 'r')
        if whence == 0:
            pass
        elif whence == 1:
            offset = self.pos+offset
        elif whence == 2:
            raise NotImplementedError
        else:
            raise ValueError
        if self._is_gzip:
            assert(offset >= self.pos)
        else:
            # Find the correct chunk
            self.flush()
            self.nextbuf = []
            self.readbuf = ''
            self.chunkidx = -1
            self.pos = 0
            for idx, data in enumerate(self.chunks):
                if data.pos <= offset:
                    self.chunkidx = idx-1
                    self.pos = data.pos
        delta = offset-self.pos
        assert(delta >= 0)
        self.read(delta)
        assert(delta <= self.chunksize or self.eof or self._is_gzip)
        assert(self.pos == offset)
.. versionadded:: 2015.5.0
dataset/ETHPy150Open nandhp/python-imdb/imdb/chunkedfile.py/ChunkedFile.seek--crossover with--dataset/ETHPy150Open saltstack/salt/salt/modules/state.py/apply_