Load the context module pointed to by the environment variable. This
        is used the first time we need the context at all, if the user has not
        previously configured the context manually.
320253
def _setup(self):
        
        context_module = os.environ.get(ENVIRONMENT_CONTEXT_VARIABLE, 'context')
        if not context_module:
            raise ImproperlyConfigured(
                'Requested context points to an empty variable. '
                'You must either define the environment variable {0} '
                'or call context.configure() before accessing the context.'
                .format(ENVIRONMENT_CONTEXT_VARIABLE))

        self._wrapped = Settings(context_module, default_settings=global_context)
716184
def load_project_context(self):
        """"""
        try:
            # just make a copy of the project context
            context = StatikContext(
                initial={
                    "project_name": self.config.project_name,
                    "base_path": self.config.base_path
                },
                static=self.config.context_static,
                dynamic=self.config.context_dynamic
            )
            logger.debug("Built project context: %s", context)
            return context.build(db=self.db, safe_mode=self.safe_mode)

        except StatikError as exc:
            raise exc
        
        except Exception as exc:
            raise ProjectConfigurationError(
                message="Failed to build context data from project configuration file.",
                orig_exc=exc
            )
1068655
def load_settings(self):
        """"""
        mname = 'loaded_module'
        if six.PY2:
            import imp
            return imp.load_source(mname, self.settings_filename)
        else:
            import importlib.machinery
            loader = importlib.machinery.SourceFileLoader(mname, self.settings_filename)
        return loader.load_module(mname)
302712
def load_context(ctx_path, ctx_type, scm=None):
    
    if ctx_path == '-':
        return loads(sys.stdin.read(), ac_parser=ctx_type, ac_schema=scm)

    return load(ctx_path, ac_parser=ctx_type, ac_schema=scm)
1070526
def set_context(self, context):
        """"""
        self._set_context(context, emit=False)
        self._modified = (not context.load_path)
        self.dataChanged.emit(self.CONTEXT_CHANGED |
                              self.REQUEST_CHANGED |
                              self.PACKAGES_PATH_CHANGED |
                              self.LOCKS_CHANGED |
                              self.LOADPATH_CHANGED |
                              self.PACKAGE_FILTER_CHANGED |
                              self.CACHING_CHANGED)
1024312
def load(self):
        
        print("[DEBUG] Loading plugin {} from {}".format(self.name,
                                                         self.source))
        import pydoc
        path, attr = self.source.split(":")
        module = pydoc.locate(path)
        return getattr(module, attr)
1358722
def load_dotenvs():
    
    if not os.getenv('DOTENVS_LOADED'):
        envs = ['.env', '.flaskenv']
        for env in envs:
            path = os.path.join(os.getcwd(), env)
            if os.path.isfile(path):
                dotenvs(path)
        os.environ['DOTENVS_LOADED'] = 'yes'
536954
def load(self):
    
    try:
      if not self.__in_memory:
        self._json = json.loads(self._load_from_configs(self._main_config))
        # ToDo: make this via extension for root logger
        # self._log = aLogger.getLogger(__name__, cfg=self)  # reload logger using loaded configuration
        self._load_modules()
      else:
        self._json = {}
      # parse command line, currently used for re-assign settings in configuration, but can't be used as replacement
      self._load_from_commandline()
    except Exception as err:
      self._json = None
      raise
435782
def load_module(self, module, module_uri=None):
        
        # Check to see that module isn't availble in python path
        try:
            import_module(module)
        except ImportError, e:
            if module_uri is None:
                raise e
        else:
            return module

        if not CACHE_DOWNLOADS:
            module_name = self._unique_module_name(module)
        else:
            module_name = self._sanitize_module_name(module)

        # Check to see whether we've already downloaded, otherwise, download
        try:
            import_module(module_name)
        except ImportError:
            module_file = self.download_module(module_uri)
            try:
                load_source(module_name, module_file)
            except Exception:
                msg = "Unable to load code module %s" % module
                self._log.exception(msg)
                raise PIDanticExecutionException(msg)

        return module_name
1293465
def load():
    
    config = ConfigParser.RawConfigParser(DEFAULTS)
    config.readfp(open(CONF_PATH))
    for section in config.sections():
        globals()[section] = {}
        for key, val in config.items(section):
            globals()[section][key] = val
17200
def load_module(self, module):
        
        # pylint: disable=unused-variable
        for name, obj in inspect.getmembers(module,
                                            lambda member: hasattr(member, '__module__')
                                            and member.__module__ == module.__name__
                                            and inspect.isclass):
            self.load_class(obj)
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}
1029037
def load(self, context):
    
    try:
      # pylint: disable=g-import-not-at-top,unused-import
      import tensorflow
    except ImportError:
      return
    # pylint: disable=g-import-not-at-top
    from tensorboard.plugins.beholder.beholder_plugin import BeholderPlugin
    return BeholderPlugin(context)
295485
def load_environment_vars(self, prefix=SANIC_PREFIX):
        
        for k, v in os.environ.items():
            if k.startswith(prefix):
                _, config_key = k.split(prefix, 1)
                try:
                    self[config_key] = int(v)
                except ValueError:
                    try:
                        self[config_key] = float(v)
                    except ValueError:
                        try:
                            self[config_key] = strtobool(v)
                        except ValueError:
                            self[config_key] = v
6676
def load_hooks(self, context):
        
        for hook in self.configuration.get('hooks', ()):
            config = hook.get('configuration', {})
            config.update(self.configuration.get('configuration', {}))

            try:
                self._load_hook(hook['name'], config, context)
            except KeyError:
                self.logger.exception('Provided hook has no name: %s.', hook)
114586
def init_with_context(self, context):
        
        site_name = get_admin_site_name(context)

        self.children += [
            items.MenuItem(_('Dashboard'), reverse('{0}:index'.format(site_name))),
            items.Bookmarks(),
        ]

        for title, kwargs in get_application_groups():
            if kwargs.get('enabled', True):
                self.children.append(CmsModelList(title, **kwargs))

        self.children += [
            ReturnToSiteItem()
        ]
711101
def load(self, context):
    
    try:
      # pylint: disable=g-import-not-at-top,unused-import
      import tensorflow
    except ImportError:
      return
    # pylint: disable=g-import-not-at-top
    from tensorboard.plugins.hparams.hparams_plugin import HParamsPlugin
    return HParamsPlugin(context)