All the packages found in 'where' that pass the 'include' filter, but
        not the 'exclude' filter.
329712
def _find_packages_iter(cls, where, exclude, include):
        
        for root, dirs, files in os.walk(where, followlinks=True):
            # Copy dirs to iterate over it, then empty dirs.
            all_dirs = dirs[:]
            dirs[:] = []

            for dir in all_dirs:
                full_path = os.path.join(root, dir)
                rel_path = os.path.relpath(full_path, where)
                package = rel_path.replace(os.path.sep, '.')

                # Skip directory trees that are not valid packages
                if ('.' in dir or not cls._looks_like_package(full_path)):
                    continue

                # Should this package be included?
                if include(package) and not exclude(package):
                    yield package

                # Keep searching subdirectories, as there may be more packages
                # down there, even if the parent was excluded.
                dirs.append(dir)
713832
def setup(self):
        """"""
        super(RequireJSFilter, self).setup()

        excluded_files = []
        for bundle in self.excluded_bundles:
            excluded_files.extend(
                map(lambda f: os.path.splitext(f)[0],
                    bundle.contents)
            )

        if excluded_files:
            self.argv.append(
                'exclude={0}'.format(','.join(excluded_files))
            )
285072
def _filter_packages(self):
        
        global LOG_PLUGINS

        filter_plugins = filter_project_plugins()
        if not filter_plugins:
            if LOG_PLUGINS:
                logger.info("No project filters are enabled. Skipping filtering")
                LOG_PLUGINS = False
            return

        # Make a copy of self.packages_to_sync keys
        # as we may delete packages during iteration
        packages = list(self.packages_to_sync.keys())
        for package_name in packages:
            for plugin in filter_plugins:
                if plugin.check_match(name=package_name):
                    if package_name not in self.packages_to_sync:
                        logger.debug(
                            f"{package_name} not found in packages to sync - "
                            + f"{plugin.name} has no effect here ..."
                        )
                    else:
                        del self.packages_to_sync[package_name]
570597
public static String[] getMatchingPaths(final String[] includes,
			final String[] excludes, final String baseDir) {
		DirectoryScanner scanner = new DirectoryScanner();
		scanner.setBasedir(baseDir);
		if (includes != null && includes.length > 0){
			scanner.setIncludes(includes);
		}
		if (excludes != null && excludes.length > 0){
			scanner.setExcludes(excludes);
		}
		scanner.scan();
		return scanner.getIncludedFiles();
	}
288549
protected boolean checkExcludePackages(String classPackageName) {
		if (excludePackages != null && excludePackages.length > 0) {
			WildcardHelper wildcardHelper = new WildcardHelper();

			// we really don't care about the results, just the boolean
			Map<String, String> matchMap = new HashMap<String, String>();

			for (String packageExclude : excludePackages) {
				int[] packagePattern = wildcardHelper.compilePattern(packageExclude);
				if (wildcardHelper.match(matchMap, classPackageName, packagePattern)) {
					return false;
				}
			}
		}
		return true;
	}
1102393
def is_filtered(self, relpath):
        """"""
        # Only include files under the parent_dir
        if relpath.startswith("../"):
            return True

        # Ignore files that we don't want timestamps from
        if self.timestamps_for is not None and type(self.timestamps_for) is list:
            match = False
            for line in self.timestamps_for:
                if fnmatch.fnmatch(relpath, line):
                    match = True
                    break
            if not match:
                return True

        # Matched is true by default if
        # * Have exclude
        # * No exclude and no include
        matched = self.exclude or not any([self.exclude, self.include])

        # Anything not matching exclude gets included
        if self.exclude:
            for line in self.exclude:
                if fnmatch.fnmatch(relpath, line):
                    matched = False

        # Anything matching include gets included
        if self.include:
            for line in self.include:
                if fnmatch.fnmatch(relpath, line):
                    matched = True
                    break

        return not matched
142634
def compile_excludes(self):
        """"""
        self.compiled_exclude_files = []
        for pattern in self.exclude_files:
            try:
                self.compiled_exclude_files.append(re.compile(pattern))
            except re.error as e:
                raise ValueError(
                    "Bad python regex in exclude '%s': %s" % (pattern, str(e)))
1359215
def exclude_by_filter(self, filename, module_name):
        '''
        
        '''
        for exclude_filter in self._exclude_filters:  # : :type exclude_filter: ExcludeFilter
            if exclude_filter.is_path:
                if glob_matches_path(filename, exclude_filter.name):
                    if exclude_filter.exclude:
                        pydev_log.debug("File %s ignored by filter %s" % (filename, exclude_filter.name))
                    return exclude_filter.exclude
            else:
                # Module filter.
                if exclude_filter.name == module_name or module_name.startswith(exclude_filter.name + '.'):
                    return exclude_filter.exclude
        return None
1021428
def _exclude_pkg_path(self, pkg, exclusion_path):
        
        parts = pkg.split('.') + [exclusion_path]
        return os.path.join(self.install_dir, *parts)
351910
def _check_filter_includes(self, includes: list, resource: str = "metadata"):
        
        # check resource parameter
        if resource == "metadata":
            ref_subresources = _SUBRESOURCES_MD
        elif resource == "keyword":
            ref_subresources = _SUBRESOURCES_KW
        else:
            raise ValueError("Must be one of: metadata | keyword.")

        # sub resources manager
        if isinstance(includes, str) and includes.lower() == "all":
            includes = ",".join(ref_subresources)
        elif isinstance(includes, list):
            if len(includes) > 0:
                includes = ",".join(includes)
            else:
                includes = ""
        else:
            raise TypeError("'includes' expect a list or a str='all'")
        return includes
1219441
def _is_excluded(self, path, dir_only):
        """"""

        return self.npatterns and self._match_excluded(path, self.npatterns)
925650
def filter_installed_packages(packages):
    """"""
    yb = yum.YumBase()
    package_list = yb.doPackageLists()
    temp_cache = {p.base_package_name: 1 for p in package_list['installed']}

    _pkgs = [p for p in packages if not temp_cache.get(p, False)]
    return _pkgs
600074
function execExclude(file) {
    var result = false;
    excludeList.every(function (item) {
      if (minimatch(file, item)) {
        result = true;
      }
      return !result;
    });
    return result;
  }
1145435
def find_package(name, installed, package=False):
    '''
    '''
    if package:
        name = name.lower()
        tests = (
            lambda x: x.user and name == x.name.lower(),
            lambda x: x.local and name == x.name.lower(),
            lambda x: name == x.name.lower(),
        )
    else:
        tests = (
            lambda x: x.user and name in x.import_names,
            lambda x: x.local and name in x.import_names,
            lambda x: name in x.import_names,
        )

    for t in tests:
        try:
            found = list(filter(t, installed))
            if found and not found[0].is_scan:
                return found[0]
        except StopIteration:
            pass
    return None
897912
def has_contents_for(self, package):
        """"""

        pfx = package + '.'

        for p in self.iter_distribution_names():
            if p == package or p.startswith(pfx):
                return True
621781
def exclude(self, *args, **kwargs):
        
        if args or kwargs:
            self.q_filters = Q(self.q_filters & ~Q(*args, **kwargs))
        return self
529625
async function filterFiles(files) {
    const clearModule = replace(/^\.\//, '');
    const resources = files | filter(test(/^((icon\.png)|(README(\.\w+)?\.md))$/));
    const missing = without(files, requiredFiles);

    if (missing.length > 0) {
        return reject(Error(`missing ${missing.join(', ')} from the project`));
    }

    if (!contains('icon.png', files)) {
        emitWarning('compiling app without providing an icon.png file');
    }

    const infoFiles = await listFiles('info')
        | filter(test(/[a-z]{2}(_[A-Z]{2,3})?\.md/))
        | map(path.join('info/', _));

    return fs.readFileAsync('index.js', 'utf-8')
        .then(inspect)
        .then(over(lensProp('modules'), filter(startsWith('./'))))
        .then(({ code, modules }) => ({
            code,
            files: union(modules.map(clearModule),
                [...resources, ...requiredFiles, ...infoFiles])
        }));
}