code: def get_char_dataset(
      config: dict, augmentor: Optional["AudioAugmentor"] = None
  ) -> audio_to_text.AudioToCharDataset:
      """
      Instantiates a Character Encoding based AudioToCharDataset.
  
      Args:
          config: Config of the AudioToCharDataset.
          augmentor: Optional AudioAugmentor object for augmentations on audio data.
  
      Returns:
          An instance of AudioToCharDataset.
      """
      if "labels" not in config:
          logging.warning(
              f"dataset does not have explicitly defined labels"
          )
  
      dataset = audio_to_text.AudioToCharDataset(
          manifest_filepath=config["manifest_filepath"],
          labels=config.get("labels", None),
          sample_rate=config["sample_rate"],
          int_values=config.get("int_values", False),
          augmentor=augmentor,
          max_duration=config.get("max_duration", None),
          min_duration=config.get("min_duration", None),
          max_utts=config.get("max_utts", 0),
          blank_index=config.get("blank_index", -1),
          unk_index=config.get("unk_index", -1),
          normalize=config.get("normalize_transcripts", False),
          trim=config.get("trim_silence", False),
          parser=config.get("parser", "en"),
          return_sample_id=config.get("return_sample_id", False),
          channel_selector=config.get("channel_selector", None),
      )
      return dataset
  
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 3 for calling a global function with example usage: get_char_dataset(config, augmentor) and returns: dataset