code: def test_basic(ray_start_4_cpus):
      ds = ray.data.range(10)
  
      # Single worker basic case.
      test = TestBasic(
          1,
          True,
          {"train": 10, "test": 10},
          datasets={"train": ds, "test": ds},
      )
      test.fit()
  
      # Single worker, no test ds.
      test = TestBasic(
          1, True, {"train": 10, "test": -1}, datasets={"train": ds}
      )
      test.fit()
  
      # Two workers, train and test split.
      test = TestBasic(
          2,
          True,
          {"train": 5, "test": 5},
          datasets={"train": ds, "test": ds},
      )
      test.fit()
  
      # Two workers, both split.
      test = TestBasic(
          2,
          True,
          {"train": 5, "test": 5},
          dataset_config=DataConfig(
              datasets_to_split=["train", "test"]
          ),
          datasets={"train": ds, "test": ds},
      )
      # Test get config.
      assert isinstance(test.get_dataset_config(), DataConfig)
      test.fit()
  
imports: from typing import Optional
  import random
  import pytest
  from unittest.mock import MagicMock
  import ray
  from ray import train
  from ray.train import DataConfig, ScalingConfig
  from ray.data import DataIterator
  from ray.train.data_parallel_trainer import DataParallelTrainer
  from ray.data._internal.execution.interfaces.execution_options import ExecutionOptions
  from ray.tests.conftest import *
label_desc: Use image node_id 2 for calling a global function with example usage: test_basic(ray_start_4_cpus) without return types