code: def test_deepspeed_load_checkpoint_client_state_missing(tmp_path):
      """Test that the DeepSpeed strategy raises a custom error when client state couldn't be loaded by DeepSpeed."""
      from deepspeed import DeepSpeedEngine
  
      strategy = DeepSpeedStrategy()
      optimizer = Mock()
      model = Mock(spec=DeepSpeedEngine, optimizer=optimizer)
      model.modules.return_value = [model]
  
      # If the DeepSpeed engine fails to load the checkpoint file (e.g., file not found), it prints a warning and
      # returns None from its function call
      model.load_checkpoint.return_value = [None, None]
  
      # Check for our custom user error
      with pytest.raises(
          FileNotFoundError,
          match="The provided path is not a valid DeepSpeed checkpoint",
      ):
          strategy.load_checkpoint(
              path=tmp_path,
              state={
                  "model": model,
                  "optimizer": optimizer,
                  "test": "data",
              },
          )
  
imports: import json
  from re import escape
  from unittest import mock
  from unittest.mock import ANY, Mock
  import pytest
  import torch
  from lightning.fabric.accelerators import CPUAccelerator, CUDAAccelerator
  from lightning.fabric.strategies import DeepSpeedStrategy
  from torch.optim import Optimizer
  from tests_fabric.helpers.runif import RunIf
label_desc: Use image node_id 18 for calling a global function with example usage: test_deepspeed_load_checkpoint_client_state_missing(tmp_path) without return types