code: def instantiate_scheduler(optimizer, scheduler_opt):
      """Return a learning rate scheduler
      Parameters:
          optimizer          -- the optimizer of the network
          scheduler_opt (option class) -- dict containing all the params to build the scheduler
                                opt.lr_policy is the name of learning rate policy: lambda_rule | step | plateau | cosine
                                opt.params contains the scheduler_params to construct the scheduler
      See https://pytorch.org/docs/stable/optim.html for more details.
      """
  
      update_scheduler_on = scheduler_opt.update_scheduler_on
      scheduler_cls_name = getattr(scheduler_opt, "class")
      scheduler_params = collect_params(
          scheduler_opt.params, update_scheduler_on
      )
  
      try:
          scheduler_cls = getattr(lr_scheduler, scheduler_cls_name)
      except:
          scheduler_cls = getattr(
              _custom_lr_scheduler, scheduler_cls_name
          )
          log.info("Created custom lr scheduler")
  
      if scheduler_cls_name.lower() == "ReduceLROnPlateau".lower():
          raise NotImplementedError(
              "This scheduler is not fully supported yet"
          )
  
      scheduler = scheduler_cls(optimizer, **scheduler_params)
      # used to re_create the scheduler
  
      setattr(
          scheduler,
          "_scheduler_opt",
          OmegaConf.to_container(scheduler_opt),
      )
      return LRScheduler(
          scheduler, scheduler_params, update_scheduler_on
      )
  
imports: import sys
  from torch.optim import lr_scheduler
  from omegaconf import OmegaConf
  from omegaconf.dictconfig import DictConfig
  import logging
  from torch.optim.lr_scheduler import LambdaLR
  from torch_points3d.utils.enums import SchedulerUpdateOn
label_desc: Use image node_id 3 for calling a global function with example usage: instantiate_scheduler(optimizer, scheduler_opt) and returns: LRScheduler