install a library by name
 @param name [String] the library name
 @return [bool] whether the command succeeded
332397
def _install_library(library_name)
      result = run_and_capture(flag_install_library, library_name)

      already_installed = result[:err].include?("Library is already installed: #{library_name}")
      success = result[:success] || already_installed

      @libraries_indexed = (@libraries_indexed || success) if library_name == WORKAROUND_LIB
      success
    end
555156
def op_install_package(self, names):
        
        venvs = self.get_venvs()
        for venv in venvs:
            for name in names:
                self.venv_install(name, self._get_venv_path(venv))
765590
def enable(name, **kwargs):
    '''
    
    '''
    osmajor = _osrel()[0]
    if osmajor < '6':
        cmd = 'update-rc.d -f {0} defaults 99'.format(_cmd_quote(name))
    else:
        cmd = 'update-rc.d {0} enable'.format(_cmd_quote(name))
    try:
        if int(osmajor) >= 6:
            cmd = 'insserv {0} && '.format(_cmd_quote(name)) + cmd
    except ValueError:
        osrel = _osrel()
        if osrel == 'testing/unstable' or osrel == 'unstable' or osrel.endswith("/sid"):
            cmd = 'insserv {0} && '.format(_cmd_quote(name)) + cmd
    return not __salt__['cmd.retcode'](cmd, python_shell=True)
1253067
def install_unit?(unit, type, quiet = false)
      unit.install?
      logger.info do
        "Testing install for #{type_name(type)}:" \
        " #{unit.source} => #{unit.destination_path}"
      end unless quiet
      return true

    rescue Unit::InstallFailed => e
      logger.error { "Cannot install #{type_name(type)}: #{e}" }
      return false
    end
973322
def add_library(self, name):
        
        libdoc = LibraryDocumentation(name)
        if len(libdoc.keywords) > 0:
            # FIXME: figure out the path to the library file
            collection_id = self.add_collection(None, libdoc.name, libdoc.type,
                                                libdoc.doc, libdoc.version,
                                                libdoc.scope, libdoc.named_args,
                                                libdoc.doc_format)
            self._load_keywords(collection_id, libdoc=libdoc)
1286466
def remove_lib(lib_name):
    
    targ_dlib = libraries_dir() / lib_name
    log.debug('remove %s', targ_dlib)
    targ_dlib.rmtree()
123676
function addLib($name) {
        if (isset($this->_libs[$name])) return;
        if (isset(self::$libs[$name])) {
            $this->_libs[$name] = true;
            $this->addFromArray(self::$libs[$name]);
        }
    }
74863
def load_ctypes_library(name):
    

    try:
        return cdll.LoadLibrary(name)
    except OSError:
        name = find_library(name)
        if name is None:
            raise
        return cdll.LoadLibrary(name)
759980
def add_installed_libraries(self, extra_libs = ["Selenium2Library",
                                                    "SudsLibrary",
                                                    "RequestsLibrary"]):
        

        libdir = os.path.dirname(robot.libraries.__file__)
        loaded = []
        for filename in os.listdir(libdir):
            if filename.endswith(".py") or filename.endswith(".pyc"):
                libname, ext = os.path.splitext(filename)
                if (libname.lower() not in loaded and
                    not self._should_ignore(libname)):

                    try:
                        self.add(libname)
                        loaded.append(libname.lower())
                    except Exception as e:
                        # need a better way to log this...
                        self.log.debug("unable to add library: " + str(e))

        # I hate how I implemented this, but I don't think there's
        # any way to find out which installed python packages are
        # robot libraries.
        for library in extra_libs:
            if (library.lower() not in loaded and
                not self._should_ignore(library)):
                try:
                    self.add(library)
                    loaded.append(library.lower())
                except Exception as e:
                    self.log.debug("unable to add external library %s: %s" % \
                                   (library, str(e)))
114537
def add_command(self, cmd, name=None):
        
        name = name or cmd.name
        if name is None:
            raise TypeError('Command has no name.')
        self.commands[name] = cmd
614609
public function hasMethod($name) {
		try {
			$method = new ReflectionMethod($this, $name);
			if (!$method->isPublic() || substr($name, 0, 1) === '_') {
				return false;
			}
			if ($method->getDeclaringClass()->name === 'Shell') {
				return false;
			}
			$installerCommands = $this->ConfigInstaller->getListInstallerCommands(false);
			$defaultCommands = ['main' => null];
			$commands = $installerCommands + $defaultCommands;
			if (!array_key_exists($name, $commands)) {
				return false;
			}

			return true;
		} catch (ReflectionException $e) {
			return false;
		}

		return true;
	}
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
528680
def executable(name)
      define_method(name) do |*command|
        Executable.execute_command(name, Array(command).flatten, false)
      end

      define_method(name.to_s + '!') do |*command|
        Executable.execute_command(name, Array(command).flatten, true)
      end
    end
1134988
def sbo(self, name):
        
        if (self.meta.rsl_deps in ["on", "ON"] and
                "--resolve-off" not in self.flag):
            sys.setrecursionlimit(10000)
            dependencies = []
            requires = SBoGrep(name).requires()
            if requires:
                for req in requires:
                    status(0.03)
                    # toolbar_width = status(index, toolbar_width, 1)
                    # avoid to add %README% as dependency and
                    # if require in blacklist
                    if "%README%" not in req and req not in self.blacklist:
                        dependencies.append(req)
                if dependencies:
                    self.dep_results.append(dependencies)
                    for dep in dependencies:
                        self.sbo(dep)
            return self.dep_results
        else:
            return []
253856
def add_external_library(library):
    

    for command in ['build', 'build_ext', 'install']:
        add_command_option(command, str('use-system-' + library),
                           'Use the system {0} library'.format(library),
                           is_bool=True)
1090555
def install_package_command(package_name):
    ''''''
    #TODO refactor python logic
    if sys.platform == "win32":
        cmds = 'python -m pip install --user {0}'.format(package_name)
    else:
        cmds = 'python3 -m pip install --user {0}'.format(package_name)
    call(cmds, shell=True)
694083
def set_library(pLibrary)
      return nil if (pLibrary.nil?) ||
                    (!pLibrary.is_a? String) ||
                    (pLibrary.empty?)

      @library = pLibrary
    end