Check if patterns contains a pattern that matches filename.

    If patterns is unspecified, this always returns True.
767182
def filename_match(filename, patterns, default=True):
    
    if not patterns:
        return default
    return any(fnmatch(filename, pattern) for pattern in patterns)
535525
public boolean match(String vfsName) {

        boolean match = false;

        for (int j = 0; j < m_vfsFolders.size(); j++) {
            Pattern pattern = m_vfsFolders.get(j);
            match = pattern.matcher(vfsName).matches();
            if (match) {
                break;
            }
        }
        return match;
    }
634878
def _match_pattern(filename, include, exclude, real, path, follow):
    """"""

    if real:
        symlinks = {}
        if isinstance(filename, bytes):
            curdir = os.fsencode(os.curdir)
            mount = RE_BWIN_MOUNT if util.platform() == "windows" else RE_BMOUNT
        else:
            curdir = os.curdir
            mount = RE_WIN_MOUNT if util.platform() == "windows" else RE_MOUNT

        if not mount.match(filename):
            exists = os.path.lexists(os.path.join(curdir, filename))
        else:
            exists = os.path.lexists(filename)

        if not exists:
            return False
        if path:
            return _match_real(filename, include, exclude, follow, symlinks)

    matched = False
    for pattern in include:
        if pattern.fullmatch(filename):
            matched = True
            break

    if not include and exclude:
        matched = True

    if matched:
        matched = True
        if exclude:
            for pattern in exclude:
                if not pattern.fullmatch(filename):
                    matched = False
                    break
    return matched
1225425
def matches_all_rules(self, target_filename):
        

        for rule in self.match_rules:
            if rule.test(target_filename) is False:
                return False

        self.logger.debug('{0}: {1} - {2}'.format(self.name,
                                                  os.path.basename(target_filename),
                                                  'Match'))
        return True
948575
def match(self, filename):
        
            
        double_neg = self._ignores[2].match(filename)
        if double_neg:
            return "!!%s" % double_neg
        elif self._ignores[1].match(filename):
            #print("Ignores")
            return None
        else:
            #print("Normal match")
            return self._ignores[0].match(filename)
976341
function match (filename, patterns, ignorePatterns) {
  function isMatch (ps) {
    return ps.some(p => {
      return mm.isMatch(filename, p, mmOptions)
    })
  }

  let isIgnore = false

  if (Array.isArray(ignorePatterns) && ignorePatterns.length) {
    isIgnore = isMatch(ignorePatterns)
  }

  if (isIgnore) {
    return false
  }

  return isMatch(patterns)
}
114861
def grep(pattern, *files_or_paths):
    """"""
    matches = []

    for fop in files_or_paths:
        with fileobj(fop) as fo:
            matches.extend((line for line in fo if re.match(pattern, line)))

    return matches
885309
def _file_filter(cls, filename, include_patterns, exclude_patterns):
    """"""
    logger.debug('filename: {}'.format(filename))
    for exclude_pattern in exclude_patterns:
      if exclude_pattern.match(filename):
        return False
    if include_patterns:
      found = False
      for include_pattern in include_patterns:
        if include_pattern.match(filename):
          found = True
          break
      if not found:
        return False
    return True
509632
def find(patterns)
      if patterns.empty?
        raise SCSSLint::Exceptions::NoFilesError,
              'No files, paths, or patterns were specified'
      end

      matched_files = extract_files_from(patterns)
      if matched_files.empty?
        raise SCSSLint::Exceptions::NoFilesError,
              "No SCSS files matched by the patterns: #{patterns.join(' ')}"
      end

      matched_files.reject { |file| @config.excluded_file?(file) }
    end
701098
private static boolean matchesNameOrWildcard(String pattern, String s) {
        return "*".equals(pattern) || Objects.equal(pattern, s);
    }
143
def match_files(self, matched, unmatched):
        """"""
        for pattern in self.iter():
            pattern.match_files(matched, unmatched)
            if not unmatched:
                # Optimization: If we have matched all files already
                # simply return at this point - nothing else to do
                break
54988
def match_pattern(self, path):
        
        for pattern in self.__pattern:
            if len(fnmatch.filter([path], pattern)) > 0:
                return True
        return False
157138
public boolean matches(Archive source) {
        if (includePattern != null) {
            return source.reader().entries().stream()
                    .map(name -> name.replace('/', '.'))
                    .filter(name -> !name.equals("module-info.class"))
                    .anyMatch(this::matches);
        }
        return hasTargetFilter();
    }
79659
@Override
    public boolean matches(String fileName) {
        // Special case: if no classes or packages have been defined,
        // then the screener matches all class files.
        if (patternList.isEmpty()) {
            return true;
        }

        LOG.debug("Matching: {}", fileName);

        // Scan through list of regexes
        for (Matcher matcher : patternList) {
            matcher.reset(fileName);
            if (matcher.find()) {
                LOG.debug("\\tTrying [{}]: yes!", matcher.pattern());
                return true;
            }
            LOG.debug("\\tTrying [{}]: no", matcher.pattern());
        }
        return false;
    }
4404
def match(self, item):
        
        val = getattr(item, self._name)
        if val is not None:
            for fileinfo in val:
                if fnmatch.fnmatchcase(fileinfo.path.lower(), self._value):
                    return True
            return False
886732
def process_pattern(fn):
    
    directory, pattern = validate_pattern(fn)
    if directory is not None:
        filenames = fnmatch.filter(auto(listdir, directory), pattern)
        if filenames:
            return [directory + '/' + sfn for sfn in filenames]
        else:
            print_err("cannot access '{}': No such file or directory".format(fn))
440887
@Override
    public boolean matches(Source src) {
        String name = src.getOrigin().getName().toLowerCase();
        String[] extensions = getInputFileExtensions();
        if (extensions.length == 1) {
            return FilenameUtils.isExtension(name, extensions[0]);
        }

        return FilenameUtils.isExtension(name, extensions);
    }