Skip files with extentions in `FILE_EXCLUDE_EXTENTIONS` and filenames that
    contain `FILE_SKIP_PATTENRS`.
513003
def filter_filenames(filenames):
    
    filenames_cleaned = []
    for filename in filenames:
        keep = True
        for pattern in FILE_EXCLUDE_EXTENTIONS:
            if filename.endswith(pattern):
                keep = False
        for pattern in FILE_SKIP_PATTENRS:   # This will reject exercises...
            if pattern in filename:
                keep = False
        if keep:
            filenames_cleaned.append(filename)
    return filenames_cleaned
734349
def get_ignorer(path, additional_exclusions=None):
    """"""
    ignorefile = zgitignore.ZgitIgnore()
    gitignore_file = os.path.join(path, '.gitignore')
    if os.path.isfile(gitignore_file):
        with open(gitignore_file, 'r') as fileobj:
            ignorefile.add_patterns(fileobj.read().splitlines())

    if additional_exclusions is not None:
        ignorefile.add_patterns(additional_exclusions)

    return ignorefile
598011
def should_skip_file(name):
    
    if name.endswith(('~', '.bak')):
        return 'Skipping backup file %(filename)s'
    if name.endswith(('.pyc', '.pyo')):
        return 'Skipping %s file ' % os.path.splitext(name)[1] + '%(filename)s'
    if name.endswith('$py.class'):
        return 'Skipping $py.class file %(filename)s'
    return None
61900
def excluded_file?(file)
      full_path = File.expand_path(file)
      options.fetch(:excluded_files) { [] }.any? do |file_to_exclude|
        File.fnmatch(file_to_exclude, full_path)
      end
    end
457141
function globsToExcludeFromFileSet (dirname, fileset) {
  if (fileset.excludes && fileset.excludes.length) {
    return fileset.excludes.map(exclude => '!' + path.join(dirname, exclude));
  } else {
    return [];
  }
}
529058
def not_files(self):
        """"""

        _args = []

        for arg in self.all:
            if not len(expand_path(arg)):
                if not os.path.exists(arg):
                    _args.append(arg)

        return Args(_args, no_argv=True)
37573
def recursive_exclude(self, dir, pattern):
        
        match = translate_pattern(os.path.join(dir, '**', pattern))
        return self._remove_files(match.match)
490956
function filterFiles(files, validExtensions) {
    const accepted = [];

    for (const fileName of files) {
        if (accepted.indexOf(fileName) === -1 && fileMatchesExtension(fileName, validExtensions)) {
            accepted.push(fileName);
        }
    }

    return accepted;
}
824518
function platoExcludes() {
    var excludes = '';
    excludeFileset.forEach(function (file) {
        if (isDirectory(file)) {
            excludes += file.replace(/\//g, '\/');
        } else {
            excludes += file;
        }
        excludes += '|';
    });

    if (excludes !== '') {
        return new RegExp(excludes.slice(0, -1));
    } else {
        return null;
    }
}
641361
def strip_sdist_extras(filelist):
    
    return [name for name in filelist
            if not file_matches(name, IGNORE)
            and not file_matches_regexps(name, IGNORE_REGEXPS)]
412326
def list_files(dirname, extension=None):
    
    f = []
    for (dirpath, dirnames, filenames) in os.walk(dirname):
        f.extend(filenames)
        break
    if extension is not None:
        # Filter on extension
        filtered = []
        for filename in f:
            fn, ext = os.path.splitext(filename)
            if ext.lower() == '.' + extension.lower():
                filtered.append(filename)
        f = filtered
    return f
884680
def clean_extra(self):
        """"""
        extra_paths = self.get_extra_paths()
        for path in extra_paths:
            if not os.path.exists(path):
                continue
            if os.path.isdir(path):
                self._clean_directory(path)
            else:
                self._clean_file(path)
519983
private void skipHeaders(int flag) {
		// trying to skip optional gzip file members if any is present
		if ((flag & FEXTRA) != 0) {
			skipExtra(flag);
		} else if ((flag & FNAME) != 0) {
			skipTerminatorByte(flag, FNAME);
		} else if ((flag & FCOMMENT) != 0) {
			skipTerminatorByte(flag, FCOMMENT);
		} else if ((flag & FHCRC) != 0) {
			skipCRC16(flag);
		}
	}
89747
function excludeFiles(list, regex) {
        var ret = [];
        for (var i=0; i < list.length; i++) {
            if (!regex.test(list[i].dst)) {
                ret.push(list[i]);
            }
        }
        return ret;
    }
897393
def ignore_file_extension(self, extension):
        
        logger.info('Ignoring file extension: {}'.format(extension))
        self.watcher.ignore_file_extension(extension)
476201
def skip(self, count):
        

        if count < 0:
            raise ValueError

        if count <= self._bits:
            self.bits(count)
        else:
            count -= self.align()
            n_bytes = count // 8
            self._fileobj.seek(n_bytes, 1)
            count -= n_bytes * 8
            self.bits(count)
885185
def restricted_to_files(self, filenames: List[str]) -> 'FileLineSet':
        
        restricted = {} # type: Dict[str, Set[int]]
        for fn in filenames:
            if fn in self.__contents:
                restricted[fn] = set(self.__contents[fn])
        return FileLineSet(restricted)