code: def get_confidence_measure_bank():
      """Generate a dictionary with confidence measure functionals.
  
      Supported confidence measures:
          max_prob: normalized maximum probability
          entropy_gibbs_lin: Gibbs entropy with linear normalization
          entropy_gibbs_exp: Gibbs entropy with exponential normalization
          entropy_tsallis_lin: Tsallis entropy with linear normalization
          entropy_tsallis_exp: Tsallis entropy with exponential normalization
          entropy_renyi_lin: Rényi entropy with linear normalization
          entropy_renyi_exp: Rényi entropy with exponential normalization
  
      Returns:
          dictionary with lambda functions.
      """
      # helper functions
      # Gibbs entropy is implemented without alpha
      neg_entropy_gibbs = lambda x: (x.exp() * x).sum(-1)
      neg_entropy_alpha = lambda x, t: (x * t).exp().sum(-1)
      neg_entropy_alpha_gibbs = lambda x, t: ((x * t).exp() * x).sum(-1)
  
      # too big for a lambda
      def entropy_tsallis_exp(x, v, t):
          exp_neg_max_ent = math.exp((1 - math.pow(v, 1 - t)) / (1 - t))
          return (
              ((1 - neg_entropy_alpha(x, t)) / (1 - t)).exp()
              - exp_neg_max_ent
          ) / (1 - exp_neg_max_ent)
  
      def entropy_gibbs_exp(x, v, t):
          exp_neg_max_ent = math.pow(v, -t * math.pow(v, 1 - t))
          return (
              (neg_entropy_alpha_gibbs(x, t) * t).exp()
              - exp_neg_max_ent
          ) / (1 - exp_neg_max_ent)
  
      # use Gibbs entropies for Tsallis and Rényi with t == 1.0
      entropy_gibbs_lin_baseline = lambda x, v: 1 + neg_entropy_gibbs(
          x
      ) / math.log(v)
      entropy_gibbs_exp_baseline = lambda x, v: (
          neg_entropy_gibbs(x).exp() * v - 1
      ) / (v - 1)
      # fill the measure bank
      confidence_measure_bank = {}
      # Maximum probability measure is implemented without alpha
      confidence_measure_bank["max_prob"] = (
          lambda x, v, t: (x.max(dim=-1)[0].exp() * v - 1) / (v - 1)
          if t == 1.0
          else ((x.max(dim=-1)[0] * t).exp() * math.pow(v, t) - 1)
          / (math.pow(v, t) - 1)
      )
      confidence_measure_bank["entropy_gibbs_lin"] = (
          lambda x, v, t: entropy_gibbs_lin_baseline(x, v)
          if t == 1.0
          else 1
          + neg_entropy_alpha_gibbs(x, t)
          / math.log(v)
          / math.pow(v, 1 - t)
      )
      confidence_measure_bank["entropy_gibbs_exp"] = (
          lambda x, v, t: entropy_gibbs_exp_baseline(x, v)
          if t == 1.0
          else entropy_gibbs_exp(x, v, t)
      )
      confidence_measure_bank["entropy_tsallis_lin"] = (
          lambda x, v, t: entropy_gibbs_lin_baseline(x, v)
          if t == 1.0
          else 1
          + (1 - neg_entropy_alpha(x, t)) / (math.pow(v, 1 - t) - 1)
      )
      confidence_measure_bank["entropy_tsallis_exp"] = (
          lambda x, v, t: entropy_gibbs_exp_baseline(x, v)
          if t == 1.0
          else entropy_tsallis_exp(x, v, t)
      )
      confidence_measure_bank["entropy_renyi_lin"] = (
          lambda x, v, t: entropy_gibbs_lin_baseline(x, v)
          if t == 1.0
          else 1
          + neg_entropy_alpha(x, t).log2() / (t - 1) / math.log(v, 2)
      )
      confidence_measure_bank["entropy_renyi_exp"] = (
          lambda x, v, t: entropy_gibbs_exp_baseline(x, v)
          if t == 1.0
          else (neg_entropy_alpha(x, t).pow(1 / (t - 1)) * v - 1)
          / (v - 1)
      )
      return confidence_measure_bank
  
imports: import math
  from abc import ABC, abstractmethod
  from dataclasses import dataclass, field
  from functools import partial
  from typing import List, Optional
  import torch
  from omegaconf import DictConfig, OmegaConf
  from nemo.collections.asr.parts.utils.rnnt_utils import Hypothesis
  from nemo.utils import logging
label_desc: Use image node_id 1 for calling a global function with example usage: get_confidence_measure_bank() and returns: confidence_measure_bank, unknown, unknown