code: def test_run(ray_start_4_cpus):
      """Tests that Train can be run without any specific backends."""
      num_workers = 2
      key = "value"
      value = 1
      config = TestConfig()
  
      def train_func():
          checkpoint = train.get_checkpoint()
          checkpoint_dict = load_dict_checkpoint(checkpoint)
          if train.get_context().get_world_rank() == 0:
              train.report(
                  metrics=checkpoint_dict, checkpoint=checkpoint
              )
          else:
              train.report(metrics=checkpoint_dict)
          return checkpoint_dict[key]
  
      with create_dict_checkpoint({key: value}) as checkpoint:
          trainer = DataParallelTrainer(
              train_func,
              backend_config=config,
              resume_from_checkpoint=checkpoint,
              scaling_config=ScalingConfig(num_workers=num_workers),
          )
          results = trainer.fit()
  
          assert load_dict_checkpoint(
              results.checkpoint
          ) == load_dict_checkpoint(checkpoint)
  
file_path: ray/python/ray/train/tests/test_minimal.py
imports: import pytest
  import ray
  from ray import train
  from ray.train import ScalingConfig
  from ray.train._internal.worker_group import WorkerGroup
  from ray.train.backend import Backend, BackendConfig
  from ray.train.data_parallel_trainer import DataParallelTrainer
  from ray.train.tests.util import create_dict_checkpoint, load_dict_checkpoint
label_desc: Use image node_id 2 for calling a global function with example usage: test_run(ray_start_4_cpus) and returns: checkpoint_dict