code: def _get_resubmit_project_id(
      jobs: Iterable[Job],
      project_id: Optional[str],
      creds_file: Optional[str],
  ) -> Optional[str]:
      """checks CAIP or GKE jobs in provided list, and if any exist, then ensures
      that a valid project_id can be determined, either using defaults or an
      explicitly-provided value
  
      Args:
      jobs: list of jobs to inspect
      project_id: explicitly-provided project id, or if None attempt to determine
      creds_file: optional credentials file to use for determining project id
  
      Returns:
      project_id
      """
  
      if project_id is not None:
          return project_id
  
      cloud_jobs = filter(
          lambda j: j.spec.platform in [Platform.CAIP, Platform.GKE],
          jobs,
      )
  
      if len(list(cloud_jobs)) == 0:
          return project_id
  
      return credentials(creds_file).project_id
  
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 10 for calling a global function with example usage: _get_resubmit_project_id(jobs, project_id, creds_file) and returns: credentials, project_id, project_id