code: def get_extra_cmake_options():
      """read --clean, --no, --set, --compiler-flags, and -G options from the command line and add them as cmake switches."""
      _cmake_extra_options = []
      _clean_build_folder = False
  
      opt_key = None
  
      argv = [arg for arg in sys.argv]  # take a copy
      # parse command line options and consume those we care about
      for arg in argv:
          if opt_key == "compiler-flags":
              _cmake_extra_options.append(
                  "-DCMAKE_CXX_FLAGS={arg}".format(arg=arg.strip())
              )
          elif opt_key == "G":
              _cmake_extra_options += ["-G", arg.strip()]
          elif opt_key == "no":
              _cmake_extra_options.append(
                  "-D{arg}=no".format(arg=arg.strip())
              )
          elif opt_key == "set":
              _cmake_extra_options.append(
                  "-D{arg}".format(arg=arg.strip())
              )
  
          if opt_key:
              sys.argv.remove(arg)
              opt_key = None
              continue
  
          if arg == "--clean":
              _clean_build_folder = True
              sys.argv.remove(arg)
              continue
  
          if arg == "--yes":
              print(
                  "The --yes options to dlib's setup.py don't do anything since all these options "
              )
              print(
                  "are on by default.  So --yes has been removed.  Do not give it to setup.py."
              )
              sys.exit(1)
          if arg in ["--no", "--set", "--compiler-flags"]:
              opt_key = arg[2:].lower()
              sys.argv.remove(arg)
              continue
          if arg in ["-G"]:
              opt_key = arg[1:]
              sys.argv.remove(arg)
              continue
  
      return _cmake_extra_options, _clean_build_folder
  
imports: import os
  import re
  import sys
  import shutil
  import platform
  import subprocess
  import multiprocessing
  from distutils import log
  from math import ceil, floor
  from setuptools import find_packages, setup, Extension
  from setuptools.command.build_ext import build_ext
  from distutils.version import LooseVersion
  from setuptools.command.test import test
label_desc: Use image node_id 1 for calling a global function with example usage: get_extra_cmake_options() and returns: _cmake_extra_options,  _clean_build_folder