code: def test_base_image():
      # If NO base image is specified, None is returned.
      assert c.base_image({}, c.JobMode.CPU) == None
      assert c.base_image({}, c.JobMode.GPU) == None
  
      dlvm = c.CalibanConfig.validate(
          {"base_image": "dlvm:pytorch-{}-1.4"}
      )
  
      # If you leave a {} format block, base_image will splice in the job mode.
      assert (
          c.base_image(dlvm, c.JobMode.CPU)
          == c.DLVM_CONFIG["dlvm:pytorch-cpu-1.4"]
      )
      assert (
          c.base_image(dlvm, c.JobMode.GPU)
          == c.DLVM_CONFIG["dlvm:pytorch-gpu-1.4"]
      )
  
      conf = c.CalibanConfig.validate(
          {
              "base_image": {
                  "cpu": "dlvm:tf2-{}-2.1",
                  "gpu": "random:latest",
              }
          }
      )
  
      # Same trick works even nested in dicts. If the image is NOT a specially
      # keyed DLVM, it's untouched.
      assert (
          c.base_image(conf, c.JobMode.CPU)
          == c.DLVM_CONFIG["dlvm:tf2-cpu-2.1"]
      )
      assert c.base_image(conf, c.JobMode.GPU) == "random:latest"
  
file_path: caliban/tests/caliban/config/test_config.py
imports: import json
  import os
  from argparse import ArgumentTypeError
  import hypothesis.strategies
  from hypothesis import given
  import caliban.config
  import caliban.platform.cloud.types
  import caliban.util.schema
  import pytest
label_desc: Use image node_id 8 for calling a global function with example usage: test_base_image() without return types