Find all directories in the project library that include C++ header files
 @return [Array<Pathname>]
978808
def header_dirs
      real = @base_dir.realpath
      all_files = Find.find(real).map { |f| Pathname.new(f) }.reject(&:directory?)
      unbundled = all_files.reject { |path| vendor_bundle?(path) }
      files = unbundled.select { |path| HPP_EXTENSIONS.include?(path.extname.downcase) }
      files.map(&:dirname).uniq
    end
964339
def find_wheels(projects, search_dirs):
    

    wheels = []

    # Look through SEARCH_DIRS for the first suitable wheel. Don't bother
    # about version checking here, as this is simply to get something we can
    # then use to install the correct version.
    for project in projects:
        for dirname in search_dirs:
            # This relies on only having "universal" wheels available.
            # The pattern could be tightened to require -py2.py3-none-any.whl.
            files = glob.glob(os.path.join(dirname, project + '-*.whl'))
            if files:
                wheels.append(os.path.abspath(files[0]))
                break
        else:
            # We're out of luck, so quit with a suitable error
            logger.fatal('Cannot find a wheel for %s' % (project,))

    return wheels
1217774
def find_files_relative(directory, files)
      return [] unless files.any?
      files.each_with_object([]) do |file, obj|
        path = "#{directory}/#{file}"
        obj << path if File.exist?(path)
      end
    end
114663
def find_runfiles
      result = []
      dirs = runfile_folders
      dirs.each do |d|
        found = Dir[File.join(d, '*.runfile')]
        result << found unless found.empty?
      end
      return result.empty? ? false : result.flatten.uniq
    end
1340931
private static List<File> findPythonLibDirectories(File parentDirectory) {
        List<File> foundDirectories = new ArrayList<>();
        if (parentDirectory != null && parentDirectory.exists()) {
            for (File dir : parentDirectory.listFiles(DIRECTORY_FILE_FILTER)) {
                if (dir.getName().equals("pythonlib")) {
                    foundDirectories.add(dir);
                } else {
                    foundDirectories.addAll(findPythonLibDirectories(dir));
                }
            }
        }
        return foundDirectories;
    }
218834
def read_directories(dir = "")
      base = site.in_source_dir(dir)

      return unless File.directory?(base)

      dot_dirs = []
      dot_pages = []
      dot_static_files = []

      dot = Dir.chdir(base) { filter_entries(Dir.entries("."), base) }
      dot.each do |entry|
        file_path = @site.in_source_dir(base, entry)
        if File.directory?(file_path)
          dot_dirs << entry
        elsif Utils.has_yaml_header?(file_path)
          dot_pages << entry
        else
          dot_static_files << entry
        end
      end

      retrieve_posts(dir)
      retrieve_dirs(base, dir, dot_dirs)
      retrieve_pages(dir, dot_pages)
      retrieve_static_files(dir, dot_static_files)
    end
145752
function paths(dir) {
	var paths = [];

	try {
		fs.statSync(dir);
	}
	catch (e) {
		return e;
	}

	(function traverse(dir, stack) {
		stack.push(dir);
		fs.readdirSync(stack.join('/')).forEach(function(file) {
			var path = stack.concat([file]).join('/'),
				stat = fs.statSync(path);

			if (file[0] == '.' || file === 'vendor') {
				return;
			} else if (stat.isFile() && /\.js$/.test(file)) {
				paths.push(path);
			} else if (stat.isDirectory()) {
				paths.push(path);
				traverse(file, stack);
			}
		});
		stack.pop();
	})(dir || '.', []);

	return paths;
}
726728
def inside_project?
      project_found = false
      cwd = Pathname(Dir.pwd)
      home_directory = File.expand_path('~')
      cwd.ascend do |current_path|
        project_found = File.file?("#{current_path.to_s}/.bebox")
        self.project_root = current_path.to_s if project_found
        break if project_found || (current_path.to_s == home_directory)
      end
      project_found
    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 ()]);
  }
1194357
def project_paths
      return @_project_paths if @_project_paths
      if self.workspace?
        # Find the xcodeproj file, as the information isn't included in the workspace file
        # We have a reference to the workspace, let's find the xcodeproj file
        # Use Xcodeproj gem here to
        # * parse the contents.xcworkspacedata XML file
        # * handle different types (group:, container: etc.) of file references and their paths
        # for details see https://github.com/CocoaPods/Xcodeproj/blob/e0287156d426ba588c9234bb2a4c824149889860/lib/xcodeproj/workspace/file_reference.rb```

        workspace_dir_path = File.expand_path("..", self.path)
        file_references_paths = workspace.file_references.map { |fr| fr.absolute_path(workspace_dir_path) }
        @_project_paths = file_references_paths.select do |current_match|
          # Xcode workspaces can contain loose files now, so let's filter non-xcodeproj files.
          current_match.end_with?(".xcodeproj")
        end.reject do |current_match|
          # We're not interested in a `Pods` project, as it doesn't contain any relevant information about code signing
          current_match.end_with?("Pods/Pods.xcodeproj")
        end

        return @_project_paths
      else
        # Return the path as an array
        return @_project_paths = [path]
      end
    end
761482
def paths
      relative_paths = gem_names.flat_map do |plugin|
        Dir.glob("vendor/gems/ruby/*/gems/#{plugin}*/lib/**/**/**/**.rb")
      end

      relative_paths.map { |path| File.join(dir, path) }
    end
761413
function readFilePaths(files) {
    const locations = [];
    for (let i = 0; i < files.length; i++) {
      const file = files[i];
      const location = path.join(__dirname, "../../../", file);
      locations.push(location);
    }
    return locations;
  }
201287
def arduino_library_src_dirs(aux_libraries)
      # Pull in all possible places that headers could live, according to the spec:
      # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification
      # TODO: be smart and implement library spec (library.properties, etc)?
      subdirs = ["", "src", "utility"]
      all_aux_include_dirs_nested = aux_libraries.map do |libdir|
        subdirs.map { |subdir| Pathname.new(@arduino_lib_dir) + libdir + subdir }
      end
      all_aux_include_dirs_nested.flatten.select(&:exist?).select(&:directory?)
    end
138918
function getRecentProjects() {
        var recentProjects = PreferencesManager.getViewState("recentProjects") || [],
            i;

        for (i = 0; i < recentProjects.length; i++) {
            // We have to canonicalize & then de-canonicalize the path here, since our pref format uses no trailing "/"
            recentProjects[i] = FileUtils.stripTrailingSlash(ProjectManager.updateWelcomeProjectPath(recentProjects[i] + "/"));
        }
        return recentProjects;
    }
1318621
@Override
  public File[] getLibraryPath() {
    if (this.libDirs == null) {
      final File CCloc = CUtil.getExecutableLocation("CC");
      if (CCloc != null) {
        final File compilerLib = new File(new File(CCloc, "../lib").getAbsolutePath());
        if (compilerLib.exists()) {
          this.libDirs = new File[2];
          this.libDirs[0] = compilerLib;
        }
      }
      if (this.libDirs == null) {
        this.libDirs = new File[1];
      }
    }
    this.libDirs[this.libDirs.length - 1] = new File("/usr/lib");
    return this.libDirs;
  }
471147
function getSrcDirPath(projectInfo)
{
    let srcDir
    if(projectInfo.SourceDir){
        srcDir = path.normalize(path.join(projectInfo.ProjectPath, projectInfo.SourceDir))
    }
    return srcDir
}
1216414
def obtain_all_templates_from_a_catalog(catalog_path)
      template_names = []
      catalog_path.children.select { |child|
        File.directory?(child) && child.split.last.to_s[0] != '.'
      }.map { |template_path|
        template_path.split.last.to_s
      }.each { |template_name|
        template_names.push(template_name)
      }
      return template_names
    end