code: def test_validate_datasets(ray_start_4_cpus):
      with pytest.raises(ValueError) as e:
          DummyTrainer(train_loop=None, datasets=1)
      assert "`datasets` should be a dict mapping" in str(e.value)
  
      with pytest.raises(ValueError) as e:
          DummyTrainer(train_loop=None, datasets={"train": 1})
      assert "The Dataset under train key is not a `ray.data.Dataset`"
  
imports: import logging
  import tempfile
  import pytest
  import ray
  from ray import train, tune
  from ray.air.constants import MAX_REPR_LENGTH
  from ray.data.context import DataContext
  from ray.train import Checkpoint, ScalingConfig
  from ray.train.gbdt_trainer import GBDTTrainer
  from ray.train.trainer import BaseTrainer
  from ray.util.placement_group import get_current_placement_group
label_desc: Use image node_id 2 for calling a global function with example usage: test_validate_datasets(ray_start_4_cpus) without return types