code: def test_run_confidence_benchmark(
      self,
      model_name,
      target_level,
      audio_and_texts,
      conformer_ctc_bpe_model,
      conformer_rnnt_bpe_model,
  ):
      model = (
          conformer_ctc_bpe_model
          if model_name == "ctc"
          else conformer_rnnt_bpe_model
      )
      assert isinstance(model, ASRModel)
      filepaths, reference_texts = audio_and_texts
      confidence_cfg = (
          ConfidenceConfig(preserve_token_confidence=True)
          if target_level == "token"
          else ConfidenceConfig(preserve_word_confidence=True)
      )
      model.change_decoding_strategy(
          RNNTDecodingConfig(
              fused_batch_size=-1,
              strategy="greedy_batch",
              confidence_cfg=confidence_cfg,
          )
          if model_name == "rnnt"
          else CTCDecodingConfig(confidence_cfg=confidence_cfg)
      )
      with tempfile.TemporaryDirectory() as tmpdir:
          assert np.allclose(
              np.array(
                  run_confidence_benchmark(
                      model,
                      target_level,
                      filepaths,
                      reference_texts,
                      plot_dir=tmpdir,
                  )[target_level]
              ),
              np.array(
                  [
                      0.5,
                      1.0,
                      0.0,
                      -math.inf,
                      ECE_VALUES[(target_level, model_name)],
                      0.0,
                      0.0,
                      0.0,
                  ]
              ),
              atol=TOL,
          )
  
imports: import json
  import math
  import tempfile
  from pathlib import Path
  import numpy
  import pytest
  from omegaconf import OmegaConf
  from pytorch_lightning import Trainer
  from nemo.collections.asr.models import ASRModel, EncDecCTCModelBPE, EncDecRNNTBPEModel
  from nemo.collections.asr.parts.submodules.ctc_decoding import CTCDecodingConfig
  from nemo.collections.asr.parts.submodules.ctc_greedy_decoding import GreedyCTCInferConfig
  from nemo.collections.asr.parts.submodules.rnnt_decoding import RNNTDecodingConfig
  from nemo.collections.asr.parts.submodules.rnnt_greedy_decoding import GreedyBatchedRNNTInferConfig
  from nemo.collections.asr.parts.utils.asr_confidence_benchmarking_utils import run_confidence_benchmark
  from nemo.collections.asr.parts.utils.asr_confidence_utils import ConfidenceConfig
label_desc: Use image node_id 1 for calling the TestASRConfidenceBenchmark obj's underlying member method code with example usage: obj.test_run_confidence_benchmark(model_name, target_level, audio_and_texts, conformer_ctc_bpe_model, conformer_rnnt_bpe_model) without return types