code: def copy_legacy_redirects(app, docname):
      if app.builder.name == "html":
          for html_src_path, new in redirect_files:
              page = redirect_template.format(new=new)
              target_path = app.outdir + "/" + html_src_path
              with open(target_path, "w") as f:
                  f.write(page)
  
file_path: distributed/docs/source/conf.py
imports: from __future__ import annotations
  from docutils.parsers.rst import directives
  from sphinx.ext.autosummary import Autosummary, get_documenter
  from sphinx.util.inspect import safe_getattr
  import distributed
label_desc: Use image node_id 1 for calling a global function with example usage: copy_legacy_redirects(app, docname) without return types