code: def test_scaling_config_validate_config_valid_class():
      scaling_config = {"num_workers": 2}
      ensure_only_allowed_dataclass_keys_updated(
          ScalingConfig(**scaling_config), ["num_workers"]
      )
  
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 5 for calling a global function with example usage: test_scaling_config_validate_config_valid_class() without return types