Empty our virtualenv so that new (or older) dependencies may be
        installed
6151
def clean_virtualenv(self):
        
        self.user_run_script(
            script=scripts.get_script_path('clean_virtualenv.sh'),
            args=[],
            rw_venv=True,
            )
1093414
def all():
    """"""
    dir()
    cmd3()
    banner("CLEAN PREVIOUS CLOUDMESH INSTALLS")
    r = int(local("pip freeze |fgrep cloudmesh | wc -l", capture=True))
    while r > 0:
        local('echo "y\n" | pip uninstall cloudmesh')
        r = int(local("pip freeze |fgrep cloudmesh | wc -l", capture=True))
915025
def _uninstall(name=None, pkgs=None, root=None):
    '''
    
    '''
    try:
        pkg_params = __salt__['pkg_resource.parse_targets'](name, pkgs)[0]
    except MinionError as exc:
        raise CommandExecutionError(exc)

    includes = _find_types(pkg_params.keys())
    old = list_pkgs(root=root, includes=includes)
    targets = []
    for target in pkg_params:
        # Check if package version set to be removed is actually installed:
        # old[target] contains a comma-separated list of installed versions
        if target in old and pkg_params[target] in old[target].split(','):
            targets.append(target + "-" + pkg_params[target])
        elif target in old and not pkg_params[target]:
            targets.append(target)
    if not targets:
        return {}

    systemd_scope = _systemd_scope()

    errors = []
    while targets:
        __zypper__(systemd_scope=systemd_scope, root=root).call('remove', *targets[:500])
        targets = targets[500:]

    _clean_cache()
    new = list_pkgs(root=root, includes=includes)
    ret = salt.utils.data.compare_dicts(old, new)

    if errors:
        raise CommandExecutionError(
            'Problem encountered removing package(s)',
            info={'errors': errors, 'changes': ret}
        )

    return ret
234135
def clean_dists(self, _args):
        """"""
        ctx = self.ctx
        if exists(ctx.dist_dir):
            shutil.rmtree(ctx.dist_dir)
895738
def clean_build(self):
        
        import shutil

        if self.build_fs.exists:
            try:
                shutil.rmtree(self.build_fs.getsyspath('/'))
            except NoSysPathError:
                pass
1080197
def _clean_args(sys_argv, args):
    
    base = [x for x in sys_argv if
            x.startswith("-") or not args.datadir == os.path.abspath(os.path.expanduser(x))]
    # Remove installer only options we don't pass on
    base = [x for x in base if x not in set(["--minimize-disk"])]
    if "--nodata" in base:
        base.remove("--nodata")
    else:
        base.append("--data")
    return base
947852
def clean():
    """"""
    rm("$testfn*")
    rm("*.bak")
    rm("*.core")
    rm("*.egg-info")
    rm("*.orig")
    rm("*.pyc")
    rm("*.pyd")
    rm("*.pyo")
    rm("*.rej")
    rm("*.so")
    rm("*.~")
    rm("*__pycache__")
    rm(".coverage")
    rm(".tox")
    rm(".coverage")
    rm("build")
    rm("dist")
    rm("docs/_build")
    rm("htmlcov")
    rm("tmp")
    rm("venv")
1172935
function cleanup() {
  const artifacts = ['.requirements'];
  if (this.options.zip) {
    if (this.serverless.service.package.individually) {
      this.targetFuncs.forEach(f => {
        artifacts.push(path.join(f.module, '.requirements.zip'));
        artifacts.push(path.join(f.module, 'unzip_requirements.py'));
      });
    } else {
      artifacts.push('.requirements.zip');
      artifacts.push('unzip_requirements.py');
    }
  }

  return BbPromise.all(
    artifacts.map(artifact =>
      fse.removeAsync(path.join(this.servicePath, artifact))
    )
  );
}
179029
def _cleanup():
    '''
    
    '''
    for inst in _ACTIVE[:]:
        res = inst.isalive()
        if res is not True:
            try:
                _ACTIVE.remove(inst)
            except ValueError:
                # This can happen if two threads create a new Terminal instance
                # It's harmless that it was already removed, so ignore.
                pass
443804
def _CleanupInstall(self):
    """"""
    if os.path.exists(self.install_path):
      shutil.rmtree(self.install_path)
      if os.path.exists(self.install_path):
        raise RuntimeError("Install path still exists: %s" % self.install_path)

    # Deliberately don't check return code, since service may not be installed.
    subprocess.call(["sc", "stop", self.service_name])
1227059
def cleanup():
    
    script_dir = os.path.dirname(__file__) if not os.path.islink(__file__) else os.path.dirname(os.readlink(__file__))
    script_dir = os.path.realpath(os.path.join(script_dir, ".."))
    shutil.rmtree(os.path.join(script_dir, "dist"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "tmp"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "urh.egg-info"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "src", "urh.egg-info"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "src", "urh", "tmp"), ignore_errors=True)
485955
def cleanup(self):
        
        try:
            self.unload_lime()
        except AttributeError as ex:
            pass
        self.tunnel.cleanup()
        self.shell.cleanup()
116506
def uninstall(self):
        """"""
        if self.is_installed():
            installed = self.installed_dir()
            if installed.is_symlink():
                installed.unlink()
            else:
                shutil.rmtree(str(installed))
686108
def clean_env(uchroot_cmd, varnames):
    """"""
    env = uchroot_cmd["/usr/bin/env"]
    __clean_env = env["-u", ",".join(varnames)]
    return __clean_env
775256
def install_dependencies(dependencies, verbose=False):
    """"""
    if not dependencies:
        return

    stdout = stderr = None if verbose else subprocess.DEVNULL
    with tempfile.TemporaryDirectory() as req_dir:
        req_file = Path(req_dir) / "requirements.txt"

        with open(req_file, "w") as f:
            for dependency in dependencies:
                f.write(f"{dependency}\n")

        pip = ["python3", "-m", "pip", "install", "-r", req_file]
        # Unless we are in a virtualenv, we need --user
        if sys.base_prefix == sys.prefix and not hasattr(sys, "real_prefix"):
            pip.append("--user")

        try:
            subprocess.check_call(pip, stdout=stdout, stderr=stderr)
        except subprocess.CalledProcessError:
            raise Error(_("failed to install dependencies"))

        # Reload sys.path, to find recently installed packages
        importlib.reload(site)
601351
def clean():
    """"""
    shutil.rmtree('{PROJECT_NAME}.egg-info'.format(PROJECT_NAME=PROJECT_NAME), ignore_errors=True)
    shutil.rmtree('build', ignore_errors=True)
    shutil.rmtree('dist', ignore_errors=True)
    shutil.rmtree('htmlcov', ignore_errors=True)
    shutil.rmtree('__pycache__', ignore_errors=True)
1269129
def cleanup_files_on_ev3():
    """"""

    list = get_base_ev3dev_cmd() + ['cleanup']

    env = os.environ.copy()
    env["PYTHONUSERBASE"] = THONNY_USER_BASE
    proc = subprocess.Popen(list, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
                            universal_newlines=True, env=env)
    dlg = MySubprocessDialog(get_workbench(), proc, "Delete files in homedir on EV3", autoclose=False)
    dlg.wait_window()