code: def setup(app: application.Sphinx) -> Dict[str, Any]:
      app.add_config_value("dai_downloads_root", None, "html")
  
      # Disable the old instance of DownloadFileCollector and replace it with ours.
      for key in app.events.listeners:
          event = app.events.listeners[key]
          app.events.listeners[key] = [
              listener
              for listener in event
              if not (
                  isinstance(listener.handler, types.MethodType)
                  and isinstance(
                      listener.handler.__self__,
                      asset.DownloadFileCollector,
                  )
              )
          ]
  
      app.add_env_collector(DownloadExternalFileCollector)
  
      return {
          "version": "0",
          "parallel_read_safe": True,
          "parallel_write_safe": True,
      }
  
file_path: determined/docs/sphinx_ext_downloads.py
imports: import logging
  import os
  import types
  from typing import Any, Dict
  from docutils import nodes
  from sphinx import addnodes, application
  from sphinx.environment.collectors import asset
  from sphinx.locale import __
label_desc: Use image node_id 1 for calling a global function with example usage: setup(app) and returns: dict