def load_config(self, key, default_values=None, user_values=None,
                    required_keys=None):
        """Returns a configuration for a given key.

        This can be used by objects that define a default configuration. It
        will update the app configuration with the default values the first
        time it is requested, and mark the key as loaded.

        :param key:
            A configuration key.
        :param default_values:
            Default values defined by a module or class.
        :param user_values:
            User values, used when an object can be initialized with
            configuration. This overrides the app configuration.
        :param required_keys:
            Keys that can not be None.
        :raises:
            Exception, when a required key is not set or is None.
        """
        if key in self.loaded:
            config = self[key]
        else:
            config = dict(default_values or ())
            if key in self:
                config.update(self[key])

            self[key] = config
            self.loaded.append(key)
            if required_keys and not user_values:
                self._validate_required(key, config, required_keys)

        if user_values:
            config = config.copy()
            config.update(user_values)
            if required_keys:
                self._validate_required(key, config, required_keys)

        return config
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/webapp2-2.5.1/webapp2.py/Config.load_config/original