code: def _parse_process_entry_flags(all_argv: list[str]) -> list[str]:
      """Parse and consume all flags for the entry script; return the rest."""
      # unconsumed_argv will still include all_argv[0], which is expected to be
      # the program name and is ignored by flag parsing.
      unconsumed_argv = FLAGS(all_argv, known_only=True)
  
      # JAX doesn't use absl flags and so we need to forward absl flags to JAX
      # explicitly. Here's a heuristic to detect JAX flags and forward them.
      if any(arg.startswith("--jax_") for arg in sys.argv):
          try:
              # pytype:disable=import-error
              import jax
  
              # pytype:enable=import-error
              jax.config.parse_flags_with_absl()
          except ImportError:
              pass
  
      return unconsumed_argv
  
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 1 for calling a global function with example usage: _parse_process_entry_flags(all_argv) and returns: unconsumed_argv