If "include" option exists in "default.cfg",
        read the file(glob-match) in the directory.
499682
def _merge_includes(self):
        
        raw_include_path = self.get_global_include()
        if raw_include_path:
            abs_include_path = self._get_global_include_abs_path(
                raw_include_path
            )
            self._validate_global_include(abs_include_path)
            self.set_global_include(abs_include_path)

            for infile in glob.glob(abs_include_path):
                self.config.merge(
                    self._configobj_factory(infile=infile)
                )
296786
def check_cfg_files(cfg_files,module_name):
    

    cfg = ConfigParser.SafeConfigParser()
    cfg.read(cfg_files)
    if cfg.has_section(module_name):
        section_items = cfg.items(module_name)
    else:
        section_items = []
    default_items = cfg.items('DEFAULT')

    n_items = len(section_items) + len(default_items)
    if n_items==0:
        log.warn('configuration files were specified, but no options were '
                 'found in "%s" or "DEFAULT" sections.' % (module_name,) )
1200095
async function baseInclude(filename) {
	let f = new Functmpl(this);
	try {
		await f.loadFile(filename);
		return this.echo((await f.parse(_scope2.default)));
	} catch (e) {}
}
193978
function loadIncludes(data, current_file) {
  return data.replace(includeExpr, function(src, name, ext) {
    try {
      var include_path =
          path.join(current_file, "../", name+"."+(ext || "markdown"))
      return loadIncludes(fs.readFileSync(include_path, "utf8"), current_file);
    } catch(e) {
      return "";
    }
  });
}
193986
function cog(glob) {
  if (typeof glob === 'undefined') {
    var glob = '**/*';
  }

  // Collect all files, before we filter stream
  var allFiles = {};
  var collectFilesStream = through.obj(function(file, enc, cb) {
    allFiles[file.relative] = file;
    cb();
  }, function(cb) {
    _.each(allFiles, function(file) {
      collectFilesStream.push(file);
    });
    cb();
  });

  // Get all includes for a file
  function getIncludes(file) {
    var content = String(file.contents);
    var matches = [];

    while (regexMatch = DIRECTIVE_REGEX.exec(content)) {
      matches.push(regexMatch);
    }

    // For every require fetch it's matching files
    var fileLists = _.map(matches, function(match) {
      return globMatch(match, file).sort();
    });

    // Merge all matching file lists into one concat list
    var order = _.reduce(fileLists, function(memo, fileList) {
      return _.union(memo, fileList);
    }, []);

    // And self to include list
    order.push(file.relative);
    return order;
  }

  function getRelativeDir(file) {
    var relativeDir = _.initial(file.relative.split('/')).join('/');
    if (relativeDir.length > 0) {
      relativeDir += '/';
    }
    return relativeDir;
  }

  // Translate an include match to a glob
  function globMatch(match, file) {
    var directiveType = match[1];
    var globPattern = match[2]; // relative file

    // require all files under a directory
    if (directiveType.indexOf('_tree') !== -1) {
      globPattern = globPattern.concat('/**/*');
      directiveType = directiveType.replace('_tree', '');
    }

    // require only first level files in a directory
    if (directiveType.indexOf('_directory') !== -1) {
      globPattern = globPattern.concat('/*');
      directiveType = directiveType.replace('_directory', '');
    }

    // Only require and include directives are allowed
    if (directiveType !== 'require' && directiveType !== 'include') {
      return [];
    }

    // Add file extension to glob pattern if not already set
    var jsExt = '.js';
    if (globPattern.substr(globPattern.length-jsExt.length).indexOf(jsExt) !== 0) {
      globPattern += jsExt;
    } 

    // Append the current dir to include so we can match the glob against the file list
    var relativeDir = getRelativeDir(file);
    globPattern = relativeDir+globPattern;

    var possibleIncludes = [];
    _.each(_.keys(allFiles), function(fileName) {
      // Only process files in the current directory. ../ will not work.
      if (fileName.indexOf(relativeDir) !== 0) {
        return;
      }

      possibleIncludes.push(fileName);
    });
    
    return minimatch.match(possibleIncludes, globPattern);
  }


  // creating a stream through which each file will pass
  var concatFiles = [];
  var buildIncludesStream = through.obj(function(file, enc, cb) {
    if (file.isStream()) {
      this.emit('error', new PluginError(PLUGIN_NAME, 'Streams are not supported!'));
      return cb();
    }

    // Attach includes to masterfile
    file.includes = _.filter(_.map(getIncludes(file), function(filename) {
      return allFiles[filename];
    }, function(file) {
      return !!file;
    }));

    this.push(file);
    cb();
  });

  /*
   * Construct the stream.
   * 
   * Steps:
   * 1. Build a list of all files in the stream for use later
   * 2. Filter files to only desired master concat files
   * 3. Build concat manifests data objects for each of the master files
   */
  var stream = sc(
    collectFilesStream,
    filter(glob),
    buildIncludesStream
  );

  return stream;
}
279840
def _match_real(filename, include, exclude, follow, symlinks):
    """"""

    sep = '\\' if util.platform() == "windows" else '/'
    if isinstance(filename, bytes):
        sep = os.fsencode(sep)
    if not filename.endswith(sep) and os.path.isdir(filename):
        filename += sep

    matched = False
    for pattern in include:
        if _fs_match(pattern, filename, sep, follow, symlinks):
            matched = True
            break

    if matched:
        matched = True
        if exclude:
            for pattern in exclude:
                if _fs_match(pattern, filename, sep, follow, symlinks):
                    matched = False
                    break
    return matched
898639
def _glob(pattern, skip_dirs=False):
    """"""
    # Implicit recursive iff no / in pattern and starts with *
    if "/" not in pattern and pattern.startswith("*"):
        files = glob.glob(f"**/{pattern}", recursive=True)
    else:
        files = glob.glob(pattern, recursive=True)

    # Expand dirs
    all_files = set()
    for file in files:
        if os.path.isdir(file) and not skip_dirs:
            all_files.update(set(f for f in _glob(f"{file}/**/*", skip_dirs=True) if not os.path.isdir(f)))
        else:
            all_files.add(file)

    # Normalize all files
    return {str(Path(f)) for f in all_files}
1167531
def include_file(filename):
        """"""
        if os.path.isfile(filename):
            with open(filename) as handle:
                return safe_load(handle)
        raise RuntimeError("Include file %s doesn't exist!" % filename)
1071205
def _fs_match(pattern, filename, sep, follow, symlinks):
    

    matched = False

    base = None
    m = pattern.fullmatch(filename)
    if m:
        matched = True
        # Lets look at the captured `globstar` groups and see if that part of the path
        # contains symlinks.
        if not follow:
            groups = m.groups()
            last = len(groups)
            for i, star in enumerate(m.groups(), 1):
                if star:
                    parts = star.strip(sep).split(sep)
                    if base is None:
                        base = filename[:m.start(i)]
                    for part in parts:
                        base = os.path.join(base, part)
                        is_link = symlinks.get(base, None)
                        if is_link is not None:
                            matched = not is_link
                        elif i != last or os.path.isdir(base):
                            is_link = os.path.islink(base)
                            symlinks[base] = is_link
                            matched = not is_link
                        if not matched:
                            break
                if matched:
                    break
    return matched
426457
def contains_glob(path, glob_expr):
    '''
    
    '''
    path = os.path.expanduser(path)

    if not os.path.exists(path):
        return False

    try:
        with salt.utils.filebuffer.BufferedReader(path) as breader:
            for chunk in breader:
                if fnmatch.fnmatch(chunk, glob_expr):
                    return True
            return False
    except (IOError, OSError):
        return False
385900
function (contents, workingDir) {
			var matches = includePattern.exec(contents);

			while (matches) {
				var match = matches[0];
				var includePath = resolveIncludePath(matches[1], workingDir);

				grunt.log.debug('Including', includePath);

				var includeContents = grunt.file.read(includePath);
				includeContents = include(includeContents, path.dirname(includePath));
				contents = contents.replace(match, includeContents);

				matches = includePattern.exec(contents);

				numIncludes++;
			}

			return contents;
		}
480565
def load(self):
        
        # If we are given a string, open it up else assume it's something we
        # can call read on.
        if isinstance(self.specfile, str):
            f = open(self.specfile, 'r')
        else:
            f = self.specfile

        for line in f:
            if self.v_regex.match(line):
                self._pkg_version = self.v_regex.match(line).group(1)
            if self.n_regex.match(line):
                self._pkg_name = self.n_regex.match(line).group(1)
        f.close()
        self._loaded = True
1283576
def _glob_dir(self, curdir, matcher, dir_only=False, deep=False):
        """"""

        scandir = self.current if not curdir else curdir

        # Python will never return . or .., so fake it.
        if os.path.isdir(scandir) and matcher is not None:
            for special in self.specials:
                if matcher(special):
                    yield os.path.join(curdir, special)

        try:
            if NO_SCANDIR_WORKAROUND:
                # Our current directory can be empty if the path starts with magic,
                # But we don't want to return paths with '.', so just use it to list
                # files, but use '' when constructing the path.
                with os.scandir(scandir) as scan:
                    for f in scan:
                        try:
                            # Quicker to just test this way than to run through `fnmatch`.
                            if deep and self._is_hidden(f.name):
                                continue
                            path = os.path.join(curdir, f.name)
                            is_dir = f.is_dir()
                            if is_dir:
                                is_link = f.is_symlink()
                                self.symlinks[path] = is_link
                            else:
                                # We don't care if a file is a link
                                is_link = False
                            if deep and not self.follow_links and is_link:
                                continue
                            if (not dir_only or is_dir) and (matcher is None or matcher(f.name)):
                                yield path
                            if deep and is_dir:
                                yield from self._glob_dir(path, matcher, dir_only, deep)
                        except OSError:  # pragma: no cover
                            pass
            else:
                for f in os.listdir(scandir):
                    # Quicker to just test this way than to run through `fnmatch`.
                    if deep and self._is_hidden(f):
                        continue
                    path = os.path.join(curdir, f)
                    is_dir = os.path.isdir(path)
                    if is_dir:
                        is_link = os.path.islink(path)
                        self.symlinks[path] = is_link
                    else:
                        is_link = False
                    if deep and not self.follow_links and is_link:
                        continue
                    if (not dir_only or is_dir) and (matcher is None or matcher(f)):
                        yield path
                    if deep and is_dir:
                        yield from self._glob_dir(path, matcher, dir_only, deep)
        except OSError:  # pragma: no cover
            pass
1290636
def match_files(self, matched, unmatched):
        """"""
        this_match = set(self.file_filter(unmatched))
        matched |= this_match
        unmatched -= this_match
990408
def extract_applicable_files(config, options)
      included_patterns = options[:files]
      excluded_patterns = config['exclude']
      excluded_patterns += options.fetch(:excluded_files, [])

      HamlLint::FileFinder.new(config).find(included_patterns, excluded_patterns)
    end
261449
def include?(pattern)
      self.each do |current|
        return true if File.fnmatch(pattern, current) || pattern == current
      end
      return false
    end
225400
def expand_includes(text, path='.'):
    """"""
    def read_and_expand(match):
        filename = match.group('filename')
        filename = join(path, filename)
        text = read(filename)
        return expand_includes(
            text, path=join(path, dirname(filename)))

    return re.sub(r'^\.\. include:: (?P<filename>.*)$',
                  read_and_expand,
                  text,
                  flags=re.MULTILINE)