code: def test_metadata_propagation_base(ray_start_4_cpus):
      class MyTrainer(BaseTrainer):
          def training_loop(self):
              assert train.get_context().get_metadata() == {
                  "a": 1,
                  "b": 1,
              }
              with tempfile.TemporaryDirectory() as path:
                  checkpoint = Checkpoint.from_directory(path)
                  checkpoint.set_metadata({"b": 2, "c": 3})
                  train.report(dict(my_metric=1), checkpoint=checkpoint)
  
      trainer = MyTrainer(metadata={"a": 1, "b": 1})
      result = trainer.fit()
      meta_out = result.checkpoint.get_metadata()
      assert meta_out == {"a": 1, "b": 2, "c": 3}, meta_out
  
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 8 for calling a global function with example usage: test_metadata_propagation_base(ray_start_4_cpus) without return types