code: def get_whole_archive_peers_and_libs(args):
      remaining_args = []
      peers = []
      libs = []
      peers_flag = "--whole-archive-peers"
      libs_flag = "--whole-archive-libs"
  
      next_is_peer = False
      next_is_lib = False
      for arg in args:
          if arg == peers_flag:
              next_is_peer = True
          elif arg == libs_flag:
              next_is_lib = True
          elif next_is_peer:
              peers.append(arg)
              next_is_peer = False
          elif next_is_lib:
              libs.append(arg)
              next_is_lib = False
          else:
              remaining_args.append(arg)
      return remaining_args, peers, libs
  
file_path: catboost/build/scripts/process_whole_archive_option.py
imports: import os
  import process_command_files
label_desc: Use image node_id 1 for calling a global function with example usage: get_whole_archive_peers_and_libs(args) and returns: remaining_args,  peers,  libs