code: def _create_image_spec(
      cfg: Config,
      cpu_specs: Dict[str, ImageSpec],
      gpu_specs: Dict[str, ImageSpec],
  ) -> ImageSpec:
      cpu_base = CpuBase(
          base_image=cfg["base_image"], python=cfg["python"]
      )
      cpu_spec = cpu_specs[cpu_base.tag]
  
      gpu_version = cfg.get("gpu")
      if gpu_version is None:
          return cpu_spec
  
      gpu_base = GpuBase(base_image=cfg["base_image"], gpu=cfg["gpu"])
      gpu_spec = gpu_specs[gpu_base.tag]
  
      build_args = copy(cpu_spec.build_args)
      build_args["BASE_IMAGE"] = gpu_spec.tag
  
      return ImageSpec(
          base_image=cpu_spec.base_image,
          cpu_version=cpu_spec.cpu_version,
          gpu_version=gpu_version,
          build_args=build_args,
      )
  
imports: from absl import flags, app, logging
  from copy import copy
  from typing import Dict, List, Any, NamedTuple, Optional, Set
  from enum import Enum
  import json
  import pprint
label_desc: Use image node_id 6 for calling a global function with example usage: _create_image_spec(cfg, cpu_specs, gpu_specs) and returns: ImageSpec, cpu_spec