# Buggy code
def setup(app: Sphinx) -> Dict[str, Any]:
    # builders
    app.add_builder(StandaloneHTMLBuilder)

    # config values
    app.add_config_value("html_theme", "alabaster", "html")
    app.add_config_value("html_theme_path", [], "html")
    app.add_config_value("html_theme_options", {}, "html")
    app.add_config_value(
        "html_title",
        lambda self: _("%s %s documentation") % (self.project, self.release),
        "html",
        [str],
    )
    app.add_config_value("html_short_title", lambda self: self.html_title, "html")
    app.add_config_value("html_style", None, "html", [str])
    app.add_config_value("html_logo", None, "html", [str])
    app.add_config_value("html_favicon", None, "html", [str])
    app.add_config_value("html_css_files", [], "html")
    app.add_config_value("html_js_files", [], "html")
    app.add_config_value("html_static_path", [], "html")
    app.add_config_value("html_extra_path", [], "html")
    app.add_config_value("html_last_updated_fmt", None, "html", [str])
    app.add_config_value("html_sidebars", {}, "html")
    app.add_config_value("html_additional_pages", {}, "html")
    app.add_config_value("html_domain_indices", True, "html", [list])
    app.add_config_value("html_add_permalinks", "¶", "html")
    app.add_config_value("html_use_index", True, "html")
    app.add_config_value("html_split_index", False, "html")
    app.add_config_value("html_copy_source", True, "html")
    app.add_config_value("html_show_sourcelink", True, "html")
    app.add_config_value("html_sourcelink_suffix", ".txt", "html")
    app.add_config_value("html_use_opensearch", "", "html")
    app.add_config_value("html_file_suffix", None, "html", [str])
    app.add_config_value("html_link_suffix", None, "html", [str])
    app.add_config_value("html_show_copyright", True, "html")
    app.add_config_value("html_show_sphinx", True, "html")
    app.add_config_value("html_context", {}, "html")
    app.add_config_value("html_output_encoding", "utf-8", "html")
    app.add_config_value("html_compact_lists", True, "html")
    app.add_config_value("html_secnumber_suffix", ". ", "html")
    app.add_config_value("html_search_language", None, "html", [str])
    app.add_config_value("html_search_options", {}, "html")
    app.add_config_value("html_search_scorer", "", None)
    app.add_config_value("html_scaled_image_link", True, "html")
    app.add_config_value("html_baseurl", "", "html")
    app.add_config_value("html_math_renderer", None, "env")
    app.add_config_value("html4_writer", False, "html")

    # event handlers
    app.connect("config-inited", convert_html_css_files)
    app.connect("config-inited", convert_html_js_files)
    app.connect("config-inited", validate_html_extra_path)
    app.connect("config-inited", validate_html_static_path)
    app.connect("config-inited", validate_html_logo)
    app.connect("config-inited", validate_html_favicon)
    app.connect("builder-inited", validate_math_renderer)
    app.connect("html-page-context", setup_js_tag_helper)

    # load default math renderer
    app.setup_extension("sphinx.ext.mathjax")

    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]:
    # builders
    app.add_builder(StandaloneHTMLBuilder)

    # config values
    app.add_config_value("html_theme", "alabaster", "html")
    app.add_config_value("html_theme_path", [], "html")
    app.add_config_value("html_theme_options", {}, "html")
    app.add_config_value(
        "html_title",
        lambda self: _("%s %s documentation") % (self.project, self.release),
        "html",
        [str],
    )
    app.add_config_value("html_short_title", lambda self: self.html_title, "html")
    app.add_config_value("html_style", None, "html", [str])
    app.add_config_value("html_logo", None, "html", [str])
    app.add_config_value("html_favicon", None, "html", [str])
    app.add_config_value("html_css_files", [], "html")
    app.add_config_value("html_js_files", [], "html")
    app.add_config_value("html_static_path", [], "html")
    app.add_config_value("html_extra_path", [], "html")
    app.add_config_value("html_last_updated_fmt", None, "html", [str])
    app.add_config_value("html_sidebars", {}, "html")
    app.add_config_value("html_additional_pages", {}, "html")
    app.add_config_value("html_domain_indices", True, "html", [list])
    app.add_config_value("html_add_permalinks", "¶", "html")
    app.add_config_value("html_use_index", True, "html")
    app.add_config_value("html_split_index", False, "html")
    app.add_config_value("html_copy_source", True, "html")
    app.add_config_value("html_show_sourcelink", True, "html")
    app.add_config_value("html_sourcelink_suffix", ".txt", "html")
    app.add_config_value("html_use_opensearch", "", "html")
    app.add_config_value("html_file_suffix", None, "html", [str])
    app.add_config_value("html_link_suffix", None, "html", [str])
    app.add_config_value("html_show_copyright", True, "html")
    app.add_config_value("html_show_sphinx", True, "html")
    app.add_config_value("html_context", {}, "html")
    app.add_config_value("html_output_encoding", "utf-8", "html")
    app.add_config_value("html_compact_lists", True, "html")
    app.add_config_value("html_secnumber_suffix", ". ", "html")
    app.add_config_value("html_search_language", None, "html", [str])
    app.add_config_value("html_search_options", {}, "html")
    app.add_config_value("html_search_scorer", "", None)
    app.add_config_value("html_scaled_image_link", True, "html")
    app.add_config_value("html_baseurl", "", "html")
    app.add_config_value("html_math_renderer", None, "env")
    app.add_config_value("html4_writer", False, "html")

    # event handlers
    app.connect("config-inited", convert_html_css_files, priority=800)
    app.connect("config-inited", convert_html_js_files, priority=800)
    app.connect("config-inited", validate_html_extra_path, priority=800)
    app.connect("config-inited", validate_html_static_path, priority=800)
    app.connect("config-inited", validate_html_logo, priority=800)
    app.connect("config-inited", validate_html_favicon, priority=800)
    app.connect("builder-inited", validate_math_renderer)
    app.connect("html-page-context", setup_js_tag_helper)

    # load default math renderer
    app.setup_extension("sphinx.ext.mathjax")

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