looking for suggestions
495444
function instantSearch() {

    const q = $("#searchbox").val();
    if (q === '')
        return;

    const matcher = "/matcher?beginsWith=" + q;
    const request = host + matcher;

    console.debug(request);

    $.getJSON(request, '', {})
        .done(data => {

            $("#searchbox").autocomplete({
                source: data,
                select: (event) => {
                    event.stopPropagation();
                    $("#search").trigger("click");
                }
            });
        })
        .fail((d, textStatus, error) => {

            const err = d.status + " " + error + " -> message: " + d.responseText;
            bootstrapAlert.error(err);
            console.error(`Search request failed: \n ${err}`);
        });
}
144013
protected void filterSuggestions(List<String> suggestions) {
    suggestions.removeIf(suggestion -> isProhibited(suggestion));
    filterDupes(suggestions);
  }
135500
public Map<String, Integer> suggest(String string, int maxCost, int substitutionCost) {
      if (StringUtils.isNullOrBlank(string)) {
         return Collections.emptyMap();
      } else if (containsKey(string)) {
         return Maps.map(string, 0);
      }
      Map<String, Integer> results = new HashMap<>();
      int[] current = new int[string.length() + 1];
      for (int i = 0; i < current.length; i++) {
         current[i] = i;
      }
      for (TrieNode<V> child : root.children) {
         if (child != null) {
            search(child, child.nodeChar, string, current, results, maxCost, substitutionCost);
         }
      }
      return results;
   }
482428
def filter(self, table, flavors, filter_string):
        """"""
        q = filter_string.lower()

        def comp(flavor):
            return q in flavor.name.lower()

        return filter(comp, flavors)
587061
def doFind(self, WHAT={}, SORT=[], SKIP=None, MAX=None, LOP='AND', **params):
		""""""

		self._preFind(WHAT, SORT, SKIP, MAX, LOP)

		for key in params:
			self._addDBParam(key, params[key])

		try:
			return self._doAction('-find')
		except FMServerError as e:
			if e.args[0] in [401, 8]:
				return []
894448
def post(self, urls=None, **overrides):
        """"""
        if urls is not None:
            overrides['urls'] = urls
        return self.where(accept='POST', **overrides)
231302
def spelling_suggestions(self):
        """"""
        if not self.is_tagged(WORDS):
            self.tokenize_words()
        return [data[SUGGESTIONS] for data in vabamorf.spellcheck(self.word_texts, suggestions=True)]
760067
def run(self, dw, m, area):
        """"""
        return _fitz.DisplayList_run(self, dw, m, area)
754346
function (suggestionNode, className) {
            var suggestionNodeClassList = new aria.utils.ClassList(suggestionNode);
            suggestionNodeClassList.add(className);
            suggestionNodeClassList.$dispose();
        }
1001503
def domain_suggestions(self, query, **kwargs):
        """"""
        return self._results('domain-suggestions', '/v1/domain-suggestions', query=delimited(query, ' '),
                            items_path=('suggestions', ), **kwargs)
1242998
def suggest_path(root_dir):
    
    if not root_dir:
        return [os.path.abspath(os.sep), '~', os.curdir, os.pardir]

    if '~' in root_dir:
        root_dir = os.path.expanduser(root_dir)

    if not os.path.exists(root_dir):
        root_dir, _ = os.path.split(root_dir)

    return list_path(root_dir)
1218025
def suggest(query):
  '''
  
  '''

  search_params = {
    'list': 'search',
    'srinfo': 'suggestion',
    'srprop': '',
  }
  search_params['srsearch'] = query

  raw_result = _wiki_request(search_params)

  if raw_result['query'].get('searchinfo'):
    return raw_result['query']['searchinfo']['suggestion']

  return None
186916
def might_prefer(self, **items):
        ''''''
        self._overrides = dict((k, v) for (k, v) in items.items() if v is not None)
1215781
def list_matching_entries(program, arguments):
    """"""
    output("\n".join(entry.name for entry in program.smart_search(*arguments)))
1008229
def list_items(path_to_directory, pattern, wanted):
    """"""
    if not path_to_directory:
        return set()
    needed = make_needed(pattern, path_to_directory, wanted)
    return [os.path.join(path_to_directory, name)
            for name in _names_in_directory(path_to_directory)
            if needed(name)]
205861
public function post()
    {
        $this->getInvoice()->setAmountDue(
            $this->getInvoice()->getAmountDue() - $this->getAmount()
        );

        parent::post();
    }
846148
public function boot()
    {
        View::share('users', User::all());
        View::share('comments', Comment::all());
        View::share('comment', Comment::first());
    }