Private: Resolves a node given a node and a resolver

 node - The given node
 resolver - The DNSSD::Server that is resolving nodes

 Returns if there are more nodes coming
341462
def node_resolver(node, resolved)
      address = get_device_address(resolved)
      type = get_type(resolved.text_record)

      device = create_device(node.name, address, type)
      device.text_records = resolved.text_record

      devices << device

      resolved.flags.more_coming?
    end
917025
def refresh_peers(node, &block)
      node.peers.each do |node|
        if node.address.resolved
          block.call(node) unless seeds.include?(node)
          peers.push(node) unless peers.include?(node)
        end
      end
    end
990166
function Resolver(root, dot, sep) {
    if (!Is.instance(this, Resolver)) {
        return PKG.Builder(root, dot, sep).get();
    }

    this.aliases = {};
    /**
     * Root path.
     *
     * @private
     * @type {string}
     */
     this.root = PKG.ROOT;
    /**
     * Character separator used in path keys.
     *
     * @private
     * @type {string}
     * @default {@link Dotresolver.DOT}
     */
    this.dot = dot || PKG.DOT;
    /**
     * Character separator used in built path.
     *
     * @private
     * @type {string}
     * @default {@link Dotresolver.SEP}
     */
    this.sep = sep || PKG.SEP;

    this.setRoot(root);
}
987599
function(host, next) {
    var tokens = tldtools.extract(host),
      resolvingHost;

    if (ipaddr.IPv4.isValid(host) || ipaddr.IPv6.isValid(host) ) {
      next(false, [ host ], host);
    } else {
      resolvingHost = tokens.inspect.getDomain() || tokens.domain;
      dns.resolve(resolvingHost, function(err, aRecords) {
        next(err, aRecords, resolvingHost );
      });
    }
  }
1233751
def query(number, domains, resolver=None):
    
    if resolver is None:
        resolver = dns.resolver.get_default_resolver()
    for domain in domains:
        if isinstance(domain, (str, unicode)):
            domain = dns.name.from_text(domain)
        qname = dns.e164.from_e164(number, domain)
        try:
            return resolver.query(qname, 'NAPTR')
        except dns.resolver.NXDOMAIN:
            pass
    raise dns.resolver.NXDOMAIN
1061490
function after(yd){
  var res;

  yd = Resolver.when(yd);
  if(yd[yielded]) return yd[yielded];
  res = new Resolver();
  yd.listen(res.accept,[],res);
  return yd[yielded] = res.yielded;
}
182742
def solve_resolve(expr, vars):
    
    objs, _ = __solve_for_repeated(expr.lhs, vars)
    member = solve(expr.rhs, vars).value

    try:
        results = [structured.resolve(o, member)
                   for o in repeated.getvalues(objs)]
    except (KeyError, AttributeError):
        # Raise a better exception for the non-existent member.
        raise errors.EfilterKeyError(root=expr.rhs, key=member,
                                     query=expr.source)
    except (TypeError, ValueError):
        # Is this a null object error?
        if vars.locals is None:
            raise errors.EfilterNoneError(
                root=expr, query=expr.source,
                message="Cannot resolve member %r from a null." % member)
        else:
            raise
    except NotImplementedError:
        raise errors.EfilterError(
            root=expr, query=expr.source,
            message="Cannot resolve members from a non-structured value.")

    return Result(repeated.meld(*results), ())
116115
protected void doResolve(String inetHost,
                             DnsRecord[] additionals,
                             Promise<InetAddress> promise,
                             DnsCache resolveCache) throws Exception {
        if (inetHost == null || inetHost.isEmpty()) {
            // If an empty hostname is used we should use "localhost", just like InetAddress.getByName(...) does.
            promise.setSuccess(loopbackAddress());
            return;
        }
        final byte[] bytes = NetUtil.createByteArrayFromIpAddressString(inetHost);
        if (bytes != null) {
            // The inetHost is actually an ipaddress.
            promise.setSuccess(InetAddress.getByAddress(bytes));
            return;
        }

        final String hostname = hostname(inetHost);

        InetAddress hostsFileEntry = resolveHostsFileEntry(hostname);
        if (hostsFileEntry != null) {
            promise.setSuccess(hostsFileEntry);
            return;
        }

        if (!doResolveCached(hostname, additionals, promise, resolveCache)) {
            doResolveUncached(hostname, additionals, promise, resolveCache, true);
        }
    }
990488
public static SocketAddress resolve(RedisURI redisURI, DnsResolver dnsResolver) {

        if (redisURI.getSocket() != null) {
            return redisURI.getResolvedAddress();
        }

        try {
            InetAddress[] inetAddress = dnsResolver.resolve(redisURI.getHost());

            if (inetAddress.length == 0) {
                return InetSocketAddress.createUnresolved(redisURI.getHost(), redisURI.getPort());
            }

            return new InetSocketAddress(inetAddress[0], redisURI.getPort());
        } catch (UnknownHostException e) {
            return redisURI.getResolvedAddress();
        }
    }
1045705
def get_node(conn, name):
    '''
    
    '''
    for node in conn.list_servers(per_page=1000):
        if node['name'] == name:
            return node
1169730
def resolve_name(target)
      if (group = @group_lookup[target])
        group.node_names
      else
        # Try to wildcard match nodes in inventory
        # Ignore case because hostnames are generally case-insensitive
        regexp = Regexp.new("^#{Regexp.escape(target).gsub('\*', '.*?')}$", Regexp::IGNORECASE)

        nodes = @groups.node_names.select { |node| node =~ regexp }
        nodes += @groups.node_aliases.select { |target_alias, _node| target_alias =~ regexp }.values

        if nodes.empty?
          raise(WildcardError, target) if target.include?('*')
          [target]
        else
          nodes
        end
      end
    end
548836
def maybe_resolve(object, resolve):
    
    if isinstance(object, dict) and object.get('$ref'):
        return resolve(object['$ref'])
    return object
1029923
protected function resolve(Node $node)
    {
        $value = null;
        try {
            ++$this->nodeLevel;

            $methodName = $this->getDispatchMethodFor($node);
            if (method_exists($this, $methodName)) {
                $value = $this->$methodName($node);
            }
        } finally {
            --$this->nodeLevel;
        }

        return $value;
    }
581166
function resolveNodeSkel(index, nodeName) {
    var idx = +graph.nameToIndex[nodeName];
    argh = [idx, +index]
    if(Number.isNaN(idx)) {
      throw "Unable to get index for node '" + nodeName + "'. (Is the node name misspelled?)";
    }
    if(index !== undefined && idx > +index) {
      throw "Unable to get index for node '" + nodeName + "'. (Are the nodes out of order?)";
    }
    if(index !== undefined && idx == +index) {
      throw "Unable to get index for node '" + nodeName + "'. (Is the node trying to reference itself?)";
    }
    return (dataContext) => dataContext.values[idx];
  }
402529
private Map<NodeId, NodeId> resolveAliases(Iterable<Alias> aliases) {
        Map<NodeId, NodeId> resolved = Maps.newHashMap();
        Map<NodeId, Set<NodeId>> inverse = Maps.newHashMap();

        for (Alias alias : aliases) {
            NodeId from = alias.getFromId();
            NodeId to = alias.getToId();
            if (resolved.containsKey(to)) {
                to = resolved.get(to);
            }
            resolved.put(from, to);
            if (inverse.get(to) == null) {
                inverse.put(to, Sets.<NodeId> newHashSet());
            }
            inverse.get(to).add(from);

            Set<NodeId> prev = inverse.get(from);
            if (prev != null) {
                for (NodeId id : prev) {
                    resolved.remove(id);
                    inverse.get(from).remove(id);
                    resolved.put(id, to);
                    inverse.get(to).add(id);
                }
            }
        }

        return resolved;
    }
636844
def get_subdomain_resolver(name, db_path=None, zonefiles_dir=None):
    
    opts = get_blockstack_opts()
    if not is_subdomains_enabled(opts):
        log.warn("Subdomain support is disabled")
        return None

    if db_path is None:
        db_path = opts['subdomaindb_path']

    if zonefiles_dir is None:
        zonefiles_dir = opts['zonefiles']

    db = SubdomainDB(db_path, zonefiles_dir)
    resolver_url = db.get_domain_resolver(name)

    return resolver_url
23678
public function resolve(NodeContract $node)
    {
        $children = $node->getChildren();

        if (count($children) > 0) {
            $this->resolve($node->getChildByIndex(0));

            $value = '';
            $positions = [];
            foreach ($node->getChildren() as $child) {
                if ($child instanceof Nodes\TextNode || $child instanceof Nodes\KeyNode) {
                    $value .= ' '.$child->getValue();
                    $p = array_fill(0, strlen(' '.$child->getValue()), $child->getIndex());
                    $positions = array_merge($positions, $p);
                }
            }

            foreach ($this->regex as $regex) {
                preg_match($regex, $value, $match, PREG_OFFSET_CAPTURE);

                if ($match) {
                    $new_node = new $this->node();

                    $start = $match[0][1];
                    $length = strlen($match[0][0]);

                    $this->groupNode($node, $new_node, $start, $start + $length, $positions);
                    $this->resolveRelationsNode($node, $new_node);

                    // Search for another match in this node.
                    return $this->resolve($node->getParent());
                }
            }
        }

        return $node->next() !== null ? $this->resolve($node->next()) : null;
    }