@classmethod
def from_dict(cls, config, defaults=None):
    """
        Creates a configuration using a dictionary.
        The dictionary should hold the appropriate _private and _namespace values.
        The _private value specifies which configurations should not be passed on
        to configuration that use this configuration as a base.
        The _namespace value specifies which prefix should be used to search default configurations,
        when a key can not be found in the configuration.

        :param config: (dict) the configuration keys and values to create a configuration with
        :param defaults: (dict) the configuration keys and values that act as a fallback
            or None to load defaults from settings at runtime
        :return: a configuration instance
        """
    assert isinstance(config, dict
        ), 'Config should be a dict which values are the configurations.'
    assert '_namespace' in config, '_namespace needs to be specified in the configuration.'
    assert '_private' in config, '_private needs to be specified in the configuration.'
    assert isinstance(defaults, dict
        ) or defaults is None, 'Defaults should be a dict which values are the configuration defaults.'
    instance = cls(defaults=defaults, namespace=config['_namespace'],
        private=config['_private'])
    instance.update(config)
    return instance
