Return true if the platform is a unix, False otherwise.
556576
def is_unix(name=None):
        
        name = name or sys.platform
        return Platform.is_darwin(name) or Platform.is_linux(name) or Platform.is_freebsd(name)
214402
def on_windows ():
    
    if bjam.variable("NT"):
        return True

    elif bjam.variable("UNIX"):

        uname = bjam.variable("JAMUNAME")
        if uname and uname[0].startswith("CYGWIN"):
            return True

    return False
147849
def get_os():
    
    if sys.platform == 'darwin':
        return 'mac'
    elif sys.platform.find('freebsd') != -1:
        return 'freebsd'
    elif sys.platform.find('linux') != -1:
        return 'linux'
    elif sys.platform.find('win32') != -1:
        return 'windows'
    elif sys.platform.find('sunos') != -1:
        return 'solaris'
    else:
        return sys.platform
810315
def is_capable_terminal(file=sys.stderr) -> bool:
    
    if not os.isatty(file.fileno()):
        return False
    terminal = os.getenv("TERM", "dumb")
    # Hardcoded list of non-capable terminals.
    return terminal not in ["dumb", "emacs"]
876789
def is_char_device(self):
        
        try:
            return S_ISCHR(self.stat().st_mode)
        except OSError as e:
            if e.errno != ENOENT:
                raise
            # Path doesn't exist or is a broken symlink
            # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
            return False
176779
def is_binary(path):
    '''
    
    '''
    if not os.path.isfile(path):
        return False
    try:
        with fopen(path, 'rb') as fp_:
            try:
                data = fp_.read(2048)
                if six.PY3:
                    data = data.decode(__salt_system_encoding__)
                return salt.utils.stringutils.is_binary(data)
            except UnicodeDecodeError:
                return True
    except os.error:
        return False
1301241
def is_systemd():
    
    os_family = platform.system()
    if os_family != 'Linux':
        raise OSError('This method is only supported on Linux, found OS: {o}'.format(o=os_family))
    linux_distro, linux_version, distro_name = platform.linux_distribution()

    # Determine when to use systemd
    systemd = False
    if 'ubuntu' in linux_distro.lower() and '16' in linux_version:
        systemd = True
    elif 'red' in linux_distro.lower() and '7' in linux_version:
        systemd = True
    elif 'cent' in linux_distro.lower() and '7' in linux_version:
        systemd = True
    return systemd
1076516
function supportedPlatform( $platform = NULL ) {
		return is_object( $this->parent ) ? $this->parent->supportedPlatform( $platform ) : TRUE;
	}
554209
public function checkForDCA()
    {
        $binaries = [
            'Darwin' => [
                32 => 'dca-v0.1.0-darwin-10.6-386',
                64 => 'dca-v0.1.0-darwin-10.6-amd64',
            ],
            'Linux' => [
                32 => 'dca-v0.1.0-linux-386',
                64 => 'dca-v0.1.0-linux-amd64',
            ],
        ];

        if (array_key_exists(PHP_OS, $binaries)) {
            $binary = realpath(__DIR__.'/../../../bin/'.$binaries[PHP_OS][PHP_INT_SIZE * 8]);

            $this->dca = $binary;

            return true;
        }

        $this->emit('error', [new DCANotFoundException('No DCA binary was found that is compatible with your operating system and arch.')]);

        return false;
    }
412470
def is_terminal(self) -> bool:
        
        for resp in self._untagged:
            if resp.is_terminal:
                return True
        return False
1063781
def avail_platforms():
    '''
    
    '''
    ret = {}
    for platform in CMD_MAP:
        ret[platform] = True
        for cmd in CMD_MAP[platform]:
            if not salt.utils.path.which(cmd):
                ret[platform] = False
    return ret
542245
function satisfiesPlatform(platform, list) {
    if (_.contains(list, platform)) return true;

    // By default, user 32bits version
    if (_.contains(list+'_32', platform)) return true;

    return false;
}
519068
public static boolean isPlatformSRE(ISREInstall sre) {
		if (sre != null) {
			LOCK.lock();
			try {
				return platformSREInstalls.contains(sre.getId());
			} finally {
				LOCK.unlock();
			}
		}
		return false;
	}
1131512
protected function checkPlatform() 
    {
        if( stripos($this->_agent, 'iPad') !== false ) 
        {
		    $this->_platform = self::PLATFORM_APPLE; // iOS folgt spaeter
	    }
	    elseif( stripos($this->_agent, 'iPod') !== false ) 
	    {
		    $this->_platform = self::PLATFORM_APPLE; // iOS folgt spaeter
	    }
	    elseif( stripos($this->_agent, 'iPhone') !== false ) 
	    {
		    $this->_platform = self::PLATFORM_APPLE; // iOS folgt spaeter
	    }
	    elseif( stripos($this->_agent, 'android') !== false ) {
		    $this->_platform = self::PLATFORM_ANDROID;
	    }
	    elseif( stripos($this->_agent, 'mac') !== false ) {
	        $this->_platform = self::PLATFORM_APPLE;
	    }
	    elseif( stripos($this->_agent, 'linux') !== false ) {
		    $this->_platform = self::PLATFORM_LINUX;
	    }
	    elseif( stripos($this->_agent, 'windows phone') !== false ) {
	        $this->_platform = self::PLATFORM_WINDOWS_PHONE;
	    }
	    elseif( stripos($this->_agent, 'Nokia') !== false ) {
		    $this->_platform = self::PLATFORM_NOKIA;
	    }
	    elseif( stripos($this->_agent, 'BlackBerry') !== false ) {
		    $this->_platform = self::PLATFORM_BLACKBERRY;
	    }
	    elseif( stripos($this->_agent, 'windows ce') !== false ) {
	        $this->_platform = self::PLATFORM_WINDOWS_CE;
	    }
	    elseif( stripos($this->_agent, 'windows') !== false ) {
	        $this->_platform = self::PLATFORM_WINDOWS;
	    }
	    elseif( stripos($this->_agent,'FreeBSD') !== false ) {
		    $this->_platform = self::PLATFORM_FREEBSD;
	    }
	    elseif( stripos($this->_agent,'OpenBSD') !== false ) {
		    $this->_platform = self::PLATFORM_OPENBSD;
	    }
	    elseif( stripos($this->_agent,'NetBSD') !== false ) {
		    $this->_platform = self::PLATFORM_NETBSD;
	    }
	    elseif( stripos($this->_agent, 'OpenSolaris') !== false ) {
		    $this->_platform = self::PLATFORM_OPENSOLARIS;
	    }
	    elseif( stripos($this->_agent, 'SunOS') !== false ) {
		    $this->_platform = self::PLATFORM_SUNOS;
	    }
	    elseif( stripos($this->_agent, 'OS/2') !== false ) {
		    $this->_platform = self::PLATFORM_OS2;
	    }
	    elseif( stripos($this->_agent, 'BeOS') !== false ) {
		    $this->_platform = self::PLATFORM_BEOS;
	    }
	    elseif( stripos($this->_agent, 'win') !== false ) {
		    $this->_platform = self::PLATFORM_WINDOWS;
	    }
	    // add BugBuster
	    elseif( stripos($this->_agent, 'PHP') !== false ) {
		    $this->_platform = self::PLATFORM_PHP;
	    }
	    // add BugBuster
	    elseif( stripos($this->_agent, 'PLAYSTATION') !== false ) {
	        $this->_platform = self::PLATFORM_PLAYSTATION;
	    }

    }
909162
def is_executable(path):
    ''''''
    return (stat.S_IXUSR & os.stat(path)[stat.ST_MODE]
            or stat.S_IXGRP & os.stat(path)[stat.ST_MODE]
            or stat.S_IXOTH & os.stat(path)[stat.ST_MODE])
166893
def Is64bit(self):
    """"""
    if "64" not in platform.machine():
      return False
    iswow64 = ctypes.c_bool(False)
    if IsWow64Process is None:
      return False
    if not IsWow64Process(self.h_process, ctypes.byref(iswow64)):
      raise process_error.ProcessError("Error while calling IsWow64Process.")
    return not iswow64.value
881632
function isPortInUse(port) {
  _validatePortFormat(port);
  if (isPlatform('unix')) {
    if (isPlatform('linux') && fileExists('/proc/net')) {
      return _isPortInUseRaw(port);
    } else if (isInPath('netstat')) {
      return _isPortInUseNetstat(port);
    } else {
      throw new Error('Cannot check port status');
    }
  } else {
    throw new Error('Port checking not supported on this platform');
  }
}