returns true if the filename should be included
769574
function filenameInclude(filename, exclude, include) { // eslint-disable-line
  var output = true; // eslint-disable-line

  if (exclude) {
    if (globToRegExp(exclude, { extended: true }).test(filename)
    && !globToRegExp(include || '', { extended: true }).test(filename)) {
      output = false;
    }
  }

  return output;
}
469773
def include_library(libname):
    """"""
    # For configuration phase we need to have exclude / include lists None
    # so these checking is skipped and library gets included.
    if exclude_list:
        if exclude_list.search(libname) and not include_list.search(libname):
            # Library is excluded and is not overriden by include list.
            # It should be then excluded.
            return False
        else:
            # Include library
            return True
    else:
        # By default include library.
        return True
959689
public boolean isValidSourceFileOrDir(File file) {
        String name = file.getName();
        return !isExcludedDotFile(name) && !excludeExtensions.contains(Files.getExtension(file.getName()));
    }
342303
def has_file(self, name: str):
        '''
        
        '''
        return os.path.isfile(self._path / name)
672033
def find_include_file(self, t):
        
        fname = t[2]
        for d in self.searchpath[t[1]]:
            if d == os.curdir:
                f = fname
            else:
                f = os.path.join(d, fname)
            if os.path.isfile(f):
                return f
        return None
212401
def filename_match(fsearch, filename, width, height):
    '''
    
    '''
    fsearch = clean_path(fsearch)
    filename = clean_path(filename)
    if fsearch == filename:
        return True

    if fsearch.find('@') == -1:
        return False
    basename, fileext = os.path.splitext(fsearch)
    nickname, extinfo = basename.split('@', 1)
    if extinfo == 'auto':
        valid_names = {}.fromkeys([
            nickname+'@{}x{}'.format(width, height)+fileext,
            nickname+'@{}x{}'.format(height, width)+fileext,
            nickname+'.{}x{}'.format(width, height)+fileext,
            nickname+'.{}x{}'.format(height, width)+fileext,
        ])
        if filename in valid_names:
            return True
    # if extinfo.find('x') != -1:
    #     cw, ch = extinfo.split('x', 1)
    #     if cw*width == ch*height or cw*height == ch*width:
    #         return True
    return False
1177434
private boolean shouldExcludeSourceFile(CompilationUnitTree tree) {
    Pattern excludedPattern = errorProneOptions.getExcludedPattern();
    return excludedPattern != null
        && excludedPattern.matcher(ASTHelpers.getFileName(tree)).matches();
  }
1266290
def excluded(filename):
    
    basename = os.path.basename(filename)
    for pattern in options.exclude:
        if fnmatch(basename, pattern):
            # print basename, 'excluded because it matches', pattern
            return True
1308897
def KnowsFile(self,filename):
        """"""
        if self._isMediaFile(filename) or self._isConfigFile(filename):
            return True
        return False
200127
public boolean include(Archive source) {
        Module module = source.getModule();
        // skip system module by default
        return  !module.isSystem()
                    || configuration.rootModules().contains(source);
    }
903453
def CheckHeaderFileIncluded(filename, include_state, error):
  """"""

  # Do not check test files
  if filename.endswith('_test.cc') or filename.endswith('_unittest.cc'):
    return

  fileinfo = FileInfo(filename)
  headerfile = filename[0:len(filename) - 2] + 'h'
  if not os.path.exists(headerfile):
    return
  headername = FileInfo(headerfile).RepositoryName()
  first_include = 0
  for section_list in include_state.include_list:
    for f in section_list:
      if headername in f[0] or f[0] in headername:
        return
      if not first_include:
        first_include = f[1]

  error(filename, first_include, 'build/include', 5,
        '%s should include its header file %s' % (fileinfo.RepositoryName(),
                                                  headername))
133024
private boolean isIncluded(String _fqcn) {
        if (includePackageNames.contains(_fqcn)) {
            return true;
        }

        String packageName = _fqcn.substring(0, _fqcn.lastIndexOf('.') + 1);
        for (String str : includePackageNames) {
            if (packageName.startsWith(str)) {
                return true;
            }
        }

        return false;
    }
63999
def would_merge? filename
      return true if directory == '*' || source_hash.include?(filename)
      @config = Solargraph::Workspace::Config.new(directory)
      config.calculated.include?(filename)
    end
437018
function filesFromFileSet (dirname, fileset) {
  if (!fileset.includes || !fileset.includes.length) {
    return [];
  }
  return fileset.includes
    .filter(include => !glob.hasMagic(include))
    .map(include => path.join(dirname, include));
}
920124
def is_file_ignored(opts, fname):
    '''
    
    '''
    if opts['file_ignore_regex']:
        for regex in opts['file_ignore_regex']:
            if re.search(regex, fname):
                log.debug(
                    'File matching file_ignore_regex. Skipping: %s',
                    fname
                )
                return True

    if opts['file_ignore_glob']:
        for glob in opts['file_ignore_glob']:
            if fnmatch.fnmatch(fname, glob):
                log.debug(
                    'File matching file_ignore_glob. Skipping: %s',
                    fname
                )
                return True
    return False
132486
def is_excluded_path(args, filepath):
    """"""
    # Try regular expressions first.
    for regexp_exclude_path in args.regexp:
        if re.match(regexp_exclude_path, filepath):
            return True
    abspath = os.path.abspath(filepath)
    if args.include:
        # If the file is outside of any include directories.
        out_of_include_dirs = True
        for incl_path in args.include:
            absolute_include_path = os.path.abspath(os.path.join(args.root, incl_path))
            if is_child_dir(absolute_include_path, abspath):
                out_of_include_dirs = False
                break
        if out_of_include_dirs:
            return True

    excl_rules = create_exclude_rules(args)
    for i, rule in enumerate(excl_rules):
        if rule[0] == abspath:
            return rule[1]
        if is_child_dir(rule[0], abspath):
            # continue to try to longest match.
            last_result = rule[1]
            for j in range(i + 1, len(excl_rules)):
                rule_deep = excl_rules[j]
                if not is_child_dir(rule_deep[0], abspath):
                    break
                last_result = rule_deep[1]
            return last_result
    return False
875026
def include(self):
        
        if len(self.pending) == 0 or not self.pending[0].startswith('include '):
            return
        name = self.pending.pop(0)[8:].strip()[1:-1]
        for b in [os.path.dirname(self.name)] + self.inc_dirs:
            pname = os.path.abspath(os.path.expanduser(os.path.join(b, name)))
            if os.path.isfile(pname):
                name = pname
                break
        else:
            raise Exception('Can not find include file "{}".'.format(name))
        self.pending = list(FortranReader(name, self.docmark, self.predocmark, 
                                          self.docmark_alt, self.predocmark_alt,
                                          self.fixed, self.length_limit,
                                          inc_dirs=self.inc_dirs)) + self.pending