Finds multiple icons based on the term
 * term - search term
 * limit - limit the amount of results
 * offset - offset the results
 * page - page number
166735
def find(term, limit = nil, offset = nil, page = nil)
      raise ArgumentError.new("Missing search term") unless term

      search = OAuth::Helper.escape(term)
      search += "?limit_to_public_domain=#{NounProjectApi.configuration.public_domain ? 1 : 0}"

      args = {
        "limit" => limit,
        "offset" => offset,
        "page" => page
      }.reject { |_, v| v.nil? }
      args.each { |k, v| search += "&#{k}=#{v}" } if args.size > 0

      result = access_token.get("#{API_BASE}#{API_PATH}#{search}")
      raise ServiceError.new(result.code, result.body) unless %w(200 404).include? result.code

      if result.code == "200"
        JSON.parse(result.body)["icons"].map { |icon| Icon.new(icon) }
      else
        []
      end
    end
625459
def searchFor(page, text, hit_max = 16, quads = False):
    
    CheckParent(page)
    dl = page.getDisplayList()         # create DisplayList
    tp = dl.getTextPage()              # create TextPage
    # return list of hitting reactangles
    rlist = tp.search(text, hit_max = hit_max, quads = quads)
    dl = None
    tp = None
    return rlist
1016235
def search(search_string)
    load_keywords if Page.visited != (0..Page.total).to_a

    puts "searching..."
    @searching = true

    search_string.downcase!
    terms = search_string.scan(/"[^"]*"/)
    terms.each { |term| search_string.slice!(term) }
    terms.collect! { |term| term.gsub("\"", '') }
    terms += search_string.split(' ')

    @results = (1..Problem.total).select do |i|
      terms.all? { |term| Problem[i].title.downcase.include?(term) }
    end
  end
877383
public function find($translations, $term = null, $page = 1, $perPage = 20)
    {
        $keys = [];
        foreach ($translations as $key => $translation) {
            foreach ($translation as $lang => $value) {
                if (empty($term) || str_contains(strtoupper($value), strtoupper($term))
                    || str_contains(strtoupper($key), strtoupper($term))) {
                    $keys[$key] = $translation;

                    continue;
                }
            }
        }

        return $this->paginate($keys, $page, $perPage);
    }
1102590
def page(self, i):
		""""""
		# Need to clear previous results.
		self.torrents = list()
		self._current_page = i
		self.search(term=self.term, category=self.category,
					sort=self.sort, order=self.order)
617143
def search(self, q, field=None, page=None, per_page=None):
        """"""

        def picker(results):
            if type(results['result']) == list:
                return results['result']
            else:
                return [results['result']]

        return self._get(('search',), picker, q=q, field=field, page=page, per_page=per_page)
508250
def index
      if params[:terms]
        # For search mode
        @dashboard_templates = []
        JSON.parse(params[:terms]).map { |t| @dashboard_templates = @dashboard_templates | dashboard_templates.where(Hash[*t]) }
        response.headers['X-Total-Count'] = @dashboards_templates.count
      else
        @dashboard_templates = dashboard_templates
        @dashboard_templates = @dashboard_templates.limit(params[:limit]) if params[:limit]
        @dashboard_templates = @dashboard_templates.skip(params[:offset]) if params[:offset]
        @dashboard_templates = @dashboard_templates.order_by(params[:order_by]) if params[:order_by]
        @dashboard_templates = @dashboard_templates.where(params[:where]) if params[:where]
        @dashboard_templates = @dashboard_templates.all.fetch
        response.headers['X-Total-Count'] = @dashboard_templates.metadata[:pagination][:count]
      end
    end
543274
def find(page_no = 1)
      images = {}
      return images unless @query

      while images.count < @num
        visit search_url(page_no)
        links = Capybara.page.all("a")
        links = links.select{|x| x["href"] =~ /^\/imgres/} if links.any?
        return images unless links.any?
        page_counter = 0
        links.each do |link|
          attribs = CGI.parse(URI.parse(link["href"]).query) rescue nil
          next if attribs.nil?
          hash = Digest::MD5.hexdigest(attribs["imgurl"][0])
          unless images.has_key?(hash)
            images[hash] = {
              width:          attribs["w"][0],
              height:         attribs["h"][0],
              url:            attribs["imgurl"][0],
              reference_url:  attribs["imgrefurl"][0]
            }
            page_counter += 1
          end
        end
        page_no += 1
        break if page_counter == 0
      end
      images.take(@num).map{|x| x[1]}
    end
1165003
def number_of_pages(self, key, value):
    """"""
    result = maybe_int(force_single_element(value.get('a', '')))
    if result and result > 0:
        return result
732653
def search(self, terms):
        
        images   = {}
        response = self._request_builder('GET', 'search', params={'q': terms})

        if self._validate_response(response):
            body = json.loads(response.content.decode('utf-8'))['results']
            for image in body:
                images[image['name']] = image

        return images
1242378
def get_search(self):
        """"""
        old_search = self.get_session_value('search', '')
        search = self.get_and_save_value('search', '')
        if old_search != search:
            self.page = 1
            self.get_session_value('page', self.page)
        return search
942135
def search_all(self, limit=50, format='json'):
        ''' '''
        desired_limit = limit
        results = self._search(limit, format)
        limit = limit - len(results)
        while len(results) < desired_limit:
            more_results = self._search(limit, format)
            if not more_results:
                break
            results += more_results
            limit = limit - len(more_results)
            time.sleep(1)
        return results
206844
def find_petition_pages(name, limit: 10, offset: 0)
      target = "#{self.base_url}/petitionpage/"

      options = {
          basic_auth: self.auth,
          query: {
            _limit: limit,
            _offset: offset,
            name: name
          }
      }

      self.class.get(target, options)
    end
1288499
def search(term, category=Categories.ALL, pages=1, sort=None, order=None):
	""""""
	s = Search()
	s.search(term=term, category=category, pages=pages, sort=sort, order=order)
	return s
884525
def search_album(self, album_name, quiet=False, limit=9):
        

        result = self.search(album_name, search_type=10, limit=limit)

        if result['result']['albumCount'] <= 0:
            LOG.warning('Album %s not existed!', album_name)
            raise SearchNotFound('Album {} not existed'.format(album_name))
        else:
            albums = result['result']['albums']
            if quiet:
                album_id, album_name = albums[0]['id'], albums[0]['name']
                album = Album(album_id, album_name)
                return album
            else:
                return self.display.select_one_album(albums)
1336904
function PageResultInfinite(items, totalCount, requestIndex, nextIndex, baseUrl) {
      this.items = items != null ? items : [];
      this.totalCount = totalCount != null ? totalCount : 0;
      this.requestIndex = requestIndex;
      this.nextIndex = nextIndex != null ? nextIndex : null;
      this.baseUrl = baseUrl != null ? baseUrl : null;
      this.toRest = __bind(this.toRest, this);

    }
1010037
def search(self, s, stype=1, offset=0, total='true', limit=60):
        """"""
        action = uri + '/search/get'
        data = {
            's': s,
            'type': stype,
            'offset': offset,
            'total': total,
            'limit': 60
        }
        resp = self.request('POST', action, data)
        if resp['code'] == 200:
            return resp['result']['songs']
        return []