Lists the webids of the analyses that match the given query.

        Searches in MD5, SHA1, SHA256, filename, cookbook name, comment, url and report id.
192131
def analysis_search(self, query):
        
        response = self._post(self.apiurl + "/v2/analysis/search", data={'apikey': self.apikey, 'q': query})

        return self._raise_or_extract(response)
1165647
def search(query, count=10)
      return [] if query.length < 4
      response = @connection.get DOMESTIC_URL, params: { q: query.to_ascii, count: count }
      addresses = response.parsed['addresses'].each do |a|
        a['address_id'] = Integer(a['address_id'])
        a['dpid'] = Integer(a['dpid']) if a['dpid']
      end
      addresses.map {|address| OpenStruct.new(address)}
    end
1328044
def search(self):
        
        self.set_url()
        listings = []
        request = Request(debug=self._debug)
        url = self.get_url()
        soup = request.get(url)
        divs = soup.find_all("div", {"class": "box"})
        [listings.append(Listing(div, debug=self._debug)) for div in divs]
        return listings
423604
def search(query)
      return [] if query.nil?

      @atoms = @storage.fetch(cleanup_atoms(query), query[/\^/])
      queries = parse_query(query.dup)
      positive = run_queries(queries[:positive])
      positive_quoted = run_quoted_queries(queries[:positive_quoted])
      negative = run_queries(queries[:negative])
      negative_quoted = run_quoted_queries(queries[:negative_quoted])
      starts_with = run_queries(queries[:starts_with], true)
      start_quoted = run_quoted_queries(queries[:start_quoted], true)

      results = ActiveSupport::OrderedHash.new

      if queries[:start_quoted].any?
        results = merge_query_results(results, start_quoted)
      end

      if queries[:starts_with].any?
        results = merge_query_results(results, starts_with)
      end

      if queries[:positive_quoted].any?
        results = merge_query_results(results, positive_quoted)
      end

      if queries[:positive].any?
        results = merge_query_results(results, positive)
      end

      negative_results = (negative.keys + negative_quoted.keys)
      results.delete_if { |r_id, w| negative_results.include?(r_id) }
      results
    end
783459
def raw_query(query, index=INDEX_NAME, doc_type=DOC_TYPE):
    
    result = es_conn.search(index=index, doc_type=DOC_TYPE, body=query)
    return result['hits']['hits']
520728
async def query_pathings(self, zipped_list: List[List[Union[Unit, Point2, Point3]]]) -> List[Union[float, int]]:
        
        assert zipped_list, "No zipped_list"
        assert isinstance(zipped_list, list), f"{type(zipped_list)}"
        assert isinstance(zipped_list[0], list), f"{type(zipped_list[0])}"
        assert len(zipped_list[0]) == 2, f"{len(zipped_list[0])}"
        assert isinstance(zipped_list[0][0], (Point2, Unit)), f"{type(zipped_list[0][0])}"
        assert isinstance(zipped_list[0][1], Point2), f"{type(zipped_list[0][1])}"
        if isinstance(zipped_list[0][0], Point2):
            results = await self._execute(
                query=query_pb.RequestQuery(
                    pathing=[
                        query_pb.RequestQueryPathing(
                            start_pos=common_pb.Point2D(x=p1.x, y=p1.y), end_pos=common_pb.Point2D(x=p2.x, y=p2.y)
                        )
                        for p1, p2 in zipped_list
                    ]
                )
            )
        else:
            results = await self._execute(
                query=query_pb.RequestQuery(
                    pathing=[
                        query_pb.RequestQueryPathing(unit_tag=p1.tag, end_pos=common_pb.Point2D(x=p2.x, y=p2.y))
                        for p1, p2 in zipped_list
                    ]
                )
            )
        results = [float(d.distance) for d in results.query.pathing]
        return results
524516
def do_list(marfile, detailed=False):
    
    with open(marfile, 'rb') as f:
        with MarReader(f) as m:
            if detailed:
                if m.compression_type:
                    yield "Compression type: {}".format(m.compression_type)
                if m.signature_type:
                    yield "Signature type: {}".format(m.signature_type)
                if m.mardata.signatures:
                    plural = "s" if (m.mardata.signatures.count == 0 or m.mardata.signatures.count > 1) else ""
                    yield "Signature block found with {} signature{}".format(m.mardata.signatures.count, plural)
                    for s in m.mardata.signatures.sigs:
                        yield "- Signature {} size {}".format(s.algorithm_id, s.size)
                    yield ""
                if m.mardata.additional:
                    yield "{} additional block found:".format(len(m.mardata.additional.sections))
                    for s in m.mardata.additional.sections:
                        if s.id == 1:
                            yield ("  - Product Information Block:")
                            yield ("    - MAR channel name: {}".format(s.channel))
                            yield ("    - Product version: {}".format(s.productversion))
                            yield ""
                        else:
                            yield ("Unknown additional data")
            yield ("{:7s} {:7s} {:7s}".format("SIZE", "MODE", "NAME"))
            for e in m.mardata.index.entries:
                yield ("{:<7d} {:04o}    {}".format(e.size, e.flags, e.name))
577084
def _generate_index_report(self, index, query_analysis):
        """"""

        all_fields = []
        equiv_fields = []
        sort_fields = []
        range_fields = []

        for query_field in query_analysis['analyzedFields']:
            all_fields.append(query_field['fieldName'])
            if query_field['fieldType'] is EQUIV_TYPE:
                equiv_fields.append(query_field['fieldName'])
            elif query_field['fieldType'] is SORT_TYPE:
                sort_fields.append(query_field['fieldName'])
            elif query_field['fieldType'] is RANGE_TYPE:
                range_fields.append(query_field['fieldName'])

        max_equiv_seq = len(equiv_fields)
        max_sort_seq = max_equiv_seq + len(sort_fields)
        max_range_seq = max_sort_seq + len(range_fields)

        coverage = 'none'
        query_fields_covered = 0
        query_field_count = query_analysis['fieldCount']
        supported = True
        ideal_order = True
        for index_field in index['key']:
            field_name = index_field[0]

            if index_field[1] == '2d':
                supported = False
                break

            if field_name not in all_fields:
                break

            if query_fields_covered == 0:
                coverage = 'partial'

            if query_fields_covered < max_equiv_seq:
                if field_name not in equiv_fields:
                    ideal_order = False
            elif query_fields_covered < max_sort_seq:
                if field_name not in sort_fields:
                    ideal_order = False
            elif query_fields_covered < max_range_seq:
                if field_name not in range_fields:
                    ideal_order = False
            query_fields_covered += 1
        if query_fields_covered == query_field_count:
            coverage = 'full'

        # INDEX REPORT
        return OrderedDict({
            'coverage': coverage,
            'idealOrder': ideal_order,
            'queryFieldsCovered': query_fields_covered,
            'index': index,
            'supported': supported
        })
1094913
function querySearch (query) {
      var results = query ? self.vegetables.filter(createFilterFor(query)) : [];
      return results;
    }
940747
static ImmutableList<ListFindingsResult> listFindingsWithQueryMarks(SourceName sourceName) {
    try (SecurityCenterClient client = SecurityCenterClient.create()) {
      // Start setting up a request for to list all findings filtered by a specific security mark.
      // SourceName sourceName = SourceName.of(/*organization=*/"123234324",/*source=*/
      // "423432321");

      String filter = "NOT security_marks.marks.key_a=\"value_a\"";

      ListFindingsRequest.Builder request =
          ListFindingsRequest.newBuilder().setParent(sourceName.toString()).setFilter(filter);

      // Call the API.
      ListFindingsPagedResponse response = client.listFindings(request.build());

      // This creates one list for all findings in the filter.If your organization has a large
      // number of
      // findings this can cause out of memory issues.  You can process them batches by returning
      // the Iterable returned response.iterateAll() directly.
      ImmutableList<ListFindingsResult> results = ImmutableList.copyOf(response.iterateAll());
      System.out.println("Findings with security mark - key_a=value_a:");
      System.out.println(results);
      return results;
    } catch (IOException e) {
      throw new RuntimeException("Couldn't create client.", e);
    }
  }
680018
def analysis_list(self):
        
        response = self._post(self.apiurl + '/v2/analysis/list', data={'apikey': self.apikey})

        return self._raise_or_extract(response)
1328082
def get_list(self, ids: List[str]) -> List[Account]:
        
        query = (
            self.query
            .filter(Account.guid.in_(ids))
        )
        return query.all()
636915
def processSearch(query, tld='com', lang='en', num=10, start=0, stop=50, pause=2.0, only_standard=False):
    ''' 
        

    '''
    uriList = search(query, tld=tld, lang=lang, num=int(num), start=int(start), stop=int(stop), pause=float(pause),only_standard=only_standard)       
    
    # Dictionary containing the URI objects
    results = []
    
    # Building the objects
    for uri in uriList:
        aux = {}
        aux["type"] = "i3visio.uri"
        aux["value"] = uri        
        aux["attributes"] = []
        results.append(aux)

    return results
922822
def lookup_thread_id(self):
        

        query_string = 'in:title "%s" repo:%s/%s' % (
            self.topic, self.owner, self.realm)
        cache_key = (self.owner, self.realm, self.topic)
        result = self.lookup_cache_key(cache_key)
        if result is not None:
            my_req = self.raw_pull(result)
            if my_req.status_code != 200:
                result = None  # Cached item was no good
            elif my_req.json()['title'] != self.topic:
                logging.debug('Title must have changed; ignore cache')
                result = None
            else:
                logging.debug('Using cached thread id %s for %s', str(result),
                              str(cache_key))
                return result
        data, dummy_hdr = self.raw_search(self.user, self.token, query_string)

        if data['total_count'] == 1:   # unique match
            if data['items'][0]['title'] == self.topic:
                result = data['items'][0]['number']
            else:
                result = None
        elif data['total_count'] > 1:  # multiple matches since github doesn't
            searched_data = [          # have unique search we must filter
                item for item in data['items'] if item['title'] == self.topic]
            if not searched_data:  # no matches
                return None
            elif len(searched_data) > 1:
                raise yap_exceptions.UnableToFindUniqueTopic(
                    self.topic, data['total_count'], '')
            else:
                assert len(searched_data) == 1, (
                    'Confused searching for topic "%s"' % str(self.topic))
                result = searched_data[0]['number']
        else:
            result = None
        self.update_cache_key(cache_key, result)

        return result
1332104
def get_all_file_report_pages(self, query):
        
        responses = []
        r = self.get_hashes_from_search(query)
        responses.append(r)

        if ('results' in r.keys()) and ('next_page' in r['results'].keys()):
            next_page = r['results']['next_page']
        else:
            next_page = None

        while next_page:
            r = self.get_hashes_from_search(query, next_page)

            if ('results' in r.keys()) and ('next_page' in r['results'].keys()):
                next_page = r['results']['next_page']
            else:
                next_page = None

            responses.append(r)
        return dict(results=responses)
77205
def analyses(self, *, family: str=None, query: str=None, status: str=None, deleted: bool=None,
                 temp: bool=False, before: dt.datetime=None, is_visible: bool=None):
        """"""
        analysis_query = self.Analysis.query
        if family:
            analysis_query = analysis_query.filter_by(family=family)
        elif query:
            analysis_query = analysis_query.filter(sqa.or_(
                self.Analysis.family.like(f"%{query}%"),
                self.Analysis.status.like(f"%{query}%"),
            ))
        if status:
            analysis_query = analysis_query.filter_by(status=status)
        if isinstance(deleted, bool):
            analysis_query = analysis_query.filter_by(is_deleted=deleted)
        if temp:
            analysis_query = analysis_query.filter(self.Analysis.status.in_(TEMP_STATUSES))
        if before:
            analysis_query = analysis_query.filter(self.Analysis.started_at < before)
        if is_visible is not None:
            analysis_query = analysis_query.filter_by(is_visible=is_visible)
        return analysis_query.order_by(self.Analysis.started_at.desc())
1248484
def getAnalyses(self, contentFilter=None, **kwargs):
        
        # contentFilter and kwargs are combined.  They both exist for
        # compatibility between the two signatures; kwargs has been added
        # to be compatible with how getAnalyses() is used everywhere else.
        cf = contentFilter if contentFilter else {}
        cf.update(kwargs)
        analyses = []
        for ar in self.getAnalysisRequests():
            analyses.extend(ar.getAnalyses(**cf))
        return analyses