code: def sphinx_build(src_dir, build_dir):
      import sphinx
  
      cmd = [
          "-b",
          "html",
          "-d",
          op.join(build_dir, "doctrees"),
          src_dir,  # Source
          op.join(build_dir, "html"),  # Dest
      ]
  
      if sphinx.version_info > (1, 7):
          import sphinx.cmd.build
  
          ret = sphinx.cmd.build.build_main(cmd)
      else:
          ret = sphinx.build_main(["sphinx-build"] + cmd)
      if ret != 0:
          raise RuntimeError("Sphinx error: %s" % ret)
      print(
          "Build finished. The HTML pages are in %s/html." % build_dir
      )
  
file_path: imageio/tasks/docs.py
imports: import os
  import sys
  import os.path
  import shutil
  from invoke import task
  from ._config import DOC_DIR, DOC_BUILD_DIR
label_desc: Use image node_id 3 for calling a global function with example usage: sphinx_build(src_dir, build_dir) without return types