code: def apply_confidence_parameters(decoding_cfg, hp):
      """Apply parameters from a parameter grid to a decoding config.
  
      Returns:
          Updated decoding config.
      """
      new_decoding_cfg = copy.deepcopy(decoding_cfg)
      confidence_cfg_fields = ("aggregation", "exclude_blank")
      confidence_method_cfg_fields = (
          "name",
          "alpha",
          "entropy_type",
          "entropy_norm",
      )
      with open_dict(new_decoding_cfg):
          for p, v in hp.items():
              if p in confidence_cfg_fields:
                  new_decoding_cfg.confidence_cfg[p] = v
              elif p in confidence_method_cfg_fields:
                  new_decoding_cfg.confidence_cfg.method_cfg[p] = v
      return new_decoding_cfg
  
file_path: NeMo/nemo/collections/asr/parts/utils/asr_confidence_benchmarking_utils.py
imports: import contextlib
  import copy
  import os
  from pathlib import Path
  from typing import List, Optional, Tuple, Union
  import numpy
  import texterrors
  import torch
  from omegaconf import open_dict
  from nemo.collections.asr.models import ASRModel, EncDecRNNTModel
  from nemo.collections.asr.parts.utils.confidence_metrics import auc_nt, auc_pr, auc_roc, auc_yc, ece, nce, save_confidence_hist, save_custom_confidence_curve, save_nt_curve, save_pr_curve, save_roc_curve
  from nemo.collections.asr.parts.utils.rnnt_utils import Hypothesis
label_desc: Use image node_id 5 for calling a global function with example usage: apply_confidence_parameters(decoding_cfg, hp) and returns: new_decoding_cfg