@private

Return the useful information for each search result item
191363
function mapItem (item) {
  const title = item.pagemap.metatags[0]['og:title'] ||
                item.pagemap.metatags[0]['dc.title'] ||
                item.title

  return {
    title,
    link: item.link,
    date: item.pagemap.metatags[0].date,
    image: item.pagemap.cse_image[0].src,
    author: item.pagemap.metatags[0].author
  }
}
24987
function getAll(url, collection) {
    // Initialise array
    collection = typeof collection === 'undefined' ? [] : collection;

    return makeRequest(url).then(function (data) {
      // Add each item to array
      var length = data.results.length;
      for (var i = 0; i < length; ++i) {
        collection.push(data.results[i]);
      }

      if (data.next === null) {
        // Return on final page
        return collection;
      } else {
        return getAll(data.next, collection);
      }
    }).catch(function (err) {
      throw err;
    });
  }
592435
function () {
            var data = this._data;
            if (data.selectedIndex == -1) {
                // no item is selected
                return [];
            } else if (data.selectedIndex != null) {
                return [data.selectedIndex];
            } else {
                var retVal = [];
                // we iterate over the view, so that we return indexes in the order visible to the user:
                var view = data.itemsView;
                view.refresh(); // in case there are changes in the view, refresh it
                var items = view.items;
                for (var idx = 0, length = items.length; idx < length; idx++) {
                    if (items[idx].value.selected) {
                        // retVal.push(idx);
                        retVal.push(items[idx].initIndex);
                    }
                }
                return retVal;
            }
        }
612003
function getStats(results, done) {
  const databases = results.databases;

  const keys = ['document_count', 'storage_size', 'index_count', 'index_size'];
  const stats = {};
  keys.map(function(k) {
    stats[k] = 0;
  });
  databases.map(function(db) {
    keys.map(function(k) {
      stats[k] += db[k];
    });
  });
  done(null, stats);
}
1196418
function findValues(toSearch, ...searchFor) {
  const searchesLen = searchFor.length;
  let results = {};
  let searches = {};

  for (let i = 0; i < searchesLen; i++) {
    searches[searchFor[i]] = true;
  }

  /* Object, Object -> Void */
  function traverseObject(toSearchObj, searchForObj) {
    const allKeys = Object.keys(toSearchObj);
    const len = allKeys.length;

    for (let i = 0; i < len; i++) {
      const key = allKeys[i];
      const val = toSearchObj[key];

      if (searchForObj[key] && !results[key]) {
        results[key] = val;
      } else if (isObject(val)) {
        traverseObject(val, searchForObj);
      } else if (isArray(val)) {
        traverseArray(val, searchForObj);
      }
    }
  }

  /* Array, Object -> Void */
  function traverseArray(arr, searchForObj) {
    const len = arr.length;

    for (let i = 0; i < len; i++) {
      const item = arr[i];

      if (isArray(item)) {
        traverseArray(item, searchForObj);
      } else if (isObject(item)) {
        traverseObject(item, searchForObj);
      }
    }
  }

  traverseObject(toSearch, searches);

  return results;
}
977467
function collectionResult (results) {
    // get context by executing any pre methods on collection views
    return this.collectionResultPre()
    // apply views to each record
    .then(context => {
        // if there are no results then do nothing
        if (!Array.isArray(results) || !results.length) {
            return context
        }
        // check if full records were loaded
        return this.query.limit === 1 || this.query.all
            // apply views to results directly
            ? this.collectionResultList(context, results)
            // create result object to iterate over results
            : this.collectionResultIterator(context, results)
    })
    // apply any post methods to context and return result
    .then(context => {
        return this.collectionResultPost(context)
    })
}
1333824
function getUrlParameters() {
        var params = [ "allume" ];
        location.search.substr(1).split("&").forEach(function (part) {
            if (!part) return;
            var item = part.split("=");
            params.push(decodeURIComponent(item[0]));
        });
        return params;
    }
218842
function arraySearch(items, id) {
  for (var i = 0; i < items.length; i++)
    if (items[i].id === id) {
      return items[i];
    }
}
592987
function getReturns() {
  var tag = getTag(this, 'returns'),
      desc = _.toString(_.get(tag, 'description')),
      type = _.toString(_.get(tag, 'type.name')) || '*';

  return tag ? [type, desc] : [];
}
1101074
def getResults(uri):
    '''
        
    '''
    # Using i3visio browser to avoid certain issues...
    i3Browser = browser.Browser()

    data = i3Browser.recoverURL(uri)        

    # Strings to be searched
    regExp = "<!-- Results -->(.*)<!-- /Results -->"
    # re.DOTALL is needed to match any character INCLUDING \n
    results = re.findall(regExp, data, re.DOTALL)
    
    return results
1211690
function listSearchPaths(output) {
    var book = output.getBook();
    var plugins = output.getPlugins();

    var searchPaths = plugins
        .valueSeq()
        .map(function(plugin) {
            return plugin.getPath();
        })
        .toList();

    return searchPaths.unshift(book.getContentRoot());
}
240269
function getNextPageofSearchResults() {
        var searchDeferred = $.Deferred();
        if (searchModel.allResultsAvailable) {
            return searchDeferred.resolve().promise();
        }
        _updateChangedDocs();
        FindUtils.notifyNodeSearchStarted();
        searchDomain.exec("nextPage")
            .done(function (rcvd_object) {
                FindUtils.notifyNodeSearchFinished();
                if (searchModel.results) {
                    var resultEntry;
                    for (resultEntry in rcvd_object.results ) {
                        if (rcvd_object.results.hasOwnProperty(resultEntry)) {
                            searchModel.results[resultEntry.toString()] = rcvd_object.results[resultEntry];
                        }
                    }
                } else {
                    searchModel.results = rcvd_object.results;
                }
                searchModel.fireChanged();
                searchDeferred.resolve();
            })
            .fail(function () {
                FindUtils.notifyNodeSearchFinished();
                console.log('node fails');
                FindUtils.setNodeSearchDisabled(true);
                searchDeferred.reject();
            });
        return searchDeferred.promise();
    }
618937
def get_results():
    """"""
    base = "http://www.theduckwebcomics.com/search/?page=%d&search=&type=0&type=1&last_update="
    href = re.compile(tagre("a", "href", r'(/[^"]+/)', before="size24 yanone blue"))
    num = re.compile(r'(\d+) pages?</span>')
    # store info in a dictionary {name -> number of comics}
    res = {}
    # a search for an empty string returned 825 result pages
    result_pages = 825
    print("Parsing", result_pages, "search result pages...", file=sys.stderr)
    session = requests.Session()
    for i in range(1, result_pages + 1):
        print(i, file=sys.stderr, end=" ")
        handle_url(base % i, session, href, num, res)
    save_result(res, json_file)
279124
def get_all(self, search_filter=None):
        """"""
        items = self.backend.get_all()

        if not items:
            if self.version == 1:
                return {self.namespace: []}
            return []

        if search_filter:
            items = jmespath.search(search_filter, items)

        return items
51013
function(xxx, results) {
        var o, r, lookup = {}
          // map from results to keys
        for (var i = 0, l = results.rows.length; i < l; i++) {
          o = JSON.parse(results.rows.item(i).value)
          o.key = results.rows.item(i).id
          lookup[o.key] = o;
        }
        r = args.map(function(key) {
          return lookup[key];
        });
        if (!that.isArray(keyOrArray)) r = r.length ? r[0] : null
        if (cb) that.lambda(cb).call(that, r)
      }
323290
function parseSearchResults (html) {
  const $ = cheerio.load(html)
  return $('a')
    .filter(function (index, element) {
      const spans = $(element).find('span')
      return spans.length === 2 && spans.eq(0).text().trim() === 'English'
    })
    .map(function (index, element) {
      const title = $(element).find('span').eq(1).text().trim()
      const url = $(element).attr('href')
      return new SearchResult({
        title: title,
        url: url
      })
    })
    .get()
}
161832
def _fetch_all(self):
        
        if self._result_cache is None:
            self._result_cache = list(self.iterator())
            # TODO: Do we have to test for ValuesListIterable, ValuesIterable,
            # and FlatValuesListIterable here?
            if self._iterable_class == ModelIterable:
                for x in self._result_cache:
                    self._set_item_querytime(x)
        if self._prefetch_related_lookups and not self._prefetch_done:
            self._prefetch_related_objects()