code: def test_resume_from_checkpoint(tmpdir):
      with pytest.raises(ValueError):
          DummyTrainer(resume_from_checkpoint="invalid")
  
      with pytest.raises(ValueError):
          DummyTrainer(resume_from_checkpoint=False)
  
      with pytest.raises(ValueError):
          DummyTrainer(resume_from_checkpoint=True)
  
      with pytest.raises(ValueError):
          DummyTrainer(resume_from_checkpoint={})
  
      # Succeed
      DummyTrainer(resume_from_checkpoint=None)
  
      # Succeed
      DummyTrainer(
          resume_from_checkpoint=Checkpoint.from_directory(tmpdir)
      )
  
imports: import pytest
  import ray
  from ray.train import Checkpoint, CheckpointConfig, ScalingConfig
  from ray.air._internal.config import ensure_only_allowed_dataclass_keys_updated
  from ray.data.preprocessor import Preprocessor
  from ray.train.trainer import BaseTrainer
label_desc: Use image node_id 11 for calling a global function with example usage: test_resume_from_checkpoint(tmpdir) without return types