Returns the host this command should be executed against.
356249
def get_host_for_command(self, command, args):
        """"""
        return self.get_host_for_key(self.get_key(command, args))
585648
def host_url(self):
        
        return get_current_url(
            self.environ, host_only=True, trusted_hosts=self.trusted_hosts
        )
28494
def _find_port(self, host):  # pylint: disable=no-self-use
        
        ind = host.rfind(":")
        if ind != -1:
            try:
                port = int(host[ind + 1:])
                host = host[:ind]
            except ValueError:
                port = 3000
        else:
            port = 3000
        return host, port
1035071
def get_host(environ):
    # type: (Dict[str, str]) -> str
    """"""
    if environ.get("HTTP_HOST"):
        rv = environ["HTTP_HOST"]
        if environ["wsgi.url_scheme"] == "http" and rv.endswith(":80"):
            rv = rv[:-3]
        elif environ["wsgi.url_scheme"] == "https" and rv.endswith(":443"):
            rv = rv[:-4]
    elif environ.get("SERVER_NAME"):
        rv = environ["SERVER_NAME"]
        if (environ["wsgi.url_scheme"], environ["SERVER_PORT"]) not in (
            ("https", "443"),
            ("http", "80"),
        ):
            rv += ":" + environ["SERVER_PORT"]
    else:
        # In spite of the WSGI spec, SERVER_NAME might not be present.
        rv = "unknown"

    return rv
1142499
public function getHost() : ?string 
    {
        if ( ! $this->hasHost()) {
            $this->setHost($this->getDefaultHost());
        }
        return $this->host;
    }
161154
def get_by_ip(cls, ip):
        ''
        ret = cls.hosts_by_ip.get(ip)
        if ret is None:
            ret = cls.hosts_by_ip[ip] = [Host(ip)]
        return ret
960835
def get_host_ip(hostname, fallback=None):
    
    if is_ip(hostname):
        return hostname

    ip_addr = ns_query(hostname)
    if not ip_addr:
        try:
            ip_addr = socket.gethostbyname(hostname)
        except Exception:
            log("Failed to resolve hostname '%s'" % (hostname),
                level=WARNING)
            return fallback
    return ip_addr
965654
def get_host(self, host):
        '''  '''

        if len(self.index) == 0:
            # Need to load index from cache
            self.load_index_from_cache()

        if not host in self.index:
            # try updating the cache
            self.do_api_calls_update_cache()
            if not host in self.index:
                # host might not exist anymore
                return {}

        (region, instance_id) = self.index[host]

        instance = self.get_instance(region, instance_id)
        return self.get_host_info_dict_from_instance(instance)
221161
def _build_command(self):
        

        command = [self._path]
        command.extend(["-H", "{}:{}".format(self._host, self._port)])
        if log.getEffectiveLevel() == logging.DEBUG:
            command.extend(["-d", "2"])
        return command
531514
private String getHostHeaderForHost(String hostName) {
        List<ServerRedirect> servers = serverRedirectService.tableServers(requestInformation.get().client.getId());
        for (ServerRedirect server : servers) {
            if (server.getSrcUrl().compareTo(hostName) == 0) {
                String hostHeader = server.getHostHeader();
                if (hostHeader == null || hostHeader.length() == 0) {
                    return null;
                }
                return hostHeader;
            }
        }
        return null;
    }
1372686
def _host():
    """"""
    host_and_port = request.urlparts[1]
    try:
        host, _ = host_and_port.split(':')
    except ValueError:
        # No port yet. Host defaults to '127.0.0.1' in bottle.request.
        return DEFAULT_BIND
    return host or DEFAULT_BIND
278635
def externalHostname(hosts):
    """"""
    hostname = hosts[0][0]
    if hostname in localHostnames and len(hosts) > 1:
        hostname = socket.getfqdn().split(".")[0]
        try:
            socket.getaddrinfo(hostname, None)
        except socket.gaierror:
            raise Exception("\nThe first host (containing a broker) is not"
                            " routable.\nMake sure the address is correct.")
    return hostname
44876
public String getRemoteHost()
  {
    InetAddress remoteAddress = addressRemote();
    
    if (remoteAddress != null)
      return remoteAddress.getHostAddress();
    else
      return null;
  }
1266851
def host2id(self, hostname):
        """"""
        for key, value in self.server_map.items():
            if value == hostname:
                return key
406925
function getHost()
    {
        if ($this->host)
            return $this->host;
        
        // attempt to get host from target uri
        $host  = $this->getTarget();
        $host  = parse_url($host, PHP_URL_HOST);
        if (!$host && $this->headers()->has('Host')) {
            /** @var iHeader $host */
            $host = $this->headers()->get('Host');
            $host = $host->renderValueLine();
        }

        return $host;
    }
534466
def host(self, value=None):
        
        if value is not None:
            return URL._mutate(self, host=value)
        return self._tuple.host
587136
def get_host_mac(name=None, allow_array=False, **api_opts):
    '''
    
    '''
    data = get_host(name=name, **api_opts)
    if data and 'ipv4addrs' in data:
        l = []
        for a in data['ipv4addrs']:
            if 'mac' in a:
                l.append(a['mac'])
        if allow_array:
            return l
        if l:
            return l[0]
    return None