code: def main(argv: list[str], process_argv: list[str]):
      # See `parse_flags_and_run()` for why arguments are passed in `process_argv`
      # instead.
      assert len(argv) == 1
      del argv
  
      # Allow for importing modules from the current directory.
      sys.path.append(os.getcwd())
      data_file = FLAGS.data_file
      init_file = FLAGS.init_file
  
      if os.environ.get("TF_CONFIG", None):
          # For GCP runtime log to STDOUT so that logs are not reported as errors.
          logging.get_absl_handler().python_handler.stream = sys.stdout
  
      if init_file:
          init_function = cloudpickle.load(open(init_file, "rb"))
          init_function()
      functions = cloudpickle.load(open(data_file, "rb"))
  
      # Now that the code that we intend to run has been unpickled, that should
      # have caused the registration of any remaining flags that the program needs.
      [unused_program_name, *unconsumed_argv] = FLAGS(
          process_argv, known_only=True
      )
      if unconsumed_argv:
          logging.warning(
              "The following command-line arguments were passed to the "
              "program but are not used by anything that it imports: %s",
              unconsumed_argv,
          )
  
      task_id = _get_task_id()
  
      if lp_flags.LP_WORKER_MANAGER_V2.value:
          worker_manager_v2.WorkerManager(
              handle_sigterm=True, register_in_thread=True
          )
      else:
          # Worker manager is used here to handle termination signals and provide
          # preemption support.
          worker_manager.WorkerManager(register_in_thread=True)
  
      with contextlib.suppress():  # no-op context manager
          functions[task_id]()
  
file_path: launchpad/launchpad/nodes/python/process_entry.py
imports: import contextlib
  import functools
  import json
  import os
  import sys
  from absl import app
  from absl import flags
  from absl import logging
  import cloudpickle
  from launchpad import flags
  from launchpad.launch import worker_manager
  from launchpad.launch import worker_manager_v2
  import six
label_desc: Use image node_id 3 for calling a global function with example usage: main(argv, process_argv) without return types