Apply the configured exclude file patterns to a list of files

 @param [Array<Pathname>] file_paths
        the list of files to filter

 @param [Array<Pathname>]
        the filtered list of files
15516
def filter_exclusions file_paths
      file_paths.reject do |path|
        exclude_file_patterns.any? { |pattern| File.fnmatch("#{pattern}", path) || File.fnmatch("**/#{pattern}", path) }
      end
    end
33812
public static void filterTrash(Configuration conf, List<String> files) {
    filterTrash(conf, files.iterator());
  }
758980
def find_source_files(input_path, excludes):
    

    java_files = []

    input_path = os.path.normpath(os.path.abspath(input_path))

    for dirpath, dirnames, filenames in os.walk(input_path):
        if is_excluded(dirpath, excludes):
            del dirnames[:]
            continue

        for filename in filenames:
            if filename.endswith(".java"):
                java_files.append(os.path.join(dirpath, filename))

    return java_files
277925
def load_file_exclusions
      return unless config_hash["Exclude Files"]
      config_options[:excluded_files] = []
      config_hash["Exclude Files"].each do |short_file|
        config_options[:excluded_files] << File.join(starting_path, short_file)
      end
    end
799995
def remove_files_in_dir(dpath, fname_pattern_list='*', recursive=False,
                        verbose=VERBOSE, dryrun=False, ignore_errors=False):
    
    if isinstance(fname_pattern_list, six.string_types):
        fname_pattern_list = [fname_pattern_list]
    if verbose > 2:
        print('[util_path] Removing files:')
        print('  * from dpath = %r ' % dpath)
        print('  * with patterns = %r' % fname_pattern_list)
        print('  * recursive = %r' % recursive)
    num_removed, num_matched = (0, 0)
    if not exists(dpath):
        msg = ('!!! dir = %r does not exist!' % dpath)
        if verbose:
            print(msg)
        warnings.warn(msg, category=UserWarning)
    for root, dname_list, fname_list in os.walk(dpath):
        for fname_pattern in fname_pattern_list:
            for fname in fnmatch.filter(fname_list, fname_pattern):
                num_matched += 1
                num_removed += remove_file(join(root, fname),
                                           ignore_errors=ignore_errors,
                                           dryrun=dryrun,
                                           verbose=verbose > 5)
        if not recursive:
            break
    if verbose > 0:
        print('[util_path] ... Removed %d/%d files' % (num_removed, num_matched))
    return True
919791
def remove_unwanted_files
        file_array = []
        root_path = FileUtils.join_paths(@install_path, @project_name)
        unless @config_file[:remove_files].nil?
          @config_file[:remove_files].each do |file|
            file_array << FileUtils.join_paths(root_path, file)
          end
          FileUtils.remove_files(file_array)
        end
      end
179977
def delete_paths(paths):
    
    for path in paths:
        if exists(path):
            if isfile(path):
                remove(path)
            else:
                rmtree(path)
433582
def filter_paths(pathnames, patterns=None, ignore_patterns=None):
    """"""
    result = []
    if patterns is None:
        patterns = ['*']
    if ignore_patterns is None:
        ignore_patterns = []
    for pathname in pathnames:
        if match_patterns(pathname, patterns) and not match_patterns(pathname, ignore_patterns):
            result.append(pathname)
    return result
550889
def remove_file(paths):
    

    for path in force_list(paths):
        if os.path.exists(path):
            os.remove(path)
210486
private function applyExcludesAndIncludes(array $files, array $excludes = [], array $includes = []): array
    {
        if (!$excludes) {
            return $files;
        }

        foreach ($files as $key => $file) {
            if ($this->isMatch($file['relative_path'], $excludes)
                && !$this->isMatch(
                    $file['relative_path'],
                    $includes
                )) {
                unset($files[$key]);
            }
        }

        // Reindex to avoid confusion when comparing last index to count
        return array_values($files);
    }
1359215
def exclude_by_filter(self, filename, module_name):
        '''
        
        '''
        for exclude_filter in self._exclude_filters:  # : :type exclude_filter: ExcludeFilter
            if exclude_filter.is_path:
                if glob_matches_path(filename, exclude_filter.name):
                    if exclude_filter.exclude:
                        pydev_log.debug("File %s ignored by filter %s" % (filename, exclude_filter.name))
                    return exclude_filter.exclude
            else:
                # Module filter.
                if exclude_filter.name == module_name or module_name.startswith(exclude_filter.name + '.'):
                    return exclude_filter.exclude
        return None
366738
def _add_baseline_to_exclude_files(args):
    
    baseline_name_regex = r'^{}$'.format(args.import_filename[0])

    if not args.exclude_files:
        args.exclude_files = baseline_name_regex
    elif baseline_name_regex not in args.exclude_files:
        args.exclude_files += r'|{}'.format(baseline_name_regex)
357987
def exclude_paths(args):
    """"""
    results = []
    if args.exclude:
        for excl_path in args.exclude:
            results.append(os.path.abspath(os.path.join(args.root, excl_path)))
    return results
780020
def set_exclude_filters(self, exclude_filters):
        '''
        
        '''
        self._exclude_filters = exclude_filters
        self.require_module = False
        for exclude_filter in exclude_filters:
            if not exclude_filter.is_path:
                self.require_module = True
                break
1057283
def remove_directories(list_of_paths):
    
    found_dirs = set('/')
    for path in list_of_paths:
        dirs = path.strip().split('/')
        for i in range(2,len(dirs)):
            found_dirs.add( '/'.join(dirs[:i]) )

    paths = [ path for path in list_of_paths if
              (path.strip() not in found_dirs) and path.strip()[-1]!='/' ]
    return paths
584041
def checkout_files(files)
      files = Array(files).select { |path| files_paths.include? path }
      checkout nil, files: files if files
    end
283859
function filterPaths(paths, allowed) {
  if (!allowed) { return []; }
  if (!allowed.only.length) { return paths; }

  return paths.filter(
    path => {
      let match = false;

      for (const filter of allowed.only) {
        try {
          switch (typeof filter) {
            case 'function':
              match = filter(path.path);
              break;
            case 'string':
              match = path.path === filter;
              break;
            default:
              match = filter.test(path.path);
         }
        } catch (e) {
          throw new Error(`${ typeof filter } is not an allowed filter type. Must be String, RegExp or Function`);
        }
        if (match) { return match; }
      }
      return match;
    }
  );
}