def create_config_tree(config, modules, prefix='<STR_LIT>'):
def work_in(parent_config, config_name, prefix, module):<EOL><INDENT>if config_name not in parent_config:<EOL><INDENT>parent_config[config_name] = {}<EOL><DEDENT>elif not isinstance(parent_config[config_name], collections.Mapping):<EOL><INDENT>raise ConfigurationError(<EOL>'<STR_LIT>'.format(prefix))<EOL><DEDENT>else:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>_recurse_config(config, modules, work_in)<EOL>
Cause every possible configuration sub-dictionary to exist.

    This is intended to be called very early in the configuration
    sequence.  For each module, it checks that the corresponding
    configuration item exists in `config` and creates it as an empty
    dictionary if required, and then recurses into child
    configs/modules.

    :param dict config: configuration to populate
    :param modules: modules or Configurable instances to use
    :type modules: iterable of :class:`~yakonfig.configurable.Configurable`
    :param str prefix: prefix name of the config
    :return: `config`
    :raises yakonfig.ConfigurationError: if an expected name is present
      in the provided config, but that name is not a dictionary