code: def train_fn(config):
      for i in range(3):
          with tempfile.TemporaryDirectory() as temp_checkpoint_dir:
              Path(temp_checkpoint_dir).joinpath("model.pt").touch()
              train.report(
                  {"loss": i},
                  checkpoint=Checkpoint.from_directory(
                      temp_checkpoint_dir
                  ),
              )
  
file_path: ray/doc/source/train/doc_code/key_concepts.py
imports: from pathlib import Path
  import tempfile
  from ray import train
  from ray.train import Checkpoint
  from ray.train.data_parallel_trainer import DataParallelTrainer
  import os
  from ray.train import RunConfig
  from ray.train import RunConfig, FailureConfig
  from ray.train import RunConfig, CheckpointConfig
  from ray.train import RunConfig, CheckpointConfig
  import pyarrow
  from ray.train import Result
label_desc: Use image node_id 1 for calling a global function with example usage: train_fn(config) without return types