Performs a high level check of SimpleSAMLphp installation.
765556
protected function checkSimpleSamlPhp() {
    if ($this->getConfig()->has('simplesamlphp')) {
      $lib_root = $this->getConfigValue('repo.root') . '/vendor/simplesamlphp/simplesamlphp';
      $config_root = $this->getConfigValue('repo.root') . '/simplesamlphp';

      // Check for the configurable files in docroot/simplesamlphp.
      if (!file_exists($config_root)) {
        $this->logProblem(__FUNCTION__, [
          "Simplesamlphp config directory is missing. $config_root",
          "",
          "Run `blt simplesamlphp:config:init` to create a config directory.",
        ], 'error');
      }

      // Check for the SimpleSAMLphp library in the vendor directory.
      if (!file_exists($lib_root)) {
        $this->logProblem(__FUNCTION__, [
          "The SimpleSAMLphp library was not found in the vendor directory.",
          "  Run `blt simplesamlphp:config:init` to add the library as a dependency.",
        ], 'error');
      }

      // Compare config files in $config_root and $lib_root.
      if (file_exists($lib_root) && file_exists($config_root)) {
        $config_files = [
          '/config/config.php',
          '/config/authsources.php',
          '/metadata/saml20-idp-remote.php',
        ];
        foreach ($config_files as $config_file) {
          if (file_exists($lib_root . $config_file) && file_exists($config_root . $config_file)) {
            $config_file_content = file_get_contents($config_root . $config_file);
            $lib_file_content = file_get_contents($lib_root . $config_file);
            if (strcmp($config_file_content, $lib_file_content) !== 0) {
              $this->logProblem(__FUNCTION__, [
                "The configuration file: $config_file in $config_root does not match the one in $lib_root.",
                "  Run `blt source:build:simplesamlphp-config` to copy the files from the repo root to the library.",
              ], 'error');
            }
          }
          else {
            $lib_file_path = $lib_root . $config_file;
            $this->logProblem(__FUNCTION__, [
              "$lib_file_path is missing. Run `blt source:build:simplesamlphp-config`.",
            ], 'error');
          }
        }
      }

      // Check that the library's www dirctory is symlinked in the docroot.
      if (!file_exists($this->getConfigValue('docroot') . '/simplesaml')) {
        $this->logProblem(__FUNCTION__, [
          "The symlink to the SimpleSAMLphp library is missing from your docroot.",
          "  Run `blt recipes:simplesamlphp:init`",
        ], 'error');
      }

      // Check that access to the symlinked directory is not blocked.
      $htaccess = file_get_contents($this->getConfigValue('docroot') . '/.htaccess');
      if (!strstr($htaccess, 'simplesaml')) {
        $this->logProblem(__FUNCTION__, [
          "Access to {$this->getConfigValue('docroot')}/simplesaml is blocked by .htaccess",
          "  Add the snippet in simplesamlphp-setup.md readme to your .htaccess file.",
        ], 'error');
      }
    }
  }
684204
def action_verify_checksum(self, ids):
        """"""
        try:
            count = 0
            for file_id in ids:
                f = FileInstance.query.filter_by(
                    id=uuid.UUID(file_id)).one_or_none()
                if f is None:
                    raise ValueError(_("Cannot find file instance."))
                verify_checksum.delay(file_id)
                count += 1
            if count > 0:
                flash(_('Fixity check(s) sent to queue.'), 'success')
        except Exception as exc:
            if not self.handle_view_exception(exc):
                raise
            current_app.logger.exception(str(exc))  # pragma: no cover
            flash(_('Failed to run fixity checks.'),
                  'error')
538345
def verify_package(verbose=True):
    """"""
    is_passing = True

    # Check the config file.
    if os.path.exists("config.txt"):
        log("✓ config.txt is OK",
            delay=0, chevrons=False, verbose=verbose)
    else:
        log("✗ config.txt is MISSING",
            delay=0, chevrons=False, verbose=verbose)
        return False

    # Check the experiment file.
    if os.path.exists("experiment.py"):

        # Check if the experiment file has exactly one Experiment class.
        tmp = tempfile.mkdtemp()
        for f in ["experiment.py", "config.txt"]:
            shutil.copyfile(f, os.path.join(tmp, f))

        cwd = os.getcwd()
        os.chdir(tmp)

        open("__init__.py", "a").close()
        exp = imp.load_source('experiment', os.path.join(tmp, "experiment.py"))

        classes = inspect.getmembers(exp, inspect.isclass)
        exps = [c for c in classes
                if (c[1].__bases__[0].__name__ in "Experiment")]

        if len(exps) == 0:
            log("✗ experiment.py does not define an experiment class.",
                delay=0, chevrons=False, verbose=verbose)
            is_passing = False
        elif len(exps) == 1:
            log("✓ experiment.py is OK",
                delay=0, chevrons=False, verbose=verbose)
        else:
            log("✗ experiment.py defines more than one experiment class.",
                delay=0, chevrons=False, verbose=verbose)
        os.chdir(cwd)

    else:
        log("✗ experiment.py is MISSING",
            delay=0, chevrons=False, verbose=verbose)
        is_passing = False

    # Make sure there's a help file.
    is_txt_readme = os.path.exists("README.md")
    is_md_readme = os.path.exists("README.txt")
    if (not is_md_readme) and (not is_txt_readme):
        is_passing = False
        log("✗ README.txt or README.md is MISSING.",
            delay=0, chevrons=False, verbose=verbose)
    else:
        log("✓ README is OK",
            delay=0, chevrons=False, verbose=verbose)

    # Check front-end files do not exist
    if os.path.exists("templates/complete.html"):
        log("✗ templates/complete.html will CONFLICT with shared front-end files inserted at run-time, please delete or rename.",
            delay=0, chevrons=False, verbose=verbose)
        return False
    elif os.path.exists("templates/error_wallace.html"):
        log("✗ templates/error_wallace.html will CONFLICT with shared front-end files inserted at run-time, please delete or rename.",
            delay=0, chevrons=False, verbose=verbose)
        return False
    elif os.path.exists("templates/launch.html"):
        log("✗ templates/launch.html will CONFLICT with shared front-end files inserted at run-time, please delete or rename.",
            delay=0, chevrons=False, verbose=verbose)
        return False
    elif os.path.exists("static/css/wallace.css"):
        log("✗ static/css/wallace.css will CONFLICT with shared front-end files inserted at run-time, please delete or rename.",
            delay=0, chevrons=False, verbose=verbose)
        return False
    elif os.path.exists("static/scripts/wallace.js"):
        log("✗ static/scripts/wallace.js will CONFLICT with shared front-end files inserted at run-time, please delete or rename.",
            delay=0, chevrons=False, verbose=verbose)
        return False
    elif os.path.exists("static/scripts/reqwest.min.js"):
        log("✗ static/scripts/reqwest.min.js will CONFLICT with shared front-end files inserted at run-time, please delete or rename.",
            delay=0, chevrons=False, verbose=verbose)
        return False
    elif os.path.exists("static/robots.txt"):
        log("✗ static/robots.txt will CONFLICT with shared front-end files inserted at run-time, please delete or rename.",
            delay=0, chevrons=False, verbose=verbose)
        return False
    else:
        log("✓ no file conflicts",
            delay=0, chevrons=False, verbose=verbose)

    return is_passing
885407
def check(self, check_all=True, do_reload=True):
        """"""
        with enaml.imports():
            super(EnamlReloader, self).check(check_all=check_all, do_reload=do_reload)
1292175
def is_installed(self, pkgname):
        

        return any(d for d in self.get_distributions() if d.project_name == pkgname)
1227361
def verify(self):
        
        with ffi.OutputString() as outmsg:
            if ffi.lib.LLVMPY_VerifyModule(self, outmsg):
                raise RuntimeError(str(outmsg))
1301566
def _init_check_upodates():
    
    message, count, packages = check_updates()
    if count > 0:
        print(message)
        for pkg in packages:
            print("{0}".format(pkg))
    else:
        print(message)
777718
public function safeUp()
    {
        // 1. Run the install migration
	    if (!$this->db->tableExists(Map::TableName))
	        (new Install())->safeUp();

	    // 2. Upgrade the data
	    if ($this->db->tableExists('{{%simplemap_maps}}'))
	    	$this->_upgrade2();
	    else
	    	$this->_upgrade3();
    }
136711
def _verify_install(desired, new_pkgs, ignore_epoch=False, new_caps=None):
    '''
    
    '''
    ok = []
    failed = []
    if not new_caps:
        new_caps = dict()
    for pkgname, pkgver in desired.items():
        # FreeBSD pkg supports `openjdk` and `java/openjdk7` package names.
        # Homebrew for Mac OSX does something similar with tap names
        # prefixing package names, separated with a slash.
        has_origin = '/' in pkgname

        if __grains__['os'] == 'FreeBSD' and has_origin:
            cver = [k for k, v in six.iteritems(new_pkgs) if v['origin'] == pkgname]
        elif __grains__['os'] == 'MacOS' and has_origin:
            cver = new_pkgs.get(pkgname, new_pkgs.get(pkgname.split('/')[-1]))
        elif __grains__['os'] == 'OpenBSD':
            cver = new_pkgs.get(pkgname.split('%')[0])
        elif __grains__['os_family'] == 'Debian':
            cver = new_pkgs.get(pkgname.split('=')[0])
        else:
            cver = new_pkgs.get(pkgname)
            if not cver and pkgname in new_caps:
                cver = new_pkgs.get(new_caps.get(pkgname)[0])

        if not cver:
            failed.append(pkgname)
            continue
        elif pkgver == 'latest':
            ok.append(pkgname)
            continue
        elif not __salt__['pkg_resource.version_clean'](pkgver):
            ok.append(pkgname)
            continue
        elif pkgver.endswith("*") and cver[0].startswith(pkgver[:-1]):
            ok.append(pkgname)
            continue
        if _fulfills_version_string(cver, pkgver, ignore_epoch=ignore_epoch):
            ok.append(pkgname)
        else:
            failed.append(pkgname)
    return ok, failed
494077
def _check_pkg(target):
    '''
    
    '''
    ret = {}
    cmd = ['/usr/bin/lslpp', '-Lc', target]
    lines = __salt__['cmd.run'](
            cmd,
            python_shell=False).splitlines()

    name = ''
    version_num = ''
    rpmpkg = False
    for line in lines:
        if line.startswith('#'):
            continue

        comps = line.split(':')
        if len(comps) < 7:
            raise CommandExecutionError(
                'Error occurred finding fileset/package',
                info={'errors': comps[1].strip()})

        # handle first matching line
        if 'R' in comps[6]:
            name = comps[0]
            rpmpkg = True
        else:
            name = comps[1]     # use fileset rather than rpm package

        version_num = comps[2]
        break

    return name, version_num, rpmpkg
533108
function systemCheck()
    {
        $this->checkPiwikIsNotInstalled();

        $this->deleteConfigFileIfNeeded();

        $view = new View(
            '@Installation/systemCheck',
            $this->getInstallationSteps(),
            __FUNCTION__
        );

        // Do not use dependency injection because this service requires a lot of sub-services across plugins
        /** @var DiagnosticService $diagnosticService */
        $diagnosticService = StaticContainer::get('Piwik\Plugins\Diagnostics\DiagnosticService');
        $view->diagnosticReport = $diagnosticService->runDiagnostics();

        $view->showNextStep = !$view->diagnosticReport->hasErrors();

        // On the system check page, if all is green, display Next link at the top
        $view->showNextStepAtTop = $view->showNextStep && !$view->diagnosticReport->hasWarnings();

        return $view->render();
    }
694754
def check_dependencies(self):
        ""
        if self.test_program == 'nose':
            try:
                import nose
            except ImportError:
                sys.exit('Nosetests is not available on your system. Please install it and try to run it again')
        if self.test_program == 'py':
            try:
                import py
            except:
                sys.exit('py.test is not available on your system. Please install it and try to run it again')
        if self.test_program == 'django':
            try:
                import django
            except:
                sys.exit('django is not available on your system. Please install it and try to run it again')
        if self.test_program == 'phpunit':
            try:
                process = subprocess.check_call(['phpunit','--version']) 
            except:
                sys.exit('phpunit is not available on your system. Please install it and try to run it again')
        if self.test_program == 'tox':
            try:
                import tox
            except ImportError:
                sys.exit('tox is not available on your system. Please install it and try to run it again')
1368462
def _pcap_check(cls):
        """"""
        if not conf.use_winpcapy:
            # Winpcap/Npcap isn't installed
            return

        _detect = pcap_service_status()

        def _ask_user():
            if not conf.interactive:
                return False
            msg = "Do you want to start it ? (yes/no) [y]: "
            try:
                # Better IPython compatibility
                import IPython
                return IPython.utils.io.ask_yes_no(msg, default='y')
            except (NameError, ImportError):
                while True:
                    _confir = input(msg)
                    _confir = _confir.lower().strip()
                    if _confir in ["yes", "y", ""]:
                        return True
                    elif _confir in ["no", "n"]:
                        return False
                return False
        _error_msg = ("No match between your pcap and windows "
                      "network interfaces found. ")
        if _detect:
            # No action needed
            return
        else:
            warning(
                "Scapy has detected that your pcap service is not running !"
            )
            if not conf.interactive or _ask_user():
                succeed = pcap_service_start(askadmin=conf.interactive)
                if succeed:
                    log_loading.info("Pcap service started !")
                    return
            _error_msg = "Could not start the pcap service ! "
        warning(_error_msg +
                "You probably won't be able to send packets. "
                "Deactivating unneeded interfaces and restarting "
                "Scapy might help. Check your winpcap/npcap installation "
                "and access rights.")
1357709
def run
      require_dependencies

      # Find any missing steps in each file, and keep track of unused steps
      clean = true
      filenames.each do |file|
        result = audit_file(file)
        clean &&= result # set to false if any result is false
      end

      # At the end, report any unused steps
      report_unused_steps

      # If the audit was clean, make sure the user knows
      puts "\nAudit clean - no missing steps.".colorize(:light_green) if clean

      true
    end
910043
public function compile()
    {
        $pharFilePath = dirname(__FILE__).'/../../build/packagist-security-checker.phar';

        if (file_exists($pharFilePath)) {
            unlink($pharFilePath);
        }

        $phar = new Phar($pharFilePath, 0, 'packagist-security-checker.phar');
        $phar->setSignatureAlgorithm(\Phar::SHA1);

        $phar->startBuffering();

        $this
            ->addPHPFiles($phar)
            ->addVendorFiles($phar)
            ->addComposerVendorFiles($phar)
            ->addBin($phar)
            ->addStub($phar)
            ->addLicense($phar);

        $phar->stopBuffering();

        unset($phar);
    }
497264
public function simpleSamlPhpBuildConfig() {
    $this->say('Copying config files to the appropriate place in simplesamlphp library...');
    $result = $this->taskCopyDir(["{$this->repoRoot}/simplesamlphp" => "{$this->repoRoot}/vendor/simplesamlphp/simplesamlphp"])
      ->overwrite(TRUE)
      ->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERBOSE)
      ->run();
    if (!$result->wasSuccessful()) {
      throw new BltException("Unable to copy configuration into SimpleSamlPhp.");
    }

    $result = $this->taskFileSystemStack()
      ->copy("{$this->bltRoot}/scripts/simplesamlphp/gitignore.txt", "{$this->repoRoot}/vendor/simplesamlphp/simplesamlphp/.gitignore", TRUE)
      ->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERBOSE)
      ->run();
    if (!$result->wasSuccessful()) {
      throw new BltException("Unable to copy .gitignore into SimpleSamlPhp.");
    }
  }
606001
def check_dependencies(specs)
      missing = check_app_requirement(specs)

      present = exclude_specs(installed, specs)
      future = present + specs

      check_all_dependencies(specs, future, missing)
    end