code: def make_script(
      script_dir, script_basename, source, omit_suffix=False
  ):
      script_filename = script_basename
      if not omit_suffix:
          script_filename += os.extsep + "py"
      script_name = os.path.join(script_dir, script_filename)
      # The script should be encoded to UTF-8, the default string encoding
      with open(script_name, "w", encoding="utf-8") as script_file:
          script_file.write(source)
      importlib.invalidate_caches()
      return script_name
  
imports: import collections
  import importlib
  import sys
  import os
  import os.path
  import subprocess
  import py_compile
  from importlib.util import source_from_cache
  from test import support
  from test.support.import_helper import make_legacy_pyc
label_desc: Use image node_id 8 for calling a global function with example usage: make_script(script_dir, script_basename, source, omit_suffix) and returns: script_name