code: def build_default_lr_scheduler(
      optimizer: torch.optim.Optimizer,
      scheduler_kwargs: hf_parse.LRSchedulerKwargs,
  ) -> Any:
      """
      This follows the function in transformer's Trainer to construct the lr_scheduler.
  
      Args:
          optimizer: optimizer to apply lr_scheduler to
          scheduler_kwargs: see LRSchedulerKwargs in _config_parser.py for expected fields.
      Returns:
          lr_scheduler configured accordingly
      """
      return hf_opt.get_scheduler(
          scheduler_kwargs.lr_scheduler_type,
          optimizer,
          num_warmup_steps=scheduler_kwargs.num_warmup_steps,
          num_training_steps=scheduler_kwargs.num_training_steps,
      )
  
file_path: determined/model_hub/model_hub/huggingface/_trial.py
imports: import dataclasses
  import logging
  from typing import Any, Dict, List, Optional, Tuple, Union, cast
  import datasets
  import torch
  import transformers
  import transformers.optimization
  import determined.pytorch
  from model_hub import utils
  from model_hub.huggingface import _config_parser
label_desc: Use image node_id 4 for calling a global function with example usage: build_default_lr_scheduler(optimizer, scheduler_kwargs) and returns: hf_opt