code: def train_mosaic_cifar10(
      num_workers=2, use_gpu=False, max_duration="5ep"
  ):
      from composer.algorithms import LabelSmoothing
  
      from ray.train.mosaic import MosaicTrainer
  
      trainer_init_config = {
          "max_duration": max_duration,
          "algorithms": [LabelSmoothing()],
          "should_eval": False,
      }
  
      trainer = MosaicTrainer(
          trainer_init_per_worker=trainer_init_per_worker,
          trainer_init_config=trainer_init_config,
          scaling_config=ScalingConfig(
              num_workers=num_workers, use_gpu=use_gpu
          ),
      )
      result = trainer.fit()
      print(f"Results: {result.metrics}")
  
      return result
  
file_path: ray/python/ray/train/examples/mosaic_cifar10_example.py
imports: import argparse
  import os
  import torch
  import torch.utils.data
  import torchvision
  from filelock import FileLock
  from torchvision import datasets, transforms
  import ray
  from ray import train
  from ray.train import ScalingConfig
label_desc: Use image node_id 2 for calling a global function with example usage: train_mosaic_cifar10(num_workers, use_gpu, max_duration) and returns: result