Query nameservers to find the answer to the question.

    This is a convenience function that uses the default resolver
    object to make the query.
    @see: L{dns.resolver.Resolver.query} for more information on the
    parameters.
435828
def query(qname, rdtype=dns.rdatatype.A, rdclass=dns.rdataclass.IN,
          tcp=False, source=None, raise_on_no_answer=True, resolver=None):
    """"""
    if resolver is None:
        resolver = get_default_resolver()
    return resolver.query(qname, rdtype, rdclass, tcp, source, raise_on_no_answer)
491079
public function query($name, $class, $resolver = null)
    {
        /**
         * @var QueryScaffolder $query
        */
        $query = $this->queries->findByName($name);
        if ($query) {
            return $query;
        }

        $operationScaffold = (new ListQueryScaffolder($name, null, $resolver, $class))
            ->setChainableParent($this);

        $this->queries->push($operationScaffold);

        return $operationScaffold;
    }
1245512
def backend_query(self, **kwargs):
        ''''''
        q = self.construct()
        return q if isinstance(q, EmptyQuery) else q.backend_query(**kwargs)
221943
function querystring(query) {
  var parser = /([^=?&]+)=?([^&]*)/g
    , result = {}
    , part;

  while (part = parser.exec(query)) {
    var key = decode(part[1])
      , value = decode(part[2]);

    //
    // Prevent overriding of existing properties. This ensures that build-in
    // methods like `toString` or __proto__ are not overriden by malicious
    // querystrings.
    //
    if (key in result) continue;
    result[key] = value;
  }

  return result;
}
990766
def query(self, query):
    '''
    '''
    self.logger.info('%s: query %s' % (self, query))
    return super(LoggingDatastore, self).query(query)
570871
function query (args) {
    // get relation
    var relation = this.model.relation(args.relation)
    // delete relation name from args so it wont pass to query
    delete args.relation
    // build query args
    var queryArgs = {
        session: args.session || this.session,
        where: { relation: { name: this.model.name } },
    }
    // relation is via a linking table
    if (relation.via) {
        // query by current records ids
        queryArgs.where.relation[relation.viaModelIdColumn] = this[this.model.defaultColumns[relation.modelIdColumn]]
    }
    // relation is direct
    else {
        // query by current records ids
        queryArgs.where.relation[relation.relationIdColumn] = this[this.model.defaultColumns[relation.modelIdColumn]]
    }
    // merge args
    _.merge(queryArgs, args)
    // do query on related model
    return relation.model.query(queryArgs)
}
330165
def parse_uri_query_params(query)
      query.to_s.split('&'.freeze).reduce({}) do |h, p|
        k, v = p.split('='.freeze, 2)
        v = URI::Generic::DEFAULT_PARSER.unescape(v) if v
        h[k.to_sym] = v || true
        h
      end
    end
240534
function Query(server, query, options, token) {
  this.server = server;
  this.query = query;
  // Used to track the presence of r.args (workaround)
  this.originalQuery = util.deepCopy(query);
  this.options = {};
  this.context = {};
  this.frames = [];
  this.nowValue = ReqlDate.now();
  this.complete = false;
  this.token = token;

}
379199
def handle_query(self, msg, addr, port, orig):
        
        out = None

        # Support unicast client responses
        #
        if port != _MDNS_PORT:
            out = DNSOutgoing(_FLAGS_QR_RESPONSE | _FLAGS_AA, 0)
            for question in msg.questions:
                out.add_question(question)
        for question in msg.questions:
            if question.type == _TYPE_PTR:
                for service in self.services.values():
                    if question.name == service.type:
                        # FIXME: sometimes we just not in time filling cache
                        answer = self.cache.get(
                                DNSPointer(service.type,
                                    _TYPE_PTR, _CLASS_IN,
                                    service.ttl, service.name))
                        if out is None and answer is not None:
                            out = DNSOutgoing(_FLAGS_QR_RESPONSE | _FLAGS_AA)
                        if answer:
                            out.add_answer(msg, answer)
            if question.type == _TYPE_AXFR:
                if question.name in list(self.zones.keys()):
                    if out is None:
                        out = DNSOutgoing(_FLAGS_QR_RESPONSE | _FLAGS_AA)
                    for i in self.zones[question.name].services.values():
                        out.add_answer(msg, i)
            else:
                try:
                    if out is None:
                        out = DNSOutgoing(_FLAGS_QR_RESPONSE | _FLAGS_AA)

                    service = self.services.get(question.name.lower(), None)
                    try:
                        rs = service.records
                    except:
                        rs = []

                    # Answer A record queries for any service addresses we know
                    if (question.type == _TYPE_A or \
                            question.type == _TYPE_ANY) \
                            and (_TYPE_A in rs):
                        for service in self.services.values():
                            if service.server == question.name.lower():
                                for i in service.address:
                                    out.add_answer(msg, self.cache.get(
                                        DNSAddress(question.name,
                                            _TYPE_A, _CLASS_IN | _CLASS_UNIQUE,
                                            service.ttl, i)))

                    if not service:
                        continue

                    if (question.type == _TYPE_SRV or \
                            question.type == _TYPE_ANY) and (_TYPE_SRV in rs):
                        out.add_answer(msg, self.cache.get(
                            DNSService(question.name,
                                _TYPE_SRV, _CLASS_IN | _CLASS_UNIQUE,
                                service.ttl, service.priority, service.weight,
                                service.port, service.server)))
                    if (question.type == _TYPE_TXT or \
                            question.type == _TYPE_ANY) and \
                            (_TYPE_TXT in rs):
                        out.add_answer(msg, self.cache.get(
                            DNSText(question.name,
                                _TYPE_TXT, _CLASS_IN | _CLASS_UNIQUE,
                                service.ttl, service.text)))
                    if (question.type == _TYPE_SRV) and (_TYPE_SRV in rs):
                        for i in service.address:
                            out.add_additional_answer(self.cache.get(
                                DNSAddress(service.server,
                                    _TYPE_A, _CLASS_IN | _CLASS_UNIQUE,
                                    service.ttl, i)))
                except:
                    traceback.print_exc()

        if out is not None and out.answers:
            out.id = msg.id
            self.send(out, addr, port)
1127740
public Future<AddressedEnvelope<DnsResponse, InetSocketAddress>> query(DnsQuestion question) {
        return query(nextNameServerAddress(), question);
    }
1006006
def query(self):
        
        if self._rawquery==True:
            return self.__query
        return flatten(self.__query)
201592
def get_domain_resolver(self, domain_name, cur=None):
        
        get_cmd = "SELECT resolver FROM {} WHERE domain=? AND resolver != '' AND accepted=1 ORDER BY sequence DESC, parent_zonefile_index DESC LIMIT 1;".format(self.subdomain_table)

        cursor = None
        if cur is None:
            cursor = self.conn.cursor()
        else:
            cursor = cur

        db_query_execute(cursor, get_cmd, (domain_name,))

        rowdata = cursor.fetchone()
        if not rowdata:
            return None

        return rowdata['resolver']
1132955
def query(self, *q):
    
    params = join_params(self.parameters, {"q": q})

    return self.__class__(**params)
1028858
def lookup!(nameserver=nil)
      resolver = Resolv.resolver(nameserver)
      ips = begin
              resolver.getaddresses(self.address)
            rescue
              []
            end

      ips.map! do |addr|
        IPAddress.first_or_create(
          :address => addr,
          :host_names => [self]
        )
      end

      return ips
    end
35626
def explainAQLQuery(self, query, bindVars={}, allPlans = False) :
        """"""
        payload = {'query' : query, 'bindVars' : bindVars, 'allPlans' : allPlans}
        request = self.connection.session.post(self.explainURL, data = json.dumps(payload, default=str))
        return request.json()
899791
function() {
    var queries = new nodes.QueryList
      , skip = ['comment', 'newline', 'space'];

    do {
      this.skip(skip);
      queries.push(this.query());
      this.skip(skip);
    } while (this.accept(','));
    return queries;
  }
498503
def query=(query)
      raise ArgumentError, "Invalid URL: #{self.url}" unless self.url.respond_to?(:query)
      if query.kind_of?(Hash)
        query = build_query_from_hash(query)
      end
      query = query.to_s unless query.is_a?(String)
      self.url.query = query
    end