code: def main():
      # First parse options and check if we can perform our work
      parseOptions()
      checkEnvironment()
  
      os.environ["MACOSX_DEPLOYMENT_TARGET"] = DEPTARGET
      os.environ["CC"] = CC
      os.environ["CXX"] = CXX
  
      if os.path.exists(WORKDIR):
          shutil.rmtree(WORKDIR)
      os.mkdir(WORKDIR)
  
      os.environ["LC_ALL"] = "C"
  
      # Then build third-party libraries such as sleepycat DB4.
      buildLibraries()
  
      # Now build python itself
      buildPython()
  
      # And then build the documentation
      # Remove the Deployment Target from the shell
      # environment, it's no longer needed and
      # an unexpected build target can cause problems
      # when Sphinx and its dependencies need to
      # be (re-)installed.
      del os.environ["MACOSX_DEPLOYMENT_TARGET"]
      buildPythonDocs()
  
      # Prepare the applications folder
      folder = os.path.join(
          WORKDIR,
          "_root",
          "Applications",
          "Python %s" % (getVersion(),),
      )
      fn = os.path.join(folder, "License.rtf")
      patchFile("resources/License.rtf", fn)
      fn = os.path.join(folder, "ReadMe.rtf")
      patchFile("resources/ReadMe.rtf", fn)
      fn = os.path.join(folder, "Update Shell Profile.command")
      patchScript("scripts/postflight.patch-profile", fn)
      fn = os.path.join(folder, "Install Certificates.command")
      patchScript("resources/install_certificates.command", fn)
      os.chmod(folder, STAT_0o755)
      setIcon(folder, "../Icons/Python Folder.icns")
  
      # Create the installer
      buildInstaller()
  
      # And copy the readme into the directory containing the installer
      patchFile(
          "resources/ReadMe.rtf",
          os.path.join(WORKDIR, "installer", "ReadMe.rtf"),
      )
  
      # Ditto for the license file.
      patchFile(
          "resources/License.rtf",
          os.path.join(WORKDIR, "installer", "License.rtf"),
      )
  
      fp = open(os.path.join(WORKDIR, "installer", "Build.txt"), "w")
      fp.write("# BUILD INFO\n")
      fp.write("# Date: %s\n" % time.ctime())
      fp.write("# By: %s\n" % pwd.getpwuid(os.getuid()).pw_gecos)
      fp.close()
  
      # And copy it to a DMG
      buildDMG()
  
imports: import platform, os, sys, getopt, textwrap, shutil, stat, time, pwd, grp
label_desc: Use image node_id 38 for calling a global function with example usage: main() without return types