Helper function that returns paths to the html files in the specified directory
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";
  });
}
431669
function listdir(dir, rules, root, included) {
  return fs.readdir(dir)
  .then(function(files) {
    return when.all(files.map(function(f) {
      f = path.join(dir, f);
      return when(fs.stat(f), function(stat) {
        return {
          path: f,
          isDirectory: stat.isDirectory()
        };
      });
    }));
  })
  .then(function(arr) {
    var files = [];
    var subdirs = [];
    arr.forEach(function(e) {
      if (e.isDirectory) {
        subdirs.push(e.path);
      } else {
        files.push(e.path);
      }
    });
    files = files.filter(function(f) {
      return filter(f, rules, root, false, included);
    });
    return when.all(subdirs.map(function(d) {
      return listdir(d, rules, root, filter(d, rules, root, true, included));
    }))
    .then(function(list) {
      list = list.reduce(function(ret, i) {
        return ret.concat(i);
      }, files);
      // include current dir only if at least one of its children is included
      if (list.length > 0) {
        list.push(dir);
      }
      return list;
    });
  });
}
659155
function rPath (htmlyFile, sourceFilepath) {
  htmlyFile = pathResolve(__dirname, htmlyFile)
  htmlyFile = pathRelative(dirname(sourceFilepath), htmlyFile)
  htmlyFile = slash(htmlyFile)
  if (!/^(\.|\/)/.test(htmlyFile)) {
    return './' + htmlyFile
  } else {
    return htmlyFile
  }
}
582831
def get_dir(path, dest, saltenv='base', template=None, gzip=None, **kwargs):
    '''
    
    '''
    (path, dest) = _render_filenames(path, dest, saltenv, template, **kwargs)

    return _client().get_dir(path, dest, saltenv, gzip)
788509
function getDirectories(source) {
  const isDirectory = sourcePath => lstatSync(sourcePath).isDirectory()
  return readdirSync(source)
    .map(name => join(source, name))
    .filter(isDirectory)
}
822141
function fileToURL(output, filePath) {
    var options = output.getOptions();
    var directoryIndex = options.get('directoryIndex');

    filePath = fileToOutput(output, filePath);

    if (directoryIndex && path.basename(filePath) == 'index.html') {
        filePath = path.dirname(filePath) + '/';
    }

    return LocationUtils.normalize(filePath);
}
968324
function (dir) {
    let files = [];
    let list = fs.readdirSync(dir);
    list.forEach(function (file) {
        file = dir + '/' + file;
        let stat = fs.statSync(file);
        if (stat && stat.isDirectory()) files = files.concat(walk(file));
        else files.push(file);
    });
    return files;
}
1231307
def read_html_file(filename):
    
    with open(os.path.join(get_static_directory(), 'html/{filename}'.format(filename=filename))) as f:
        contents = f.read()
    return contents
1088309
async function srcToDocs (dir) {
  const location = path.join(srcPath, dir)
  const srcFiles = await getFiles(location, (item) => item.path.endsWith('.js') && !item.path.endsWith('index.js'))
  const filesContents = await readFiles(srcFiles)
  const filesComments = srcFiles.map((location, index) => {
    const fnName = path.basename(location).replace(/\.js$/, '')
    const matter = getMatter(fnName, dir)
    const doc = matter.concat(extractComments(filesContents[index])).concat(getRuleImport(fnName))
    return { comments: doc.join('\n'), location }
  })
  await writeDocs(docsDir, filesComments)
}
561066
function getJSFiles(folder = srcFolder){
  let all = [];
  let f = fs.readdirSync(folder);
  for(file of f){
    all.push(path.join(folder,file))
    if(fs.lstatSync(path.join(folder,file)).isDirectory()){
      all = all.concat(getJSFiles(path.join(folder,file)));
    }
  }
  return all.filter(x => x.endsWith('.js'));
}
717234
function getDirectories(path){
  return fs.readdirSync(path).filter(function (file) {
    return fs.statSync(path + "/" + file).isDirectory();
  });	
}
352872
function getDemoFilePath() {
			if (!o.htmlDemo) return null;
			var name = o.htmlDemoFilename || o.fontBaseName;
			return path.join(o.destHtml, name + '.html');
		}
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)
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)))
}
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
451002
def paths(self):
        """"""
        if self.format is None:
            raise ArcanaFileFormatError(
                "Cannot get paths of fileset ({}) that hasn't had its format "
                "set".format(self))
        if self.format.directory:
            return chain(*((op.join(root, f) for f in files)
                           for root, _, files in os.walk(self.path)))
        else:
            return chain([self.path], self.aux_files.values())
973464
def _find_files(directory):
    
    pattern = "{directory}/*.xml".format(
        directory=directory,
    )
    files = glob(pattern)
    return files