code: def write_on_batch_end(
      self,
      trainer,
      pl_module: "LightningModule",
      prediction: Any,
      batch_indices: List[int],
      batch: Any,
      batch_idx: int,
      dataloader_idx: int,
  ):
      for sample_id, transcribed_text in prediction:
          item = {}
          sample = self.dataset.get_manifest_sample(sample_id)
          item["audio_filepath"] = sample.audio_file
          item["offset"] = sample.offset
          item["duration"] = sample.duration
          item["text"] = sample.text_raw
          item["pred_text"] = transcribed_text
          self.outf.write(json.dumps(item) + "\n")
          self.samples_num += 1
      return
  
imports: import copy
  import json
  import random
  from math import isclose
  from typing import Any, List, Optional, Union
  import torch
  from omegaconf import DictConfig, OmegaConf, open_dict
  from omegaconf.listconfig import ListConfig
  from pytorch_lightning.callbacks import BasePredictionWriter
  from torch.utils.data import ChainDataset
  from nemo.collections.asr.data import audio_to_text, audio_to_text_dali
  from nemo.collections.asr.data.huggingface.hf_audio_to_text_dataset import get_hf_audio_to_text_bpe_dataset, get_hf_audio_to_text_char_dataset
  from nemo.collections.asr.parts.preprocessing.perturb import process_augmentations
  from nemo.collections.common.data.dataset import CodeSwitchedDataset, ConcatDataset
  from nemo.utils import logging
label_desc: Use image node_id 2 for calling the ASRPredictionWriter obj's underlying member method code with example usage: obj.write_on_batch_end(trainer, pl_module, prediction, batch_indices, batch, batch_idx, dataloader_idx) without return types