Return actions from plug-in at `index`

        Arguments:
            index (int): Index at which item is located in model
322286
def getPluginActions(self, index):
        

        index = self.data["proxies"]["plugin"].mapToSource(
            self.data["proxies"]["plugin"].index(
                index, 0, QtCore.QModelIndex())).row()
        item = self.data["models"]["item"].items[index]

        # Inject reference to the original index
        actions = [
            dict(action, **{"index": index})
            for action in item.actions
        ]

        # Context specific actions
        for action in list(actions):
            if action["on"] == "failed" and not item.hasError:
                actions.remove(action)
            if action["on"] == "succeeded" and not item.succeeded:
                actions.remove(action)
            if action["on"] == "processed" and not item.processed:
                actions.remove(action)
            if action["on"] == "notProcessed" and item.processed:
                actions.remove(action)

        # Discard empty categories, separators
        remaining_actions = list()
        index = 0
        try:
            action = actions[index]
        except IndexError:
            pass
        else:
            while action:
                try:
                    action = actions[index]
                except IndexError:
                    break

                isempty = False

                if action["__type__"] in ("category", "separator"):
                    try:
                        next_ = actions[index + 1]
                        if next_["__type__"] != "action":
                            isempty = True
                    except IndexError:
                        isempty = True

                if not isempty:
                    remaining_actions.append(action)

                index += 1

        return remaining_actions
939008
def index(options = {}, &block)
      respond_with(collection, options,  &block) if stale?(collection, last_modified: collection.maximum(:updated_at))
    end
1009895
def index(self, request):
        """"""
        objects = self.model.objects.all()

        return self._render(
            request = request,
            template = 'index',
            context = {
                cc2us(pluralize(self.model.__name__)): objects,
            },
            status = 200
        )
240852
def create_indexed_document(index_instance, model_items, action):
    '''
    
    '''
    data = []
    if action == 'delete':
        for pk in model_items:
            data.append({'_id': pk, '_op_type': action})
    else:
        for doc in model_items:
            if index_instance.matches_indexing_condition(doc):
                data.append(index_instance.serialize_object(doc))
    return data
437351
def indexFromItem(self, regItem, col=0):
        
        if col < 0:
            col = len(self.attrNames) - col
        try:
            row = self.registry.items.index(regItem)
        except ValueError:
            return QtCore.QModelIndex()
        else:
            return self.index(row, col)
600532
def set_index(self, index):
        
        item = index.internalPointer()
        self.actionunit = item.internal_data()
        self.setEnabled(bool(self.actionunit.status.traceback))
885092
def insert(self, index, item):
        # type: (int, Any) -> None
        
        return list.insert(self, index, self.ref(item))
1095967
def itemFromIndex(self, index):
        
        sourceIndex = self.mapToSource(index)
        return self.sourceModel().itemFromIndex(sourceIndex)
1244394
def get(self, index: Union[int, str]) -> HistoryItem:
        
        index = int(index)
        if index == 0:
            raise IndexError('The first command in history is command 1.')
        elif index < 0:
            return self[index]
        else:
            return self[index - 1]
74959
def done(self, index):
        
        if self.model.exists(index):
            self.model.edit(index, done=True)
525340
def _get_dump_item_context(self, index, name, opts):
        
        c = {
            'item_no': index,
            'label': name,
            'name': name,
            'models': ' '.join(opts['models']),
            'natural_key': '',
        }
        if opts.get('use_natural_key', False):
            c['natural_key'] = ' -n'
        c.update(self.get_global_context())
        return c
477743
def get_indexable(cls):
        
        model = cls.get_model()
        return model.objects.order_by('id').values_list('id', flat=True)
616358
def navigateToIndex( self, index ):
        
        self._completerTree.hide()
        item = self._navigationModel.itemFromIndex(index)
        self.setText(self._navigationModel.itemPath(item))
410247
def index(self, row, column, parent=QModelIndex()):
        
        if parent is not None and not parent.isValid():
            parentItem = self.rootItem
        else:
            parentItem = self.item(parent)

        childItem = parentItem.child(row)

        if childItem:
            index = self.createIndex(row, column, childItem)
        else:
            index = QModelIndex()

        return index
33221
def index(self, index):
        
        if self._index != index:
            self._dirty = True
        self._index = index
210133
def MI_get_item(self, key, index=0):
    ''
    index = _key_to_index_single(force_list(self.indices.keys()), index)
    if index != 0:
        key = self.indices[index][key]  # always use first index key
    # key must exist
    value = super(MIMapping, self).__getitem__(key)
    N = len(self.indices)
    if N == 1:
        return [key]

    if N == 2:
        value = [value]
    return [key] + value
635381
function(index){
        var len = arguments.length, i = 0, results;

        if (len > 1) {
            results = [];

            while(len--){
                results.push(this.get(arguments[i++]));
            }

            return results;
        }

        return this._models[index];
    }