Does the given path pass the filtering criteria?
962494
def _path_to_be_kept(self, path):
        """"""
        if self.excludes and (path in self.excludes
                or helpers.is_inside_any(self.excludes, path)):
            return False
        if self.includes:
            return (path in self.includes
                or helpers.is_inside_any(self.includes, path))
        return True
791003
def include_path(self, path):
        
        self.seen_paths.add(path)
        return self.filter.include(path)
1013416
function isIgnoringFiles(path){
    if (!ignoring_files.length) return false;

    for (var i = 0, l = ignoring_files.length; i < l; i++){
        if (minimatch(path, ignoring_files[i])) return true;
    }

    return false;
}
1029349
def filter_dirs(root, dirs, excl_paths):
    
    filtered_dirs = []
    for dirpath in dirs:
        abspath = os.path.abspath(os.path.join(root, dirpath))
        if os.path.basename(abspath) in _SKIP_DIRS:
            continue
        if abspath not in excl_paths:
            filtered_dirs.append(dirpath)
    return filtered_dirs
256276
def is_uri_to_be_filtered(uri, filter_list):
    """"""
    match = False
    if filter_list:
        for uri_filter in filter_list:
            if re.search(uri_filter, uri, flags=re.IGNORECASE):
                match = True
        return match
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
436508
function _isFilePathVisible(treeData, path) {
        if (path === null) {
            return null;
        } else if (path === "") {
            return true;
        }

        var parts = path.split("/"),
            part = parts.shift(),
            result = [],
            node;

        while (part) {
            if (treeData === null) {
                return false;
            }
            node = treeData.get(part);
            if (node === undefined) {
                return null;
            }
            result.push(part);
            part = parts.shift();
            if (part) {
                if (!node.get("open")) {
                    return false;
                }
                treeData = node.get("children");
                if (treeData) {
                    result.push("children");
                }
            }
        }

        return true;
    }
701843
def from_path_by_ext(dir_path, ext):
        
        if isinstance(ext, (list, set, dict)): # collection of extension
            def filter(winfile):
                if winfile.ext in ext:
                    return True
                else:
                    return False
        else: # str
            def filter(winfile):
                if winfile.ext == ext:
                    return True
                else:
                    return False

        return FileCollection.from_path_by_criterion(
            dir_path, filter, keepboth=False)
953034
protected boolean isFiltered(String path) {

        // filter all temporary files
        if (CmsResource.isTemporaryFileName(path)) {
            return true;
        }

        if (m_filter == null) {
            return false;
        }

        return m_filter.isFiltered(path);
    }
1186545
def match_filters(self, path):
        
        # indicate if all required filters were matched
        all_required_match = True

        # iterate over filters to match files
        for filt, ftype in self.__filters:

            # handle "Required" filters:
            if all_required_match and ftype == self.FilterType.Required and not filt.match(path):
                all_required_match = False

            # handle "Include" filters:
            elif ftype == self.FilterType.Include and filt.match(path):
                return True

            # handle "Exclude" filters:
            elif ftype == self.FilterType.Exclude and filt.match(path):
                return False

        # if got here it means we processed all filters, and no include/exclude filter was matched.
        # return if all required were matched
        return all_required_match
261862
public void filterPaths(PathImpl path, String prefix, PathCallback cb)
  {
    if (! path.exists() || ! path.canRead()) {
      return;
    }
    
    if (! isValidPrefix(path, prefix)) {
      return;
    }
    
    if (path.isDirectory()) {
      try {
        String []list = path.list();

        for (int i = 0; i < list.length; i++) {
          String name = list[i];
          
          if (".".equals(name) || "..".equals(name))
            continue;
          
          // jsp/187j
          PathImpl subpath = path.lookup("./" + name);
          
          filterPaths(subpath, prefix, cb);
        }
      } catch (IOException e) {
        log.log(Level.WARNING, e.toString(), e);
      }
    }
    
    if (path.exists()) {
      // server/2438 - logging on unreadable
      //  if (path.canRead()) {
      if (isMatch(path, prefix)) {
        String suffix = "";
        String fullPath = path.getPath();

        if (prefix.length() < fullPath.length())
          suffix = path.getPath().substring(prefix.length());

        path.setUserPath(_userPathPrefix + suffix);

        cb.onMatch(path);
      }
    }
  }
983230
private static boolean exclude(String host, java.nio.file.Path path) {
        List<PathMatcher> exclusions = getExcludes(host);
        if (exclusions == null && host != null) {
            exclusions = getExcludes(null); // check global config
        }
        if (exclusions != null) {
            for (PathMatcher matcher : exclusions) {
                if (matcher.matches(path))
                    return true;
            }
        }
        return false;
    }
1249944
public static void consumeSubFilePaths(Path startDirectoryPath,
			int maxDepth, Predicate<Path> filter, Consumer<Path> consumer) {
		consumePathList(true,
				getSubFilePathList(startDirectoryPath, maxDepth, filter),
				consumer);
	}
287781
function isValidPath(path) {
  if (path === null || path === undefined) return false;
  return typeof path === 'string' && path.length > 0;
}
887557
function filter(p) {
          if (filters.length === 0)
            return true
          let predicate = false
          filters.forEach(section=> {
            let current = path.join('src', section)
            if (p.startsWith(current)) {
              predicate = true
            }
          })
          return predicate
        }
1364897
def _filter_path(self, path):
        
        if self._is_videofile(path):
            return [path, ]

        if os.path.isdir(path):
            result = []
            for root, dirs, files in os.walk(path):
                result.extend(filter(self._is_videofile, map(
                    lambda f: os.path.join(root, f), files)))
            return result
        else:
            return []
1351223
def _filter_files(path):
    
    s = os.path.normpath(path).split(os.path.sep)

    if path.endswith("snapshots"):
        return True

    # filter directory of snapshots
    if "{sep}snapshots{sep}".format(sep=os.path.sep) in path:
        return True

    try:
        i = s.index("project-files")
        if s[i + 1] in ("tmp", "captures", "snapshots"):
            return True
    except (ValueError, IndexError):
        pass

    file_name = os.path.basename(path)
    # Ignore log files and OS noises
    if file_name.endswith('_log.txt') or file_name.endswith('.log') or file_name == '.DS_Store':
        return True

    return False