code: def generate_source_files(ns):
      if ns.zip_lib:
          zip_name = PYTHON_ZIP_NAME
          zip_path = ns.temp / zip_name
          if zip_path.is_file():
              zip_path.unlink()
          elif zip_path.is_dir():
              log_error(
                  "Cannot create zip file because a directory exists by the same name"
              )
              return
          log_info("Generating {} in {}", zip_name, ns.temp)
          ns.temp.mkdir(parents=True, exist_ok=True)
          with zipfile.ZipFile(
              zip_path, "w", zipfile.ZIP_DEFLATED
          ) as zf:
              for dest, src in get_lib_layout(ns):
                  _write_to_zip(zf, dest, src, ns, checked=False)
  
      if ns.include_underpth:
          log_info("Generating {} in {}", PYTHON_PTH_NAME, ns.temp)
          ns.temp.mkdir(parents=True, exist_ok=True)
          with open(
              ns.temp / PYTHON_PTH_NAME, "w", encoding="utf-8"
          ) as f:
              if ns.zip_lib:
                  print(PYTHON_ZIP_NAME, file=f)
                  if ns.include_pip:
                      print("packages", file=f)
              else:
                  print("Lib", file=f)
                  print("Lib/site-packages", file=f)
              if not ns.flat_dlls:
                  print("DLLs", file=f)
              print(".", file=f)
              print(file=f)
              print(
                  "# Uncomment to run site.main() automatically", file=f
              )
              print("#import site", file=f)
  
      if ns.include_pip:
          log_info("Extracting pip")
          extract_pip_files(ns)
  
imports: import argparse
  import os
  import shutil
  import sys
  import tempfile
  import zipfile
  from pathlib import Path
  from .support.appxmanifest import *
  from .support.catalog import *
  from .support.constants import *
  from .support.filesets import *
  from .support.logging import *
  from .support.options import *
  from .support.pip import *
  from .support.props import *
  from .support.nuspec import *
label_desc: Use image node_id 8 for calling a global function with example usage: generate_source_files(ns) without return types