Runs a quick check to see if cargo fmt is installed.
437399
def has_cargo_fmt():
    """"""
    try:
        c = subprocess.Popen(
            ["cargo", "fmt", "--", "--help"],
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
        )
        return c.wait() == 0
    except OSError:
        return False
527738
def check_dependee_build(self, depender, dependee, dependee_id):
		
		shutit_global.shutit_global_object.yield_to_draw()
		cfg = self.cfg
		# If depender is installed or will be installed, so must the dependee
		if not (cfg[dependee.module_id]['shutit.core.module.build'] or
		        self.is_to_be_built_or_is_installed(dependee)):
			return 'depender module id:\n\n[' + depender.module_id + ']\n\nis configured: "build:yes" or is already built but dependee module_id:\n\n[' + dependee_id + ']\n\n is not configured: "build:yes"'
		return ''
1052934
def install(self):
        
        logger.debug("")

        # If we're already installed, don't do anything.
        if self.installed:
            self.pr_info("pkg {} is already installed. Perhaps you want to update it?",
                    self.name)
            return

        self.clone()
        self.install_update_deps()

        logger.debug("Checking for install script")

        inst = os.path.join(self.repo_dir, '_upkg', 'install')
        if os.path.exists(inst):
            cwd = os.getcwd()
            logger.debug("chdir to %s", os.path.join(self.repo_dir, '_upkg'))
            logger.debug("install script is %s", inst)
            self.pr_info("Running install script at {}", inst)
            logger.debug("runnin script %s", inst)
            # We use subprocess instead of the sh module due to problems with
            # runing shell scripts with sh
            os.chdir(os.path.join(self.repo_dir, '_upkg'))
            subprocess.check_call(inst, shell=True)
            os.chdir(cwd)
            self.pr_pass("install script finished")
940700
def _run_check(self, low_data):
        '''
        
        '''
        ret = {'result': False, 'comment': []}
        cmd_opts = {}

        if 'shell' in self.opts['grains']:
            cmd_opts['shell'] = self.opts['grains'].get('shell')

        if 'onlyif' in low_data:
            _ret = self._run_check_onlyif(low_data, cmd_opts)
            ret['result'] = _ret['result']
            ret['comment'].append(_ret['comment'])
            if 'skip_watch' in _ret:
                ret['skip_watch'] = _ret['skip_watch']

        if 'unless' in low_data:
            _ret = self._run_check_unless(low_data, cmd_opts)
            # If either result is True, the returned result should be True
            ret['result'] = _ret['result'] or ret['result']
            ret['comment'].append(_ret['comment'])
            if 'skip_watch' in _ret:
                # If either result is True, the returned result should be True
                ret['skip_watch'] = _ret['skip_watch'] or ret['skip_watch']

        return ret
1170453
function checkPkg(pkgDir, scopes) {
  var errors;
  try {
    var config = {packageDir: pkgDir};
    if (scopes) {
      config.scopeList = scopes;
    }
    var checked = checkDeps.sync(config);
    if (checked.error.length) {
      errors = checked.error;
    }
  } finally {
    // eslint-disable-next-line no-unsafe-finally
    return errors;
  }
}
771435
def check_backend() -> bool:
        """"""
        try:
            call('gatttool', stdout=PIPE, stderr=PIPE)
            return True
        except OSError as os_err:
            msg = 'gatttool not found: {}'.format(str(os_err))
            _LOGGER.error(msg)
        return False
373778
def if_running(meth):
        """"""

        @wraps(meth)
        def check_running(self, *args, **kwargs):
            if not self.running:
                return
            return meth(self, *args, **kwargs)

        return check_running
1280017
protected function checkForSSHClientOrInstall()
    {
        if (! File::exists(self::USR_BIN_SSH)) {
            $this->info('No SSH client found on your system (' . self::USR_BIN_SSH .')!');
            $this->installSshClient();
        } else {
            $this->info('SSH client found in your system (' . self::USR_BIN_SSH .')...');
        }
    }
304195
def _repos_checked(self, worker, output, error):
        """"""
        if worker.repo in self._checking_repos:
            self._checking_repos.remove(worker.repo)

        if output:
            self._valid_repos.append(worker.repo)

        if len(self._checking_repos) == 0:
            self._download_repodata(self._valid_repos)
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, '  ' ) );
    }
}
603875
function isInstallationAlreadyPerformed(ctx) {
  var pathToInstallFlag = path.join(ctx.opts.projectRoot, 'plugins', ctx.opts.plugin.id, INSTALLATION_FLAG_FILE_NAME);
  try {
    fs.accessSync(pathToInstallFlag, fs.F_OK);
    return true;
  } catch (err) {
    return false;
  }
}
880180
function checkThatExecutableExists(next) {
        fs.exists(nodeCompiler.releasePath, function(exists) {
          if (!exists) {
            _log(
              'error',
              'The release executable has not been generated. ' +
                'This indicates a failure in the build process. ' +
                'There is likely additional information above.',
            );
            process.exit(1);
          } else {
            next();
          }
        });
      }
616409
def is_to_be_built_or_is_installed(self, shutit_module_obj):
		
		shutit_global.shutit_global_object.yield_to_draw()
		cfg = self.cfg
		if cfg[shutit_module_obj.module_id]['shutit.core.module.build']:
			return True
		return self.is_installed(shutit_module_obj)
1134216
function checkOlderIE() {
  const ua = navigator.userAgent;
  const isIE = ua.indexOf('MSIE') !== -1 || ua.indexOf('Trident') !== -1;
  if (!isIE) {
    return false;
  }
  const version = ua.match(/(MSIE\s|Trident.*rv:)([\w.]+)/)[2];
  const versionNumber = parseFloat(version);
  if (versionNumber < 10) {
    return true;
  }
  return false;
}
386398
function verifyOthers() {
      if ( !isTypeString(options.commit) ) {
        errorOption('commit', options.commit);
      }
      if ( !isTypeString(options.tag) ) {
        errorOption('tag', options.tag);
      }
    }
409012
def check(module):
  global passed, failed
  '''
  
  '''
  module_name = module.rsplit('/', 1)[1]
  if module[-3:] == ".py" and module_name not in IGNORED_FILES:
    print ("CHECKING ", module)
    pout = os.popen('pylint %s'% module, 'r')
    for line in pout:
      if "Your code has been rated at" in line:
        print ("PASSED pylint inspection: " + line)
        passed += 1
        return True
      if "-error" in line:
        print ("FAILED pylint inspection: " + line)
        failed += 1
        errors.append("FILE: " + module)
        errors.append("FAILED pylint inspection: " + line)
        return False
197490
def auto_detect(self, args):
        
        suffixes = [
            ".tgz",
            ".txz",
            ".tbz",
            ".tlz"
        ]
        if (not args[0].startswith("-") and args[0] not in self.commands and
                args[0].endswith(tuple(suffixes))):
            packages, not_found = [], []
            for pkg in args:
                if pkg.endswith(tuple(suffixes)):
                    if os.path.isfile(pkg):
                        packages.append(pkg)
                    else:
                        not_found.append(pkg)
            if packages:
                Auto(packages).select()
            if not_found:
                for ntf in not_found:
                    self.msg.pkg_not_found("", ntf, "Not installed", "")
            raise SystemExit()