Pushes new suggestions to the array of selectedSuggestions and return the array of new suggestions.
@protected
@param {Object} suggestionToBeAdded
@return {Array}
978370
function (suggestionToBeAdded) {
                var allSuggestions = ariaUtilsJson.copy(this.selectedSuggestions, false);
                var res = [];
                var maxOptions = this.maxOptions;
                var length = suggestionToBeAdded.length;
                if (maxOptions && allSuggestions.length + length > maxOptions) {
                    length = maxOptions - allSuggestions.length;
                }
                if (length > 0) {
                    for (var k = 0; k < length; k++) {
                        if (this._editedSuggestionIndex != -1) {
                            allSuggestions.splice(this._editedSuggestionIndex, 0, suggestionToBeAdded[k]);
                            this._editedSuggestionIndex += 1;
                        } else {
                            allSuggestions.push(suggestionToBeAdded[k]);
                        }
                        res[k] = suggestionToBeAdded[k];
                    }
                    this._editedSuggestionIndex = -1;
                    this.selectedSuggestions = allSuggestions;
                }
                return res;
            }
617495
function(searchTerm) {
    var suggestions = [ ];
    var popup = this.getElement({type: "searchBar_autoCompletePopup"});
    var treeElem = this.getElement({type: "searchBar_suggestions"});

    // Enter search term and wait for the popup
    this.type(searchTerm);

    this._controller.waitForEval("subject.popup.state == 'open'", TIMEOUT, 100,
                                 {popup: popup.getNode()});
    this._controller.waitForElement(treeElem, TIMEOUT);

    // Get all suggestions
    var tree = treeElem.getNode();
    this._controller.waitForEval("subject.tree.view != null", TIMEOUT, 100,
                                 {tree: tree});
    for (var i = 0; i < tree.view.rowCount; i ++) {
      suggestions.push(tree.view.getCellText(i, tree.columns.getColumnAt(0)));
    }

    // Close auto-complete popup
    this._controller.keypress(popup, "VK_ESCAPE", {});
    this._controller.waitForEval("subject.popup.state == 'closed'", TIMEOUT, 100,
                                 {popup: popup.getNode()});

    return suggestions;
  }
374234
function (fields) {
        return function(query, suggestions) {
            var tokens = text_util.splitTokens(text_util.split(query));
            var suggestionWords = [];

            if (suggestions.length === 1) {
                if (fields) {
                    collection_util.each(fields, function (stopwords, field) {
                        var fieldValue = object_util.getDeepValue(suggestions[0], field);
                        var fieldWords = fieldValue 
                            && text_util.splitTokens(text_util.split(fieldValue, stopwords));

                        if (fieldWords && fieldWords.length) {
                            suggestionWords = suggestionWords.concat(fieldWords);
                        }
                    });
                }

                if (collection_util.minusWithPartialMatching(tokens, suggestionWords).length === 0) {
                    return 0;
                }
            }

            return -1;
        }
    }
865955
function (suggestionNode) {
            if (suggestionNode == null) {
                suggestionNode = Aria.$window.document.activeElement;
                if (suggestionNode.className.indexOf("highlight") === -1) {
                    suggestionNode = this._getSuggestionsContainer().children[this.getHighlightedOptionIndex() - 1];
                }
                // TODO Get currently focused element and check this is an highlighted option...
            }

            if (suggestionNode != null) {
                this._removeClass(suggestionNode, 'highlight');
                suggestionNode.firstChild.removeAttribute('tabindex');
            }
        }
900012
function (newItems) {
            var res = this._mergeItemsAndSelectionInfo(newItems, this.getSelectedValues());
            this._setItems(res.items);
            this.json.setValue(this._data, "selectedIndex", res.selectedIndex);
            this.json.setValue(this._data, "selectedCount", res.selectedCount);
        }
785551
protected List<String> getAdditionalSuggestions(List<String> suggestions, String word) {
    return Collections.emptyList();
  }
571445
public void addFeatures(Collection<String> featuresToAdd) {
        if (featuresToAdd == null) return;
        for (String feature : featuresToAdd) {
            addFeature(feature);
        }
    }
1125613
def suggest(self, *replies):
        """"""
        chips = []
        for r in replies:
            chips.append({"title": r})

        # NOTE: both of these formats work in the dialogflow console,
        # but only the first (suggestions) appears in actual Google Assistant

        # native chips for GA
        self._messages.append(
            {"platform": "ACTIONS_ON_GOOGLE", "suggestions": {"suggestions": chips}}
        )

        # # quick replies for other platforms
        # self._messages.append(
        #     {
        #         "platform": "ACTIONS_ON_GOOGLE",
        #         "quickReplies": {"title": None, "quickReplies": replies},
        #     }
        # )

        return self
953600
function (item) {
            // Check if it already exists in the suggestions list.  Duplicates aren't allowed.
            var exists = false;
            for(var j = 0; j < suggestions.length; j++){
              if(suggestions[j].attr('name').toLowerCase() === item.name.toLowerCase()){
                exists=true;
                break;
              }
            }
            // If it didn't exist, add it to the list of suggestions and the searchTerms.
            if(!exists){
              suggestions.push(item);
            }

            // We are using searchTerms's setter to execute the filter, so have to set the property (not just update):
            var searchTerms = self.viewModel.attr('searchTerms').attr().concat(item.name);
            self.viewModel.attr('searchTerms', searchTerms);
          }
976258
function (suggestions) {

                if (typesUtil.isArray(suggestions)) {
                    var newSuggestions = [], suggestionsLabel = this._options.labelKey, suggestionsCode = this._options.codeKey;
                    if (this._options.sortingMethod && typesUtil.isFunction(this._options.sortingMethod)) {
                        suggestions.sort(this._options.sortingMethod);
                    } else {
                        suggestions.sort(function (a, b) {
                            return (a[suggestionsLabel] < b[suggestionsLabel])
                                    ? 1
                                    : (a[suggestionsLabel] > b[suggestionsLabel]) ? -1 : 0;
                        });
                    }

                    for (var index = 0, l = suggestions.length; index < l; index++) {
                        var suggestion = suggestions[index], eachSuggestion = {};
                        if (this.__islabelCode && !jsonValidator.check(suggestion, this.SUGGESTION_BEAN)) {
                            return this.$logError(this.INVALID_SUGGESTIONS, null, suggestions);

                        } else if (!(suggestion.hasOwnProperty(suggestionsLabel) && suggestion.hasOwnProperty(suggestionsCode))) {
                            return this.$logError(this.INVALID_KEYCODE, null, suggestions);
                        }
                        eachSuggestion.label = suggestion[suggestionsLabel];
                        eachSuggestion.code = suggestion[suggestionsCode];
                        var newSuggestion = {
                            label : stringUtil.stripAccents(eachSuggestion.label).toLowerCase(),
                            code : stringUtil.stripAccents(eachSuggestion.code).toLowerCase(),
                            original : eachSuggestion
                        };
                        if (this._labelMatchAtWordBoundaries) {
                            newSuggestion.wordBoundaries = this.__getWordBoundaries(newSuggestion.label);
                        }
                        newSuggestions.push(newSuggestion);
                    }
                    this._suggestions = newSuggestions;

                } else {
                    return this.$logError(this.INVALD_SUGGESTION_TYPE, null, suggestions);
                }

            }
368340
public void addItems(Collection<Item> itemsToAdd) {
        if (itemsToAdd == null) return;
        for (Item i : itemsToAdd) {
            addItem(i);
        }
    }
265330
function addSuggestions(currentActivity, rest) {
    currentActivity.suggestedActions = { actions: [] };
    let actions = rest.split('|');
    for (let action of actions) {
        currentActivity.suggestedActions.actions.push({ title: action.trim(), type: "imBack", value: action.trim() });
    }
}
713761
function push(callback) {
  window.yandex_metrika_callbacks = window.yandex_metrika_callbacks || [];
  window.yandex_metrika_callbacks.push(callback);
}
402602
function addFlattened(array, item) {
  if (item === null || typeof item !== 'object') {
    const child =
      item === undefined || item === null || item === true || item === false
        ? ''
        : '' + item

    const arrayLength = array.length

    if (arrayLength > 0 && typeof array[arrayLength - 1] === 'string') {
      array[arrayLength - 1] += child
    } else {
      array.push(child)
    }
  } else if (Array.isArray(item)) {
    for (let i = 0; i < item.length; ++i) {
      addFlattened(array, item[i])
    }
  } else if (item[Symbol.iterator]) {
    for (const x of item) {
      addFlattened(array, x)
    }
  } else {
    array.push(item)
  }
}
1169002
function (suggestions, textEntry) {
                var matchValueIndex = -1, suggestion;
                for (var index = 0, len = suggestions.length, label, ariaLabel; index < len; index += 1) {
                    suggestion = suggestions[index];
                    // if it's the first exact match, store it
                    if (matchValueIndex == -1) {
                        if (suggestion.exactMatch) {
                            matchValueIndex = index;
                        }
                    }
                    label = this._getLabelFromSuggestion(suggestion);
                    ariaLabel = this.waiSuggestionAriaLabelGetter ? this.waiSuggestionAriaLabelGetter({
                        value: suggestion,
                        index: index,
                        total: len
                    }) : null;
                    var tmp = {
                        entry : textEntry,
                        label : label,
                        ariaLabel : ariaLabel,
                        value : suggestion
                    };
                    suggestions[index] = tmp;
                }
                return this.preselect === "none" ? -1 : matchValueIndex;
            }
1288218
def _onCompletionListItemSelected(self, index):
        
        model = self._widget.model()
        selectedWord = model.words[index]
        textToInsert = selectedWord[len(model.typedText()):]
        self._qpart.textCursor().insertText(textToInsert)
        self._closeCompletion()
1283773
protected void onAddressChange(SuggestOracle.Suggestion suggestion) {

        try {
            onAddressChange(suggestion.getDisplayString());
        } catch (Throwable t) {
            CmsErrorDialog.handleException(t);
        }
    }