Get the real index of the selected item.
972582
def get_stack_index(self, stack_index, plugin_index):
        """"""
        other_plugins_count = sum([other_tabs[0].count() \
                                   for other_tabs in \
                                   self.plugins_tabs[:plugin_index]])
        real_index = stack_index - other_plugins_count

        return real_index
178659
def _updateItemComboBoxIndex(self, item, column, num):
        """"""
        item._combobox_current_index[column] = num
        item._combobox_current_value[column] = item._combobox_option_list[column][num][0]
854862
def get_selected(self):
        ''''''
        selected_idx = []
        for i, row in enumerate(self.liststore):
            if row[CHECK_COL]:
                selected_idx.append(i + 1)
        return (selected_idx, self.file_sha1)
330730
def getIndexedValue(self, index):
        
        actions = self._actions

        if (type (actions) is list):
            dict = actions[index]
        else:
            dict = actions
        return dict.get('value', 'NoValue')
1082849
def index_of( item )
      max = self.get_length
      #puts "length #{max} #{max.class}"
      counter = 0
      while( counter < max )
        if( get(counter) == item)
          return counter
        end
        counter = counter + 1
      end
      return nil
    end
996511
public Option getItem(final int index) {
        checkIndex(index);
        OptionElement item = selectElement.getOptions().getItem(index);
        return itemMap.get(item);
    }
970072
def _get_selected_items(self):
        
        return set(self.canvas.get_view_for_model(model) for model in self._selection)
1026954
def selected_display_item(self) -> typing.Optional[DisplayItem.DisplayItem]:
        
        # first check for the [focused] data browser
        display_item = self.focused_display_item
        if not display_item:
            selected_display_panel = self.selected_display_panel
            display_item = selected_display_panel.display_item if selected_display_panel else None
        return display_item
60606
public int getIndex(T value) {
        int count = getItemCount();
        for (int i = 0; i < count; i++) {
            if (Objects.equals(getValue(i), value)) {
                return i;
            }
        }
        return -1;
    }
799909
function indexOf(items, item) {
    var len = items.length, i;
    for (i = 0; i < len; i++) {
      if (items[i] === item) {
        return i;
      }
    }
    return -1;
  }
63357
def _get_selected_items(self):
        """"""
        selection = self.get_selection()
        if selection.get_mode() != gtk.SELECTION_MULTIPLE:
            raise AttributeError('selected_items only valid for '
                                 'select_multiple')
        model, selected_paths = selection.get_selected_rows()
        result = []
        for path in selected_paths:
            result.append(model[path][0])
        return result
1127865
def currentValue(self):
        
        enum  = self.enum()
        if ( self.isCheckable() ):
            value = 0
            for i in self.checkedIndexes():
                value |= enum[nativestring(self.itemText(i))]
            return value
        else:
            try:
                return enum[nativestring(self.itemText(self.currentIndex()))]
            except KeyError:
                return 0
60495
def OnGetItemAttr(self, item):
        """"""
        if self.indicated > -1 and item == self.indicated:
            return self.indicated_attribute
        return None
641538
def get_text(self, index=None):
        
        if index==None:
            return self.get_text(self.get_value())
        else:
            return str(self._widget.itemText(index))
105490
function selectPreviousItem(){
    var items = document.getElementById('searchresults').childNodes;
    var l = items.length;
    selectIndex((selectedSearchIndex + l - 1) % l);
  }
592435
function () {
            var data = this._data;
            if (data.selectedIndex == -1) {
                // no item is selected
                return [];
            } else if (data.selectedIndex != null) {
                return [data.selectedIndex];
            } else {
                var retVal = [];
                // we iterate over the view, so that we return indexes in the order visible to the user:
                var view = data.itemsView;
                view.refresh(); // in case there are changes in the view, refresh it
                var items = view.items;
                for (var idx = 0, length = items.length; idx < length; idx++) {
                    if (items[idx].value.selected) {
                        // retVal.push(idx);
                        retVal.push(items[idx].initIndex);
                    }
                }
                return retVal;
            }
        }
726456
def _getitem(self, key):
        """"""
        key = int(key)
        if key < 0:
            key %= self._len
        if len(self._pages) == 1 and 0 < key < self._len:
            index = self._pages[0].index
            return self.parent.pages._getitem(index + key)
        return self._pages[key]