ensure that the given library is installed, or symlinked as appropriate
 return the path of the prepared library, or nil
 @param path [Pathname] library to use
 @return [String] the path of the installed library
197401
def install_local_library(path)
      src_path = path.realpath
      library_name = src_path.basename
      destination_path = library_path(library_name)

      # things get weird if the sketchbook contains the library.
      # check that first
      if destination_path.exist?
        uhoh = "There is already a library '#{library_name}' in the library directory"
        return destination_path if destination_path == src_path

        # maybe it's a symlink? that would be OK
        if destination_path.symlink?
          return destination_path if destination_path.readlink == src_path

          @last_msg = "#{uhoh} and it's not symlinked to #{src_path}"
          return nil
        end

        @last_msg = "#{uhoh}.  It may need to be removed manually."
        return nil
      end

      # install the library
      Host.symlink(src_path, destination_path)
      destination_path
    end
573914
def ensurepath(path_, verbose=None):
    
    if verbose is None:
        verbose = VERYVERBOSE
    return ensuredir(path_, verbose=verbose)
70005
def load_path(self, path):
        

        if not foundations.common.path_exists(path):
            return False

        if os.path.isfile(path):
            if path in self.list_files():
                self.set_current_editor(path)
            else:
                self.load_file(path)
        else:
            if not path in self.list_projects():
                self.add_project(path)
        return True
629318
def path_exists?(path = @path)
      path = path.split(' ') if path.is_a?(String) && path.include?(' ')
      if path.is_a?(Array)
        path.each do |p|
          unless File.exist?(p)
            puts "#{p} does not exist"
            return false
          end
        end
      else
        path = path.gsub('/**', '').gsub('/*', '').gsub(/\/\.*/, '') if path.include?('*')
        if File.exist?(path)
          return true
        else
          puts "#{path} does not exist"
          return false
        end
      end
    end
958593
def output_path(self, path_name):
                
        # make sure it is a valid posix format
        path = to_posix(path_name)
        
        assert (path == path_name), "path_name passed to output_path must be in posix format"
        
        if posixpath.isabs(path):
            if self.output == self.cache:
                # worth seeing if an absolute path can be avoided
                path = posixpath.relpath(path, self.output)

            else:
                return posixpath.realpath(path)
    
        if path.startswith('../'):
            joined = posixpath.join(self.output, path)
            return posixpath.realpath(joined)
    
        return path
1160693
def GetPythonLibraryDirectoryPath():
  """"""
  path = sysconfig.get_python_lib(True)
  _, _, path = path.rpartition(sysconfig.PREFIX)

  if path.startswith(os.sep):
    path = path[1:]

  return path
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
1240393
def paths_of_local_libs
      local_libs = Array.new

      each_local_lib() do |lib|
        if PrjFileCache.contain?('LIB', lib)
          local_libs << "#{tc.settings['LIB_OUT']}/lib#{lib}.a"
        elsif PrjFileCache.contain?('SOLIB', lib)
          local_libs << "#{tc.settings['LIB_OUT']}/lib#{lib}.so"
        end
      end

      local_libs
    end
463119
def ruby_relative_path
      ruby_pathname = Pathname.new(ruby)
      bindir_pathname = Pathname.new(target_bin_dir)
      ruby_pathname.relative_path_from(bindir_pathname).to_s
    end
271217
def find_library(series_path):
    

    for location in cfg.CONF.libraries:
        if os.path.isdir(os.path.join(location, series_path)):
            return location
        # already tried the full path; now walk down the path
        segments = series_path.split(os.sep)[:-1]
        while segments:
            seg_path = os.path.join(*segments)
            # if the directory exists then we found our location
            if os.path.isdir(os.path.join(location, seg_path)):
                return location
            # remove the last element and try again
            segments = segments[:-1]

    return cfg.CONF.default_library
1104397
def check_for_libraries
      output = []

      required_libraries.each do |library|
        begin
          require library
        rescue LoadError
          install_command = @config['install_command']
          install_command = " -- install via #{install_command}" if install_command

          output << "Unable to load '#{library}'#{install_command}"
        end
      end

      return if output.empty?

      output.join("\n")
    end
918001
def load_lib_folder
      return false if Adhearsion.config.core.lib.nil?

      lib_folder = [Adhearsion.config.core.root, Adhearsion.config.core.lib].join '/'
      return false unless File.directory? lib_folder

      $LOAD_PATH.unshift lib_folder

      Dir.chdir lib_folder do
        rbfiles = File.join "**", "*.rb"
        Dir.glob(rbfiles).each do |file|
          require "#{lib_folder}/#{file}"
        end
      end
      true
    end
1146672
function packageNameFromPath(path) {
  var matches = moduleRegex.exec(path);
  return matches && matches.length > 1 ? matches[1] : null;
}
37709
def get_lib_name(self):
        
        # We import in here to make sure the the setup_requires are already installed
        import toml

        cfg = toml.load(self.path)
        name = cfg.get("lib", {}).get("name")
        if name is None:
            name = cfg.get("package", {}).get("name")
        if name is None:
            raise Exception(
                "Can not parse library name from Cargo.toml. "
                "Cargo.toml missing value for 'name' key "
                "in both the [package] section and the [lib] section"
            )
        name = re.sub(r"[./\\-]", "_", name)
        return name
540714
def is_symlink(path):
	
	path = _patch_path(path)
	try:
		return _is_symlink(next(find_files(path)))
	# comment below workaround for PyCQA/pyflakes#376
	except WindowsError as orig_error:  # noqa: F841
		tmpl = "Error accessing {path}: {orig_error.message}"
		raise builtins.WindowsError(tmpl.format(**locals()))
410894
function(opts) {
  // If opts is a string, assume libpath
  if(_.isString(opts)) {
    opts = { path: opts }
  }

  if(!opts) opts = {};
  var libpath = opts['path'];

  this._library = this._createLibrary(libpath);
}
1313076
def _load_library(self):
        
        path = self._library_path()
        logger.info("Loading library from path {}".format(path))
        library_dir = os.path.dirname(path)
        if platform.system() == 'Windows':
            import win32api
            olddir = os.getcwd()
            os.chdir(library_dir)
            win32api.SetDllDirectory('.')

        result = cdll.LoadLibrary(path)

        if platform.system() == 'Windows':
            os.chdir(olddir)

        return result