Return the index where the target window starts.
328785
def _get_target_index(self):
        """"""
        return (self.index + self.source_window * (not self.overlapping) +
                self.offset)
1349112
def _get_section_start_index(self, section):
        '''
        '''

        sec_start_re = r'%s\s*\{' % section

        found = re.search(sec_start_re, self.template_str)
        if found:
            return found.end() - 1

        raise NonextantSectionException(
            'Section %s not found in template' % section
            )
311894
def get_header_index(self, hdrclass, startidx=0):
        '''
        
        '''
        for hdridx in range(startidx, len(self._headers)):
            if isinstance(self._headers[hdridx], hdrclass):
                return hdridx
        return -1
444660
private int getCurrentWindowIndex()
    {
        long currentTime = System.currentTimeMillis();
        long currentWindow =((currentTime - startTime) / windowDurationInMs);
        return (int) currentWindow%(numKeys/windowSize);
    }
1296758
def __wrap_index(self):
        """"""
        if self.current_index < 0:
            self.current_index = len(self.gui_buttons) - 1
        elif self.current_index >= len(self.gui_buttons):
            self.current_index = 0
1044701
def _get_hit_nearest_ref_start(self, hits):
        ''''''
        nearest_to_start = hits[0]
        for hit in hits[1:]:
            if hit.ref_coords().start < nearest_to_start.ref_coords().start:
                nearest_to_start = hit
        return nearest_to_start
12936
def _get_index(self):
        
        contour = self.contour
        value = contour.bPoints.index(self)
        return value
711226
def get_start_of_line_position(self, after_whitespace=False):
        
        if after_whitespace:
            current_line = self.current_line
            return len(current_line) - len(current_line.lstrip()) - self.cursor_position_col
        else:
            return - len(self.current_line_before_cursor)
869874
private void seekToRestartPosition(int restartPosition)
    {
        checkPositionIndex(restartPosition, restartCount, "restartPosition");

        // seek data readIndex to the beginning of the restart block
        int offset = restartPositions.getInt(restartPosition * SIZE_OF_INT);
        data.setPosition(offset);

        // clear the entries to assure key is not prefixed
        nextEntry = null;

        // read the entry
        nextEntry = readEntry(data, null);
    }
800787
def get(self, end_ix):
        
        if self.most_recent_ix == end_ix:
            return self.current

        target = end_ix - self.cal_start - self.offset + 1
        self.current = self.window.seek(target)

        self.most_recent_ix = end_ix
        return self.current
31338
def get_focused_window(self):
        
        window_ret = window_t(0)
        _libxdo.xdo_get_focused_window(self._xdo, ctypes.byref(window_ret))
        return window_ret.value
1316553
def get_window(self): 
        
        x = self
        while not x._parent == None and \
              not isinstance(x._parent, Window): 
                  x = x._parent
        return x._parent
1220971
def gotoPrevious(self):
        
        index = self._currentPanel.currentIndex() - 1
        if index < 0:
            index = self._currentPanel.count() - 1
        
        self._currentPanel.setCurrentIndex(index)
318230
def set_stage_index(self):
        """"""
        window_start = self.parent.value('window_start')
        window_length = self.parent.value('window_length')
        stage = self.annot.get_stage_for_epoch(window_start, window_length)
        #lg.info('winstart: ' + str(window_start) + ', stage: ' + str(stage))

        if stage is None:
            self.idx_stage.setCurrentIndex(-1)
        else:
            self.idx_stage.setCurrentIndex(STAGE_NAME.index(stage))
606504
def _index(self):
        

        if self.y + 1 >= self.size[0]:
            # If the cursor is currently on the last row, then spawn another
            # and scroll down (removing the top row).
            self.display = self.display[1:] + [u" " * self.size[1]]
        else:
            # If the cursor is anywhere else, then just move it to the 
            # next line.
            self.y += 1
1207855
def _start_index(self, start=None):
        
        if start is None:
            return 0
        start_stage = translate_stage_name(start)
        internal_names = [translate_stage_name(s.name) for s in self._stages]
        try:
            return internal_names.index(start_stage)
        except ValueError:
            raise UnknownPipelineStageError(start, self)
909292
def int_global_to_local_start(self, index, axis=0):
        
        if index >= self.__mask[axis].stop-self.__halos[1][axis]:
            return None

        if index < self.__mask[axis].start:
            return 0

        return index-self.__mask[axis].start