def seek(self, pos, whence=0):
    if (whence == 0):
        if (pos < 0):
            raise ValueError('negative seek value')
        self._calc_seek(pos)
    elif (whence == 1):
        if ((self._fake_seek - pos) < 0):
            pos = 0
        self._calc_seek((self._fake_seek + pos))
    elif (whence == 2):
        if ((self._total_size + pos) < 0):
            pos = (- self._total_size)
        self._calc_seek((self._total_size + pos))
    elif isinstance(whence, int):
        raise ValueError(f'whence value {whence} unsupported')
    else:
        raise TypeError(f'an integer is required (got type {type(whence).__name__})')
    return self._fake_seek
def seek(self, pos, whence=0):
    if (whence == 0):
        if (pos < 0):
            raise ValueError('negative seek value')
        self._calc_seek(pos)
    elif (whence == 1):
        if ((self._fake_seek - pos) < 0):
            pos = 0
        self._calc_seek((self._fake_seek + pos))
    elif (whence == 2):
        if ((self._total_size + pos) < 0):
            pos = (- self._total_size)
        self._calc_seek((self._total_size + pos))
    elif isinstance(whence, int):
        raise ValueError(f'whence value {whence} unsupported')
    else:
        raise TypeError(f'an integer is required (got type {type(whence).__name__})')
    return self._fake_seek