Given a named query's name, runs it
 on the server
 @returns [Array<String>] list of bugs
15204
def expand_named_query(what)
      url = @api_url.clone
      url.path = '/buglist.cgi'
      url.query = "cmdtype=runnamed&namedcmd=#{URI.escape(what)}&ctype=atom"
      logger.info("Expanding named query: '#{what}' to #{url.request_uri}")
      fetch_named_query_url(url, 5)
    end
1160207
def fetch_named_query_url(url, redirects_left)
      raise 'You need to be authenticated to use named queries' unless @userid
      http = Net::HTTP.new(@api_url.host, @api_url.port)
      http.set_debug_output(Bicho::LoggerIODevice.new)
      http.verify_mode = OpenSSL::SSL::VERIFY_NONE
      http.use_ssl = (@api_url.scheme == 'https')
      # request = Net::HTTP::Get.new(url.request_uri, {'Cookie' => self.cookie})
      request = Net::HTTP::Get.new(url.request_uri)
      request.basic_auth @api_url.user, @api_url.password
      response = http.request(request)
      case response
      when Net::HTTPSuccess
        bugs = []
        begin
          xml = Nokogiri::XML.parse(response.body)
          xml.root.xpath('//xmlns:entry/xmlns:link/@href', xml.root.namespace).each do |attr|
            uri = URI.parse attr.value
            bugs << uri.query.split('=')[1]
          end
          return bugs
        rescue Nokogiri::XML::XPath::SyntaxError
          raise "Named query '#{url.request_uri}' not found"
        end
      when Net::HTTPRedirection
        location = response['location']
        if redirects_left.zero?
          raise "Maximum redirects exceeded (redirected to #{location})"
        end
        new_location_uri = URI.parse(location)
        logger.debug("Moved to #{new_location_uri}")
        fetch_named_query_url(new_location_uri, redirects_left - 1)
      else
        raise "Error when expanding named query '#{url.request_uri}': #{response}"
      end
    end
759298
public function query($query_with_placeholders, $named_parameters = []) {
            Event::dispatch(EventData::forBefore(Event::BEFORE_QUERY, '', $named_parameters, $query_with_placeholders), $named_parameters);
            try {
                $stmt = $this->prepareStatement($query_with_placeholders, $named_parameters);
                $stmt->execute();
            } catch (Exception $ex) {
                Event::dispatch(EventData::forException($ex, $query_with_placeholders, $named_parameters));
                throw new QueryException($ex->getMessage(), $ex->getCode(), $ex);
            }

            Event::dispatch(EventData::forAfter(Event::AFTER_QUERY, null, $named_parameters, $query_with_placeholders, $stmt->rowCount()));

            return $this->fetch($stmt);
        }
1339029
def query_facts_exist(query, facts = [])
      result = query_facts(query, facts)
      unless facts.empty?
        result.keep_if do |_k, v|
          facts.any? { |f| !v[f].nil? }
        end
      end
      result
    end
905154
def method_missing(name, *args, &block)
      if queries.key?(name.to_sym)
        query = queries[name.to_sym]
        query.proc = block if block_given?
        query.options = args.extract_options!
        return query
      end

      super
    end
1130959
def search_by_name(cls, query, name):
        
        query = query.filter(db.or_(cls.first_name.contains(name),
                                    cls.last_name.contains(name)))
        return query
539094
def namedb_get_names_with_value_hash( cur, value_hash, block_number ):
    

    unexpired_query, unexpired_args = namedb_select_where_unexpired_names( block_number )
    select_query = "SELECT name FROM name_records JOIN namespaces ON name_records.namespace_id = namespaces.namespace_id " + \
                   "WHERE value_hash = ? AND revoked = 0 AND " + unexpired_query + ";"

    args = (value_hash,) + unexpired_args
    name_rows = namedb_query_execute( cur, select_query, args )
    names = []

    for name_row in name_rows:
        names.append( name_row['name'] )

    if len(names) == 0:
        return None
    else:
        return names
10795
def method_missing(name, *args)
      if self[0].respond_to?(name)
        self.inject(QueryResult.new) do |memo, node|
          ret = node.send(name, *args)
          memo << ret if ret
          memo
        end
      else
        super
      end
    end
1198909
def getProjectionForQueryName(self, query_name):
        
        projectionFileName = query_name + '.pyql'
        projectionText = self._getText(projectionFileName)
        return projectionText
582304
def results
      return @results if defined? @results
      return [] if frozen?

      enforce_timezone do
        case query
        when /\ADELETE/i
          @affected_rows = connection.delete(query, "#{self.class.name} Delete")

        when /\AINSERT/i
          @last_insert_id = connection.insert(query, "#{self.class.name} Insert")

        when /\AUPDATE/i
          @affected_rows = connection.update(query, "#{self.class.name} Update")

        when /\ASELECT/i
          # Why not execute or select_rows? Because select_all hits the query cache.
          ar_results = connection.select_all(query, "#{self.class.name} Select")
          @hash_results = ar_results.to_ary
          @results = ar_results.rows
        else
          @results = connection.execute(query, "#{self.class.name} Execute").to_a
        end

        @results ||= []

        retrieve_found_row_count
        freeze

        @results
      end
    end
8865
def get_bugs(*ids)
      params = {}
      params[:ids] = normalize_ids ids

      bugs = []
      ret = @client.call('Bug.get', params)
      handle_faults(ret)
      ret['bugs'].each do |bug_data|
        bugs << Bug.new(self, bug_data)
      end
      bugs
    end
513018
def get(path: nil, headers: {}, query: {})
      execute(method: :get, path: path, query: query, headers: headers)
    end
929190
function (query, indexName) {
        if (!query) return;
        var index = this._indexes[indexName || this.mainIndex];
        return index[query] || index[query[this.mainIndex]] || this._indexes.cid[query] || this._indexes.cid[query.cid];
    }
1076229
def exec_insert(sql, name = nil, binds = [], pk = nil, sequence_name = nil)
      exec_query(sql, name, binds)
    end
262823
def _query_service(self, name):
        """"""
        if self.query_cmd:
            try:
                return sos_get_command_output("%s %s" % (self.query_cmd, name))
            except Exception:
                return None
        return None
175425
def [](name)
      name = name.to_s
      entries.detect { |entry| entry.name.to_s == name }
    end
1164702
def get_query_arguments(self, name: str, strip: bool = True) -> List[str]:
        
        return self._get_arguments(name, self.request.query_arguments, strip)