Enumartes the files in path with the given extension
779902
def files_in_dir(path, extension):
    """"""
    ends = '.{0}'.format(extension)
    return (f for f in os.listdir(path) if f.endswith(ends))
283074
def _get_schema_file(extension, path):
        
        for file in os.listdir(path):
            if file.endswith(extension):
                return os.path.join(path, file)
1320104
public static String getFilenameExtension(String path) {
        if (path == null) return null;

        int extIndex = path.lastIndexOf(EXTENSION_SEPARATOR);
        if (extIndex == -1) return null;

        int folderIndex = path.lastIndexOf(FOLDER_SEPARATOR);
        if (folderIndex > extIndex) return null;

        return path.substring(extIndex + 1);
    }
484811
function getFileNames(path, extension)
{
    var docPath = __dirname + '/' + path;
    var fileNames = [];
    var findPattern = new RegExp("." + extension + "$");
    var replacePattern = new RegExp("." + extension + "$","g");
    fs.readdirSync( docPath ).forEach( function(fileName ) {
        if( fileName.match( findPattern ) ) {
            fileNames.push( fileName.replace( replacePattern, "" ) );
        }
    });

    verbose && console.log('Read "' + extension + '" files from ' + docPath );

    return fileNames;
}
31202
function extensionMatches (filename) {
		var extname = path.extname(filename);
		if (extname) {
			return extname === extension;
		}
		return true;
	}
689751
private static void getFilesByExtensionRecursive(Collection<Media> filesList, Media path, String extension)
    {
        for (final Media content : path.getMedias())
        {
            if (extension.equals(UtilFile.getExtension(content.getPath())))
            {
                filesList.add(content);
            }
        }
    }
945799
function parseFilepath(path) {
  if (path === undefined) {
    return {filename: null, list: []};
  }

  var list = path.split('/'),
      isDir = (path[path.length - 1] === '/') || (list[list.length - 1].indexOf('.') === -1);

  return {
    filename: isDir ? null : list.pop(),
    list: list
  };
}
1165532
def match_path_extname(path, extensions)
      basename = File.basename(path)

      i = basename.index('.'.freeze)
      while i && i < basename.length - 1
        extname = basename[i..-1]
        if value = extensions[extname]
          return extname, value
        end

        i = basename.index('.'.freeze, i+1)
      end

      nil
    end
1352897
function filterFile(file, callback) {
      // Ensure it matches the extension.
      const correctExtention = path.extname(file) === opts.extname

      // Make sure it has defined files.
      const source = files[file].source || false
      const destination = files[file].destination || '.'
      callback(null, correctExtention && source && destination)
    }
1132604
function filterFile(file, done) {
      // Ensure it matches the extension.
      const correctExtention = path.extname(file) === opts.extname

      // Make sure it has defined files.
      const hasFiles = files[file].files
      done(null, correctExtention && hasFiles)
    }
1118832
def match_extension(f):
    ''''''
    (root,ext) = os.path.splitext(f)
    return ext.lower() in extensions
1340154
private static List<Media> getFilesByExtension(Media path, String extension)
    {
        final List<Media> filesList = new ArrayList<>(1);
        getFilesByExtensionRecursive(filesList, path, extension);
        return filesList;
    }
890337
function getorigPath(filePath, base) {
    var extName = path.extname(filePath);
    var pt = path.resolve(base, filePath);
    if (!extName) pt += '.js';
    return pt;
}
1120965
def expand_path(path):
    '''
    
    '''
    expanded = []
    if len(path) < 2:
        return expanded
    for i in range(len(path)-1):
        expanded += bresenham(path[i], path[i + 1])
    expanded += [path[:-1]]
    return expanded
810728
function setExtension(filename, ext) {
    return path.join(
        path.dirname(filename),
        path.basename(filename, path.extname(filename)) + ext
    );
}
1368760
function (path) {
    var pathSep = require('path').sep;
    var dirs = path.split(pathSep);
    var root = '';

    while (dirs.length > 0) {
      var dir = dirs.shift();
      if (dir === '') {
        root = pathSep;
      }
      if (!fs.existsSync(root + dir)) {
        fs.mkdirSync(root + dir);
      }
      root += dir + pathSep;
    }
  }
1304406
def normalize_extension(extension):
    """"""
    extension = decode_path(extension)
    if extension is None:
        return
    if extension.startswith('.'):
        extension = extension[1:]
    if '.' in extension:
        _, extension = os.path.splitext(extension)
    extension = slugify(extension, sep='')
    if extension is None:
        return
    if len(extension):
        return extension