code: def init_cosine_decay(
      config: LRSchedulerConfig,
      optimizer: Optimizer,
      step_info: StepInfo,
  ) -> CosineAnnealingWarmRestarts:
      t_0 = config.t_0
      if not t_0:
          t_0 = step_info.steps_per_checkpoint
      if not t_0:
          # A scheduler may be initialized with dummy values like at the start of training.
          # Ensure that t_0 != 0, as this causes an error to be raised.
          t_0 = 1
  
      return CosineAnnealingWarmRestarts(
          optimizer,
          T_0=t_0,
          T_mult=config.t_mult or 1,
          eta_min=config.eta_min or 0,
      )
  
imports: import logging
  import math
  from typing import Any, Callable, Dict
  from torch.optim import Optimizer
  from torch.optim.lr_scheduler import CosineAnnealingWarmRestarts, LambdaLR, ReduceLROnPlateau, SequentialLR
  from ludwig.constants import MINIMIZE, TRAINING, VALIDATION
  from ludwig.modules.metric_registry import get_metric_objective
  from ludwig.schema.lr_scheduler import LRSchedulerConfig
  from ludwig.utils.metric_utils import TrainerMetric
  from ludwig.utils.trainer_utils import ProgressTracker
label_desc: Use image node_id 6 for calling a global function with example usage: init_cosine_decay(config, optimizer, step_info) and returns: CosineAnnealingWarmRestarts