Finds all html files in the given destination.
519866
def find_html_files(self, destination):
        
        for root, dirs, files in os.walk(destination):
            for f in files:
                if f.endswith('.html'):
                    yield os.path.join(root, f)
149959
function findRoutes (dir, fileExtensions) {
  let files = fs.readdirSync(dir)
  let resolve = f => path.join(dir, f)
  let routes = files.filter(f => fileExtensions.indexOf(path.extname(f)) !== -1).map(resolve)
  let dirs = files.filter(f => fs.statSync(path.join(dir, f)).isDirectory()).map(resolve)
  return routes.concat(...dirs.map(subdir => findRoutes(subdir, fileExtensions)))
}
1045317
private static void traverseDirs(List<FileStatus> fileStatusesList, FileSystem hdfs,
      Path inputPath, JobFileModifiedRangePathFilter jobFileModifiedRangePathFilter)
          throws IOException
  {
    // get all the files and dirs in the current dir
    FileStatus allFiles[] = hdfs.listStatus(inputPath);
    for (FileStatus aFile: allFiles) {
      if (aFile.isDir()) {
        //recurse here
        traverseDirs(fileStatusesList, hdfs, aFile.getPath(), jobFileModifiedRangePathFilter);
      }
      else {
        // check if the pathFilter is accepted for this file
        if (jobFileModifiedRangePathFilter.accept(aFile.getPath())) {
          fileStatusesList.add(aFile);
        }
      }
    }
  }
196489
function fixAllLinks(htmlFiles) {
  const writePromises = [];
  htmlFiles.forEach(file => {
    // Update links in each html file to match flattened file structure.
    writePromises.push(fixLinks(`${docPath}/${file}.html`));
  });
  return Promise.all(writePromises);
}
27853
def FileFinderOSFromClient(args):
  
  stat_cache = filesystem.StatCache()

  opts = args.action.stat

  for path in GetExpandedPaths(args):
    try:
      content_conditions = conditions.ContentCondition.Parse(args.conditions)
      for content_condition in content_conditions:
        with io.open(path, "rb") as fd:
          result = list(content_condition.Search(fd))
        if not result:
          raise _SkipFileException()
      # TODO: `opts.resolve_links` has type `RDFBool`, not `bool`.
      stat = stat_cache.Get(path, follow_symlink=bool(opts.resolve_links))
      stat_entry = client_utils.StatEntryFromStatPathSpec(
          stat, ext_attrs=opts.collect_ext_attrs)
      yield stat_entry
    except _SkipFileException:
      pass
520032
protected void findContentFiles() throws CmsImportExportException, IOException, SAXException {

        Digester digester = new Digester();
        digester.setUseContextClassLoader(true);
        digester.setValidating(false);
        digester.setEntityResolver(new CmsXmlEntityResolver(null));
        digester.setRuleNamespaceURI(null);
        digester.setErrorHandler(new CmsXmlErrorHandler(CmsImportExportManager.EXPORT_MANIFEST));

        digester.addCallMethod("export/files/file", "addContentFile", 2);
        digester.addCallParam("export/files/file/source", 0);
        digester.addCallParam("export/files/file/uuidresource", 1);
        m_contentFiles.clear();
        digester.push(this);
        InputStream stream = null;
        try {
            stream = m_helper.getFileStream(CmsImportExportManager.EXPORT_MANIFEST);
            digester.parse(stream);
        } finally {
            if (stream != null) {
                stream.close();
            }
        }
    }
38313
function html(files, dir, useIcons, view, req) {
  return '<ul id="files" class="view-' + escapeHtml(view) + '">'
    + (view == 'details' ? (
      '<li class="header">'
      + '<span class="name">Name</span>'
      + '<span class="size">Size</span>'
      + '<span class="date">Modified</span>'
      + '</li>') : '')
    + files.map(function(file){
    var isDir = '..' == file.name || (file.stat && file.stat.isDirectory())
      , classes = []
      , path = dir.split('/').map(function (c) { return encodeURIComponent(c); });

    if (useIcons) {
      classes.push('icon');

      if (isDir) {
        classes.push('icon-directory');
      } else {
        var ext = extname(file.name);
        var icon = iconLookup(file.name);

        classes.push('icon');
        classes.push('icon-' + ext.substring(1));

        if (classes.indexOf(icon.className) === -1) {
          classes.push(icon.className);
        }
      }
    }

    path.push(encodeURIComponent(file.name));

    var date = file.stat && file.name !== '..'
      ? file.stat.mtime.toDateString() + ' ' + file.stat.mtime.toLocaleTimeString()
      : '';
    var size = file.stat && !isDir
      ? file.stat.size
      : '';

    return '<li><a href="'
      + escapeHtml(normalizeSlashes(normalize(req.prefixPath + path.join('/'))))
      + '" class="' + escapeHtml(classes.join(' ')) + '"'
      + ' title="' + escapeHtml(file.name) + '">'
      + '<span class="name">' + escapeHtml(file.name) + '</span>'
      + '<span class="size">' + escapeHtml(size) + '</span>'
      + '<span class="date">' + escapeHtml(date) + '</span>'
      + '</a></li>';

  }).join('\n') + '</ul>';
}
413874
def list_js_files(dir):
    
    for dirpath, dirnames, filenames in os.walk(dir):
        for filename in filenames:
            if is_js_file(filename):
                yield os.path.join(dirpath, filename)
550532
def extract(self, destination):
        """"""
        with tarfile.open(self.archive, 'r:') as tar:
            tar.extractall(path=destination)
371736
def do_for_dir(inws, begin):
    '''
    
    '''
    inws = os.path.abspath(inws)
    for wroot, wdirs, wfiles in os.walk(inws):
        for wfile in wfiles:
            if wfile.endswith('.html'):
                if 'autogen' in wroot:
                    continue
                check_html(os.path.abspath(os.path.join(wroot, wfile)), begin)
14931
function getHtmlFilenames (directory)
{
  return fs.readdirSync(directory).map(function (file) {
    return path.join(directory, file);
  }).filter(function (file) {
    return fs.statSync(file).isFile();
  }).filter(function (file) {
    return path.extname(file).toLowerCase() == ".html";
  });
}
1204066
def _find_paths(self, current_dir, patterns):
        """"""
        pattern = patterns[0]
        patterns = patterns[1:]
        has_wildcard = is_pattern(pattern)
        using_globstar = pattern == "**"

        # This avoids os.listdir() for performance
        if has_wildcard:
            entries = [x.name for x in scandir(current_dir)]
        else:
            entries = [pattern]

        if using_globstar:
            matching_subdirs = map(lambda x: x[0], walk(current_dir))
        else:
            subdirs = [e for e in entries
                       if os.path.isdir(os.path.join(current_dir, e))]
            matching_subdirs = match_entries(subdirs, pattern)

        # For terminal globstar, add a pattern for all files in subdirs
        if using_globstar and not patterns:
            patterns = ['*']

        if patterns:  # we've still got more directories to traverse
            for subdir in matching_subdirs:
                absolute_path = os.path.join(current_dir, subdir)
                for match in self._find_paths(absolute_path, patterns):
                    yield match

        else:  # we've got the last pattern
            if not has_wildcard:
                entries = [pattern + '.wsp', pattern + '.wsp.gz']
            files = [e for e in entries
                     if os.path.isfile(os.path.join(current_dir, e))]
            matching_files = match_entries(files, pattern + '.*')

            for _basename in matching_files + matching_subdirs:
                yield os.path.join(current_dir, _basename)
814985
function collect(){
  let arrOfJsFiles = [];
  let all = {nameToContent: {}, contentToName: {}};
  let files = getFiles();
  for(let file of files){
     if(file.endsWith('.js')){
       arrOfJsFiles.push(file);
     }
     if(file.endsWith('.jsx') || file.endsWith('.html') || file.endsWith('.htm') || file.endsWith('.js')){
       all.nameToContent[file] = fs.readFileSync(file, 'utf-8');
       all.contentToName[all.nameToContent[file]] = file;
     }
  }
  return all;
}
155878
def files(self):
        """"""
        contents = self.paths
        contents = (BinFile(path.path) for path in contents if path.is_file)
        return contents
807219
function findFiles( options ) {

  var cwd = options.cwd ? path.resolve( options.cwd ) : CWD;

  var patterns = makeSureArray( options.src ).map( function( pattern ) {
    return new Pattern( pattern, options.micromatch );
  } );

  return new MotaObservable( function( observer ) {

    var reader = new Reader( patterns, cwd, observer );

    reader.readDir( cwd ).then(
      observer.complete.bind( observer ),
      observer.error.bind( observer )
    );

    return function() {
      reader.cancel();
    };

  } );

}
641495
public static void findSourceFiles(List<SourceLocation> sourceLocations,
                                       Set<String> sourceTypes,
                                       Map<String,Source> foundFiles,
                                       Map<String, Module> foundModules,
                                       Module currentModule,
                                       boolean permitSourcesInDefaultPackage,
                                       boolean inLinksrc)
                                               throws IOException {

        for (SourceLocation source : sourceLocations) {
            source.findSourceFiles(sourceTypes,
                                   foundFiles,
                                   foundModules,
                                   currentModule,
                                   permitSourcesInDefaultPackage,
                                   inLinksrc);
        }
    }
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;
  }
}