code: def build_lr_scheduler(cfg, optimizer):
      """
      Build a LR scheduler from config.
      """
      name = cfg.CONFIG.TRAIN.ITER_LR_SCHEDULER_NAME
      if name == "WarmupMultiStepLR":
          return WarmupMultiStepLR(
              optimizer,
              cfg.CONFIG.TRAIN.ITER_LR_STEPS,
              cfg.CONFIG.TRAIN.STEP,
              warmup_factor=cfg.CONFIG.TRAIN.ITER_BASED_WARMUP_FACTOR,
              warmup_iters=cfg.CONFIG.TRAIN.ITER_BASED_WARMUP_ITERS,
              warmup_method=cfg.CONFIG.TRAIN.ITER_BASED_WARMUP_METHOD,
          )
      elif name == "WarmupCosineLR":
          return WarmupCosineLR(
              optimizer,
              cfg.CONFIG.TRAIN.ITER_NUM,
              warmup_factor=cfg.CONFIG.TRAIN.ITER_BASED_WARMUP_FACTOR,
              warmup_iters=cfg.CONFIG.TRAIN.ITER_BASED_WARMUP_ITERS,
              warmup_method=cfg.CONFIG.TRAIN.ITER_BASED_WARMUP_METHOD,
          )
      elif name == "WarmupLinearLR":
          return WarmupLinearLR(
              optimizer=optimizer,
              max_iter=cfg.CONFIG.TRAIN.ITER_NUM,
              warmup_factor=cfg.CONFIG.TRAIN.ITER_BASED_WARMUP_FACTOR,
              warmup_iters=cfg.CONFIG.TRAIN.ITER_BASED_WARMUP_ITERS,
              warmup_method=cfg.CONFIG.TRAIN.ITER_BASED_WARMUP_METHOD,
          )
      else:
          raise ValueError("Unknown LR scheduler: {}".format(name))
  
imports: from typing import List
  import torch
  from torch.optim.lr_scheduler import _LRScheduler
  from torch.optim.lr_scheduler import ReduceLROnPlateau
label_desc: Use image node_id 2 for calling a global function with example usage: build_lr_scheduler(cfg, optimizer) and returns: WarmupMultiStepLR, WarmupCosineLR, WarmupLinearLR