Loads the bot's actual code which is stored in the bot's +lib+
 subdirectory.
965017
def load_bot_code
      load_special_tasks
      files = Dir["#{File.expand_path('./lib', @options[:current_dir])}/**/*"]
      files.each do |file|
        require_relative file.sub(/\.rb$/, '') if file.end_with? '.rb'
      end
    end
480565
def load(self):
        
        # If we are given a string, open it up else assume it's something we
        # can call read on.
        if isinstance(self.specfile, str):
            f = open(self.specfile, 'r')
        else:
            f = self.specfile

        for line in f:
            if self.v_regex.match(line):
                self._pkg_version = self.v_regex.match(line).group(1)
            if self.n_regex.match(line):
                self._pkg_name = self.n_regex.match(line).group(1)
        f.close()
        self._loaded = True
167565
async function loadModulesConfig()
{
    if(!modulesLoaded)
    {
		for (let i = 0; i < modules.length; i++) {
			await applyBotDataSource(modules[i]);
        }
        
        modulesLoaded = true;
    }
}
235752
def load(cls, fpath):
        
        module_name = os.path.splitext(os.path.basename(fpath))[0]

        sys.path.insert(0, os.path.dirname(fpath))
        try:
            module = import_module(module_name)

        finally:
            sys.path = sys.path[1:]

        return module
552657
def load_stdlib():
    '''
    '''
    if _stdlib:
        return _stdlib

    prefixes = tuple({os.path.abspath(p) for p in (
        sys.prefix,
        getattr(sys, 'real_prefix', sys.prefix),
        getattr(sys, 'base_prefix', sys.prefix),
    )})

    for sp in sys.path:
        if not sp:
            continue
        _import_paths.append(os.path.abspath(sp))

    stdpaths = tuple({p for p in _import_paths
                      if p.startswith(prefixes) and 'site-packages' not in p})

    _stdlib.update(sys.builtin_module_names)

    for stdpath in stdpaths:
        if not os.path.isdir(stdpath):
            continue

        for item in os.listdir(stdpath):
            if item.startswith('.') or item == 'site-packages':
                continue

            p = os.path.join(stdpath, item)
            if not os.path.isdir(p) and not item.endswith(('.py', '.so')):
                continue

            _stdlib.add(item.split('.', 1)[0])

    return _stdlib
930537
def load_source(self):
    """"""
    if self.filename in self.STDIN_NAMES:
      self.filename = 'stdin'
      self.source = pycodestyle.stdin_get_value()
    else:
      with pep257.tokenize_open(self.filename) as fd:
        self.source = fd.read()
389281
def load(target, source_module=None):
    """"""
    module, klass, function = _get_module(target)
    if not module and source_module:
        module = source_module
    if not module:
        raise MissingModule(
            "No module name supplied or source_module provided.")
    actual_module = sys.modules[module]
    if not klass:
        return getattr(actual_module, function)

    class_object = getattr(actual_module, klass)
    if function:
        return getattr(class_object, function)
    return class_object
123915
def lib(ctx,
        filepath=None,
        extra=False,
        bootstrap=False,
        cache=False,
        reveal=False,
        show=False,
        save=False,
        directory=False):
    
    verbose = ctx.obj['VERBOSE']
    sTime = ctx.obj['STIME']
    print_opts = {
        'labels': verbose,
    }
    DONE_ACTION = False

    if bootstrap:
        DONE_ACTION = True
        action_bootstrap(verbose)
        printDebug("Tip: you can now load an ontology by typing `ontospy lib -s`",
                   "important")
        # raise SystemExit(1)

    elif cache:
        DONE_ACTION = True
        action_cache_reset()

    elif directory:
        if not filepath:
            printDebug("Please specify a new directory for the local library.",
                       'important')
            sys.exit(0)
        else:
            _location = filepath[0]
            if _location.endswith("/"):
                # dont need the final slash
                _location = _location[:-1]
            output = action_update_library_location(_location)
            if output:
                printDebug(
                    "Note: no files have been moved or deleted (this has to be done manually)",
                    "comment")
                printDebug("----------\n" + "New location: '%s'" % _location,
                           "important")

            else:
                printDebug(
                    "----------\n" + "Please specify an existing folder path.",
                    "important")
            raise SystemExit(1)

    elif reveal:
        action_reveal_library()
        raise SystemExit(1)

    elif save:
        if filepath:
            DONE_ACTION = True
            action_import(filepath[0], verbose)
        else:
            click.secho(
                "You provided no arguments - please specify what to save..",
                fg='white')
        raise SystemExit(1)

    elif show:
        click.secho("Local library => '%s'" % get_home_location(), fg='white')
        filename = action_listlocal(all_details=False)

        if filename:
            DONE_ACTION = True
            g = get_pickled_ontology(filename)
            if not g:
                g = do_pickle_ontology(filename)
            shellPrintOverview(g, print_opts)

    else:
        click.echo(ctx.get_help())
        return

    if DONE_ACTION:
        eTime = time.time()
        tTime = eTime - sTime
        printDebug("\n-----------\n" + "Time:	   %0.2fs" % tTime, "comment")
    else:
        printDebug("Goodbye", "comment")
805548
def load_module(self, name):
        
        _verbose_message('namespace module loaded with path {!r}', self.path)

        # Adjusting code from LoaderBasics
        if name in sys.modules:
            mod = sys.modules[name]
            self.exec_module(mod)
            # In this case we do not want to remove the module in case of error
            # Ref : https://docs.python.org/3/reference/import.html#loaders
        else:
            try:
                # Building custom spec and loading as in _LoaderBasics...
                spec = ModuleSpec(name, self, origin='namespace', is_package=True)
                spec.submodule_search_locations = self.path

                # this will call create_module and also initialize the module properly (like for py3)
                mod = module_from_spec(spec)

                # as per https://docs.python.org/3/reference/import.html#loaders
                assert mod.__name__ in sys.modules

                self.exec_module(mod)
                # We don't ensure that the import-related module attributes get
                # set in the sys.modules replacement case.  Such modules are on
                # their own.
            except:
                # as per https://docs.python.org/3/reference/import.html#loaders
                if name in sys.modules:
                    del sys.modules[name]
                raise

        return sys.modules[name]
572967
def loadModule(self, modName, **userCtx):
        """"""
        for mibSource in self._mibSources:
            debug.logger & debug.FLAG_BLD and debug.logger(
                'loadModule: trying %s at %s' % (modName, mibSource))

            try:
                codeObj, sfx = mibSource.read(modName)

            except IOError as exc:
                debug.logger & debug.FLAG_BLD and debug.logger(
                    'loadModule: read %s from %s failed: '
                    '%s' % (modName, mibSource, exc))
                continue

            modPath = mibSource.fullPath(modName, sfx)

            if modPath in self._modPathsSeen:
                debug.logger & debug.FLAG_BLD and debug.logger(
                    'loadModule: seen %s' % modPath)
                break

            else:
                self._modPathsSeen.add(modPath)

            debug.logger & debug.FLAG_BLD and debug.logger(
                'loadModule: evaluating %s' % modPath)

            g = {'mibBuilder': self,
                 'userCtx': userCtx}

            try:
                exec(codeObj, g)

            except Exception:
                self._modPathsSeen.remove(modPath)
                raise error.MibLoadError(
                    'MIB module "%s" load error: '
                    '%s' % (modPath, traceback.format_exception(*sys.exc_info())))

            self._modSeen[modName] = modPath

            debug.logger & debug.FLAG_BLD and debug.logger(
                'loadModule: loaded %s' % modPath)

            break

        if modName not in self._modSeen:
            raise error.MibNotFoundError(
                'MIB file "%s" not found in search path '
                '(%s)' % (modName and modName + ".py[co]", ', '.join(
                    [str(x) for x in self._mibSources])))

        return self
173053
def load(self):
        """"""
        module = importlib.import_module(self.import_path)
        if self.attr:
            return getattr(module, self.attr)
        return module
1091869
def load(self, path):
        
        with open(path) as f:
            code = f.read()
            exec(code, {}, self.__dict__)
454688
def load_dir(dir)
      logger.debug { "Loading the class definitions in #{dir}..." }
      # Import the classes.
      srcs = sources(dir)
      # Introspect and load the classes in reverse class order, i.e. superclass before subclass.
      klasses = srcs.keys.transitive_closure { |k| [k.superclass] }.select { |k| srcs[k] }.reverse
      # Introspect the classes as necessary.
      klasses.each { |klass| add_metadata(klass) unless introspected?(klass) }
      # Load the classes.
      klasses.each do |klass|
        file = srcs[klass]
        load_definition(klass, file)
      end
      logger.debug { "Loaded the class definitions in #{dir}." }
    end
1165697
def _load_root_directory(self):
        
        kwargs = self._req_directory(0)
        self._root_directory = Directory(api=self, **kwargs)
1252210
def load_subcommand(subparsers):
    """"""
    parser_analyze = subparsers.add_parser('echo_conf', help='Echo sample configuration file')
    parser_analyze.set_defaults(func=echo_conf)
1339492
def __load(self):
        
        parts = self.__class_name.split('.')
        module_name = ".".join(parts[:-1])
        module = __import__(module_name)
        modules = []
        for comp in parts[1:]:
            module = getattr(module, comp)
            modules.append(module)

        self.__module = modules[-2]
902188
def load_module(self, name):
        
        # Implementation inspired from pytest.rewrite and importlib

        # If there is an existing module object named 'name' in
        # sys.modules, the loader must use that existing module. (Otherwise,
        # the reload() builtin will not work correctly.)
        if name in sys.modules:
            return sys.modules[name]
        try:
            # we have already done the search, an gone through package layers
            # so we directly feed the latest module and correct path
            # to reuse the logic for choosing the proper loading behavior

            # TODO : double check maybe we do not need the loop here, already handled by finders in dir hierarchy
            # TODO : use exec_module (recent, more tested API) from here
            for name_idx, name_part in enumerate(name.split('.')):
                pkgname = ".".join(name.split('.')[:name_idx+1])
                if pkgname not in sys.modules:
                    if '.' in pkgname:
                        # parent has to be in sys.modules. make sure it is a package, else fails
                        if '__path__' in vars(sys.modules[pkgname.rpartition('.')[0]]):
                            path = sys.modules[pkgname.rpartition('.')[0]].__path__
                        else:
                            raise ImportError("{0} is not a package (no __path__ detected)".format(pkgname.rpartition('.')[0]))
                    else:  # using __file__ instead. should always be there.
                        path = os.path.dirname(sys.modules[pkgname].__file__)if pkgname in sys.modules else None
                    try:
                        file, pathname, description = imp.find_module(pkgname.rpartition('.')[-1], path)
                        sys.modules[pkgname] = imp.load_module(pkgname, file, pathname, description)
                    finally:
                        if file:
                            file.close()
        except:
            # dont pollute the interpreter environment if we dont know what we are doing
            if name in sys.modules:
                del sys.modules[name]
            raise
        return sys.modules[name]