code: def make_command_file(
      path_to_debug_info, prefix_code="", no_import=False
  ):
      if not no_import:
          pattern = os.path.join(
              path_to_debug_info, "cython_debug", "cython_debug_info_*"
          )
          debug_files = glob.glob(pattern)
  
          if not debug_files:
              sys.exit(
                  "%s.\nNo debug files were found in %s. Aborting."
                  % (usage, os.path.abspath(path_to_debug_info))
              )
  
      fd, tempfilename = tempfile.mkstemp()
      f = os.fdopen(fd, "w")
      try:
          f.write(prefix_code)
          f.write(
              textwrap.dedent(
                  """\
              # This is a gdb command file
              # See https://sourceware.org/gdb/onlinedocs/gdb/Command-Files.html
  
              set breakpoint pending on
              set print pretty on
  
              python
              # Activate virtualenv, if we were launched from one
              import os
              virtualenv = os.getenv('VIRTUAL_ENV')
              if virtualenv:
                  path_to_activate_this_py = os.path.join(virtualenv, 'bin', 'activate_this.py')
                  print("gdb command file: Activating virtualenv: %s; path_to_activate_this_py: %s" % (
                      virtualenv, path_to_activate_this_py))
                  with open(path_to_activate_this_py) as f:
                      exec(f.read(), dict(__file__=path_to_activate_this_py))
  
              from Cython.Debugger import libcython, libpython
              end
              """
              )
          )
  
          if no_import:
              # don't do this, this overrides file command in .gdbinit
              # f.write("file %s\n" % sys.executable)
              pass
          else:
              path = os.path.join(
                  path_to_debug_info, "cython_debug", "interpreter"
              )
              interpreter_file = open(path)
              try:
                  interpreter = interpreter_file.read()
              finally:
                  interpreter_file.close()
              f.write("file %s\n" % interpreter)
              f.write(
                  "\n".join("cy import %s\n" % fn for fn in debug_files)
              )
              f.write(
                  textwrap.dedent(
                      """\
                  python
                  import sys
                  try:
                      gdb.lookup_type('PyModuleObject')
                  except RuntimeError:
                      sys.stderr.write(
                          'Python was not compiled with debug symbols (or it was '
                          'stripped). Some functionality may not work (properly).\\n')
                  end
  
                  source .cygdbinit
              """
                  )
              )
      finally:
          f.close()
  
      return tempfilename
  
file_path: catboost/contrib/tools/cython/Cython/Debugger/Cygdb.py
imports: import os
  import sys
  import glob
  import tempfile
  import textwrap
  import subprocess
  import optparse
  import logging
label_desc: Use image node_id 1 for calling a global function with example usage: make_command_file(path_to_debug_info, prefix_code, no_import) and returns: tempfilename