code: def read_dir(path: str) -> List[License]:
      licenses = []
      for name in os.listdir(path):
          lpath = os.path.join(path, name)
          with open(lpath) as f:
              try:
                  licenses.append(License.from_file(name, f))
              except AssertionError:
                  print(
                      f"Error reading license file {lpath}",
                      file=sys.stderr,
                  )
                  raise
      licenses.sort(key=lambda license: license.name)
      return licenses
  
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 7 for calling a global function with example usage: read_dir(path) and returns: licenses