Returns True if we can be sure the package is installed.

		@param package:   Package as a string, eg 'wget'.
		@param shutit_pexpect_child:     See send()
		@param note:      See send()

		@rtype:           boolean
512612
def package_installed(self,
	                      package,
	                      shutit_pexpect_child=None,
	                      note=None,
	                      loglevel=logging.DEBUG):
		
		shutit_pexpect_child = shutit_pexpect_child or self.get_current_shutit_pexpect_session().pexpect_child
		shutit_pexpect_session = self.get_shutit_pexpect_session_from_child(shutit_pexpect_child)
		return shutit_pexpect_session(package,note=note,loglevel=loglevel)
891885
private function checkFrameworkSupport($package)
	{
		$extra = $package->getExtra();

		if (!isset($extra[self::NAME])) {
			return FALSE;
		}

		if (!isset($extra[self::NAME][$this->framework])) {
			return FALSE;
		}

		return $this->enabled;
	}
397052
protected function isPackageSupported($package)
    {
        $extra = $package->getExtra();
        if (!empty($extra['drupal']['security-coverage']['status'])
          && $extra['drupal']['security-coverage']['status'] == 'not-covered') {
            return false;
        }
        return true;
    }
1092202
def is_deb_package_installed(pkg):
    

    with settings(hide('warnings', 'running', 'stdout', 'stderr'),
                  warn_only=True, capture=True):

        result = sudo('dpkg-query -l "%s" | grep -q ^.i' % pkg)
        return not bool(result.return_code)
689097
public function isNeedUpdate($package)
    {
        $packageBower = $this->config->getPackageBowerFileContent($package);
        $semver = new version($packageBower['version']);

        return !$semver->satisfies(new expression($package->getRequiredVersion()));
    }
918363
def get_current_shutit_pexpect_session(self, note=None):
		
		self.handle_note(note)
		res = self.current_shutit_pexpect_session
		self.handle_note_after(note)
		return res
1248175
def check_pseudo_package(path):
    
    if not os.path.isdir(path):
        raise Exception("Please make sure pseudo-package %s exists." % path)
    else:
        assets = os.listdir(path)
        if len(assets) == 0:
            raise Exception("Please make sure pseudo-package %s is populated." % path)
914695
public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
    {
        if (false === parent::isInstalled($repo, $package)) {
            return false;
        }

        $targetRoot = $this->getContaoRoot();

        foreach ($this->getSources($package) as $targetPath) {
            if (!file_exists($this->filesystem->normalizePath($targetRoot . '/' . $targetPath))) {
                return false;
            }
        }

        return true;
    }
186432
public function isPackageInstalled(PackageInterface $package)
    {
        return $this->filesystem->exists($this->config->getInstallDir() . '/' . $package->getName() . '/.bower.json');
    }
497056
public static boolean isValidJavaPackage(String packageName) {
        if (isBlank(packageName)) {
            return false;
        }
        final String[] parts = packageName.split("\\.");
        for (String part : parts) {
            if (!isValidJavaIdentifier(part)) {
                return false;
            }
        }
        return true;
    }
1159009
def set_default_shutit_pexpect_session(self, shutit_pexpect_session):
		
		assert isinstance(shutit_pexpect_session, ShutItPexpectSession), shutit_util.print_debug()
		self.current_shutit_pexpect_session = shutit_pexpect_session
		return True
770477
def whoarewe(self,
	             shutit_pexpect_child=None,
	             note=None,
	             loglevel=logging.DEBUG):
		
		shutit_global.shutit_global_object.yield_to_draw()
		shutit_pexpect_child = shutit_pexpect_child or self.get_current_shutit_pexpect_session().pexpect_child
		shutit_pexpect_session = self.get_shutit_pexpect_session_from_child(shutit_pexpect_child)
		return shutit_pexpect_session.whoarewe(note=note,
		                                       loglevel=loglevel)
601016
public boolean confirmInstalled(String packageName, List<String> output){
        if (output != null) {
            return output.stream().anyMatch(s -> s != null && s.contains(getInstallSuccess()));
        } else {
            return true; //may be successful
        }
    }
726765
def add_package(self, check_name, package):
        
        self._package_set.add(package)
        package_data = self._packages[package.name]
        self._checks_deps[check_name].append(package)

        # Versions
        if package.version:
            versions = package_data['versions']
            versions[package.version].append(check_name)

        # Marker section
        if package.marker:
            markers = package_data['markers']
            markers[package.marker].append(check_name)
1275464
def install_package(package, upgrade=True,
                    target=None):
    
    # Not using 'import pip; pip.main([])' because it breaks the logger
    with INSTALL_LOCK:
        if check_package_exists(package, target):
            return True

        _LOGGER.info('Attempting install of %s', package)
        args = [sys.executable, '-m', 'pip', 'install', '--quiet', package]
        if upgrade:
            args.append('--upgrade')
        if target:
            args += ['--target', os.path.abspath(target)]

        try:
            return subprocess.call(args) == 0
        except subprocess.SubprocessError:
            _LOGGER.exception('Unable to install pacakge %s', package)
            return False
275441
protected function mustInstallPatchesForPackage(PackageInterface $package)
    {
        $result = false;
        $patches = $this->getPatchCollection()->getPatchesFor($package);
        if ($patches->isEmpty()) {
            if ($this->io->isVerbose()) {
                $this->io->write('<info>No patches found for '.$package->getName().'.</info>');
            }
        } else {
            $result = true;
        }

        return $result;
    }
1199884
def are_debian_packages_installed(packages: List[str]) -> Dict[str, bool]:
    
    assert len(packages) >= 1
    require_executable(DPKG_QUERY)
    args = [
        DPKG_QUERY,
        "-W",  # --show
        # "-f='${Package} ${Status} ${Version}\n'",
        "-f=${Package} ${Status}\n",  # --showformat
    ] + packages
    completed_process = subprocess.run(args,
                                       stdout=subprocess.PIPE,
                                       stderr=subprocess.PIPE,
                                       check=False)
    encoding = sys.getdefaultencoding()
    stdout = completed_process.stdout.decode(encoding)
    stderr = completed_process.stderr.decode(encoding)
    present = OrderedDict()
    for line in stdout.split("\n"):
        if line:  # e.g. "autoconf install ok installed"
            words = line.split()
            assert len(words) >= 2
            package = words[0]
            present[package] = "installed" in words[1:]
    for line in stderr.split("\n"):
        if line:  # e.g. "dpkg-query: no packages found matching XXX"
            words = line.split()
            assert len(words) >= 2
            package = words[-1]
            present[package] = False
    log.debug("Debian package presence: {}", present)
    return present