Completes append entries attempts up to the given index.
420193
private void completeCommits(long previousCommitIndex, long commitIndex) {
    for (long i = previousCommitIndex + 1; i <= commitIndex; i++) {
      CompletableFuture<Long> future = appendFutures.remove(i);
      if (future != null) {
        future.complete(i);
      }
    }
  }
1291282
def insert_completions(self, e): # (M-*)
        """
        completions = self._get_completions()
        b = self.begidx
        e = self.endidx
        for comp in completions:
            rep = [ c for c in comp ]
            rep.append(' ')
            self.l_buffer[b:e] = rep
            b += len(rep)
            e = b
        self.line_cursor = b    
        self.finalize()
476684
def _add_row(self, index):
        
        self._index.append(index)
        for c, _ in enumerate(self._columns):
            self._data[c].append(None)
1344646
def go_to_completion(self, index):
        
        assert index is None or isinstance(index, int)
        assert self.complete_state

        # Set new completion
        state = self.complete_state.go_to_index(index)

        # Set text/cursor position
        new_text, new_cursor_position = state.new_text_and_position()
        self.document = Document(new_text, new_cursor_position)

        # (changing text/cursor position will unset complete_state.)
        self.complete_state = state
705175
public function offsetAppend($index, $value)
    {
        $items = [];
        if ($this->offsetExists($index)) {
            $items = $this->offsetGet($index);
            if (!is_array($items)) {
                $itemsType = gettype($items);
                throw new \Exception("Offset '$index' is '$itemsType' and must be array to append.");
            }
        }
        $items[] = $value;
        $this->offsetSet($index, $items);
    }
951649
def append(self):
        """"""
        target_index = get_index_from_alias(self.alias_name)
        if not target_index:
            self.replace()
        else:
            self.index_all(target_index)
169608
public void finish() throws IOException{

		writer.write("CREATE INDEX articleIdx ON revisions(ArticleID);\r\n");
		writer.write("ALTER TABLE index_articleID_rc_ts ENABLE KEYS;\r\n");
		writer.write("ALTER TABLE index_revisionID ENABLE KEYS;\r\n");
		writer.write("ALTER TABLE index_chronological ENABLE KEYS;\r\n");
		writer.flush();

	}
113546
private void appendValueLength(int value, int index) {
    int previousValue = toIntUnsigned(getValue(index));
    int length = toIntUnsigned(getLength(index));
    int offset = value - previousValue;
    if (offset > length) {
      setLength(index, (short) offset);
    }
  }
472929
def _append(lst, indices, value):
    
    for i, idx in enumerate(indices):
        # We need to loop because sometimes indices can increment by more than 1 due to missing tokens.
        # Example: Sentence with no words after filtering words.
        while len(lst) <= idx:
            # Update max counts whenever a new sublist is created.
            # There is no need to worry about indices beyond `i` since they will end up creating new lists as well.
            lst.append([])
        lst = lst[idx]

    # Add token and update token max count.
    lst.append(value)
66502
function appendMethods(list, addition) {
  for (var i = 0; i < addition.length; i++) {
    var method = addition[i];
    if (list.indexOf(method) === -1) {
      list.push(method);
    }
  }
}
274622
public void addSearchResult(CaptureSearchResult result, boolean append) {
		String resultDate = result.getCaptureTimestamp();
		if ((firstResultTimestamp == null) ||
				(firstResultTimestamp.compareTo(resultDate) > 0)) {
			firstResultTimestamp = resultDate;
		}
		if ((lastResultTimestamp == null) ||
				(lastResultTimestamp.compareTo(resultDate) < 0)) {
			lastResultTimestamp = resultDate;
		}

		if (append) {

			if (!results.isEmpty()) {
				results.getLast().setNextResult(result);
				result.setPrevResult(results.getLast());
			}

			results.add(result);
		} else {
			if (!results.isEmpty()) {
				results.getFirst().setPrevResult(result);
				result.setNextResult(results.getFirst());
			}

			results.add(0, result);
		}
	}
1115119
private void performIndexActions(Progress progress, String transactionId) {
    List<IndexAction> indexActions =
        dataService
            .findAll(INDEX_ACTION, createQueryGetAllIndexActions(transactionId), IndexAction.class)
            .collect(toList());
    try {
      boolean success = true;
      int count = 0;
      for (IndexAction indexAction : indexActions) {
        success &= performAction(progress, count++, indexAction);
      }
      if (success) {
        progress.progress(count, "Executed all index actions, cleaning up the actions...");
        dataService.delete(INDEX_ACTION, indexActions.stream());
        dataService.deleteById(INDEX_ACTION_GROUP, transactionId);
        progress.progress(count, "Cleaned up the actions.");
      }
    } catch (Exception ex) {
      LOG.error("Error performing index actions", ex);
      throw ex;
    } finally {
      progress.status("Refresh index start");
      indexService.refreshIndex();
      progress.status("Refresh index done");
    }
  }
1374379
def append_result(self, results, num_matches):
        """"""
        filename, lineno, colno, match_end, line = results

        if filename not in self.files:
            file_item = FileMatchItem(self, filename, self.sorting,
                                      self.text_color)
            file_item.setExpanded(True)
            self.files[filename] = file_item
            self.num_files += 1

        search_text = self.search_text
        title = "'%s' - " % search_text
        nb_files = self.num_files
        if nb_files == 0:
            text = _('String not found')
        else:
            text_matches = _('matches in')
            text_files = _('file')
            if nb_files > 1:
                text_files += 's'
            text = "%d %s %d %s" % (num_matches, text_matches,
                                    nb_files, text_files)
        self.set_title(title + text)

        file_item = self.files[filename]
        line = self.truncate_result(line, colno, match_end)
        item = LineMatchItem(file_item, lineno, colno, line, self.text_color)
        self.data[id(item)] = (filename, lineno, colno)
1277325
function insert(arr, index, values) {
  [].splice.apply(arr, [index, 0].concat(values));
}
483315
def on_receive_append_entries(self, data):
        """"""
        if self.storage.term == data['term']:
            self.state.to_follower()
567877
def update(self, index, iterable, commit=True):
        
        parler = False
        # setup here because self.existing_mappings are overridden.
        if not self.setup_complete:
            try:
                self.setup()
            except elasticsearch.TransportError as e:
                if not self.silently_fail:
                    raise

                self.log.error("Failed to add documents to Elasticsearch: %s", e)
                return

        if hasattr(iterable, 'language') and hasattr(iterable.language, '__call__'):
            parler = True  # Django-parler

        for language in self.languages:
            self.index_name = self._index_name_for_language(language)
            # self.log.debug('updating index for {0}'.format(language))
            if parler:
                # workaround for django-parler
                for item in iterable:
                    item.set_current_language(language)
                super(ElasticsearchMultilingualSearchBackend, self).update(
                    index, iterable, commit)
            else:
                with translation.override(language):
                    super(ElasticsearchMultilingualSearchBackend, self).update(
                        index, iterable, commit)
1235984
public void add(int index, Object element) {

        if (index == size()) {
            add(element);    //Add to the end of this.
        }

        //If index > size() an exception should be thrown with a slightly
        //different message than the exception thrown by getInternal.
        else if (index > size()) {
            throw new IndexOutOfBoundsException("Index out of bounds: "
                                                + index + " > " + size());
        } else {
            Node current = getInternal(index);
            Node newNext = new Node(current.data, current.next);

            current.data = element;
            current.next = newNext;

            elementCount++;

            //If they inserted at the last valid index, then a new last element
            //was created, therfore update the last pointer
            if (last == current) {
                last = newNext;
            }
        }
    }