Load features of configuration to get plugin tasks etc.
423755
function (config) {
    return _.map(config.features, function(featureDef) {
      var feature = null
        , featurePath = null;

      var featureId = featureDef.$featureId || featureDef.feature;

      // Try to require the feature from each path listed in `config.featurePaths`.
      for (var i = 0; i < config.featurePaths.length; ++i) {
        featurePath = path.join(config.featurePaths[i], featureDef.feature);
        if (fs.existsSync(featurePath) || fs.existsSync(featurePath + '.js')) {
          feature = require(featurePath);
          break;
        }
      }

      if (!feature) {
        var errorMsg =
          'Cannot find feature: ' + util.inspect(featureDef.feature) +
          ' from featurePaths: ' + util.inspect(config.featurePaths);
        throw new Error(errorMsg);
      }

      var featureTasks = _.get(feature, 'tasks', []);

      return {
        featureId: featureId,
        featureDef: featureDef,
        featureConstructor : feature,
        tasks: featureTasks
      };
    });
  }
770089
def load_manifests(self):
        
        for path in self.plugin_paths:
            for item in os.listdir(path):
                item_path = os.path.join(path, item)
                if os.path.isdir(item_path):
                    self.load_manifest(item_path)
169991
def load_base(namespace, plugin_type, provider, options = {})
    logger.info("Fetching plugin #{namespace} #{plugin_type} provider #{provider} at #{Time.now}")

    type_info  = loaded_plugin(namespace, plugin_type, provider)
    options    = translate_type(type_info, options)
    config     = Config.ensure(options)

    provider   = config.get(:provider, provider)
    name       = config.get(:name, nil)
    ensure_new = config.get(:new, false)

    if name
      logger.debug("Looking up existing instance of #{name}")

      if existing_instance = get(namespace, plugin_type, name)
        unless ensure_new
          config.delete(:new)

          config.export.each do |property_name, value|
            unless [ :name, :meta ].include?(property_name)
              existing_instance[property_name] = value
            end
          end
          existing_instance.normalize(true)

          logger.debug("Using existing instance of #{plugin_type}, #{name}")
          return existing_instance
        end
      end
    end
    create(namespace, plugin_type, provider, config)
  end
141138
def load_config(cls, opts, path=None, profile=None):
        """"""
        if path and os.path.exists(path):
            if os.path.isdir(path):
                cls.config_searchpath.insert(0, path)
            else:
                cls.config_files.insert(0, path)

        config = cls.read_config()
        values = config.get("default", {})
        cls._load_values_into_opts(opts, values)

        if profile and profile != "default":
            values = config.get("profile:%s" % profile, {})
            cls._load_values_into_opts(opts, values)

        return values
577615
def get_plugins_by_feature(features):
    
    if not features:
        return get_all_plugins()
    plugins = PluginLoader.load_all().items()
    names = set([f.__name__ for f in features])
    return [e for e, plugin in plugins if names & set(plugin.__dict__.keys())]
209179
def load_site_config(name):
    """"""
    return _load_config_json(
        os.path.join(
            CONFIG_PATH,
            CONFIG_SITES_PATH,
            name + CONFIG_EXT
        )
    )
120397
def _load_plugin(self, plugin_script, args=None, config=None):
        """"""
        # The key is the plugin name
        # for example, the file glances_xxx.py
        # generate self._plugins_list["xxx"] = ...
        name = plugin_script[len(self.header):-3].lower()
        try:
            # Import the plugin
            plugin = __import__(plugin_script[:-3])
            # Init and add the plugin to the dictionary
            if name in ('help', 'amps', 'ports', 'folders'):
                self._plugins[name] = plugin.Plugin(args=args, config=config)
            else:
                self._plugins[name] = plugin.Plugin(args=args)
            # Set the disable_<name> to False by default
            if self.args is not None:
                setattr(self.args,
                        'disable_' + name,
                        getattr(self.args, 'disable_' + name, False))
        except Exception as e:
            # If a plugin can not be log, display a critical message
            # on the console but do not crash
            logger.critical("Error while initializing the {} plugin ({})".format(name, e))
            logger.error(traceback.format_exc())
472716
def load_all_plugins(self):
        """"""

        # Go through the existing python files in the plugin directory
        self.plugin_path = os.path.realpath(self.plugin_dir)
        sys.path.append(self.plugin_dir)
        print '<<< Plugin Manager >>>'
        for f in [os.path.join(self.plugin_dir, child) for child in os.listdir(self.plugin_dir)]:

            # Skip certain files
            if '.DS_Store' in f or '__init__.py' in f: 
                continue

            # Add the plugin
            self.add_plugin(f)
692370
def get_config_parameters(plugin_path):
    """"""
    json_config_path = os.path.join(plugin_path, defs.CONFIG_FILE_NAME)
    with open(json_config_path, "r") as f:
        config = json.load(f)
    return config.get(defs.PARAMETERS, [])
378466
def _load_config(self):
        
        config = import_module('config')
        variables = [var for var in dir(config) if not var.startswith('_')]
        return {var: getattr(config, var) for var in variables}
505765
def load_cli_plugins(cli, config_dir=None):
    """"""
    from .config import load_master_config

    config = load_master_config(config_dir=config_dir)
    plugins = discover_plugins(config.Plugins.dirs)

    for plugin in plugins:
        if not hasattr(plugin, 'attach_to_cli'):  # pragma: no cover
            continue
        logger.debug("Attach plugin `%s` to CLI.", _fullname(plugin))
        # NOTE: plugin is a class, so we need to instantiate it.
        try:
            plugin().attach_to_cli(cli)
        except Exception as e:  # pragma: no cover
            logger.error("Error when loading plugin `%s`: %s", plugin, e)
620110
def load_tasks(self, cmd, params, args):
        """"""
        return generate_tasks('taskname that shows up in log', self._gen_tasks()), self.DOIT_CONFIG
689767
def load_configuration():
    """"""

    (belbio_conf_fp, belbio_secrets_fp) = get_belbio_conf_files()
    log.info(f"Using conf: {belbio_conf_fp} and secrets files: {belbio_secrets_fp} ")

    config = {}
    if belbio_conf_fp:
        with open(belbio_conf_fp, "r") as f:
            config = yaml.load(f, Loader=yaml.SafeLoader)
            config["source_files"] = {}
            config["source_files"]["conf"] = belbio_conf_fp

    if belbio_secrets_fp:
        with open(belbio_secrets_fp, "r") as f:
            secrets = yaml.load(f, Loader=yaml.SafeLoader)
            config["secrets"] = copy.deepcopy(secrets)
            if "source_files" in config:
                config["source_files"]["secrets"] = belbio_secrets_fp

    get_versions(config)

    # TODO - needs to be completed
    # add_environment_vars(config)

    return config
145308
def load_plugins(self):
        
        try:
            from pkg_resources import iter_entry_points
        except ImportError:
            return
        for ep in iter_entry_points(group="custodian.%s" % self.plugin_type):
            f = ep.load()
            f()
764485
def load_plugins(self, ):
        
        for p in self.__plugins.values():
            try:
                self.load_plugin(p)
            except errors.PluginInitError:
                log.exception('Initializing the plugin: %s failed.' % p)
635143
def load(self, client, webpy_app, course_factory, task_factory, database, user_manager, submission_manager, config):
        
        self._app = webpy_app
        self._task_factory = task_factory
        self._database = database
        self._user_manager = user_manager
        self._submission_manager = submission_manager
        self._loaded = True
        for entry in config:
            module = importlib.import_module(entry["plugin_module"])
            module.init(self, course_factory, client, entry)
1237458
def load_config(deploy_dir):
    '''
    
    '''

    config = Config()
    config_filename = path.join(deploy_dir, 'config.py')

    if path.exists(config_filename):
        extract_file_config(config_filename, config)

        # Now execute the file to trigger loading of any hooks
        exec_file(config_filename)

    return config