code: def build_sphinx(licenses: List[License]) -> str:
      """Build the sphinx-format attributions.txt with all attributions."""
  
      paragraphs = [
          sphinx_preamble,
          sphinx_format_header("WebUI", "*"),
          gen_sphinx_table(
              [license for license in licenses if license.webui]
          ),
          sphinx_format_header("Determined Master", "*"),
          gen_sphinx_table(
              [license for license in licenses if license.master]
          ),
          sphinx_format_header("Determined Agent", "*"),
          gen_sphinx_table(
              [license for license in licenses if license.agent]
          ),
      ]
  
      for license in licenses:
          paragraphs.append(license.sphinx_entry())
  
      return "\n\n".join(paragraphs)
  
file_path: determined/tools/scripts/gen-attributions.py
imports: import email
  import os
  import sys
  from typing import IO, List, Optional
label_desc: Use image node_id 5 for calling a global function with example usage: build_sphinx(licenses) and returns: str