Returns True if there are no possible matches for any
        subdirectories of this :class:`FileSetState`.

        When this :class:FileSetState is used for an 'include', a return of
        `True` means we can exclude all subdirectories.
963777
def no_possible_matches_in_subdirs(self):
        """"""
        return (not self.parent_has_patterns and self.matched_inherit.empty()
                and self.matched_and_subdir.empty() and self.unmatched.empty())
421068
def is_excluded(root, excludes):
    
    sep = os.path.sep
    if not root.endswith(sep):
        root += sep
    for exclude in excludes:
        if root.startswith(exclude):
            return True
    return False
151472
def match_local(self, prefix, includes, excludes):
        
        includes_pattern = r"|".join([fnmatch.translate(x) for x in includes])
        excludes_pattern = r"|".join([fnmatch.translate(x) for x in excludes]) or r"$."
        matches = []
        for root, dirs, files in os.walk(prefix, topdown=True):
            # exclude dirs
            dirs[:] = [os.path.join(root, d) for d in dirs]
            dirs[:] = [d for d in dirs if not re.match(excludes_pattern,
                                                       d.split(root)[1])]
            # exclude/include files
            files = [os.path.join(root, f) for f in files]
            files = [os.path.join(root, f) for f in files
                     if not re.match(excludes_pattern, f)]
            files = [os.path.join(root, f) for f in files
                     if re.match(includes_pattern, f.split(prefix)[1])]
            for fname in files:
                matches.append(fname)
        return matches
1308976
def is_file_excluded(filename, excludes):
    
    # check if you need to exclude this file
    return any([exclude and re.match(exclude, filename) is not None
                for exclude in excludes])
545216
private boolean matchesExcludes( final String fileName )
    {
        for( Pattern include : m_excludes )
        {
            if( include.matcher( fileName ).matches() )
            {
                return true;
            }
        }
        return false;
    }
47168
function shouldExclude(sets) {
        for (var i = 0; i < sets.length; ++i) {
            if (!(sets[i] in exclude)) {
                return false;
            }
        }
        return true;
    }
719137
def should_be_excluded(name, exclude_patterns):
    
    for pattern in exclude_patterns:
        if fnmatch.fnmatch(name, pattern):
            return True
    return False
84309
def contains_locked_file(directory: str):
    
    for root, subdirs, files in os.walk(directory):
        for filename in files:
            file_path = os.path.join(root, filename)
            try:
                with open(file_path, 'a'):
                    pass
            except IOError:
                logger.debug(f"Locked file: {file_path}")
                return True
    return False
21445
def is_tomodir(subdirectories):
    
    required = (
        'exe',
        'config',
        'rho',
        'mod',
        'inv'
    )
    is_tomodir = True
    for subdir in required:
        if subdir not in subdirectories:
            is_tomodir = False
    return is_tomodir
956656
public boolean isSubDirectory(File file1, File file2) {
        try {
            return (file1.getCanonicalPath()+File.separator).startsWith(file2.getCanonicalPath()+File.separator);
        } catch (IOException e) {
            e.printStackTrace();
            return false;
        }
    }
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;
	}
660076
private boolean directoryContains(File directory, IGroupMember member) {
        boolean found = false;
        if (member.isGroup()) {
            File memberFile = getFile((IEntityGroup) member);
            File[] files = directory.listFiles();
            for (int i = 0; i < files.length & !found; i++) {
                found = files[i].equals(memberFile);
            }
        }
        return found;
    }
1266290
def excluded(filename):
    
    basename = os.path.basename(filename)
    for pattern in options.exclude:
        if fnmatch(basename, pattern):
            # print basename, 'excluded because it matches', pattern
            return True
1008036
private synchronized boolean isIncluded(String _clazzName) {
        if (includes.size() > 0) {
            for (String include : includes) {
                if (_clazzName.startsWith(include)) {
                    return true;

                }
            }
        } // if we dont have a list, we include nothing (to prevent circular classloader dependencies)
        return false;
    }
80798
def match(dirname, basename)
        # Potential `entries` syscall
        matches = @entries[dirname]

        pattern = @patterns[basename]
        matches = matches.select { |m| m =~ pattern }

        sort_matches(matches, basename).each do |path|
          filename = File.join(dirname, path)

          # Potential `stat` syscall
          stat = @stats[filename]

          # Exclude directories
          if stat && stat.file?
            yield filename
          end
        end
      end
209850
function (dir, search, excludedDirs) {
        excludedDirs = excludedDirs || [];

        var result = [];
        var files = fs.readdirSync(dir);
        for (var i = 0; i < files.length; i++) {
            var fullpath = path.join(dir, files[i]);
            var stat = fs.statSync(fullpath);
            if (stat.isDirectory() && (!excludedDirs.contains(fullpath))) {
                result = result.concat(utilities.recursiveFindFiles(fullpath, search));
            }
            else if (!search || (fullpath.indexOf(search) >= 0)) {
                result.push(fullpath);
            }
        }
        return result;
    }
642508
def if_none_match(self):
        
        for option in self.options:
            if option.number == defines.OptionRegistry.IF_NONE_MATCH.number:
                return True
        return False