code: def test_iris(tmp_path: Path):
      """
      Make sure each example:
       - trains
       - validates
       - checkpoints
       - can load from checkpoint
      """
      checkpoint_dir = str(tmp_path.joinpath("checkpoint"))
      latest_checkpoint = None
      steps_completed = 0
  
      def make_workloads_1() -> workload.Stream:
          """
          Train one batch, validate one batch, checkpoint.
          """
          trainer = utils.TrainAndValidate()
          yield from trainer.send(
              steps=2, validation_freq=2, scheduling_unit=1
          )
  
          interceptor = workload.WorkloadResponseInterceptor()
          yield from interceptor.send(workload.checkpoint_workload())
          nonlocal latest_checkpoint, steps_completed
          latest_checkpoint = interceptor.metrics_result()["uuid"]
          steps_completed = trainer.get_steps_completed()
  
      example_path = utils.cv_examples_path(
          "iris_tf_keras/model_def.py"
      )
      trial_cls = utils.import_class_from_module(
          "IrisTrial", example_path
      )
  
      hparams = {
          "learning_rate": 1.0e-4,
          "learning_rate_decay": 1.0e-6,
          "layer1_dense_size": 16,
          "global_batch_size": 30,
      }
      data = {
          "train_url": "http://download.tensorflow.org/data/iris_training.csv",
          "test_url": "http://download.tensorflow.org/data/iris_test.csv",
      }
  
      exp_config = utils.make_default_exp_config(
          hparams,
          scheduling_unit=1,
          searcher_metric="random",
          checkpoint_dir=checkpoint_dir,
          data=data,
      )
  
      controller = (
          utils.make_trial_controller_from_trial_implementation(
              trial_cls,
              hparams,
              make_workloads_1(),
              trial_seed=777,
              exp_config=exp_config,
              checkpoint_dir=checkpoint_dir,
              expose_gpus=True,
          )
      )
      # Verify that train/validate/ckpt doesn't puke.
      controller.run()
  
      # Verify that load/train/validate doesn't puke.
      def make_workloads_2() -> workload.Stream:
          trainer = utils.TrainAndValidate()
          yield from trainer.send(
              steps=1, validation_freq=1, scheduling_unit=1
          )
  
      controller = (
          utils.make_trial_controller_from_trial_implementation(
              trial_cls,
              hparams,
              make_workloads_2(),
              trial_seed=777,
              exp_config=exp_config,
              checkpoint_dir=checkpoint_dir,
              latest_checkpoint=latest_checkpoint,
              steps_completed=steps_completed,
              expose_gpus=True,
          )
      )
      controller.run()
  
imports: import os
  from pathlib import Path
  from typing import Any, Callable, Dict, List, Optional
  import pytest
  import tensorflow
  from packaging import version
  import determined
  from determined import keras, workload
  from tests.experiment import utils
  from tests.experiment.fixtures import tf_keras_xor_model
label_desc: Use image node_id 3 for calling a global function with example usage: test_iris(tmp_path) without return types