

def load_config(config_file=None, **kwargs):
    '\n    Load the configuration for a given file object or name\n\n    The config_file can either be a file object, string or None. If it is None\n    the default `mkdocs.yml` filename will loaded.\n\n    Extra kwargs are passed to the configuration to replace any default values\n    unless they themselves are None.\n    '
    options = kwargs.copy()
    for (key, value) in options.copy().items():
        if (value is None):
            options.pop(key)
    config_file = _open_config_file(config_file)
    options['config_file_path'] = getattr(config_file, 'name', '')
    from mkdocs import config
    cfg = Config(schema=config.DEFAULT_SCHEMA)
    cfg.load_file(config_file)
    cfg.load_dict(options)
    (errors, warnings) = cfg.validate()
    for (config_name, warning) in warnings:
        log.warning("Config value: '%s'. Warning: %s", config_name, warning)
    for (config_name, error) in errors:
        log.error("Config value: '%s'. Error: %s", config_name, error)
    for (key, value) in cfg.items():
        log.debug("Config value: '%s' = %r", key, value)
    if (len(errors) > 0):
        raise exceptions.ConfigurationError('Aborted with {0} Configuration Errors!'.format(len(errors)))
    elif (cfg['strict'] and (len(warnings) > 0)):
        raise exceptions.ConfigurationError("Aborted with {0} Configuration Warnings in 'strict' mode!".format(len(warnings)))
    return cfg

dataset/ETHPy150Open mkdocs/mkdocs/mkdocs/config/base.py load_config/original