Child files (non-recursive)
429266
def sub_files(path, invisible=False):
    
    files = [x for x in os.listdir(path) if os.path.isfile(os.path.join(path, x))]
    if not invisible:
        files = [x for x in files if not x.startswith('.')]

    return files
619546
function walkTree(directory, callback) {
    callback(directory);
    directory.directories.forEach(childDirectory => walkTree(childDirectory, callback));
}
290300
def _glob_events_files(self, paths, recursive):
    

    event_files = []
    for path in paths:
      dirs = tf.gfile.Glob(path)
      dirs = filter(lambda x: tf.gfile.IsDirectory(x), dirs)
      for dir in dirs:
        if recursive:
          dir_files_pair = [(root, filenames) for root, _, filenames in tf.gfile.Walk(dir)]
        else:
          dir_files_pair = [(dir, tf.gfile.ListDirectory(dir))]

        for root, filenames in dir_files_pair:
          file_names = fnmatch.filter(filenames, '*.tfevents.*')
          file_paths = [os.path.join(root, x) for x in file_names]
          file_paths = filter(lambda x: not tf.gfile.IsDirectory(x), file_paths)
          event_files += file_paths
    return event_files
213683
private void recurse(File file, IResourceVisitor visitor, String path)
			throws IOException {
		File[] files = file.listFiles();
		if (files == null) {
			return;
		}
		for (File child : files) {
			String childName = path + (path.length() == 0 ? "" : "/") //$NON-NLS-1$ //$NON-NLS-2$
					+ child.getName();
			boolean result = visitor.visitResource(new VisitorResource(child,
					child.lastModified(), childName), childName);
			if (child.isDirectory() && result) {
				recurse(child, visitor, childName);
			}
		}
	}
957096
function filterChildren(children, depth) {
	if(depth == 1) {
		let found = false;

		for(let item of children) {
			if(item.name == 'package.json') found = true;
			if(item.name != 'src') item.enterDir = false;
		}

		if(!found) throw(new Error());
	}

	return(children);
}
842686
function(files, callback) {
      var recursiveCp = files.map(function(file) {
        return function(callback) {
          _cp({ source: path.join(directory, file), destination: options.destination }, callback);
        };
      });
      async.series(recursiveCp, callback);
    }
784904
function listXmlFiles(path, recursive) {
  try {
    var allFiles = recursive ? read(path) : fs.readdirSync(path);

    var xmlFiles = allFiles
      .map(function(file) {
        return fspath.join(path, file);
      })
      // Fiter out non-files
      .filter(function(file) {
        return fs.statSync(file).isFile();
      })
      // Only return files ending in '.xml'
      .filter(function(file) {
        return file.slice(-4) === ".xml";
      });
    // No files returned
    if (!xmlFiles.length > 0) {
      return new Error("No xml files found");
    } else {
      // Return the array of files ending in '.xml'
      return xmlFiles;
    }
  } catch (e) {
    throw e;
  }
}
631095
private static void dirToTarArchiveOutputStreamRecursive(FileStatus dirFileStatus, FileSystem fs,
      Optional<Path> destDir, TarArchiveOutputStream tarArchiveOutputStream) throws IOException {

    Preconditions.checkState(fs.isDirectory(dirFileStatus.getPath()));

    Path dir = destDir.isPresent() ? new Path(destDir.get(), dirFileStatus.getPath().getName())
        : new Path(dirFileStatus.getPath().getName());
    dirToTarArchiveOutputStream(dir, tarArchiveOutputStream);

    for (FileStatus childFileStatus : fs.listStatus(dirFileStatus.getPath())) {
      Path childFile = new Path(dir, childFileStatus.getPath().getName());

      if (fs.isDirectory(childFileStatus.getPath())) {
        dirToTarArchiveOutputStreamRecursive(childFileStatus, fs, Optional.of(childFile), tarArchiveOutputStream);
      } else {
        try (FSDataInputStream fsDataInputStream = fs.open(childFileStatus.getPath())) {
          fileToTarArchiveOutputStream(childFileStatus, fsDataInputStream, childFile, tarArchiveOutputStream);
        }
      }
    }
  }
482084
def load_children(self, f):
        """"""
        while True:
            line = self.readline(f)
            if line[0] == '&':
                if line[1:].startswith("END"):
                    check_name = line[4:].strip().upper()
                    if check_name != self.__name:
                        raise FileFormatError("CP2KSection end mismatch, pos=%s", f.tell())
                    break
                else:
                    section = CP2KSection()
                    section.load(f, line)
                    self.append(section)
            else:
                keyword = CP2KKeyword()
                keyword.load(line)
                self.append(keyword)
782644
def listFiles(self):
        
        def fn(dirName, level, files):
            if level == self.levelNo-1:
                for fileName in os.listdir(dirName):
                    if fileName != "lock":
                        absFileName = os.path.join(dirName, fileName)
                        files.append(absFileName)
            else:
                for subDir in os.listdir(dirName):
                    if subDir != "lock":
                        absDirName = os.path.join(dirName, subDir)
                        assert os.path.isdir(absDirName)
                        fn(absDirName, level+1, files)
        files = []
        fn(self.rootDir, 0, files)
        return files
28388
def createFileList(self):
        """"""
        global childFileListDownload
        if childFileListDownload is None or not childFileListDownload.is_alive():
            childFileListDownload = multiprocessing.Process(target=self.createFileListHTTP)
            childFileListDownload.start()
110228
function Child(file) {
  if (!(this instanceof Child))
    return new Child(file);

  EventEmitter.call(this);

  bindExit();
  children.add(this);

  this.init(file);
}
597825
def list(path, filename=None, start=None, stop=None, recursive=False, directories=False):
        
        path = uri_to_path(path)

        if not filename and recursive:
            return listrecursive(path)

        if filename:
            if os.path.isdir(path):
                path = os.path.join(path, filename)
            else:
                path = os.path.join(os.path.dirname(path), filename)
        else:
            if os.path.isdir(path) and not directories:
                path = os.path.join(path, "*")

        files = glob.glob(path)

        if not directories:
            files = [fpath for fpath in files if not os.path.isdir(fpath)]

        files.sort()
        files = select(files, start, stop)
        return files
13610
def recursive_generate_copy_in(copy_in, current_path)
      limited_files_of(current_path) { |file| copy_in << file }
      directories_of(current_path) do |dir|
        recursive_generate_copy_in(copy_in, ::File.join(dir))
      end
      true
    end
843486
private void recursivels(FileSystem fs, Path p, List<FileStatus> out) 
  throws IOException {
    FileStatus fstatus = fs.getFileStatus(p);
    if (!fstatus.isDir()) {
      out.add(fstatus);
      return;
    }
    else {
      out.add(fstatus);
      FileStatus[] listStatus = fs.listStatus(p);
      for (FileStatus stat: listStatus) {
        recursivels(fs, stat.getPath(), out);
      }
    }
  }
672247
function (options, iterationInfo, modules) {

        // Ignore explicitly excluded directories
        if (options.excludeDirs) {
            var match = iterationInfo.fileName.match(options.excludeDirs);
            if (match)
                return;
        }

        // Recursively call requireAll on each child directory
        var subIterationInfo = _.clone(iterationInfo);
        ++subIterationInfo.depth;
        subIterationInfo.dirName = iterationInfo.absoluteFullPath;

        //process subtree recursively
        var subTreeResult = doInterations(options, subIterationInfo);

        //omit empty dirs
        if (_.isEmpty(subTreeResult))
            return;

        //add to the list or to the subtree
        if (options.mode === 'list') {
            //check uniqueness
            _.forEach(subTreeResult, function (value, index) {
                if (options.useVersions === true) {
                    modules[index] = modules[index] || {};
                    _.forEach(value, function (versionValue, versionIndex) {
                        if (modules[index][versionIndex])
                            throw new Error("Identity '" + index + "' with version '" + versionIndex + "' is already registered by module at '" + modules[index][versionIndex].absoluteFullPath + "'");
                        modules[index][versionIndex] = versionValue;
                    });
                }
                else {
                    if (modules[index])
                        throw new Error("Identity '" + index + "' is already registered by module at '" + modules[index].absoluteFullPath + "'");
                    modules[index] = value;
                }
            })
        }
        else if (options.mode === 'tree') {
            if (options.markDirectories !== false) {
                subTreeResult.isDirectory = true;
            }

            var identity = generateIdentity(options, iterationInfo);
            modules[identity] = subTreeResult;
        }
        else
            throw new Error('Unknown mode');
    }
383203
def _init_children(self, parent):
        

        for dir_name in self.get_children_paths(parent.full_path):
            child = Node(name=dir_name, parent=parent)
            parent.children.append(child)
            self._init_children(child)