Check if the TwoStream Package is installed.

@return bool
502798
protected function isInstalled()
    {
        $disk = Storage::createLocalDriver([
            'driver' => 'local',
            'root'   => app_path(),
        ]);
        
        foreach ($this->files['required'] as $required) {
            if (! $disk->exists(str_replace(['.stub', app_path()], ['.php', ''], $required))) {
                return false;
            }
        }
        
        return true;
    }
538726
private function isAlreadyInstalled() : bool
    {
        $public = new SplFileInfo(self::PROJECT_ROOT  . '/public');
        $src = new SplFileInfo(self::PROJECT_ROOT  . '/src');

        return $public->isDir() && $src->isDir();
    }
168582
public function installMode(): bool
    {
        if (!isset($this->cache[self::INSTALL_MODE])) {
            $this->cache[self::INSTALL_MODE] = !is_file($this->initFile());
        }

        return $this->cache[self::INSTALL_MODE];
    }
756136
private function installed()
    {
        if ($this->installed === null) {
            $this->installed = $this->app->isInstalled();
        }

        return $this->installed;
    }
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)
490056
protected function isContao45()
	{
	    $packages = \System::getContainer()->getParameter('kernel.packages');
	    $coreVersion = $packages['contao/core-bundle']; //a.b.c
	    if ( version_compare($coreVersion, '4.5.0', '>=') )
	    {
	        ModuleVisitorLog::writeLog( __METHOD__ , __LINE__ , ': True' );
	        return true;
	    }
	    ModuleVisitorLog::writeLog( __METHOD__ , __LINE__ , ': False' );
	    return false;
	}
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
629882
public function isStreamWrapped()
	{
		$maybeStreamWrapped = $this->partCount > 1 && $this->firstPart !== '' && $this->parts[1] === '' && ':' === substr($this->firstPart, -1);
		if (! $maybeStreamWrapped) {
			return false;
		}
		$name = substr($this->firstPart, 0, -1);
		return in_array($name, stream_get_wrappers());
	}
1201901
public function isInstalled(string $name): bool
    {
        $extension = $this->getAvailableExtensions()->findByName($this->getNormalizedName($name));

        if ($extension instanceof ExtensionContract) {
            return $extension->isInstalled();
        }

        return false;
    }
186432
public function isPackageInstalled(PackageInterface $package)
    {
        return $this->filesystem->exists($this->config->getInstallDir() . '/' . $package->getName() . '/.bower.json');
    }
25814
public function checkPhpDependencies()
    {
        $errors = array();
        foreach($this->getDependencyPhpExtensions() as $dep)
        {
            if(!extension_loaded($dep['name'])) {
                $errors[] = $dep;
            }
        }
        if(count($errors)) {
            return $errors;
        }
        return true;
    }
115731
def is_installed(self, package):
        """"""
        if isinstance(package, tuple):
            package = '=='.join(package)
        if package.endswith('.git'):
            pkg_name = os.path.split(package)[1][:-4]
            return pkg_name in self.installed_package_names or \
                    pkg_name.replace('_', '-') in self.installed_package_names
        pkg_tuple = split_package_name(package)
        if pkg_tuple[1] is not None:
            return pkg_tuple in self.installed_packages
        else:
            return pkg_tuple[0].lower() in self.installed_package_names
424981
public function isStreaming(): bool
    {
        $prefixes = [
            # Standard streams
            "x-sonosapi-stream:",

            # Other streams (eg Amazon)
            "x-sonosapi-radio:",

            # Line in
            "x-rincon-stream:",

            # Line in (playbar)
            "x-sonos-htastream:",
        ];

        $media = $this->getMediaInfo();

        foreach ($prefixes as $prefix) {
            if (strpos($media["CurrentURI"], $prefix) === 0) {
                return true;
            }
        }

        return false;
    }
680837
public function have_pakefile()
    {
        $is_windows = (strtolower(substr(PHP_OS, 0, 3)) == 'win');

        $here = getcwd();
        foreach ($this->PAKEFILES as $file) {
            $path_includes_directory = basename($file) !== $file;

            if ($path_includes_directory) {
                if ($is_windows) {
                    $is_absolute_path = ($file[0] == '\\' or $file[0] == '/' or mb_ereg('^[A-Za-z]+:', $file) === 1);
                } else {
                    $is_absolute_path = $file[0] == '/';
                }
            } else {
                $is_absolute_path = false;
            }

            if ($is_absolute_path) {
                $filepath = $file;
            } else {
                $filepath = $here . DIRECTORY_SEPARATOR . $file;
            }

            if (file_exists($filepath)) {
                $this->pakefile = realpath($filepath);
                return true;
            }
        }

        return false;
    }
1095752
public static function hasCustomList()
    {
        $fh = Core::make('helper/file');
        if (is_dir(DIR_STARTING_POINT_PACKAGES)) {
            $available = $fh->getDirectoryContents(DIR_STARTING_POINT_PACKAGES);
            if (count($available) > 0) {
                return true;
            }
        }

        return false;
    }
53837
public function hasPackage($package_name)
    {
        if (!isset($this->packages_instances[$package_name])) {
            try {
                $this->packages_instances[$package_name] = $this->_buildNewPackage($package_name);
            } catch (\Exception $e) {
            }
        }
        return isset($this->packages_instances[$package_name]);
    }
160546
public function hasStream($stream)
    {
        $isInputStream = $stream == $this->getInputStream();
        $isOutputStream = $stream == $this->getOutputStream();
        $isErrStream = $stream == $this->getErrorStream();

        return $isInputStream || $isOutputStream || $isErrStream;
    }