code: def prepare_audio_data(cfg: DictConfig) -> Tuple[List[str], bool]:
      """Prepare audio data and decide whether it's partial_audio condition."""
      # this part may need refactor alongsides with refactor of transcribe
      partial_audio = False
  
      if cfg.audio_dir is not None and not cfg.append_pred:
          filepaths = list(
              glob.glob(
                  os.path.join(cfg.audio_dir, f"**/*.{cfg.audio_type}"),
                  recursive=True,
              )
          )
      else:
          # get filenames from manifest
          filepaths = []
          if os.stat(cfg.dataset_manifest).st_size == 0:
              logging.error(
                  f"The input dataset_manifest {cfg.dataset_manifest} is empty. Exiting!"
              )
              return None
  
          with open(cfg.dataset_manifest, "r", encoding="utf_8") as f:
              has_two_fields = []
              for line in f:
                  item = json.loads(line)
                  if "offset" in item and "duration" in item:
                      has_two_fields.append(True)
                  else:
                      has_two_fields.append(False)
                  audio_key = cfg.get("audio_key", "audio_filepath")
                  audio_file = get_full_path(
                      audio_file=item[audio_key],
                      manifest_file=cfg.dataset_manifest,
                  )
                  filepaths.append(audio_file)
          partial_audio = all(has_two_fields)
      logging.info(f"\nTranscribing {len(filepaths)} files...\n")
  
      return filepaths, partial_audio
  
imports: import glob
  import json
  import os
  import re
  from dataclasses import dataclass
  from typing import List, Optional, Tuple, Union
  import torch
  from omegaconf import DictConfig
  from tqdm.auto import tqdm
  import nemo.collections.asr
  from nemo.collections.asr.metrics.wer import word_error_rate
  from nemo.collections.asr.models import ASRModel, EncDecHybridRNNTCTCModel
  from nemo.collections.asr.parts.utils import rnnt_utils
  from nemo.collections.asr.parts.utils.streaming_utils import FrameBatchASR
  from nemo.collections.common.metrics.punct_er import OccurancePunctuationErrorRate
  from nemo.collections.common.parts.preprocessing.manifest import get_full_path
  from nemo.utils import logging, model_utils
label_desc: Use image node_id 5 for calling a global function with example usage: prepare_audio_data(cfg) and returns: filepaths,  partial_audio, None