Find all C/C++ source files in the `folder` directory.
194403
def get_c_sources(folder, include_headers=False):
    """"""
    allowed_extensions = [".c", ".C", ".cc", ".cpp", ".cxx", ".c++"]
    if include_headers:
        allowed_extensions += [".h", ".hpp"]
    sources = []
    for root, _, files in os.walk(folder):
        for name in files:
            ext = os.path.splitext(name)[1]
            if name == "types.cc":
                # Make sure `types.cc` is compiled first, as it has multiple
                # useful static assertions.
                sources.insert(0, os.path.join(root, name))
            elif ext in allowed_extensions:
                sources.append(os.path.join(root, name))
    return sources
427601
def __find_source_files(self):
        
        for dir_path, _, files in os.walk(self._source_directory):
            for name in files:
                if name.lower().endswith(self._source_file_extension):
                    basename = os.path.splitext(os.path.basename(name))[0]
                    relative_path = os.path.relpath(os.path.join(dir_path, name))

                    if basename in self._source_file_names:
                        self._io.error("Files '{0}' and '{1}' have the same basename.".
                                       format(self._source_file_names[basename], relative_path))
                        self.error_file_names.add(relative_path)
                    else:
                        self._source_file_names[basename] = relative_path
995127
def find_sources(self):
        
        app_configs = apps.get_app_configs()
        for app_config in app_configs:
            ignore_dirs = []
            for root, dirs, files in os.walk(app_config.path):
                if [True for idir in ignore_dirs if root.startswith(idir)]:
                    continue
                if '__init__.py' not in files:
                    ignore_dirs.append(root)
                    continue
                for filename in files:
                    basename, ext = os.path.splitext(filename)
                    if ext != '.py':
                        continue
                    yield os.path.abspath(os.path.join(root, filename))
848545
def _scan_pth_files(dir_paths):
    """"""
    for dir_path in dir_paths:
      if not os.path.exists(dir_path):
        continue

      pth_filenames = (f for f in os.listdir(dir_path) if f.endswith('.pth'))
      for pth_filename in pth_filenames:
        yield os.path.join(dir_path, pth_filename)
548654
def source_files(self):
        """"""
        if 'srcs' in self.params and self.params['srcs'] is not None:
            return util.flatten(self.params['srcs'])
1367204
def cpp_files_libraries(aux_libraries)
      arduino_library_src_dirs(aux_libraries).map { |d| cpp_files_in(d) }.flatten.uniq
    end
905834
private File [] getSourceDirectories ()
  {
    final Set <File> directories = new LinkedHashSet <> ();
    if (this.sourceDirectories != null && this.sourceDirectories.length > 0)
    {
      directories.addAll (Arrays.asList (this.sourceDirectories));
    }
    else
    {
      if (this.defaultGrammarDirectoryJavaCC != null)
      {
        directories.add (this.defaultGrammarDirectoryJavaCC);
      }
      if (this.defaultGrammarDirectoryJJTree != null)
      {
        directories.add (this.defaultGrammarDirectoryJJTree);
      }
      if (this.defaultGrammarDirectoryJTB != null)
      {
        directories.add (this.defaultGrammarDirectoryJTB);
      }
    }
    return directories.toArray (new File [directories.size ()]);
  }
1076084
def cpp_files_in(some_dir)
      raise ArgumentError, 'some_dir is not a Pathname' unless some_dir.is_a? Pathname
      return [] unless some_dir.exist? && some_dir.directory?

      real = some_dir.realpath
      files = Find.find(real).map { |p| Pathname.new(p) }.reject(&:directory?)
      cpp = files.select { |path| CPP_EXTENSIONS.include?(path.extname.downcase) }
      not_hidden = cpp.reject { |path| path.basename.to_s.start_with?(".") }
      not_hidden.sort_by(&:to_s)
    end
973271
def extract_gcc_binaries():
    """"""
    patterns = ['/opt/local/bin/g++-mp-[0-9].[0-9]',
                '/opt/local/bin/g++-mp-[0-9]',
                '/usr/local/bin/g++-[0-9].[0-9]',
                '/usr/local/bin/g++-[0-9]']
    if 'darwin' in platform.platform().lower():
        gcc_binaries = []
        for pattern in patterns:
            gcc_binaries += glob.glob(pattern)
        gcc_binaries.sort()
        if gcc_binaries:
            _, gcc = os.path.split(gcc_binaries[-1])
            return gcc
        else:
            return None
    else:
        return None
30983
def get_program_files_dir():
    
    ProgramFiles = bjam.variable("ProgramFiles")
    if ProgramFiles:
        ProgramFiles = ' '.join(ProgramFiles)
    else:
        ProgramFiles = "c:\\Program Files"
    return ProgramFiles
535219
def get_files():
    
    sources = []
    headers = ["datatable/include/datatable.h"]
    assert os.path.isfile(headers[0])
    for dirpath, _, filenames in os.walk("c"):
        for f in filenames:
            fullname = os.path.join(dirpath, f)
            if f.endswith(".h") or f.endswith(".inc"):
                headers.append(fullname)
            elif f.endswith(".c") or f.endswith(".cc"):
                sources.append(fullname)
    return (sources, headers)
745169
def dirs(self):
        """"""
        contents = self.paths
        contents = (BinDir(path.path) for path in contents if path.is_dir)
        return contents
317324
def check_input_files_for_variadic_seq(headerDir, sourceDir):
    """"""
    # Check input files in include/source-directories.
    files  = glob.glob( os.path.join( headerDir, "*.hpp" ) )
    files += glob.glob( os.path.join( headerDir, "aux_", "*.hpp" ) )
    files += glob.glob( os.path.join( sourceDir, "src", "*" ) )
    for currentFile in sorted( files ):
        if check_header_comment( currentFile ):
            return True
    return False
663155
def _get_files_to_lint(self, external_directories):
        """"""
        all_f = []

        for external_dir in external_directories:
            all_f.extend(_all_files_matching_ext(external_dir, "py"))

        packages = self.distribution.packages or list()
        for package in packages:
            all_f.extend(_all_files_matching_ext(package, "py"))

        py_modules = self.distribution.py_modules or list()
        for filename in py_modules:
            all_f.append(os.path.realpath(filename + ".py"))

        all_f.append(os.path.join(os.getcwd(), "setup.py"))

        # Remove duplicates which may exist due to symlinks or repeated
        # packages found by /setup.py
        all_f = list(set([os.path.realpath(f) for f in all_f]))

        exclusions = [
            "*.egg/*",
            "*.eggs/*"
        ] + self.exclusions
        return sorted([f for f in all_f if not _is_excluded(f, exclusions)])
333965
def file_attribs(location,
                 mode=None,
                 owner=None,
                 group=None,
                 use_sudo=False,
                 recursive=True):
    """"""
    return dir_attribs(location=location,
                       mode=mode,
                       owner=owner,
                       group=group,
                       recursive=recursive,
                       use_sudo=False)
788509
function getDirectories(source) {
  const isDirectory = sourcePath => lstatSync(sourcePath).isDirectory()
  return readdirSync(source)
    .map(name => join(source, name))
    .filter(isDirectory)
}
1250959
def files(self):
        """"""
        if self._rundir['ls'] is UNDETERMINED:
            out_stem = pathlib.Path(self.par['ioin']['output_file_stem'] + '_')
            out_dir = self.path / out_stem.parent
            if out_dir.is_dir():
                self._rundir['ls'] = set(out_dir.iterdir())
            else:
                self._rundir['ls'] = set()
        return self._rundir['ls']