code: def test_scaling_config_validate_config_bad_allowed_keys():
      # Check for keys not present in dict
      scaling_config = {"num_workers": 2}
      with pytest.raises(ValueError) as exc_info:
          ensure_only_allowed_dataclass_keys_updated(
              ScalingConfig(**scaling_config),
              ["BAD_KEY"],
          )
      assert "BAD_KEY" in str(exc_info.value)
      assert "are not present in" in str(exc_info.value)
  
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 7 for calling a global function with example usage: test_scaling_config_validate_config_bad_allowed_keys() without return types