Adds functions from a library module
        :param library: the library module
        :return:
330828
def add_library(self, library):
        
        for fn in library.__dict__.copy().values():
            # ignore imported methods and anything beginning __
            if inspect.isfunction(fn) and inspect.getmodule(fn) == library and not fn.__name__.startswith('__'):
                name = fn.__name__.lower()

                # strip preceding _ chars used to avoid conflicts with Java keywords
                if name.startswith('_'):
                    name = name[1:]

                self._functions[name] = fn
1035505
def import_module_and_get_function(whole_function):
        
        module, function = whole_function.rsplit('.', 1)
        app_module = importlib.import_module(module)
        app_function = getattr(app_module, function)
        return app_function
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
765736
def functions(self, value):
        

        if value is not None:
            assert type(value) is tuple, "'{0}' attribute: '{1}' type is not 'tuple'!".format("functions", value)
            for element in value:
                assert type(element) is LibraryHook, "'{0}' attribute: '{1}' type is not 'LibraryHook'!".format(
                    "functions", element)
        self.__functions = value
1189842
def build_funcs(modules):
        
        kernel32 = ['kernel32_']
        try:
            kernel32 += remove_dups(modules['kernel32'])
        except KeyError:
            if len(modules) and 'LoadLibraryA' not in kernel32:
                kernel32.insert(1, 'LoadLibraryA')
        if len(modules) > 1 and 'LoadLibraryA' not in kernel32:
            kernel32.insert(1, 'LoadLibraryA')
        if 'GetProcAddress' not in kernel32:
            kernel32.insert(1, 'GetProcAddress')
        logging.debug('kernel32: %s', kernel32)
        for module, funcs in modules.items():
            logging.debug('%s: %s', module, funcs)
            if module != 'kernel32':
                kernel32.extend([module + '_'] + remove_dups(funcs))
        return kernel32
392611
def module_functions(modulestr):
    

    funcs = dict(inspect.getmembers(import_module(modulestr),
                 inspect.isfunction))

    return OrderedDict(sorted(funcs.items(), key=lambda f: f[0]))
138133
def include(module_name, *module_names):
    
    def decorated(fn):
        _add_decorator(fn, "include", nargs=[module_name] + list(module_names))
        return fn

    return decorated
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
715052
def add_function(self, function):
        
        #noinspection PyTypeChecker
        if not len(self.settings.FUNCTION_MANAGERS):
            raise ConfigurationError(
                'Where have the default function manager gone?!')
        self.settings.FUNCTION_MANAGERS[0].add_function(function)
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
1322611
def add(self, calc, module, package=None):
        
        super(Calculations, self).add(calc, module, package)
        # only update layer info if it is missing!
        if calc not in self.layer:
            # copy calc source parameters to :attr:`Layer.layer`
            self.layer[calc] = {'module': module, 'package': package}
        # instantiate the calc object
        self.objects[calc] = self.sources[calc]()
        # register calc and dependencies in registry
        calc_src_obj = self.objects[calc]
        meta = [getattr(calc_src_obj, m) for m in self.reg.meta_names]
        self.reg.register(calc_src_obj.calcs, *meta)
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);
}
567072
def load_library(version):
    
    check_version(version)
    module_name = SUPPORTED_LIBRARIES[version]
    lib = sys.modules.get(module_name)
    if lib is None:
        lib = importlib.import_module(module_name)
    return lib
1352243
def setLib(self, lib):
        
        for name, item in lib.items():
            self.font.lib[name] = item
575369
function collections(library) {
  var instance = proxy(library, 'get', 'collections');

  Object.defineProperties(instance, {

    library: {
      value: library
    },

    top: {
      value: proxy(instance, 'get', 'top')
    },

    collections: {
      value: proxy(instance, 'get', '', 'collections')
    },

    nested: {
      get: function () { return this.collections; }
    },

    items: {
      value: proxy(instance, 'get', '', 'items')
    },

    tags: {
      value: proxy(instance, 'get', '', 'tags')
    }
  });

  Object.defineProperty(instance.items, 'top', {
    value: proxy(instance, 'get', '', 'items/top')
  });

  return instance;
}
469464
def add_to_loaded_modules(self, modules):
        
        modules = util.return_set(modules)
        for module in modules:
            if not isinstance(module, str):
                module = module.__name__
            self.loaded_modules.add(module)
376353
def call(fun, **kwargs):
    '''
    
    '''
    args = kwargs.get('args', [])
    dirs = kwargs.get('dirs', [])

    funcs = LazyLoader(
        [os.path.join(SALT_BASE_PATH, 'modules')] + dirs,
        None,
        tag='modules',
        virtual_enable=False,
    )
    return funcs[fun](*args)