code: def test_run_config_in_trainer_and_tuner(
      propagate_logs,
      tmp_path,
      monkeypatch,
      caplog,
      in_trainer,
      in_tuner,
  ):
      monkeypatch.setenv("RAY_AIR_LOCAL_CACHE_DIR", str(tmp_path))
      trainer_run_config = (
          RunConfig(name="trainer") if in_trainer else None
      )
      tuner_run_config = RunConfig(name="tuner") if in_tuner else None
      trainer = DataParallelTrainer(
          lambda config: None,
          backend_config=TestConfig(),
          scaling_config=ScalingConfig(num_workers=1),
          run_config=trainer_run_config,
      )
      with caplog.at_level(
          logging.INFO, logger="ray.tune.impl.tuner_internal"
      ):
          tuner = Tuner(trainer, run_config=tuner_run_config)
  
      both_msg = "`RunConfig` was passed to both the `Tuner` and the `DataParallelTrainer`"
      if in_trainer and in_tuner:
          assert (tmp_path / "tuner").exists()
          assert not (tmp_path / "trainer").exists()
          assert both_msg in caplog.text
      elif in_trainer and not in_tuner:
          assert not (tmp_path / "tuner").exists()
          assert (tmp_path / "trainer").exists()
          assert both_msg not in caplog.text
      elif not in_trainer and in_tuner:
          assert (tmp_path / "tuner").exists()
          assert not (tmp_path / "trainer").exists()
          assert both_msg not in caplog.text
      else:
          assert tuner._local_tuner.get_run_config() == RunConfig()
          assert both_msg not in caplog.text
  
imports: import logging
  import pytest
  import ray
  from ray import train, tune
  from ray.air.constants import TRAINING_ITERATION
  from ray.train import FailureConfig, RunConfig, 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.examples.pytorch.torch_fashion_mnist_example import train_func_per_worker
  from ray.train.examples.tf.tensorflow_mnist_example import train_func
  from ray.train.tensorflow.tensorflow_trainer import TensorflowTrainer
  from ray.train.tests.util import create_dict_checkpoint, load_dict_checkpoint
  from ray.train.torch.torch_trainer import TorchTrainer
  from ray.tune.tune_config import TuneConfig
  from ray.tune.tuner import Tuner
label_desc: Use image node_id 12 for calling a global function with example usage: test_run_config_in_trainer_and_tuner(propagate_logs, tmp_path, monkeypatch, caplog, in_trainer, in_tuner) without return types