Returns a subset of the file lines within this set that satisfy a given
        filtering criterion.
515489
def filter(self,
               predicate: Callable[[FileLine], 'FileLineSet']
               ) -> 'FileLineSet':
        
        filtered = [fileline for fileline in self if predicate(fileline)]
        return FileLineSet.from_list(filtered)
815703
public final Set<FilterEntry<T>> getFilterExpectEntrys() {
        HashSet<FilterEntry<T>> set = new HashSet<>();
        set.addAll(expectEntrys);
        if (ors != null) ors.forEach(f -> set.addAll(f.getFilterExpectEntrys()));
        if (ands != null) ands.forEach(f -> set.addAll(f.getFilterExpectEntrys()));
        return set;
    }
945011
def filter_lines(lines, filter_regex, groups=None):
    
    pattern = re.compile(filter_regex)
    for line in lines:
        match = pattern.search(line)
        if match:
            if groups is None:
                yield line
            elif len(groups) == 1:
                yield match.group(groups[0])
            else:
                matched_groups = match.groupdict()
                yield tuple(matched_groups.get(group) for group in groups)
1241620
def do_filter(self, filter_type, line):
        
        # Recall that filtering algorithms are applied to bytes,
        # not to pixels, regardless of the bit depth or colour type
        # of the image.

        line = bytearray(line)
        if isinstance(filter_type, int):
            res = bytearray(line)
            self._filter_scanline(filter_type, line, res)
            res.insert(0, filter_type)  # Add filter type as the first byte
        else:
            res = self.adaptive_filter(filter_type, line)
        self.prev = line
        if self.restarts:
            self.restarts[0] -= 1
            if self.restarts[0] == 0:
                del self.restarts[0]
                self.prev = None
        return res
1156562
function splitFilter (a, b, predicate) {
  const aOut = [];
  const bOut = [];
  for (let index = 0; index < a.length; index++) {
    if (predicate(a[index], index, a, b)) {
      aOut.push(a[index]);
    } else {
      bOut.push(a[index]);
    }
  }
  return [aOut, bOut];
}
1294969
def filter(self, criteria: Q, offset: int = 0, limit: int = 10,
               order_by: list = ()) -> ResultSet:
        
1271417
def subset( *keys, &select_block )
      subset_params =
      if block_given?
        filter_parameters.select &select_block
      else
        filter_parameters.slice( *keys )
      end
      subset = self.class.new( subset_params )
      subset.predicates = predicates.clone
      subset
    end
473892
public List<F> listFiles(NfsFileFilter filter) throws IOException {
        List<F> childFiles = listFiles();
        if ((childFiles == null) || (childFiles.size() == 0) || (filter == null)) {
            return childFiles;
        }
        List<F> filteredFiles = new ArrayList<F>();
        for (F childFile : childFiles) {
            if (filter.accept(childFile)) {
                filteredFiles.add(childFile);
            }
        }
        return filteredFiles;
    }
1002938
public static List<File> listFiles(File[] directories, IOFileFilter fileFilter, IOFileFilter dirFilter) {
        List<File> files = new ArrayList<>();
        for (File directory : directories) {
            if (!directory.isDirectory()) {
                continue;
            }
            Collection<File> filesInDirectory = FileUtils.listFiles(directory,
                    fileFilter,
                    dirFilter);
            files.addAll(filesInDirectory);
        }
        return files;
    }
478042
def filtre(liste_base, criteres) -> groups.Collection:
        

        def choisi(ac):
            for cat, li in criteres.items():
                v = ac[cat]
                if not (v in li):
                    return False
            return True

        return groups.Collection(a for a in liste_base if choisi(a))
691666
public static Collection<String> listFiles(String filesString, String delimiter) {
    ValidationUtils.validateNotEmpty(filesString, "fileStr");

    List<String> files = new ArrayList<String>();
    for (String fileString : filesString.split(delimiter)) {
      File file = new File(fileString);
      if (!file.getName().contains("*") && !file.getName().contains("?")) {
        files.add(file.getAbsolutePath());
        continue;
      }

      FileFilter fileFilter = new AndFileFilter(new WildcardFileFilter(file.getName()),
          FileFileFilter.FILE);
      File parent = file.getParentFile() == null ? file : file.getParentFile();
      File[] filteredFiles = parent.listFiles(fileFilter);
      if (filteredFiles == null) {
        continue;
      }

      for (File filteredFile : filteredFiles) {
        files.add(filteredFile.getAbsolutePath());
      }
    }
    return files;
  }
1010191
private static File[] filterFilesBySuffix(final File dirToFilter, final String suffix) {
		return filterFilesBySuffix(dirToFilter, new String[] { suffix });
	}
849119
def filter_files(self, path):
        
        excludes = r'|'.join([fnmatch.translate(x) for x in self.project.EXCLUDES]) or r'$.'
        for root, dirs, files in os.walk(path, topdown=True):
            dirs[:] = [d for d in dirs if not re.match(excludes, d)]
            dirs[:] = [os.path.join(root, d) for d in dirs]
            rel_path = os.path.relpath(root, path)

            paths = []
            for f in files:
                if rel_path == '.':
                    file_path = f
                else:
                    file_path = os.path.join(rel_path, f)
                if not re.match(excludes, file_path):
                    paths.append(f)

            files[:] = paths
            yield root, dirs, files
827209
def _already_cutoff_filtered(in_file, filter_type):
    
    filter_file = "%s-filter%s.vcf.gz" % (utils.splitext_plus(in_file)[0], filter_type)
    return utils.file_exists(filter_file)
336813
def _filter_by_support(in_file, data):
    
    rc_filter = ("FORMAT/SU < 4 || "
                 "(FORMAT/SR == 0 && FORMAT/SU < 15 && ABS(SVLEN)>50000) || "
                 "(FORMAT/SR == 0 && FORMAT/SU < 5 && ABS(SVLEN)<2000) || "
                 "(FORMAT/SR == 0 && FORMAT/SU < 15 && ABS(SVLEN)<300)")
    return vfilter.cutoff_w_expression(in_file, rc_filter, data, name="ReadCountSupport",
                                       limit_regions=None)
407664
public static List<Path> getSubFilePathList(Path startDirectoryPath,
			Predicate<Path> filter) {
		return getSubPathList(startDirectoryPath,
				RegularFileFilter.and(filter));
	}
411800
def get_subset_ids(path):
        
        all = []

        for path in glob.glob(os.path.join(path, '*.tsv')):
            file_name = os.path.split(path)[1]
            basename = os.path.splitext(file_name)[0]
            all.append(basename)

        return all