Find files including those in subrepositories.
519934
def find_all_files(self):
		
		files = self.find_files()
		subrepo_files = (
			posixpath.join(subrepo.location, filename)
			for subrepo in self.subrepos()
			for filename in subrepo.find_files()
		)
		return itertools.chain(files, subrepo_files)
999830
def finddirs(pattern, path='.', exclude=None, recursive=True):
    """"""
    import fnmatch
    import os
    if recursive:
        for root, dirnames, filenames in os.walk(path):
            for pat in _to_list(pattern):
                for dirname in fnmatch.filter(dirnames, pat):
                    dirpath = join(abspath(root), dirname)
                    for excl in _to_list(exclude):
                        if excl and fnmatch.fnmatch(dirpath, excl):
                            break
                    else:
                        yield dirpath
    else:
        for pat in _to_list(pattern):
            for dirname in fnmatch.filter(listdirs(path), pat):
                dirpath = join(abspath(path), dirname)
                for excl in _to_list(exclude):
                    if excl and fnmatch.fnmatch(dirpath, excl):
                        break
                else:
                    yield dirpath
483914
def collect_modules(self):
        """"""
        for path, dirlist, filelist in os.walk(self.root):
            for name in fnmatch.filter(filelist, self.filter):
                if self.is_git_file(path, name):
                    yield (os.path.join(path, name), [])
666024
def find_invalid_filenames(filenames, repository_root):
    
    errors = []
    for filename in filenames:
        if not os.path.abspath(filename).startswith(repository_root):
            errors.append((filename, 'Error: File %s does not belong to '
                           'repository %s' % (filename, repository_root)))
        if not os.path.exists(filename):
            errors.append((filename,
                           'Error: File %s does not exist' % (filename, )))
        if os.path.isdir(filename):
            errors.append((filename,
                           'Error: %s is a directory. Directories are'
                           ' not yet supported' % (filename, )))

    return errors
128656
def grab_sub_repo(repositories, repos):
    
    for i, repo in enumerate(repositories):
        if repos in repo:
            sub = repositories[i].replace(repos, "")
            repositories[i] = repos
            return sub
    return ""
865781
def find_repositories_by_walking_without_following_symlinks(path):
    """"""
    repos = []
    for dirpath, dirnames, filenames in os.walk(path, followlinks=False):
        for dotdir in set(dirnames) & DOTDIRS:
            repos.append((dirpath, dotdir))
    return repos
833008
def includes(self):
        """"""

        incs = self.combined_properties('includes')

        processed_incs = []
        for prop in incs:
            if isinstance(prop, str):
                processed_incs.append(prop)
            else:
                processed_incs.append(os.path.join(*prop))

        # All include paths are relative to base directory of the
        fullpaths = [os.path.normpath(os.path.join('.', x)) for x in processed_incs]
        fullpaths.append(os.path.normpath(os.path.abspath(self.build_dirs()['build'])))

        return fullpaths
1290636
def match_files(self, matched, unmatched):
        """"""
        this_match = set(self.file_filter(unmatched))
        matched |= this_match
        unmatched -= this_match
216546
def find(pattern, path='.', exclude=None, recursive=True):
    """"""
    import fnmatch
    import os

    if recursive:
        for root, dirnames, filenames in os.walk(path):
            for pat in _to_list(pattern):
                for filename in fnmatch.filter(filenames, pat):
                    filepath = join(abspath(root), filename)
                    for excl in _to_list(exclude):
                        if excl and fnmatch.fnmatch(filepath, excl):
                            break
                    else:
                        yield filepath
    else:
        for pat in _to_list(pattern):
            for filename in fnmatch.filter(list(path), pat):
                filepath = join(abspath(path), filename)
                for excl in _to_list(exclude):
                    if excl and fnmatch.fnmatch(filepath, excl):
                        break
                    else:
                        yield filepath
77432
protected File[] listRepositoryChoices() {
        // check current location
        String currentDir = System.getProperty("log.repository.root");
        if (currentDir == null)
            currentDir = System.getProperty("user.dir");
        File logDir = new File(currentDir);
        if (logDir.isDirectory()) {
            File[] result = RepositoryReaderImpl.listRepositories(logDir);
            if (result.length == 0 && (RepositoryReaderImpl.containsLogFiles(logDir) || tailInterval > 0)) {
                return new File[] { logDir };
            } else {
                return result;
            }
        } else {
            return new File[] {};
        }
    }
801673
def find_files_for_use(self, all_files):
        
        for path in all_files:
            # Find the path relative to the parent dir
            relpath = self.relpath_for(path)

            # Don't care about the ./
            if relpath.startswith("./"):
                relpath = relpath[2:]

            # Only care about paths that aren't filtered
            if not self.is_filtered(relpath):
                yield Path(path, relpath)
437018
function filesFromFileSet (dirname, fileset) {
  if (!fileset.includes || !fileset.includes.length) {
    return [];
  }
  return fileset.includes
    .filter(include => !glob.hasMagic(include))
    .map(include => path.join(dirname, include));
}
155878
def files(self):
        """"""
        contents = self.paths
        contents = (BinFile(path.path) for path in contents if path.is_file)
        return contents
500895
def get_repositories(path):
    
    return [get_repository(os.path.join(path, subdir))
            for subdir in os.listdir(path)
            if os.path.isdir(
            os.path.join(path, subdir, '.git'))]
250343
def files_in_subdir(dir, subdir):
    """"""
    paths = []
    for (path, dirs, files) in os.walk(os.path.join(dir, subdir)):
        for file in files:
            paths.append(os.path.relpath(os.path.join(path, file), dir))
    return paths
1222656
def _isRepositoryReady(self):
        """"""
        return os.path.exists(os.path.join(self._absWorkdir(), '.hg'))
606292
def find_data_files(self, package, src_dir):
        """'"""
        patterns = self._get_platform_patterns(
            self.package_data,
            package,
            src_dir,
        )
        globs_expanded = map(glob, patterns)
        # flatten the expanded globs into an iterable of matches
        globs_matches = itertools.chain.from_iterable(globs_expanded)
        glob_files = filter(os.path.isfile, globs_matches)
        files = itertools.chain(
            self.manifest_files.get(package, []),
            glob_files,
        )
        return self.exclude_data_files(package, src_dir, files)