Returns true if the .NET framework of the given version (or greater) is installed.
341600
public static boolean isInstalled(int major, int minor) {
        try {
            // see http://support.microsoft.com/?scid=kb;en-us;315291 for the basic algorithm
            // observation in my registry shows that the actual key name can be things like "v2.0 SP1"
            // or "v2.0.50727", so the regexp is written to accommodate this.
            RegistryKey key = RegistryKey.LOCAL_MACHINE.openReadonly("SOFTWARE\\Microsoft\\.NETFramework");
            try {
                for( String keyName : key.getSubKeys() ) {
                    if (matches(keyName, major, minor))
                        return true;
                }
                return false;
            } finally {
                key.dispose();
            }
        } catch (JnaException e) {
            if(e.getErrorCode()==2) // thrown when openReadonly fails because the key doesn't exist.
                return false;
            throw e;
        }
    }
519068
public static boolean isPlatformSRE(ISREInstall sre) {
		if (sre != null) {
			LOCK.lock();
			try {
				return platformSREInstalls.contains(sre.getId());
			} finally {
				LOCK.unlock();
			}
		}
		return false;
	}
900722
def is_installed(self):
        
        return self.is_configured() and os.access(self.bin(), os.X_OK)
471232
private static boolean isGABuild() {
        boolean result = true;

        final Properties props = new Properties();
        AccessController.doPrivileged(new PrivilegedAction<Object>() {

            @Override
            public Object run() {
                try {
                    final File version = new File(getInstallDir(), "lib/versions/WebSphereApplicationServer.properties");
                    Reader r = new InputStreamReader(new FileInputStream(version), "UTF-8");
                    props.load(r);
                    r.close();
                } catch (IOException e) {
                    // ignore because we fail safe. Returning true will result in a GA suitable schema
                }
                return null;
            }
        });
        String v = props.getProperty("com.ibm.websphere.productVersion");

        if (v != null) {
            int index = v.indexOf('.');
            if (index != -1) {
                try {
                    int major = Integer.parseInt(v.substring(0, index));
                    if (major > 2012) {
                        result = false;
                    }
                } catch (NumberFormatException nfe) {
                    // ignore because we fail safe. True for this hides stuff
                }
            }
        }

        return result;
    }
928806
def _isInstalled(fullFname):
    
    if not fullFname: return False
    if not os.path.exists(fullFname): return False
    instAreas = []
    try:
        import site
        instAreas = site.getsitepackages()
    except:
        pass # python 2.6 and lower don't have site.getsitepackages()
    if len(instAreas) < 1:
        instAreas = [ os.path.dirname(os.__file__) ]
    for ia in instAreas:
        if fullFname.find(ia) >= 0:
            return True
    return False
590943
def wf_version?(version)
      version = version.to_i if version.is_a?(String) && version =~ /^\d+$/
      return true if version.is_a?(Integer) && version.positive?
      raise Wavefront::Exception::InvalidVersion
    end
1298992
public static boolean isAtLeast(String version, String requiredVersion) {
        if (version != null) {
            SemanticVersion thisVersion = new SemanticVersion(version);
            SemanticVersion otherVersion = new SemanticVersion(requiredVersion);
            return thisVersion.compareTo(otherVersion) != -1;
        }
        return false;
    }
1079493
private static boolean isIEVersionInferiorOrEqualTo(HttpServletRequest req, int ieVersion) {

		boolean result = false;
		String agent = req.getHeader("User-Agent");
		if (LOGGER.isDebugEnabled()) {
			LOGGER.debug("User-Agent for this request:" + agent);
		}
		if (agent != null) {

			Matcher matcher = IE_USER_AGENT_PATTERN.matcher(agent);
			if (matcher.find()) {
				int version = Integer.parseInt(matcher.group(1));
				if (version <= ieVersion) {
					result = true;
				}
			}
		}

		return result;
	}
816835
private function areNullableReturnTypesSupported(): bool
    {
        $testVersion = trim(PHPCompatibility\PHPCSHelper::getConfigData('testVersion') ?: '');
        if (!$testVersion) {
            return false;
        }

        preg_match('`^(\d+\.\d+)(?:\s*-\s*(?:\d+\.\d+)?)?$`', $testVersion, $matches);
        $min = $matches[1] ?? null;

        return $min && version_compare($min, '7.1', '>=');
    }
433669
private static boolean ensureVersion(Version existing, Version expected) {
        return existing != Version.UNDEFINED && existing.greaterThanOrEqualTo(expected);
    }
143751
def is_canonical(version, loosedev=False):  # type: (str, bool) -> bool
    
    if loosedev:
        return loose440re.match(version) is not None
    return pep440re.match(version) is not None
307377
def _is_version_range(req):
    """"""

    assert len(req.specifier) > 0
    specs = list(req.specifier)
    if len(specs) == 1:
        # "foo > 2.0" or "foo == 2.4.3"
        return specs[0].operator != '=='
    else:
        # "foo > 2.0, < 3.0"
        return True
550050
function isGitInstalled() {
    var result = exec( "git --version", true );
    try {
        if ( !result || result.indexOf( "git" ) < 0 || result.indexOf( "version" ) < 0 ) {
            console.log( Fatal.format(
                "`git` is required by the ToloFrameWork!\n" +
                "Please install it:" ) );
            console.log( "\n> " + "sudo apt-get install git".yellow.italic );
            return false;
        }
        return true;
    } catch ( ex ) {
        fatal( "Fatal error in function `result`!\n" + JSON.stringify( ex, null, '  ' ) );
    }
}
422097
def get_installed_version(self):
        """"""
        if self.check():
            return '%s (%s)' % (self.installed_version, self.OK)
        else:
            return '%s (%s)' % (self.installed_version, self.NOK)
622598
def is_installed(prog):
    """"""
    with open(os.devnull, 'w') as devnull:
        try:
            if os.name == 'nt':
                retcode = subprocess.call(['where', prog], stdout=devnull)
            else:
                retcode = subprocess.call(['which', prog], stdout=devnull)
        except OSError as e:
            # If where or which doesn't exist, a "ENOENT" error will occur (The
            # FileNotFoundError subclass on Python 3).
            if e.errno != errno.ENOENT:
                raise
            retcode = 1

    return retcode == 0
171039
public boolean contains( VersionID m )
    {
        for ( Object _versionId : _versionIds )
        {
            VersionID vi = (VersionID) _versionId;
            boolean check = vi.match( m );
            if ( check )
            {
                return true;
            }
        }
        return false;
    }
101200
def supports_version(self, guid_set):
        

        # Don't let the test run if we haven't parsed install.rdf yet.
        if self.supported_versions is None:
            raise Exception('Early compatibility test run before install.rdf '
                            'was parsed.')

        return self._compare_version(requirements=guid_set,
                                     support=self.supported_versions)