code: def _launch_in_tabs(commands_to_launch, app_id):
      """Launches commands in gnome tabs."""
      file_handle, command_file_path = tempfile.mkstemp(".sh")
      os.close(file_handle)
      atexit.register(os.remove, command_file_path)
      with open(command_file_path, "w") as command_file:
          # The command file starts with setting up environment.
          for key, value in os.environ.items():
              # Remove these two keys so that new processes are created by the newly
              # started gnome-terminal-server.
              if key in [
                  "GNOME_TERMINAL_SERVICE",
                  "GNOME_TERMINAL_SCREEN",
              ]:
                  continue
              command_file.write(
                  f"export {shlex.quote(key)}={shlex.quote(value)}\n"
              )
          for command_to_launch in commands_to_launch:
              inner_cmd = "; ".join(
                  [
                      # Set the title (see https://superuser.com/a/1330292/156433).
                      "PS1=$",
                      "PROMPT_COMMAND=",
                      f'echo -en "\\033]0;{command_to_launch.title}\\a"',
                      # Run the actual command.
                      subprocess.list2cmdline(
                          command_to_launch.command_as_list
                      ),
                      # Start a shell so that the tab doesn't close instantly when the
                      # command finishes.
                      "exec $SHELL",
                  ]
              )
              terminal_command_list = [
                  "gnome-terminal",
                  "--tab",
                  "--",
                  "bash",
                  "-c",
                  inner_cmd,
              ]
              env_overrides = []
              for key, value in command_to_launch.env_overrides.items():
                  env_overrides.append(
                      f"{shlex.quote(key)}={shlex.quote(value)}"
                  )
              command_file.write(
                  subprocess.list2cmdline(
                      env_overrides + terminal_command_list
                  )
                  + "\n"
              )
  
      os.chmod(
          command_file_path,
          os.stat(command_file_path).st_mode | stat.S_IEXEC,
      )
      _run_gnome_command(
          [
              "gnome-terminal",
              "--app-id",
              app_id,
              "--",
              command_file_path,
          ],
          os.environ,
      )
  
imports: import atexit
  import copy
  import datetime
  import os
  import shlex
  import signal
  import stat
  import subprocess
  import tempfile
  import time
  from typing import Union
  from launchpad import flags
  from launchpad.launch import worker_manager
  from launchpad.launch import worker_manager_v2
  from launchpad.launch.run_locally import feature_testing
label_desc: Use image node_id 4 for calling a global function with example usage: _launch_in_tabs(commands_to_launch, app_id) without return types