shifts on a given number of record in the original file
        :param offset: number of record
548697
def seek(self, offset):
        
        if self._shifts:
            if 0 <= offset < len(self._shifts):
                current_pos = self._file.tell()
                new_pos = self._shifts[offset]
                if current_pos != new_pos:
                    if current_pos == self._shifts[-1]:  # reached the end of the file
                        self._data = self.__reader()
                        self.__file = iter(self._file.readline, '')
                        self._file.seek(0)
                        next(self._data)
                        if offset:  # move not to the beginning of the file
                            self._file.seek(new_pos)
                    else:
                        if not self.__already_seeked:
                            if self._shifts[0] < current_pos:  # in the middle of the file
                                self._data.send(True)
                            self.__already_seeked = True
                        self._file.seek(new_pos)
            else:
                raise IndexError('invalid offset')
        else:
            raise self._implement_error
31649
def shift_output_lines(delta)
      return if delta == 0
      @data.each do |m|
        m.output.start_pos.line += delta
        m.output.end_pos.line += delta
      end
    end
769691
def shift_down(self, times=1):
        
        try:
            return Location(self._rank - times, self._file)
        except IndexError as e:
            raise IndexError(e)
851633
def line_to_offset(self, line, column):
    
    line -= 1
    if line >= len(self._line_offsets):
      return self._text_len
    elif line < 0:
      return 0
    else:
      return min(self._line_offsets[line] + max(0, column), self._text_len)
225950
def align_after(self, offset):
        
        f = self.reader
        if offset <= 0:  # FIXME what is a negative offset??
            f.seek(0)
            self._block_count = 0
            self._read_header()  # FIXME we can't extimate how big it is...
            return
        sm = self.sync_marker
        sml = len(sm)
        pos = offset
        while pos < self.file_length - sml:
            f.seek(pos)
            data = f.read(self.FORWARD_WINDOW_SIZE)
            sync_offset = data.find(sm)
            if sync_offset > -1:
                f.seek(pos + sync_offset)
                self._block_count = 0
                return
            pos += len(data)
465458
private void moveVertical(int offset) {
        if (offset < 0) {
            moveUp(Math.abs(offset));
        } else if (offset > 0) {
            moveDown(offset);
        }
    }
33535
def set_offset(self, offset):
        '''
        
        '''
        super(Container, self).set_offset(offset)
        if self.is_default():
            for field in self._fields:
                field.set_offset(offset)
                offset += len(field._current_rendered)
639010
def add_offset(self, offset):
        
        self.timestamps = [ts + offset for ts in self.timestamps]
229068
public void addLineOffset(int offset) {
        if (numLines >= lineNumberMap.length) {
            // Grow the line number map.
            int capacity = lineNumberMap.length * 2;
            int[] newLineNumberMap = new int[capacity];
            System.arraycopy(lineNumberMap, 0, newLineNumberMap, 0, lineNumberMap.length);
            lineNumberMap = newLineNumberMap;
        }

        lineNumberMap[numLines++] = offset;
    }
266710
def transform(self, offset):
        
        assert self._start + offset > 0, \
            ('offset {} invalid; resulting range [{}, {}) is '
             'undefined'.format(offset, self._start+offset, self._end+offset))
        self._start += offset
        self._end += offset
530585
def __update_offset_table(self, fileobj, fmt, atom, delta, offset):
        """"""
        if atom.offset > offset:
            atom.offset += delta
        fileobj.seek(atom.offset + 12)
        data = fileobj.read(atom.length - 12)
        fmt = fmt % cdata.uint_be(data[:4])
        offsets = struct.unpack(fmt, data[4:])
        offsets = [o + (0, delta)[offset < o] for o in offsets]
        fileobj.seek(atom.offset + 16)
        fileobj.write(struct.pack(fmt, *offsets))
1306817
def offset(self, date, n_days):
        '''
        
        '''
#CONSIDER: raise an exception if a date is not in self
        index = self.index(date) + n_days
        if index < 0:
            index = 0
        if index > len(self) - 1:
            index = len(self) - 1
        return self[index]
578520
def move_by_offset(self, xoffset, yoffset):
        
        if self._driver.w3c:
            self.w3c_actions.pointer_action.move_by(xoffset, yoffset)
            self.w3c_actions.key_action.pause()
        else:
            self._actions.append(lambda: self._driver.execute(
                Command.MOVE_TO, {
                    'xoffset': int(xoffset),
                    'yoffset': int(yoffset)}))
        return self
70814
def _record_offset(self):
        """"""
        offset = self.blob_file.tell()
        self.event_offsets.append(offset)
1072534
def cursor_moved(self, filename0, position0, filename1, position1):
        """'"""
        if position0 is not None:
            self.add_cursor_position_to_history(filename0, position0)
        self.add_cursor_position_to_history(filename1, position1)
547108
public void processAlignment(final SAMRecord rec) throws IOException {
		// write an offset for the first record and for the g-th record thereafter (where
		// g is the granularity), to be consistent with the index method
		if (count == 0 || (count + 1) % granularity == 0) {
			SAMFileSource fileSource = rec.getFileSource();
			SAMFileSpan filePointer = fileSource.getFilePointer();
			writeVirtualOffset(getPos(filePointer));
		}
		count++;
	}
298151
def shift(self, count=1):
        
        if self:
            self._index = (self._index + count) % len(self)
        else:
            self._index = 0