def determine_final_config(config_module):
    """Determines the final additions and replacements.

    Combines the config module with the defaults.

    Args:
        config_module: The loaded local configuration module.

    Returns:
        Config: the final configuration.
    """
    config = Config(
        DEFAULT_LIBRARY_RC_ADDITIONS, DEFAULT_LIBRARY_RC_REPLACEMENTS,
        DEFAULT_TEST_RC_ADDITIONS, DEFAULT_TEST_RC_REPLACEMENTS)

    for field in config._fields:
        if hasattr(config_module, field):
            config = config._replace(**{field: getattr(config_module, field)})

    return config