Get current execution environment's corresponding hostname string
@return {String}
@private
17464
function ___GET_ENV_HOSTNAME() {
	try {
		if ( HAS_NODE_BUFFER ) {
			return require( 'os' ).hostname;
		}
		else
		if ( typeof window !== "undefined" ) {
			return window.location.hostname;
		}
		else {
			throw new Error("");
		}
	}
	catch(e) {
		return 'unknown.' + DumpHexStringLE(RandomBytes(32));
	}
}
517566
function hostnameof (req) {
  var host = req.headers.host

  if (!host) {
    return
  }

  var offset = host[0] === '['
    ? host.indexOf(']') + 1
    : 0
  var index = host.indexOf(':', offset)

  return index !== -1
    ? host.substring(0, index)
    : host
}
131182
function() {
      var localStorage = root.localStorage;
      if (!hostName) {
        if (localStorage) {hostName = localStorage.hostName;}
        hostName = hostName || Monitor.generateUniqueId();
        if (localStorage) {localStorage.hostName = hostName;}
      }
      return hostName;
    }
503659
function (value) {
    const IllegalValue = this.$err.IllegalValue;
    if (typeof value !== 'string') {
      return value;
    }
    const result = value.replace(ENVVAR_PATTERN, function () {
      const varname = arguments[1];
      if (process.env[varname] === undefined) {
        throw new IllegalValue(`Environment variable ${varname} was referenced but not set`);
      }
      return process.env[varname];
    });

    return result;
  }
83421
function(hostname) {
    if ( pslBuffer32 === undefined ) { return EMPTY_STRING; }

    const hostnameLen = setHostnameArg(hostname);
    const buf8 = pslBuffer8;
    if ( hostnameLen === 0 || buf8[0] === 0x2E /* '.' */ ) {
        return EMPTY_STRING;
    }

    const cursorPos = getPublicSuffixPos();
    if ( cursorPos === -1 ) {
        return EMPTY_STRING;
    }

    const beg = buf8[cursorPos + 1];
    return beg === 0 ? hostnameArg : hostnameArg.slice(beg);
}
519281
function getIfOverriden() {
    var args = process.argv.slice(2);
    var envFlagIndex = args.indexOf('--env');

    // check if environment string passed as argument
    if (!!~envFlagIndex) {
        return args[++envFlagIndex];
    }
    // check if environment is already set
    else if (isset(process.env.NODE_ENV)) {
        return process.env.NODE_ENV;
    } else {
        return false;
    }


}
282006
function getFilenames()
{
  var hostname = getHostname()
    , host     = hostname.split('.')[0]
    ;

  return [
    'default',
    '', // allow suffixes as a basename (e.g. `environment`)
    host,
    hostname,
    'local',
    this.defaults.customIncludeFiles,
    this.defaults.customEnvVars,
    'runtime'
  ];
}
626568
private function _hostname()
    {
        if (PSI_USE_VHOST === true) {
            if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);
        } else {
            $buffer = $this->_get_Win32_ComputerSystem();
            if (!$buffer && CommonFunctions::executeProgram('reg', 'query HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ActiveComputerName /v ComputerName', $strBuf, false) && (strlen($strBuf) > 0) && preg_match("/^\s*ComputerName\s+REG_SZ\s+(\S+)\s*$/mi", $strBuf, $buffer2)) {
                    $buffer[0]['Name'] = $buffer2[1];
            }
            if ($buffer) {
                $result = $buffer[0]['Name'];
                $ip = gethostbyname($result);
                if ($ip != $result) {
                    if ((version_compare("10.0.0.0", $ip, "<=") && version_compare($ip, "10.255.255.255", "<=")) ||
                        (version_compare("172.16.0.0", $ip, "<=") && version_compare($ip, "172.31.255.255", "<=")) ||
                        (version_compare("192.168.0.0", $ip, "<=") && version_compare($ip, "192.168.255.255", "<=")) ||
                        (version_compare("127.0.0.0", $ip, "<=") && version_compare($ip, "127.255.255.255", "<=")) ||
                        (version_compare("169.254.1.0", $ip, "<=") && version_compare($ip, "169.254.254.255", "<=")) ||
                        (version_compare("255.255.255.255", $ip, "=="))) {
                        $this->sys->setHostname($result); // internal ip
                    } else {
                        $this->sys->setHostname(gethostbyaddr($ip));
                    }
                }
            } else {
                if (CommonFunctions::readenv('COMPUTERNAME', $hnm)) $this->sys->setHostname($hnm);
            }
        }
    }
1096980
function() {
            var result = [];
            var hostname = spec.env.allPublicNodeIds.publicHostname ||
                    $._.__ca_getAppFullName__();
            var start = spec.env.allPublicNodeIds.publicRangeStart;
            var end = spec.env.allPublicNodeIds.publicRangeEnd;
            for (var i = start; i<= end; i++) {
                result.push(hostname + ':' + i);
            }
            return result;
        }
982389
public static final String getHostName() {
		if (cachedHostName != null) {
			return cachedHostName;
		}

		// User-defined public hostname
		String name = System.getProperty("hostname");
		if (name == null || name.isEmpty()) {
			try {
				name = InetAddress.getLocalHost().getHostName();
			} catch (Exception ignored) {
				name = null;
			}
		}
		if (name == null || name.isEmpty() || name.contains("localhost")) {
			try {
				name = System.getenv().get("COMPUTERNAME");
			} catch (Exception ignored) {
				name = null;
			}
		}
		if (name == null || name.isEmpty()) {
			cachedHostName = "localhost";
		} else {
			cachedHostName = name.toLowerCase();
		}
		return cachedHostName;
	}
767186
function() {
        return (this.scheme !== null ? this.scheme + "://" : '') +
               (this.host !== null ? this.host : '' ) +
               (this.port !== -1   ? ":" + this.port : '' ) +
               (this.path !== null ? this.path : '' ) +
               (this.qs   !== null ? "?" + this.qs : '' );
    }
979422
function getAddress (hostname) {
  if (net.isIP(hostname)) {
    return Promise.resolve(hostname);
  }
  return pify(dns.lookup)(hostname);
}
331684
def get_from_environment():
    '''
        
    '''
    name = os.environ.get("EXECJS_RUNTIME", "")
    if not name:
        return None

    try:
        return _find_runtime_by_name(name)
    except exceptions.RuntimeUnavailableError:
        return None
1308307
function getProtocolAndHostname(origUrl?: string): null | string {
  const url = getUrlParts(origUrl);
  if (!url) {
    return null;
  }
  const port = url.port ? `:${url.port}` : "";
  return `${url.protocol || "http:"}//${url.hostname}${port}`;
}
1091862
def get_hostname(config, method=None):
    
    method = method or config.get('hostname_method', 'smart')

    # case insensitive method
    method = method.lower()

    if 'hostname' in config and method != 'shell':
        return config['hostname']

    if method in get_hostname.cached_results:
        return get_hostname.cached_results[method]

    if method == 'shell':
        if 'hostname' not in config:
            raise DiamondException(
                "hostname must be set to a shell command for"
                " hostname_method=shell")
        else:
            proc = subprocess.Popen(config['hostname'],
                                    shell=True,
                                    stdout=subprocess.PIPE)
            hostname = proc.communicate()[0].strip()
            if proc.returncode != 0:
                raise subprocess.CalledProcessError(proc.returncode,
                                                    config['hostname'])
            get_hostname.cached_results[method] = hostname
            return hostname

    if method == 'smart':
        hostname = get_hostname(config, 'fqdn_short')
        if hostname != 'localhost':
            get_hostname.cached_results[method] = hostname
            return hostname
        hostname = get_hostname(config, 'hostname_short')
        get_hostname.cached_results[method] = hostname
        return hostname

    if method == 'fqdn_short':
        hostname = socket.getfqdn().split('.')[0]
        get_hostname.cached_results[method] = hostname
        if hostname == '':
            raise DiamondException('Hostname is empty?!')
        return hostname

    if method == 'fqdn':
        hostname = socket.getfqdn().replace('.', '_')
        get_hostname.cached_results[method] = hostname
        if hostname == '':
            raise DiamondException('Hostname is empty?!')
        return hostname

    if method == 'fqdn_rev':
        hostname = socket.getfqdn().split('.')
        hostname.reverse()
        hostname = '.'.join(hostname)
        get_hostname.cached_results[method] = hostname
        if hostname == '':
            raise DiamondException('Hostname is empty?!')
        return hostname

    if method == 'uname_short':
        hostname = os.uname()[1].split('.')[0]
        get_hostname.cached_results[method] = hostname
        if hostname == '':
            raise DiamondException('Hostname is empty?!')
        return hostname

    if method == 'uname_rev':
        hostname = os.uname()[1].split('.')
        hostname.reverse()
        hostname = '.'.join(hostname)
        get_hostname.cached_results[method] = hostname
        if hostname == '':
            raise DiamondException('Hostname is empty?!')
        return hostname

    if method == 'hostname':
        hostname = socket.gethostname()
        get_hostname.cached_results[method] = hostname
        if hostname == '':
            raise DiamondException('Hostname is empty?!')
        return hostname

    if method == 'hostname_short':
        hostname = socket.gethostname().split('.')[0]
        get_hostname.cached_results[method] = hostname
        if hostname == '':
            raise DiamondException('Hostname is empty?!')
        return hostname

    if method == 'hostname_rev':
        hostname = socket.gethostname().split('.')
        hostname.reverse()
        hostname = '.'.join(hostname)
        get_hostname.cached_results[method] = hostname
        if hostname == '':
            raise DiamondException('Hostname is empty?!')
        return hostname

    if method == 'none':
        get_hostname.cached_results[method] = None
        return None

    raise NotImplementedError(config['hostname_method'])
969041
function getHostname(url, userOptions = {}) {
  const defaults = {
    removeSubdomains: true,
  };
  const options = Object.assign({}, defaults, userOptions);
  const domainRegExp = /^(?:[a-z]+:\/\/)?(?:[^/@]+@)?([^/:]+)/i;
  const ipAddressRegExp = /^\d{1,3}\.\d{1,3}.\d{1,3}\.\d{1,3}$/;
  const domainMatch = url.match(domainRegExp);

  if (domainMatch === null) {
    throw new Error(`URL is invalid: ${url}`);
  }

  // If the hostname is an IP address, no further processing can be done.
  const hostname = domainMatch[1];
  if (ipAddressRegExp.test(hostname)) {
    return hostname;
  }

  // Return the hostname with subdomains removed, if requested.
  return (options.removeSubdomains) ? removeSubdomains(hostname) : hostname;
}
233262
function() {
        let tabDomain = this.getTabDomain();
        if ( tabDomain === '' ) { tabDomain = this.tabHostname; }
        if ( this.domain !== undefined && this.domain !== '' ) {
            return this.domain !== tabDomain;
        }
        const hostname = this.getHostname();
        if ( hostname.endsWith(tabDomain) === false ) { return true; }
        const i = hostname.length - tabDomain.length;
        if ( i === 0 ) { return false; }
        return hostname.charCodeAt(i - 1) !== 0x2E /* '.' */;
    }