code: def test_log_count(ray_start_4_cpus):
      from ray.train.mosaic import MosaicTrainer
  
      trainer_init_config = {
          "max_duration": "1ep",
          "should_eval": False,
      }
  
      trainer = MosaicTrainer(
          trainer_init_per_worker=trainer_init_per_worker,
          trainer_init_config=trainer_init_config,
          scaling_config=scaling_config,
      )
  
      result = trainer.fit()
  
      assert len(result.metrics_dataframe) == 1
  
      trainer_init_config["max_duration"] = "1ba"
  
      trainer = MosaicTrainer(
          trainer_init_per_worker=trainer_init_per_worker,
          trainer_init_config=trainer_init_config,
          scaling_config=scaling_config,
      )
  
      result = trainer.fit()
  
      assert len(result.metrics_dataframe) == 1
  
file_path: ray/python/ray/train/tests/test_mosaic_trainer.py
imports: import os
  import pytest
  import torch
  import torch.utils.data
  import torchvision
  from filelock import FileLock
  from torchvision import datasets, transforms
  import ray.train
  from ray.train import ScalingConfig
  from ray.train.trainer import TrainingFailedError
label_desc: Use image node_id 4 for calling a global function with example usage: test_log_count(ray_start_4_cpus) without return types