Loads a plugin manifest from a given path

        :param path: The folder to load the plugin manifest from
168347
def load_manifest(self, path):
        
        manifest_path = os.path.join(path, "plugin.json")
        self._logger.debug("Attempting to load plugin manifest from {}.".format(manifest_path))
        try:
            with open(manifest_path) as f:
                manifest = json.load(f)
            manifest["path"] = path
            self._manifests.append(manifest)
            self._logger.debug("Loaded plugin manifest from {}.".format(manifest_path))
        except ValueError:
            self._logger.error("Failed to decode plugin manifest at {}.".format(manifest_path))
        except (OSError, IOError) as e:
            self._logger.error("Failed to load plugin manifest at {}.".format(manifest_path))
1078273
def from_path(cls, path: pathlib.Path) -> 'Entity':
        
        if path.is_file():
            return File.from_path(path)
        return Directory.from_path(path)
1316672
def load(self, path):
        
        meta = self._loadMetaFromJson(path)
        return CompleteMeasurement(meta, self.dataDir) if meta is not None else None
89334
def loadFromFile(self, path):
        
        if '~' in path:
            path = os.path.expanduser(path)
        f = open(path)
        body = f.read()
        f.close()
        self._path = path
        self.loadFromString(body)
343788
function (pluginsPath) {
    var plugins = fs.readdirSync(pluginsPath);
    var loadedPlugin = [];
    plugins.forEach(function (pluginName) {
        if (pluginName !== 'index.js') {
            loadedPlugin.push(require(path.resolve(pluginsPath, path.basename(pluginName, '.js'))));
        }
    });
    return loadedPlugin;
}
755817
def load(self, path):
        
        self.dct = wrapper.Dictionary()
        self.guide = wrapper.Guide()

        with open(path, 'rb') as f:
            self.dct.read(f)
            self.guide.read(f)

        return self
998588
public static void loadPluginPath(final String plugin_path) {
    if (plugin_path != null && !plugin_path.isEmpty()) {
      try {
        PluginLoader.loadJARs(plugin_path);
      } catch (Exception e) {
        LOG.error("Error loading plugins from plugin path: " + plugin_path, e);
        throw new RuntimeException("Error loading plugins from plugin path: " +
                plugin_path, e);
      }
    }
  }
580015
def load_custom_tc_plugins(self, plugin_path=None):
        
        if not plugin_path:
            return
        directory = os.path.dirname(plugin_path)
        sys.path.append(directory)
        modulename = os.path.split(plugin_path)[1]
        # Strip of file extension.
        if "." in modulename:
            modulename = modulename[:modulename.rindex(".")]
        try:
            module = importlib.import_module(modulename)
        except ImportError:
            raise PluginException("Unable to import custom plugin information from {}.".format(
                plugin_path))
        for plugin_name, plugin_class in module.plugins_to_load.items():
            if issubclass(plugin_class, PluginBase):
                try:
                    self.register_tc_plugins(plugin_name, plugin_class())
                except PluginException as error:
                    self.logger.debug(error)
                    continue
423470
def load_dict_from_yaml(path):
    
    f = file(path, 'r')
    dictionary = yaml.load(f)
    f.close()
    return dictionary
832743
def load(path, **kw):
    
    _kw = {}
    if PY3:  # pragma: no cover
        _kw['encoding'] = 'utf-8'
    with open(str(path), **_kw) as fp:
        return json.load(fp, **kw)
203080
def load_from_path(self, filepath, container, **opts):
        
        root = ET.parse(filepath).getroot()
        nspaces = _namespaces_from_file(filepath)
        return root_to_container(root, container=container,
                                 nspaces=nspaces, **opts)
46356
def from_file(cls, file_path: Path, w3: Web3) -> "Package":
        
        if isinstance(file_path, Path):
            raw_manifest = file_path.read_text()
            validate_raw_manifest_format(raw_manifest)
            manifest = json.loads(raw_manifest)
        else:
            raise TypeError(
                "The Package.from_file method expects a pathlib.Path instance."
                f"Got {type(file_path)} instead."
            )
        return cls(manifest, w3, file_path.as_uri())
1243395
def load_plugin(self, manifest, *args):
        
        if self.get_plugin_loaded(manifest["name"]):
            self._logger.debug("Plugin {} is already loaded.".format(manifest["name"]))
            return
        try:
            self._logger.debug("Attempting to load plugin {}.".format(manifest["name"]))
            for dependency in manifest.get("dependencies", []):
                if not self.get_plugin_loaded(dependency):
                    self._logger.debug("Must load dependency {} first.".format(dependency))
                    if self.get_manifest(dependency) is None:
                        self._logger.error("Dependency {} could not be found.".format(dependency))
                    else:
                        self.load_plugin(self.get_manifest(dependency), *args)

            not_loaded = [i for i in manifest.get("dependencies", []) if not self.get_plugin_loaded(i)]
            if len(not_loaded) != 0:
                self._logger.error("Plugin {} failed to load due to missing dependencies. Dependencies: {}".format(
                    manifest["name"], ", ".join(not_loaded)
                ))
                return

            if PY3:
                spec = importlib.util.spec_from_file_location(
                    manifest.get("module_name", manifest["name"].replace(" ", "_")),
                    os.path.join(manifest["path"], manifest.get("main_path", "__init__.py"))
                )
                module = importlib.util.module_from_spec(spec)
                spec.loader.exec_module(module)
            else:
                module = imp.load_source(
                    manifest.get("module_name", manifest["name"].replace(" ", "_")),
                    os.path.join(manifest["path"], manifest.get("main_path", "__init__.py"))
                )

            module_class = manifest.get("main_class", "Plugin")
            plugin_class = getattr(module, module_class)
            if issubclass(plugin_class, self._plugin_class):
                plugin = plugin_class(manifest, *args)
            else:
                self._logger.error("Failed to load {} due to invalid baseclass.".format(manifest["name"]))
                return
            self._plugins[manifest["name"]] = plugin
            self._modules[manifest["name"]] = module

            self._logger.debug("Plugin {} loaded.".format(manifest["name"]))

        except:
            exc_path = os.path.join(manifest["path"], "error.log")
            with open(exc_path, "w") as f:
                f.write(traceback.format_exc(5))
            self._logger.error("Failed to load plugin {}. Error log written to {}.".format(manifest["name"], exc_path))
811492
def load(self, path):
        
        path = os.path.expandvars(os.path.expanduser(path))

        gdg = cgaddag.gdg_load(path.encode("ascii"))
        if not gdg:
            errno = ctypes.c_int.in_dll(ctypes.pythonapi, "errno").value
            raise OSError(errno, os.strerror(errno), path)

        self.__del__()
        self.gdg = gdg.contents
1346814
def load(self, path: str) -> ClassFile:
        
        # Try to refresh the class from the cache, loading it from disk
        # if not found.
        try:
            r = self.class_cache.pop(path)
        except KeyError:
            with self.open(f'{path}.class') as source:
                r = self.klass(source)

        r.classloader = self
        # Even if it was found re-set the key to update the OrderedDict
        # ordering.
        self.class_cache[path] = r

        # If the cache is enabled remove every item over N started from
        # the least-used.
        if self.max_cache > 0:
            to_pop = max(len(self.class_cache) - self.max_cache, 0)
            for _ in repeat(None, to_pop):
                self.class_cache.popitem(last=False)

        return r
1109787
def load(self, path=None, fatal=True, logger=None):
        
        self.reset()
        if path:
            self._path = path
            self._source = short(path)

        else:
            path = getattr(self, "_path", None)

        if path:
            self.set_from_dict(read_json(path, default={}, fatal=fatal, logger=logger))
793021
function loadFromFile(path) {
    var data = fs.readFileSync(path, {encoding: "utf8"});
    _root = Repository.readObject(data);
    return _root;
}