def METHOD_NAME(self, offset, whence=0):
    self.flush()
    if whence == 1 and offset == 0:  # tell synonym
        return self.tell()
    if whence == 1:  # adjust offset by what is read ahead
        offset -= self._get_readahead_len()
    try:
        rv = os.lseek(self.fileno(), offset, whence)
    except OSError as e:
        raise IOError(*e.args)
    else:
        self._clear_readahead_buf()
        return rv