# Buggy code
def setup(app: Sphinx) -> Dict[str, Any]:
    app.setup_extension("sphinx.builders.latex.transforms")

    app.add_builder(LaTeXBuilder)
    app.connect("config-inited", validate_config_values)

    app.add_config_value(
        "latex_engine",
        default_latex_engine,
        None,
        ENUM("pdflatex", "xelatex", "lualatex", "platex", "uplatex"),
    )
    app.add_config_value("latex_documents", default_latex_documents, None)
    app.add_config_value("latex_logo", None, None, [str])
    app.add_config_value("latex_appendices", [], None)
    app.add_config_value("latex_use_latex_multicolumn", False, None)
    app.add_config_value("latex_use_xindy", default_latex_use_xindy, None, [bool])
    app.add_config_value(
        "latex_toplevel_sectioning",
        None,
        None,
        ENUM(None, "part", "chapter", "section"),
    )
    app.add_config_value("latex_domain_indices", True, None, [list])
    app.add_config_value("latex_show_urls", "no", None)
    app.add_config_value("latex_show_pagerefs", False, None)
    app.add_config_value("latex_elements", {}, None)
    app.add_config_value("latex_additional_files", [], None)
    app.add_config_value("latex_theme", "manual", None, [str])
    app.add_config_value("latex_theme_path", [], None, [list])

    app.add_config_value("latex_docclass", default_latex_docclass, None)

    return {
        "version": "builtin",
        "parallel_read_safe": True,
        "parallel_write_safe": True,
    }


# Traceback (ValueError)
# Sphinx version: 2.0.1
# Python version: 3.7.6 (CPython)
# Docutils version: 0.15.2 release
# Jinja2 version: 2.11.1
# Last messages:

# Loaded extensions:
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/sphinx/cmd/build.py", line 283, in build_main
args.tags, args.verbosity, args.jobs, args.keep_going)
File "/usr/lib/python3.7/site-packages/sphinx/application.py", line 260, in __init__
self._init_builder()
File "/usr/lib/python3.7/site-packages/sphinx/application.py", line 321, in _init_builder
self.emit('builder-inited')
File "/usr/lib/python3.7/site-packages/sphinx/application.py", line 440, in emit
return self.events.emit(event, self, *args)
File "/usr/lib/python3.7/site-packages/sphinx/events.py", line 76, in emit
results.append(callback(*args))
File "/usr/lib/python3.7/site-packages/sphinx/ext/intersphinx.py", line 207, in load_mappings
for key, (name, (uri, invs)) in app.config.intersphinx_mapping.items():
ValueError: too many values to unpack (expected 2)

# Fixed code
def setup(app: Sphinx) -> Dict[str, Any]:
    app.setup_extension("sphinx.builders.latex.transforms")

    app.add_builder(LaTeXBuilder)
    app.connect("config-inited", validate_config_values, priority=800)

    app.add_config_value(
        "latex_engine",
        default_latex_engine,
        None,
        ENUM("pdflatex", "xelatex", "lualatex", "platex", "uplatex"),
    )
    app.add_config_value("latex_documents", default_latex_documents, None)
    app.add_config_value("latex_logo", None, None, [str])
    app.add_config_value("latex_appendices", [], None)
    app.add_config_value("latex_use_latex_multicolumn", False, None)
    app.add_config_value("latex_use_xindy", default_latex_use_xindy, None, [bool])
    app.add_config_value(
        "latex_toplevel_sectioning",
        None,
        None,
        ENUM(None, "part", "chapter", "section"),
    )
    app.add_config_value("latex_domain_indices", True, None, [list])
    app.add_config_value("latex_show_urls", "no", None)
    app.add_config_value("latex_show_pagerefs", False, None)
    app.add_config_value("latex_elements", {}, None)
    app.add_config_value("latex_additional_files", [], None)
    app.add_config_value("latex_theme", "manual", None, [str])
    app.add_config_value("latex_theme_path", [], None, [list])

    app.add_config_value("latex_docclass", default_latex_docclass, None)

    return {
        "version": "builtin",
        "parallel_read_safe": True,
        "parallel_write_safe": True,
    }