Return all direct descendands of directory `self` for which
           `filterfn` returns True.
334613
def list(self, filterfn=lambda x: True):
        
        return [self / p for p in self.listdir() if filterfn(self / p)]
1123448
def descend(self, remote, force=False):
        
        remote_dirs = remote.split('/')
        for directory in remote_dirs:
            try:
                self.conn.cwd(directory)
            except Exception:
                if force:
                    self.conn.mkd(directory)
                    self.conn.cwd(directory)
        return self.conn.pwd()
920878
def ListDirectoryAbsolute(directory):
  """"""
  return (os.path.join(directory, path)
          for path in tf.io.gfile.listdir(directory))
100364
def _filtered_walk(path, file_filter):
		
		for root, dirs, files in os.walk(path):
			log.debug('looking in %s', root)
			log.debug('files is %s', files)
			file_filter.set_root(root)
			files = filter(file_filter, files)
			log.debug('filtered files is %s', files)
			yield (root, dirs, files)
591587
public static List<Path> getSubDirectoryPathList(Path startDirectoryPath,
			Predicate<Path> filter) {
		return getSubPathList(startDirectoryPath, Integer.MAX_VALUE,
				DirectoryAndNotSymbolicLinkFilter.and(filter));
	}
1056517
def listdir(*paths, glob=None):
    '''
    
    '''
    path = genpath(*paths)

    names = os.listdir(path)
    if glob is not None:
        names = fnmatch.filter(names, glob)

    retn = [os.path.join(path, name) for name in names]
    return retn
1038095
def getIncludeDirectories(self, engineRoot, delimiter=' '):
		
		return delimiter.join(self.resolveRoot(self.includeDirs, engineRoot))
259500
def find_and_filter_sgf_files(base_dir, min_year=None, komi=None):
    """"""
    sgf_files = []
    for dirpath, dirnames, filenames in os.walk(base_dir):
        for filename in filenames:
            if filename.endswith('.sgf'):
                path = os.path.join(dirpath, filename)
                sgf_files.append(path)

    if min_year == komi == None:
        print ("Found {} sgf_files".format(len(sgf_files)))
        return sgf_files

    f = filter_year_komi(min_year, komi)
    filtered_sgf_files = [sgf for sgf in tqdm(sgf_files) if f(sgf)]

    print("{} of {} .sgf files matched (min_year >= {}, komi = {})".format(
        len(filtered_sgf_files), len(sgf_files), min_year, komi))
    return filtered_sgf_files
108408
def ls_dir(base_dir):
    """"""
    return [
        os.path.join(dirpath.replace(base_dir, '', 1), f)
        for (dirpath, dirnames, files) in os.walk(base_dir)
        for f in files
    ]
1160751
public static List<FileStatus> listPathsRecursively(FileSystem fs, Path path, PathFilter fileFilter)
      throws IOException {
    return listPathsRecursivelyHelper(fs, Lists.<FileStatus>newArrayList(), fs.getFileStatus(path), fileFilter);
  }
1215922
def fetch_parent_dir(filepath, n=1):
    '''
    '''
    filepath = os.path.realpath(filepath)
    for i in range(n):
        filepath = os.path.dirname(filepath)
    return os.path.basename(filepath)
717234
function getDirectories(path){
  return fs.readdirSync(path).filter(function (file) {
    return fs.statSync(path + "/" + file).isDirectory();
  });	
}
14507
def get_base_modules():
    "  "

    return sorted(filter(
                  lambda x: op.isdir(op.join(MOD_DIR, x)),
                  listdir(MOD_DIR)))
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
475677
function filter(p, rules, root, isDirectory, included) {
  p = path.relative(root, p);
  for (var i in rules) {
    var rule = rules[i];
    if (isDirectory) {
      if (rule.match(p) || rule.match("/" + p) ||
          rule.match(p + "/") || rule.match("/" + p + "/")
         ) {
        return rule.negate;
      }
    } else {
      if (rule.match(p) || rule.match("/" + p)) {
        return rule.negate;
      }
    }
  }
  return included;
}
1169967
def list_distinfo_files(self):
        
        base = os.path.dirname(self.path)
        for path, checksum, size in self._get_records():
            # XXX add separator or use real relpath algo
            if not os.path.isabs(path):
                path = os.path.join(base, path)
            if path.startswith(self.path):
                yield path
329168
def _fetchFilesFromFolder(self, target, recursive):
        '''
            
        '''
        directory_items = os.walk(target)

        # If recursive is false, fetch only the first tuple
        if not recursive:
            directory_items = [next(directory_items)]

        targets = []
        for dir_name, folders, files in directory_items:
            for f in files:
                targets.append(os.path.join(dir_name, f))

        return targets