Ensure that the named snap package is not installed

    name
        The snap package
324126
def removed(name):
    '''
    
    '''

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

    old = __salt__['snap.versions_installed'](name)
    if not old:
        ret['comment'] = 'Package {0} is not installed'.format(name)
        ret['result'] = True
        return ret

    if __opts__['test']:
        ret['comment'] = 'Package {0} would have been removed'.format(name)
        ret['result'] = None
        ret['pchanges']['old'] = old[0]['version']
        ret['pchanges']['new'] = None
        return ret

    remove = __salt__['snap.remove'](name)
    ret['comment'] = 'Package {0} removed'.format(name)
    ret['result'] = True
    ret['changes']['old'] = old[0]['version']
    ret['changes']['new'] = None
    return ret
188900
def _check_if_used(self, removes):
        """"""
        if "--check-deps" in self.extra:
            package, dependency, pkg_dep = [], [], []
            for pkg in find_package("", self.dep_path):
                deps = Utils().read_file(self.dep_path + pkg)
                for rmv in removes:
                    if GetFromInstalled(rmv).name() and rmv in deps.split():
                        pkg_dep.append(
                            "{0} is dependency of the package --> {1}".format(
                                rmv, pkg))
                        package.append(pkg)
                        dependency.append(rmv)
            if package:
                if "--checklist" in self.extra:
                    text = ("Press 'spacebar' to choose packages for the remove"
                            " exception")
                    backtitle = "{0} {1}".format(self.meta.__all__,
                                                 self.meta.__version__)
                    status = False
                    choose = DialogUtil(pkg_dep, text, " !!! WARNING !!! ",
                                        backtitle, status).checklist()
                    for pkg in choose:
                        self.skip.append(pkg.split()[0])
                else:
                    self.msg.template(78)
                    print("| {0}{1}{2}".format(
                        self.meta.color["RED"], " " * 30 + "!!! WARNING !!!",
                        self.meta.color["ENDC"]))
                    self.msg.template(78)
                    for p, d in zip(package, dependency):
                        print("| {0}{1}{2} is dependency of the package --> "
                              "{3}{4}{5}".format(self.meta.color["YELLOW"], d,
                                                 self.meta.color["ENDC"],
                                                 self.meta.color["GREEN"], p,
                                                 self.meta.color["ENDC"]))
                    self.msg.template(78)
                    self._skip_remove()
641727
function installMissing( error, collected ) {
	if ( error ) {
		console.error( `checking dependencies failed: ${error.message}` );

		process.exit( 1 );
		return;
	}

	if ( collected.length < 1 ) {
		postProcess( 0 );
	} else {
		if ( !quiet ) {
			console.error( `installing missing dependencies:\n${collected.map( d => `* ${d}`).join( "\n" )}` );
		}

		const npm = Child.exec( `npm install --no-save ${collected.join( " " )}`, {
			stdio: "pipe",
		} );

		npm.stdout.pipe( process.stdout );
		npm.stderr.pipe( process.stderr );

		npm.on( "exit", postProcess );
	}
}
277561
def check_package_set(package_set, should_ignore=None):
    # type: (PackageSet, Optional[Callable[[str], bool]]) -> CheckResult
    
    if should_ignore is None:
        def should_ignore(name):
            return False

    missing = dict()
    conflicting = dict()

    for package_name in package_set:
        # Info about dependencies of package_name
        missing_deps = set()  # type: Set[Missing]
        conflicting_deps = set()  # type: Set[Conflicting]

        if should_ignore(package_name):
            continue

        for req in package_set[package_name].requires:
            name = canonicalize_name(req.project_name)  # type: str

            # Check if it's missing
            if name not in package_set:
                missed = True
                if req.marker is not None:
                    missed = req.marker.evaluate()
                if missed:
                    missing_deps.add((name, req))
                continue

            # Check if there's a conflict
            version = package_set[name].version  # type: str
            if not req.specifier.contains(version, prereleases=True):
                conflicting_deps.add((name, version, req))

        if missing_deps:
            missing[package_name] = sorted(missing_deps, key=str)
        if conflicting_deps:
            conflicting[package_name] = sorted(conflicting_deps, key=str)

    return missing, conflicting
523116
def case_sensitive_name(self, package_name):
        
        if len(self.environment[package_name]):
            return self.environment[package_name][0].project_name
722669
def not_downgrade(self, package):
        """"""
        name = split_package(package)[0]
        rep_ver = split_package(package)[1]
        ins_ver = GetFromInstalled(name).version()[1:]
        if not ins_ver:
            ins_ver = "0"
        if LooseVersion(rep_ver) < LooseVersion(ins_ver):
            self.msg.template(78)
            print("| Package {0} don't downgrade, "
                  "setting by user".format(name))
            self.msg.template(78)
            return True
1080300
def ppa(state, host, name, present=True):
    '''
    
    '''

    if present:
        yield 'apt-add-repository -y "{0}"'.format(name)

    if not present:
        yield 'apt-add-repository -y --remove "{0}"'.format(name)
161897
def ensure_source_package_dir(nb_path, pkg_name):
    """"""

    pkg_path = join(dirname(nb_path), pkg_name)

    makedirs(join(pkg_path,'notebooks'),exist_ok=True)
    makedirs(join(pkg_path, 'docs'), exist_ok=True)

    return pkg_path
494415
def ensure_packages(packages):
    """"""
    required = filter_installed_packages(packages)
    if required:
        apt_install(required, fatal=True)
271287
def anitya_specific_distro(config, message, distro=None, *args, **kw):
    

    if not distro:
        return False

    if not anitya_catchall(config, message):
        return False

    d = message['msg'].get('distro', {})
    if d:  # Have to be careful for None here
        if d.get('name', '').lower() == distro.lower():
            return True

    d = None
    p = message['msg'].get('project', {})
    if p:
        d = p.get('distro', {})
    if d:  # Have to be careful for None here
        if d.get('name', '').lower() == distro.lower():
            return True

    for pkg in message['msg'].get('message', {}).get('packages', []):
        if pkg['distro'].lower() == distro.lower():
            return True

    return False
1054405
def app_uninstall(self, package_name, keep_data=False):
        
        if keep_data:
            return self.run_cmd('uninstall', '-k', package_name)
        else:
            return self.run_cmd('uninstall', package_name)
564507
def disable_plugin(self, plugin_name):
        """"""
        plugin = self.get_plugin_info(plugin_name)
        ENABLED = os.path.join(plugin["plugin_package_abspath"], "ENABLED")
        DISABLED = os.path.join(plugin["plugin_package_abspath"], "DISABLED")
        if os.path.isfile(ENABLED):
            os.remove(ENABLED)
        self.__touch_file(DISABLED)
926234
def remove(package_name):
    
    if package_name not in packages:
        raise HolodeckException("Unknown package name " + package_name)
    for config, path in _iter_packages():
        if config["name"] == package_name:
            shutil.rmtree(path)
31094
def is_installed(name):
    
    pkgs = installed_packages()
    for pkge in pkgs:
        if pkge.name == name:
            return True
    return False
706257
def package_username(repo):
    '''
        

    '''
    package = repo.replace('-', '_')
    username = repo.split('-')[1]
    return package, username
1024627
def remove_package(identifier)
      removed = @packages.delete_if { |p| p[:id] == identifier || p[:name] == identifier }
      @need_to_update = true if removed
      removed
    end
1225593
def stop_app(self, package_name, clear=False):
        '''
        
        '''
        if clear:
            self.adb_shell(['pm', 'clear', package_name])
        else:
            self.adb_shell(['am', 'force-stop', package_name])
        return self