code: def objective(config):
      start_iteration = 0
      checkpoint = train.get_checkpoint()
      # Ensure that after the node killer warmup time, we always have
      # a checkpoint to restore from.
      if (time.monotonic() - config["start_time"]) >= config[
          "warmup_time_s"
      ]:
          assert checkpoint
      checkpoint = train.get_checkpoint()
      if checkpoint:
          with checkpoint.as_directory() as checkpoint_dir:
              with open(
                  os.path.join(checkpoint_dir, "ckpt.pkl"), "rb"
              ) as f:
                  checkpoint_dict = pickle.load(f)
              start_iteration = checkpoint_dict["iteration"] + 1
  
      for iteration in range(start_iteration, MAX_ITERS + 1):
          time.sleep(random.uniform(*ITER_TIME_BOUNDS))
          dct = {"iteration": iteration}
          with tempfile.TemporaryDirectory() as tmpdir:
              with open(os.path.join(tmpdir, "ckpt.pkl"), "wb") as f:
                  pickle.dump(dct, f)
              train.report(
                  dct, checkpoint=Checkpoint.from_directory(tmpdir)
              )
  
file_path: ray/release/tune_tests/fault_tolerance_tests/workloads/test_tune_worker_fault_tolerance.py
imports: import os
  import pickle
  import argparse
  import tempfile
  import time
  import random
  import gc
  import ray
  from ray import train
  from ray.train import Checkpoint, RunConfig, FailureConfig, CheckpointConfig
  from ray.tune.tune_config import TuneConfig
  from ray.tune.tuner import Tuner
  from terminate_node_aws import create_instance_killer
label_desc: Use image node_id 1 for calling a global function with example usage: objective(config) without return types