Given a mapping of extras to dependencies, strip off
        environment markers and filter out any dependencies
        not matching the markers.
358644
def _filter_extras(dm):
        
        for extra in list(filter(None, dm)):
            new_extra = extra
            reqs = dm.pop(extra)
            new_extra, _, marker = extra.partition(':')
            fails_marker = marker and (
                invalid_marker(marker)
                or not evaluate_marker(marker)
            )
            if fails_marker:
                reqs = []
            new_extra = safe_extra(new_extra) or None

            dm.setdefault(new_extra, []).extend(reqs)
        return dm
252655
def _cleanup(self):
        """"""
        self._expkg = None
        self._extmp = None
        self._flag_e = True
        self._ifile.close()
213254
def _rmv_deps(self, dependencies, package):
        
        removes = []
        dependencies.append(package)
        self._check_if_used(dependencies)
        for dep in dependencies:
            if dep not in self.skip and GetFromInstalled(dep).name():
                ver = GetFromInstalled(dep).version()
                removes.append(dep + ver)
                self._removepkg(dep)
        return removes
765086
function analyzeDependencies(component) {
  const checkList = ['base'];

  search(
    dependencyTree({
      directory: dir,
      filename: path.join(dir, component, 'index.js'),
      filter: path => !~path.indexOf('node_modules')
    }),
    component,
    checkList
  );

  if (!whiteList.includes(component)) {
    checkList.push(component);
  }

  return checkList.filter(item => checkComponentHasStyle(item));
}
334477
public void removeDependency(T from, T to) {
      lock.writeLock().lock();
      try {
         Set<T> dependencies = outgoingEdges.get(from);
         if (dependencies == null || !dependencies.contains(to)) {
            throw new IllegalArgumentException("Inexistent dependency");
         }
         dependencies.remove(to);
         incomingEdges.get(to).remove(from);
      } finally {
         lock.writeLock().unlock();
      }
   }
911073
def remove(self, addon, dev=False):
        """"""
        dependencies = self.get_dependency_manager(dev=dev)
        other_dependencies = self.get_dependency_manager(dev=not dev)
        self.stdout.write(style.format_command('Removing', addon))
        removed = dependencies.remove(addon, warn=False)
        if not removed:
            removed = other_dependencies.remove(addon, warn=False)

        if removed:
            self.build()
        else:
            exception = '%s is not installed.' % Dependency(addon).to_stdout()
            self.stdout.write(style.red(exception))
36473
def _resolve_dependencies(self, cur, dependencies):
        
        list_of_deps_ids = []
        _list_of_deps_unresolved = []
        _is_deps_resolved = True
        for k, v in dependencies.items():
            pgpm.lib.utils.db.SqlScriptsHelper.set_search_path(cur, self._pgpm_schema_name)
            cur.execute("SELECT _find_schema('{0}', '{1}')"
                        .format(k, v))
            pgpm_v_ext = tuple(cur.fetchone()[0][1:-1].split(','))
            try:
                list_of_deps_ids.append(int(pgpm_v_ext[0]))
            except:
                pass
            if not pgpm_v_ext[0]:
                _is_deps_resolved = False
                _list_of_deps_unresolved.append("{0}: {1}".format(k, v))

        return _is_deps_resolved, list_of_deps_ids, _list_of_deps_unresolved
626320
def remove(self, flag, extra):
        
        self.flag = flag
        self.extra = extra
        self.dep_path = self.meta.log_path + "dep/"
        dependencies, rmv_list = [], []
        self.removed = self._view_removed()
        if not self.removed:
            print("")   # new line at end
        else:
            msg = "package"
            if len(self.removed) > 1:
                msg = msg + "s"
            try:
                if self.meta.default_answer in ["y", "Y"]:
                    remove_pkg = self.meta.default_answer
                else:
                    remove_pkg = raw_input(
                        "\nAre you sure to remove {0} {1} [y/N]? ".format(
                            str(len(self.removed)), msg))
            except EOFError:
                print("")   # new line at exit
                raise SystemExit()
            if remove_pkg in ["y", "Y"]:
                self._check_if_used(self.binary)
                for rmv in self.removed:
                    # If package build and install with "slpkg -s sbo <package>"
                    # then look log file for dependencies in /var/log/slpkg/dep,
                    # read and remove all else remove only the package.
                    if (os.path.isfile(self.dep_path + rmv) and
                            self.meta.del_deps in ["on", "ON"] or
                            os.path.isfile(self.dep_path + rmv) and
                            "--deps" in self.extra):
                        dependencies = self._view_deps(self.dep_path, rmv)
                        if dependencies and self._rmv_deps_answer() in ["y",
                                                                        "Y"]:
                            rmv_list += self._rmv_deps(dependencies, rmv)
                        else:
                            rmv_list += self._rmv_pkg(rmv)
                    else:
                        rmv_list += self._rmv_pkg(rmv)
                # Prints all removed packages
                self._reference_rmvs(rmv_list)
1357372
function filterDepWithoutEntryPoints(dep) {
  // Return true if we want to add a dependency to externals
  try {
    // If the root of the dependency has an index.js, return true
    if (fs.existsSync(path.join(__dirname, `node_modules/${dep}/index.js`))) {
      return false;
    }
    const pgkString = fs
      .readFileSync(path.join(__dirname, `node_modules/${dep}/package.json`))
      .toString();
    const pkg = JSON.parse(pgkString);
    const fields = ['main', 'module', 'jsnext:main', 'browser'];
    return !fields.some(field => field in pkg);
  } catch (e) {
    console.log(e);
    return true;
  }
}
986242
def delete_deps(self, conf, images):
        """"""
        for dependency_name, _ in conf.dependency_images():
            image = images[dependency_name]
            if image.deleteable_image:
                log.info("Removing un-needed image {0}".format(image.image_name))
                conf.harpoon.docker_api.remove_image(image.image_name)
323656
private void reduceDependencies(Map<ResolvedFolder, AbstractDependencyResolver> topFolderResolverMap) {
        //reduce the dependencies and duplicates files
        Set<String> topFolders = new HashSet<>();
        topFolderResolverMap.entrySet().forEach((resolverEntry) -> topFolders.addAll(resolverEntry.getKey().getTopFoldersFound().keySet()));

        // Take all resolvers and their folders
        for (Map.Entry<ResolvedFolder, AbstractDependencyResolver> entry : topFolderResolverMap.entrySet()) {
            AbstractDependencyResolver resolver = entry.getValue();
            ResolvedFolder resolvedFolder = entry.getKey();
            if (resolver != null && resolvedFolder != null) {
                // All folders of the current resolver (top folders and sub folders)
                Set<String> foldersFound = resolvedFolder.getTopFoldersFound().keySet();
                // Get the relevant folders for the current resolver (can be all folders or top folders only ...)
                Collection<String> foldersForResolver = resolver.getRelevantScannedFolders(foldersFound);
                // Remove all the irrelevant folders
                resolvedFolder.getTopFoldersFound().keySet().removeIf(folder -> !foldersForResolver.contains(folder));
            }
        }

    }
1004313
private void unloadIncompatiblePlugins() {
    // loop as long as the previous loop ignored some plugins. That allows to support dependencies
    // on many levels, for example D extends C, which extends B, which requires A. If A is not installed,
    // then B, C and D must be ignored. That's not possible to achieve this algorithm with a single
    // iteration over plugins.
    Set<String> removedKeys = new HashSet<>();
    do {
      removedKeys.clear();
      for (PluginInfo plugin : pluginInfosByKeys.values()) {
        if (!isCompatible(plugin, runtime, pluginInfosByKeys)) {
          removedKeys.add(plugin.getKey());
        }
      }
      for (String removedKey : removedKeys) {
        pluginInfosByKeys.remove(removedKey);
      }
    } while (!removedKeys.isEmpty());
  }
1317374
def dependencies(self):
        
        extra_input_rows = max(0, self.window_length - 1)
        out = {}
        for term in self.inputs:
            out[term] = extra_input_rows
        out[self.mask] = 0
        return out
884680
def clean_extra(self):
        """"""
        extra_paths = self.get_extra_paths()
        for path in extra_paths:
            if not os.path.exists(path):
                continue
            if os.path.isdir(path):
                self._clean_directory(path)
            else:
                self._clean_file(path)
1003520
def prune(force):
    """"""
    if not force:
        echo_warning(
            'Removing configuration of environments that may be in use will leave '
            'them in a potentially unusable state. If you wish to proceed (e.g. you '
            'have just restarted your machine), you may use the -f / --force flag.'
        )
        abort(code=2)

    checks = get_configured_checks()
    for check in checks:
        envs = get_configured_envs(check)

        if envs:
            echo_info('{}:'.format(check))
            for env in envs:
                echo_waiting('Removing `{}`... '.format(env), nl=False, indent=True)
                remove_env_data(check, env)
                echo_success('success!')

        remove_env_root(check)
1055264
def remove_dependency(self, p_from_todo, p_to_todo, p_leave_tags=False):
        
        dep_id = p_from_todo.tag_value('id')

        if dep_id:
            self._depgraph.remove_edge(hash(p_from_todo), hash(p_to_todo))
            self.dirty = True

        # clean dangling dependency tags
        if dep_id and not p_leave_tags:
            p_to_todo.remove_tag('p', dep_id)

            if not self.children(p_from_todo, True):
                p_from_todo.remove_tag('id')
                del self._parentdict[dep_id]
486194
def clean_dependencies(self):
        
        def remove_tag(p_todo, p_tag, p_value):
            """
            Removes a tag from a todo item.
            """
            p_todo.remove_tag(p_tag, p_value)
            self.dirty = True

        def clean_parent_relations():
            """
            Remove id: tags for todos without child todo items.
            """

            for todo in [todo for todo in self._todos if todo.has_tag('id')]:
                value = todo.tag_value('id')
                if not self._depgraph.has_edge_id(value):
                    remove_tag(todo, 'id', value)
                    del self._parentdict[value]

        def clean_orphan_relations():
            """
            Remove p: tags for todos referring to a parent that is not in the
            dependency graph anymore.
            """

            for todo in [todo for todo in self._todos if todo.has_tag('p')]:
                for value in todo.tag_values('p'):
                    parent = self.todo_by_dep_id(value)

                    if not self._depgraph.has_edge(hash(parent), hash(todo)):
                        remove_tag(todo, 'p', value)

        self._depgraph.transitively_reduce()
        clean_parent_relations()
        clean_orphan_relations()