code: def test_checkpoint_freq(ray_start_4_cpus):
      # checkpoint_freq is not supported so raise an error
      trainer = TorchTrainer(
          train_loop_per_worker=lambda config: None,
          scaling_config=train.ScalingConfig(num_workers=1),
          run_config=train.RunConfig(
              checkpoint_config=train.CheckpointConfig(
                  checkpoint_frequency=2,
              ),
          ),
      )
      with pytest.raises(ValueError):
          trainer.fit()
  
imports: import contextlib
  import os
  import tempfile
  import time
  import uuid
  from unittest.mock import patch
  import pytest
  import torch
  import ray
  import ray.train
  from ray.cluster_utils import Cluster
  from ray.train import Checkpoint, RunConfig, ScalingConfig
  from ray.train.examples.pytorch.torch_linear_example import train_func
  from ray.train.torch import TorchCheckpoint, TorchConfig, TorchPredictor, TorchTrainer
  from ray.train.trainer import TrainingFailedError
label_desc: Use image node_id 7 for calling a global function with example usage: test_checkpoint_freq(ray_start_4_cpus) without return types