code: def build_lr_hook(
      lr_config: Dict[Any, Any]
  ) -> mmcv_hooks.LrUpdaterHook:
      assert (
          "policy" in lr_config
      ), "policy must be specified in lr_config"
      policy_type = lr_config.pop("policy")
      if policy_type == policy_type.lower():
          policy_type = policy_type.title()
      hook_type = policy_type + "LrUpdaterHook"
      lr_config["type"] = hook_type
      hook = mmcv.build_from_cfg(lr_config, mmcv_hooks.HOOKS)
      return hook
  
imports: from typing import Any, Dict, Optional, cast
  import mmcv
  import mmcv.runner.hooks
  import determined.pytorch
label_desc: Use image node_id 1 for calling a global function with example usage: build_lr_hook(lr_config) and returns: hook