Give suggestion from all instances.
168556
def fuzzy(self, key, limit=5):
        """"""
        instances = [i[2] for i in self.container if i[2]]
        if not instances:
            return
        instances = sum(instances, [])
        from fuzzywuzzy import process

        maybe = process.extract(key, instances, limit=limit)
        return maybe
179066
def on_about_to_process(self, plugin, instance):
        """"""

        if instance is not None:
            instance_model = self.data["models"]["instances"]
            index = instance_model.items.index(instance)
            index = instance_model.createIndex(index, 0)
            instance_model.setData(index, True, model.IsProcessing)

        plugin_model = self.data["models"]["plugins"]
        index = plugin_model.items.index(plugin)
        index = plugin_model.createIndex(index, 0)
        plugin_model.setData(index, True, model.IsProcessing)
        self.info("%s %s" % (self.tr("Processing"), index.data(model.Label)))
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);
                }

            }
1064052
public void setRecommendations(java.util.Collection<ReservationPurchaseRecommendation> recommendations) {
        if (recommendations == null) {
            this.recommendations = null;
            return;
        }

        this.recommendations = new java.util.ArrayList<ReservationPurchaseRecommendation>(recommendations);
    }
1114550
def _create_all_recommendations(cores, ip_views=False, config=None):
    """"""
    global _reco, _store

    _reco = GraphRecommender(_store)
    _reco.load_profile('Profiles')
    if ip_views:
        _reco.load_profile('Profiles_IP')

    manager = Manager()
    record_list = manager.list(_reco.all_records.keys())
    # record_list = manager.list(list(_reco.all_records.keys())[:10])
    num_records = len(_reco.all_records.keys())
    logger.info("Recommendations to build: {}".format(num_records))

    start = time.time()
    reco_version = config.get('recommendation_version', 0)
    done_records = num_records
    if cores <= 1:
        _create_recommendations(0, record_list, reco_version)
    else:
        try:
            pool = Pool(cores)
            multiple_results = [pool.apply_async(_create_recommendations,
                                (i, record_list, reco_version))
                                for i in range(cores)]
            # Wait for all processes to exit
            [res.get() for res in multiple_results]
        except KeyboardInterrupt:
            print("Caught KeyboardInterrupt, terminating workers")
            # TODO: Update done_records.
            pool.terminate()
            pool.join()

    duration = time.time() - start
    logger.info("Time {} for {} recommendations".format(duration,
                                                        done_records))
918908
function Suggestion(data) {
	var o = Array.isArray(data)
	  ? { label: data[0], value: data[1] }
	  : typeof data === "object" && "label" in data && "value" in data ? data : { label: data, value: data };

	this.label = o.label || o.value;
	this.value = o.value;
}
298940
function suggest (opts) {
    opts.strategy = opts.strategy || c.CATEGORY;
    const num = opts.num || 30;
    return resolveApps(opts)
      .then((apps) => getSuggestions(apps, opts.keywords || []))
      .then(R.slice(0, num));
  }
682739
public void feedback(Object from, String from_out, Object to, String to_in) {
        controller.feedback(from, from_out, to, to_in);
    }
621418
def update_record(self, now, rec):
        """"""
        for listener in self.listeners:
            listener.update_record(self, now, rec)
        self.notify_all()
108984
def v1_suggest_get(request, response, tfidf, query):
    '''

    '''
    config = yakonfig.get_global_config('dossier.models')
    suggest_services = config.get('suggest_services', [])
    session = requests.Session()
    suggestions = []
    logger.info('querying %d suggest_services', len(suggest_services))
    for url in suggest_services:
        try:
            url = url % dict(query=query)
        except Exception, exc:
            logger.error('failed to insert query=%r into pattern: %r', query, url)
            continue
        try:
            resp = session.get(url)
        except Exception, exc:
            logger.error('failed to retrieve %r', url)
            continue
        try:
            results = resp.json()
        except Exception, exc:
            logger.error('failed to get JSON from: %r', 
                         resp.content, exc_info=True)
            continue
        if not isinstance(results, list) or len(results) < 2:
            logger.error('got other than list of length at least two from service: %r --> %r',
                         url, results)
            continue
        query_ack = results[0]
        query_suggestions = results[1]
        if not isinstance(query_suggestions, list):
            logger.error('got other than list of query suggestions: %r --> %r',
                         url, results)
            continue
        suggestions += query_suggestions
        logger.info('%d suggestions from %r', len(query_suggestions), url)

    logger.info('found %d suggestions for %r', len(suggestions), query)
    return [query, suggestions]
822310
def satisfy_all(self, **params):
        """"""
        verbosity = params.get('verbosity', 0)
        default_phase = params.get('default_phase', 2)
        propagation_limit = params.get('propagation_limit', -1)
        decision_limit = params.get('decision_limit', -1)
        seed = params.get('seed', 1)
        yield from picosat.satisfy_all(self.nvars, self.clauses, verbosity,
                                       default_phase, propagation_limit,
                                       decision_limit, seed)
758939
def accept(self):
        """"""
        for index in range(self.stack.count()):
            self.stack.widget(index).accept_changes()
        QDialog.accept(self)
123912
def on_any_event(self, event):
        """"""
        for delegate in self.delegates:
            if hasattr(delegate, "on_any_event"):
                delegate.on_any_event(event)
1283228
public void setSuggestions(java.util.Collection<SuggestionMatch> suggestions) {
        if (suggestions == null) {
            this.suggestions = null;
            return;
        }

        this.suggestions = new com.amazonaws.internal.SdkInternalList<SuggestionMatch>(suggestions);
    }
1001503
def domain_suggestions(self, query, **kwargs):
        """"""
        return self._results('domain-suggestions', '/v1/domain-suggestions', query=delimited(query, ' '),
                            items_path=('suggestions', ), **kwargs)
1017350
def _set_shared_instances(self):
        """"""
        self.inqueue = self.em.get_inqueue()
        self.outqueue = self.em.get_outqueue()
        self.namespace = self.em.get_namespace()
415877
def on(self):
        """"""
        msg = X10Send.unit_code_msg(self.address.x10_housecode,
                                    self.address.x10_unitcode)
        self._send_method(msg)

        msg = X10Send.command_msg(self.address.x10_housecode,
                                  X10_COMMAND_ON)
        self._send_method(msg, False)
        self._update_subscribers(0xff)