Returns list of include directories for name of libraries in parameter libs

 @param [Array] libs   List of library names

 @return [Array]       List of includes found for given library names
354960
def lib_incs(libs=[])
      includes = Array.new
      libs.each do |name, param|
        lib_includes = PrjFileCache.exported_lib_incs(name)
        includes += lib_includes if lib_includes.any?
      end
      includes
    end
1283533
def library_directories(self) -> typing.List[str]:
        
        def listify(value):
            return [value] if isinstance(value, str) else list(value)

        # If this is a project running remotely remove external library
        # folders as the remote shared libraries folder will contain all
        # of the necessary dependencies
        is_local_project = not self.is_remote_project
        folders = [
            f
            for f in listify(self.settings.fetch('library_folders', ['libs']))
            if is_local_project or not f.startswith('..')
        ]

        # Include the remote shared library folder as well
        folders.append('../__cauldron_shared_libs')

        # Include the project directory as well
        folders.append(self.source_directory)

        return [
            environ.paths.clean(os.path.join(self.source_directory, folder))
            for folder in folders
        ]
310647
def handle_includes(defns):
    '''
    '''
    newdefns = []
    for d in defns:
        if isinstance(d,list):
            newdefns.extend(handle_includes(d))
        else:
            newdefns.append(d)

    return newdefns
373361
def patch_lib_paths(fname, library_dirs):
    
    if sys.platform != 'darwin':
        return
    
    libs = _get_libs(fname)
    for lib in libs:
        if not lib.startswith(('@', '/')):
            real_lib = _find_library(lib, library_dirs)
            if real_lib:
                _install_name_change(fname, lib, real_lib)
853685
function _getLibraries() {
			var libraries = Global.versioninfo ? Global.versioninfo.libraries : undefined;
			var formattedLibraries = Object.create(null);

			if (libraries !== undefined) {
				libraries.forEach(function (element, index, array) {
					formattedLibraries[element.name] = element.version;
				});
			}

			return formattedLibraries;
		}
275316
def calc_dirs_with_files(sources)
      filemap = {}
      sources.keys.sort.reverse.each do |o|
        d = File.dirname(o)
        if filemap.include?(d)
          filemap[d] << o
        else
          filemap[d] = [o]
        end
      end
      return filemap
    end
808723
function (lib) {
    var res = _wlibs[lib];
    if (res == null) {
        res = Aria.getClassRef(lib);
        // TODO: check if res is a library
        _wlibs[lib] = res;
    }
    if (res === undefined) {
        this.$logError(this.WIDGET_LIBRARY_NOT_FOUND, [lib, this.tplClasspath]);
    }
    return res;
}
1075628
def list_files(paths = [], options = {})
      ref = options[:ref] || 'HEAD'
      path_list = paths.empty? ? '' : "\"#{paths.join('" "')}\""
      `git ls-tree --name-only #{ref} #{path_list}`.
        split(/\n/).
        map { |relative_file| File.expand_path(relative_file) }.
        reject { |file| File.directory?(file) } # Exclude submodule directories
    end
1279630
def get_organized_repos(repos)
      forks = []
      publics = []
      mirrors = []
      privates = []
      repos.each do |r|
        repo_name = r[:full_name]
        forks << repo_name if r[:fork]

        if r[:private]
          privates << repo_name
        else
          publics << repo_name
        end

        mirrors << repo_name unless r[:mirror_url].nil?
      end

      {
        public: publics,
        forks: forks,
        mirrors: mirrors,
        privates: privates
      }
    end
177132
def find_static_library(library_name, library_path):
    """"""

    variants = ["lib{0}.a", "{0}.a", "{0}.lib", "lib{0}.lib"]
    if is_unix_like():
        extra_libdirs = ["/usr/local/lib64", "/usr/local/lib",
                "/usr/lib64", "/usr/lib", "/lib64", "/lib"]
    else:
        extra_libdirs = []

    for path in extra_libdirs:
        if path not in library_path and os.path.isdir(path):
            library_path.append(path)

    for path in library_path:
        for variant in variants:
            full_path = os.path.join(path, variant.format(library_name))
            if os.path.isfile(full_path):
                return full_path
543227
def include_template(*files)
      include_base = options[:include_base] || File.dirname(caller.first.split(/:\d/,2).first)
      files.each do |file|
        path = File.join(include_base, file)
        include_file(path)
      end
    end
390844
private void scanLibs(List<T> factories, String libDir) {
    LOG.info("Loading core jars from {}", libDir);
    List<File> files = new ArrayList<>();
    try (DirectoryStream<Path> stream =
        Files.newDirectoryStream(Paths.get(libDir), mExtensionPattern)) {
      for (Path entry : stream) {
        if (entry.toFile().isFile()) {
          files.add(entry.toFile());
        }
      }
    } catch (IOException e) {
      LOG.warn("Failed to load libs: {}", e.toString());
    }
    scan(files, factories);
  }
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
329712
def _find_packages_iter(cls, where, exclude, include):
        
        for root, dirs, files in os.walk(where, followlinks=True):
            # Copy dirs to iterate over it, then empty dirs.
            all_dirs = dirs[:]
            dirs[:] = []

            for dir in all_dirs:
                full_path = os.path.join(root, dir)
                rel_path = os.path.relpath(full_path, where)
                package = rel_path.replace(os.path.sep, '.')

                # Skip directory trees that are not valid packages
                if ('.' in dir or not cls._looks_like_package(full_path)):
                    continue

                # Should this package be included?
                if include(package) and not exclude(package):
                    yield package

                # Keep searching subdirectories, as there may be more packages
                # down there, even if the parent was excluded.
                dirs.append(dir)
1043933
def processLibraryDetails(details):
		
		
		# If the header include directories list contains any directories we have flags for, add them
		for includeDir in details.includeDirs:
			
			# If the directory path matches any of the substrings in our list, generate the relevant flags
			for pattern in CUSTOM_FLAGS_FOR_INCLUDE_DIRS:
				if pattern in includeDir:
					flag = '-D' + CUSTOM_FLAGS_FOR_INCLUDE_DIRS[pattern] + '=' + includeDir
					details.cmakeFlags.append(flag)
		
		# If the libraries list contains any libs we have flags for, add them
		for lib in details.libs:
			
			# Extract the name of the library from the filename
			# (We remove any "lib" prefix or numerical suffix)
			filename = os.path.basename(lib)
			(name, ext) = os.path.splitext(filename)
			libName = name.replace('lib', '') if name.startswith('lib') else name
			libName = libName.rstrip('_-1234567890')
			
			# If the library name matches one in our list, generate its flag
			if libName in CUSTOM_FLAGS_FOR_LIBS:
				flag = '-D' + CUSTOM_FLAGS_FOR_LIBS[libName] + '=' + lib
				details.cmakeFlags.append(flag)
1308400
def find_packages(self, include):
        
        pkgdir = None
        if include.source is not None:
            pkgdir = str(include.base)

        base = str(include.elements[0].parent)

        pkg_name = include.package
        pkg_data = defaultdict(list)
        # Undocumented distutils feature:
        # the empty string matches all package names
        pkg_data[""].append("*")
        packages = [pkg_name]
        subpkg_paths = set()

        def find_nearest_pkg(rel_path):
            parts = rel_path.split(os.sep)
            for i in reversed(range(1, len(parts))):
                ancestor = "/".join(parts[:i])
                if ancestor in subpkg_paths:
                    pkg = ".".join([pkg_name] + parts[:i])
                    return pkg, "/".join(parts[i:])

            # Relative to the top-level package
            return pkg_name, Path(rel_path).as_posix()

        excluded_files = self.find_excluded_files()
        for path, dirnames, filenames in os.walk(str(base), topdown=True):
            if os.path.basename(path) == "__pycache__":
                continue

            from_top_level = os.path.relpath(path, base)
            if from_top_level == ".":
                continue

            is_subpkg = "__init__.py" in filenames
            if is_subpkg:
                subpkg_paths.add(from_top_level)
                parts = from_top_level.split(os.sep)
                packages.append(".".join([pkg_name] + parts))
            else:
                pkg, from_nearest_pkg = find_nearest_pkg(from_top_level)

                data_elements = [
                    f.relative_to(self._path)
                    for f in Path(path).glob("*")
                    if not f.is_dir()
                ]

                data = [e for e in data_elements if not self.is_excluded(e)]
                if not data:
                    continue

                if len(data) == len(data_elements):
                    pkg_data[pkg].append(pjoin(from_nearest_pkg, "*"))
                else:
                    for d in data:
                        if d.is_dir():
                            continue

                        pkg_data[pkg] += [pjoin(from_nearest_pkg, d.name) for d in data]

        # Sort values in pkg_data
        pkg_data = {k: sorted(v) for (k, v) in pkg_data.items() if v}

        return pkgdir, sorted(packages), pkg_data
259630
def get_included_databases(self):
        
        databases = set()
        databases.update(self._plain_db.keys())

        for _, namespace in self._regex_map:
            database_name, _ = namespace.source_name.split(".", 1)
            if "*" in database_name:
                return []
            databases.add(database_name)

        return list(databases)