code: def resubmit(args: Dict[str, Any]) -> None:
      """executes the `caliban resubmit` command"""
  
      user = current_user()
      xgroup = args.get("xgroup")
      dry_run = args.get("dry_run", False)
      all_jobs = args.get("all_jobs", False)
      project_id = args.get("project_id")
      creds_file = args.get("cloud_key")
      rebuild = True
  
      if xgroup is None:
          logging.error(
              f"you must specify an experiment group for this command"
          )
          return
  
      with session_scope(get_sql_engine()) as session:
          jobs = _get_resubmit_jobs(
              session=session,
              xgroup=xgroup,
              user=user,
              all_jobs=all_jobs,
          )
  
          if jobs is None:
              return
  
          # if we have CAIP or GKE jobs, then we need to have a project_id
          project_id = _get_resubmit_project_id(
              jobs, project_id, creds_file
          )
  
          # show what would be done
          logging.info(f"the following jobs would be resubmitted:")
          for j in jobs:
              logging.info(_experiment_command_str(j.experiment))
              logging.info(f"  job {_job_str(j)}")
  
          if dry_run:
              logging.info(
                  f"to actually resubmit these jobs, run this command again "
                  f"without the --dry_run flag"
              )
              return
  
          # make sure
          if not user_verify(
              f"do you wish to resubmit these {len(jobs)} jobs?", False
          ):
              return
  
          # rebuild all containers first
          if rebuild:
              logging.info(f"rebuilding containers...")
              image_id_map = _rebuild_containers(
                  jobs, project_id=project_id
              )
          else:
              image_id_map = {j: j.container for j in jobs}
  
          # create new job specs
          job_specs = [
              replace_job_spec_image(
                  spec=j.spec, image_id=image_id_map[j]
              )
              for j in jobs
          ]
  
          # submit jobs, grouped by platform
          for platform in [Platform.CAIP, Platform.GKE, Platform.LOCAL]:
              pspecs = list(
                  filter(lambda x: x.platform == platform, job_specs)
              )
              try:
                  submit_job_specs(
                      specs=pspecs,
                      platform=platform,
                      project_id=project_id,
                      credentials_path=creds_file,
                  )
              except Exception as e:
                  session.commit()  # avoid rollback
                  logging.error(
                      f"there was an error submitting some jobs"
                  )
  
          return
  
imports: import logging
  import os
  from typing import Any, Dict, Iterable, List, Optional
  from sqlalchemy import or_
  from sqlalchemy.orm import Session
  from caliban.docker.build import build_image
  from caliban.docker.push import push_uuid_tag
  from caliban.history.submit import submit_job_specs
  from caliban.history.types import ContainerSpec, Experiment, ExperimentGroup, Job, JobStatus, Platform
  from caliban.history.util import get_gke_job_name, get_sql_engine, replace_job_spec_image, session_scope, stop_job, update_job_status
  from caliban.platform.gke.util import credentials, user_verify
  from caliban.util import Package, current_user
label_desc: Use image node_id 12 for calling a global function with example usage: resubmit(args) without return types