Run path against filter sets and return True if all pass
424899
def validate(self, path):
        """"""
        # Exclude hidden files and folders with '.' prefix
        if os.path.basename(path).startswith('.'):
            return False

        # Check that current path level is more than min path and less than max path
        if not self.check_level(path):
            return False

        if self.filters:
            if not self._level_filters(path):
                return False

        # Force include and exclude iterations to be strings in case of integer filters
        # Handle exclusions
        if self.to_exclude:
            if any(str(ex).lower() in path.lower() for ex in self.to_exclude):
                return False

        # Handle inclusions
        if self.to_include:
            if not any(str(inc).lower() in path.lower() for inc in self.to_include):
                return False

        return True
895158
private function runFilters()
    {
        foreach ($this->filterObjects as $filter) {
            $filter_key = $filter->getKey();

            // Execute the filter method if enabled
            if ($this->request->has($filter_key)) {
                $filter_option = ucfirst(preg_replace('/[^a-z0-9]/i', ' ', $this->request->input($filter_key)));

                $filter_key = ucfirst(preg_replace('/[^a-z0-9]/i', ' ', $filter_key));

                if (!in_array($filter_option, $this->filters[$filter_key])) {
                    continue;
                }

                $filter_method = 'filter'.Str::studly($filter_key).Str::studly($filter_option);

                if (method_exists($this, $filter_method)) {
                    $this->$filter_method();
                }
            }
        }
    }
493503
def _filter(self, value):
        
        if self.ignores and value in self.ignores:
            return False
        return True
92407
function match(path) {
    if (path.indexOf(prefix) !== 0) {
      return false;
    }

    const newPath = path.replace(prefix, '') || '/';
    if (trailingSlash) {
      return newPath;
    }

    if (newPath[0] !== '/') {
      return false;
    }

    return newPath;
  }
481908
def check(path=None, env='default'):
    
    # TODO: add files=<list of files> to check only a subset...
    # also useful for 'quilt build' to exclude certain files?
    # (if not, then require dry_run=True if files!=None/all)
    build("dry_run/dry_run", path=path, dry_run=True, env=env)
1185032
private boolean passesFilters(Level3Element ele)
	{
		if (filters == null) return true;

		for (Filter filter : filters)
		{
			if (!filter.okToTraverse(ele)) return false;
		}
		return true;
	}
1217483
def match_patterns(pathname, patterns):
    """"""
    for pattern in patterns:
        if fnmatch(pathname, pattern):
            return True
    return False
246782
function(file, regFilter, cb) {

		cb = arguments[arguments.length-1];
		if(!file || !fs.existsSync(file)) {
			cb(true);
			return ;
		}


		// Apply filter
		var fileName = path.basename(file);
		if(regFilter && regFilter.test && regFilter.test(fileName)) {
			return ;
		}

		if(fs.lstatSync(file).isFile()) {
			cb(false, file);
			return ;
		} else if(fs.lstatSync(file).isDirectory()) {
			// is directory
			(fs.readdirSync(file)).forEach(function(item) {
				utils.traverseFolderSync(path.join(file, item), regFilter, cb);
			});
		}
	}
847355
def _find_all_simple(path):
    
    results = (
        os.path.join(base, file)
        for base, dirs, files in os.walk(path, followlinks=True)
        for file in files
    )
    return filter(os.path.isfile, results)
118750
function match(path) {

  if (!patterns) {
    patterns = fis.media().get('project.files', []);

    if (!Array.isArray(patterns)) {
      patterns = [patterns];
    }

    patterns = patterns.map(function(pattern) {
      var negate = false;

      if (pattern[0] === '!') {
        negate = true;
        pattern = pattern.substring(1);
      }

      pattern[0] === '/' && (pattern = pattern.substring(1));

      return {
        negate: negate,
        reg: _.glob(pattern)
      };
    });
  }

  path.indexOf(root) === 0 && (path = path.substring(root.length));

  var hitted = false;
  patterns.forEach(function(item) {
    if (hitted) {
      if (item.negate && item.reg.test(path)) {
        hitted = false;
      }
    } else {
      hitted = item.negate !== item.reg.test(path);
    }
  });

  return hitted;
}
906189
def find_files(path, filter="*.md"):
        
        if os.path.isfile(path):
            return [path]

        if os.path.isdir(path):
            matches = []
            for root, dirnames, filenames in os.walk(path):
                for filename in fnmatch.filter(filenames, filter):
                    matches.append(os.path.join(root, filename))
            return matches
1254854
def flatten_all_paths(self, group_filter=lambda x: True,
                          path_filter=lambda x: True,
                          path_conversions=CONVERSIONS):
        """"""
        return flatten_all_paths(self.tree.getroot(), group_filter,
                                 path_filter, path_conversions)
1283942
def ignore_path?(action, options)
        options[:except].present? &&  options[:except].include?(action) and return true
        options[:only].present?   && !options[:only].include?(action)   and return true
        false
      end
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
1030329
function filterPath(absPath) {
		var relPath = path.relative(launchFolder, absPath)
		var result = excludeList.every(checkExclusion)

		return result

		function checkExclusion(exclusion) { // true: keep the path
			return relPath.substring(0, exclusion.length) != exclusion
		}
	}
664728
async def check_filters(filters: typing.Iterable[FilterObj], args):
    
    data = {}
    if filters is not None:
        for filter_ in filters:
            f = await execute_filter(filter_, args)
            if not f:
                raise FilterNotPassed()
            elif isinstance(f, dict):
                data.update(f)
    return data
236036
def match(self, path):
        
        """
        for spec in reversed(self.pathspecs):  # type: Pathspec
            if spec.pattern.match(path):
                return not spec.negated

        return False