Verify that python is uninstalled
167027
def _check_and_uninstall_python(ret, python, user=None):
    '''
    
    '''
    ret = _python_installed(ret, python, user=user)
    if ret['result']:
        if ret['default']:
            __salt__['pyenv.default']('system', runas=user)

        if __salt__['pyenv.uninstall_python'](python, runas=user):
            ret['result'] = True
            ret['changes'][python] = 'Uninstalled'
            ret['comment'] = 'Successfully removed python'
            return ret
        else:
            ret['result'] = False
            ret['comment'] = 'Failed to uninstall python'
            return ret
    else:
        ret['result'] = True
        ret['comment'] = 'python {0} is already absent'.format(python)

    return ret
514677
def verify_appium_is_running(self):
        """"""
        process = Popen(['ps -e | grep "Appium"'], shell=True, stdout=PIPE)
        (grep_output, _grep_error) = process.communicate()
        lines = grep_output.split('\n')
        for line in lines:
            if 'Appium.app' in line:
                self.stdout.write('Appium is already running')
                return True
        self.stdout.write('Please launch and configure Appium first')
        return False
536272
def sync(to_install, to_uninstall, verbose=False, dry_run=False, install_flags=None):
    
    if not to_uninstall and not to_install:
        click.echo("Everything up-to-date")

    pip_flags = []
    if not verbose:
        pip_flags += ['-q']

    if to_uninstall:
        if dry_run:
            click.echo("Would uninstall:")
            for pkg in to_uninstall:
                click.echo("  {}".format(pkg))
        else:
            check_call([sys.executable, '-m', 'pip', 'uninstall', '-y'] + pip_flags + sorted(to_uninstall))

    if to_install:
        if install_flags is None:
            install_flags = []
        if dry_run:
            click.echo("Would install:")
            for ireq in to_install:
                click.echo("  {}".format(format_requirement(ireq)))
        else:
            # prepare requirement lines
            req_lines = []
            for ireq in sorted(to_install, key=key_from_ireq):
                ireq_hashes = get_hashes_from_ireq(ireq)
                req_lines.append(format_requirement(ireq, hashes=ireq_hashes))

            # save requirement lines to a temporary file
            tmp_req_file = tempfile.NamedTemporaryFile(mode='wt', delete=False)
            tmp_req_file.write('\n'.join(req_lines))
            tmp_req_file.close()

            try:
                check_call(
                    [sys.executable, '-m', 'pip', 'install', '-r', tmp_req_file.name] + pip_flags + install_flags
                )
            finally:
                os.unlink(tmp_req_file.name)

    return 0
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)
274540
def check_installation(cur_file):
  """"""
  cur_dir = os.path.split(os.path.dirname(os.path.abspath(cur_file)))[0]
  ch_dir = os.path.split(cleverhans.__path__[0])[0]
  if cur_dir != ch_dir:
    warnings.warn("It appears that you have at least two versions of "
                  "cleverhans installed, one at %s and one at"
                  " %s. You are running the tutorial script from the "
                  "former but python imported the library module from the "
                  "latter. This may cause errors, for example if the tutorial"
                  " version is newer than the library version and attempts to"
                  " call new features." % (cur_dir, ch_dir))
405361
def was_installed_by_pip(pkg):
    # type: (str) -> bool
    
    try:
        dist = pkg_resources.get_distribution(pkg)
        return (dist.has_metadata('INSTALLER') and
                'pip' in dist.get_metadata_lines('INSTALLER'))
    except pkg_resources.DistributionNotFound:
        return False
18186
def pip_remove(self, name=None, prefix=None, pkgs=None):
        """"""
        logger.debug(str((prefix, pkgs)))

        if isinstance(pkgs, (list, tuple)):
            pkg = ' '.join(pkgs)
        else:
            pkg = pkgs

        extra_args = ['uninstall', '--yes', pkg]

        return self._call_pip(name=name, prefix=prefix, extra_args=extra_args)
559978
def restore_cmd(argv):
    """"""

    if len(argv) < 1:
        sys.exit('You must provide a valid virtualenv to target')

    env = argv[0]
    path = workon_home / env
    py = path / env_bin_dir / ('python.exe' if windows else 'python')
    exact_py = py.resolve().name

    return check_call([sys.executable, "-m", "virtualenv", str(path.absolute()), "--python=%s" % exact_py])
736281
def _validate_install(self):

        '''  '''

        from subprocess import check_output, STDOUT
        sys_command = 'docker --help'
        try:
            check_output(sys_command, shell=True, stderr=STDOUT).decode('utf-8')
            # call(sys_command, stdout=open(devnull, 'wb'))
        except Exception as err:
            raise Exception('"docker" not installed. GoTo: https://www.docker.com')
    
        return True
892166
def check_exec_installed(exec_list):
    
    all_installed = True
    for exe in exec_list:
        if not is_tool(exe):
            print("Executable: " + exe + " is not installed")
            all_installed = False
    return all_installed
415494
def _check_and_uninstall_ruby(ret, ruby, user=None):
    '''
    
    '''
    ret = _ruby_installed(ret, ruby, user=user)
    if ret['result']:
        if ret['default']:
            __salt__['rbenv.default']('system', runas=user)

        if __salt__['rbenv.uninstall_ruby'](ruby, runas=user):
            ret['result'] = True
            ret['changes'][ruby] = 'Uninstalled'
            ret['comment'] = 'Successfully removed ruby'
            return ret
        else:
            ret['result'] = False
            ret['comment'] = 'Failed to uninstall ruby'
            return ret
    else:
        ret['result'] = True
        ret['comment'] = 'Ruby {0} is already absent'.format(ruby)

    return ret
1095572
def removed(name,
            user=None,
            env=None):
    '''
    
    '''

    ret = {'name': name, 'result': None, 'comment': '', 'changes': {}}

    try:
        installed_pkgs = __salt__['cabal.list'](
            user=user, installed=True, env=env)
    except (CommandNotFoundError, CommandExecutionError) as err:
        ret['result'] = False
        ret['comment'] = 'Error looking up \'{0}\': {1}'.format(name, err)

    if name not in installed_pkgs:
        ret['result'] = True
        ret['comment'] = 'Package \'{0}\' is not installed'.format(name)
        return ret

    if __opts__['test']:
        ret['result'] = None
        ret['comment'] = 'Package \'{0}\' is set to be removed'.format(name)
        return ret

    if __salt__['cabal.uninstall'](pkg=name, user=user, env=env):
        ret['result'] = True
        ret['changes'][name] = 'Removed'
        ret['comment'] = 'Package \'{0}\' was successfully removed'.format(name)
    else:
        ret['result'] = False
        ret['comment'] = 'Error removing package \'{0}\''.format(name)

    return ret
211400
def verify_package_status(self):
        """"""
        # rpm-libs is required for /usr/lib64/librpm*.so
        self.rpm.verify_packages_installed(['rpm-libs'])

        # Check RPM so files to build the Python binding.
        message_format = '''
RPM: {0} or
RPM download tool (dnf-plugins-core (dnf) or yum-utils (yum)) required.
Install any of those.
'''
        if self.rpm.has_composed_rpm_bulid_libs():
            if (not self.rpm.is_package_installed('rpm-build-libs')
               and not self.rpm.is_downloadable()):
                raise InstallError(message_format.format('rpm-build-libs'))
        else:
            # All the needed so files are included in rpm-libs package.
            pass
1270996
def isInstalledBuild(self):
		
		sentinelFile = os.path.join(self.getEngineRoot(), 'Engine', 'Build', 'InstalledBuild.txt')
		return os.path.exists(sentinelFile)
936361
def uninstall(cls, args):
        
        mgr = NAppsManager()
        for napp in args['<napp>']:
            mgr.set_napp(*napp)
            LOG.info('NApp %s:', mgr.napp_id)
            if mgr.is_installed():
                if mgr.is_enabled():
                    cls.disable_napp(mgr)
                LOG.info('  Uninstalling...')
                mgr.uninstall()
                LOG.info('  Uninstalled.')
            else:
                LOG.error("  NApp isn't installed.")
854556
function guessPython () {
    log.verbose('could not find "' + python + '". guessing location')
    var rootDir = process.env.SystemDrive || 'C:\\'
    if (rootDir[rootDir.length - 1] !== '\\') {
      rootDir += '\\'
    }
    var pythonPath = path.resolve(rootDir, 'Python27', 'python.exe')
    log.verbose('ensuring that file exists:', pythonPath)
    fs.stat(pythonPath, function (err, stat) {
      if (err) {
        if (err.code == 'ENOENT') {
          failNoPython()
        } else {
          callback(err)
        }
        return
      }
      python = pythonPath
      checkPythonVersion()
    })
  }
1292175
def is_installed(self, pkgname):
        

        return any(d for d in self.get_distributions() if d.project_name == pkgname)