Returns the host. If a value is defined by both an option and the config
 file, the value of the option is used.
547692
def host
      # find host in opts first
      host = options[:host] || @configuration['host']
      host = 'http://api.unipept.ugent.be' if host.nil? || host.empty?

      # add http:// if needed
      if host.start_with?('http://', 'https://')
        host
      else
        "http://#{host}"
      end
    end
589320
def env_same_host(env1, env2):
    
    config = _config_file()

    h1 = dict(config.items(env1))['base_url']
    h2 = dict(config.items(env2))['base_url']

    return h1 == h2
888423
def host(self) -> str:
        
        host = cast(Optional[str], None)
        if self.proxy and 'X-Forwarded-Host' in self._headers:
            xhost = cast(Optional[str], self.get('X-Forwarded-Host'))
            if xhost is not None:
                host = xhost.split(",")[0].strip()
        host = host or cast(str, self.get('Host'))
        return 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
721293
def get_host(self, endpoint_or_address):
        
        if not isinstance(endpoint_or_address, EndPoint):
            return self._get_host_by_address(endpoint_or_address)

        return self._hosts.get(endpoint_or_address)
474389
public String getHost() {
        String hostAndPort = hostAndPort();
        int indexOfMaohao = hostAndPort.indexOf(":");
        if (indexOfMaohao == -1) {
            return hostAndPort;
        } else {
            return hostAndPort.substring(0, indexOfMaohao);
        }
    }
856337
function findModuleFromOptions(host, options) {
    if (options.hasOwnProperty('skipImport') && options.skipImport) {
        return undefined;
    }
    if (!options.module) {
        const pathToCheck = (options.sourceDir || '') + '/' + (options.path || '')
            + (options.flat ? '' : '/' + strings_1.dasherize(options.name));
        return core_1.normalize(findModule(host, pathToCheck));
    }
    else {
        const modulePath = core_1.normalize('/' + options.sourceDir + '/' + (options.appRoot || options.path) + '/' + options.module);
        const moduleBaseName = core_1.normalize(modulePath).split('/').pop();
        if (host.exists(modulePath)) {
            return core_1.normalize(modulePath);
        }
        else if (host.exists(modulePath + '.ts')) {
            return core_1.normalize(modulePath + '.ts');
        }
        else if (host.exists(modulePath + '.module.ts')) {
            return core_1.normalize(modulePath + '.module.ts');
        }
        else if (host.exists(modulePath + '/' + moduleBaseName + '.module.ts')) {
            return core_1.normalize(modulePath + '/' + moduleBaseName + '.module.ts');
        }
        else {
            throw new Error('Specified module does not exist');
        }
    }
}
1131163
@NoAuth
    @RequestMapping(value = "/hosts", method = RequestMethod.GET)
    @ResponseBody
    public ValueVo getHosts() {

        ValueVo confItemVo = new ValueVo();
        confItemVo.setStatus(Constants.OK);
        confItemVo.setValue(zooConfig.getZooHosts());

        return confItemVo;
    }
1009
def _get_host(self):
        
        if 'VCAP_SERVICES' in os.environ:
            services = json.loads(os.getenv('VCAP_SERVICES'))
            host = services['predix-blobstore'][0]['credentials']['host']
        else:
            host = predix.config.get_env_value(self, 'host')

        # Protocol may not always be included in host setting
        if 'https://' not in host:
            host = 'https://' + host

        return host
35258
def get_conf_value(self, value, header="", plugin_name=None):
        
        if plugin_name is None:
            # If not default use the current plugin name
            plugin_name = self.plugin_name

        if header != "":
            # Add the header
            plugin_name = plugin_name + '_' + header

        try:
            return self._limits[plugin_name + '_' + value]
        except KeyError:
            return []
1353072
def get_host(url):
    
    p = parse_url(url)
    return p.scheme or 'http', p.hostname, p.port
1117813
def get_config(section, option, allow_empty_option=True, default=""):
    '''
    
    '''
    try:
        value = config.get(section, option)
        if value is None or len(value) == 0:
            if allow_empty_option:
                return ""
            else:
                return default
        else:
            return value
    except ConfigParser.NoSectionError:
        return default
343055
def get_host(self, name, default=NoHostError):
        '''
        
        '''

        if name in self.hosts:
            return self.hosts[name]

        if default is NoHostError:
            raise NoHostError('No such host: {0}'.format(name))

        return default
899238
def host(self, value):
        
        scheme, host, port = get_hostname_parameters_from_url(value)
        self._host = "%s://%s:%s" % (scheme, 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
489951
def getHosts(filename=None, hostlist=None):
    """"""
    if filename:
        return getHostsFromFile(filename)
    elif hostlist:
        return getHostsFromList(hostlist)
    elif getEnv() == "SLURM":
        return getHostsFromSLURM()
    elif getEnv() == "PBS":
        return getHostsFromPBS()
    elif getEnv() == "SGE":
        return getHostsFromSGE()
    else:
        return getDefaultHosts()
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)