code: def checkpoint(request, tmp_path):
      """Fixture that sets up a checkpoint on different filesystems."""
      checkpoint_fs_type = request.param
  
      checkpoint_path = tmp_path / "ckpt_dir"
      checkpoint_path.mkdir(exist_ok=True)
      (checkpoint_path / _CHECKPOINT_CONTENT_FILE).write_text("dummy")
  
      if checkpoint_fs_type == "local":
          yield Checkpoint.from_directory(str(checkpoint_path))
      elif checkpoint_fs_type == "mock":
          _checkpoint = Checkpoint(path="mock:///mock_bucket/ckpt_dir")
          _upload_to_fs_path(
              local_path=str(checkpoint_path),
              fs=_checkpoint.filesystem,
              fs_path=_checkpoint.path,
          )
          # The "mock://" URI doesn't persist across different instances of
          # the pyarrow.fs.MockFileSystem, so we must make sure to return
          # the checkpoint with the same filesystem instance that we uploaded
          # some mock content to.
          yield _checkpoint
      elif checkpoint_fs_type == "custom_fs":
          custom_storage_fs = _create_mock_custom_fs(
              tmp_path / "custom_fs"
          )
          _upload_to_fs_path(
              local_path=str(checkpoint_path),
              fs=custom_storage_fs,
              fs_path="mock_bucket/ckpt_dir",
          )
          yield Checkpoint(
              path="mock_bucket/ckpt_dir", filesystem=custom_storage_fs
          )
  
file_path: ray/python/ray/train/tests/test_checkpoint.py
imports: import os
  from pathlib import Path
  import pyarrow.fs
  import pytest
  import ray
  from ray.train._checkpoint import _CHECKPOINT_TEMP_DIR_PREFIX, _METADATA_FILE_NAME, Checkpoint, _get_del_lock_path, _list_existing_del_locks
  from ray.train._internal.storage import _exists_at_fs_path, _upload_to_fs_path
  from ray.train.tests.test_new_persistence import _create_mock_custom_fs
label_desc: Use image node_id 1 for calling a global function with example usage: checkpoint(request, tmp_path) without return types