code: def gen_sphinx_table(licenses: List[License]) -> str:
      """
      Example output:
  
          .. list-table::
             :header-rows: 1
  
             * - Package
               - License
             * - gopkg.in/tomb.v1
               - :ref:`BSD 3-clause <tomb>`
      """
  
      lines = [
          ".. list-table::",
          "   :header-rows: 1",
          "",
          "   * - Package",
          "     - License",
      ]
  
      for license in licenses:
          lines.append(f"   * - {license.name}")
          lines.append(f"     - {license.sphinx_ref()}")
  
      return "\n".join(lines)
  
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 4 for calling a global function with example usage: gen_sphinx_table(licenses) and returns: str