class_docstr: Base class of audio datasets, providing common functionality
  for other audio datasets.
  
  Args:
      collection: Collection of audio examples prepared from manifest files.
      audio_processor: Used to process every example from the collection.
                       A callable with `process` method. For reference,
                       please check ASRAudioProcessor.
class_docstr_tok: ["Base","class","of","audio","datasets",",","providing","common","functionality","for","other","audio","datasets",".","Args",":","collection",":","Collection","of","audio","examples","prepared","from","manifest","files",".","audio_processor",":","Used","to","process","every","example","from","the","collection",".","A","callable","with","`","process","`","method",".","For","reference",",","please","check","ASRAudioProcessor","."]
docstr: Returns the number of channels for a particular signal in
  items prepared by this dictionary.
  
  More specifically, this will get the tensor from the first
  item in the dataset, check if it's a one- or two-dimensional
  tensor, and return the number of channels based on the size
  of the first axis (shape[0]).
  
  NOTE:
  This assumes that all examples have the same number of channels.
  
  Args:
      signal_key: string, used to select a signal from the dictionary
                  output by __getitem__
  
  Returns:
      Number of channels for the selected signal.
code: def num_channels(self, signal_key) -> int:
      """Returns the number of channels for a particular signal in
      items prepared by this dictionary.
  
      More specifically, this will get the tensor from the first
      item in the dataset, check if it's a one- or two-dimensional
      tensor, and return the number of channels based on the size
      of the first axis (shape[0]).
  
      NOTE:
      This assumes that all examples have the same number of channels.
  
      Args:
          signal_key: string, used to select a signal from the dictionary
                      output by __getitem__
  
      Returns:
          Number of channels for the selected signal.
      """
      # Assumption: whole dataset has the same number of channels
      item = self.__getitem__(0)
  
      if item[signal_key].ndim == 1:
          return 1
      elif item[signal_key].ndim == 2:
          return item[signal_key].shape[0]
      else:
          raise RuntimeError(
              f"Unexpected number of dimension for signal {signal_key} with shape {item[signal_key].shape}"
          )
  
imports: import abc
  import math
  import random
  from collections import OrderedDict, namedtuple
  from dataclasses import dataclass
  from typing import Callable, Dict, List, Optional, Tuple, Type, Union
  import librosa
  import numpy
  import torch
  from nemo.collections.asr.parts.preprocessing.segment import AudioSegment
  from nemo.collections.asr.parts.utils.audio_utils import ChannelSelectorType
  from nemo.collections.common.parts.preprocessing import collections
  from nemo.collections.common.parts.utils import flatten
  from nemo.core.classes import Dataset
  from nemo.core.neural_types import AudioSignal, EncodedRepresentation, LengthsType, NeuralType
  from nemo.utils import logging
label_desc: Use image node_id 3 for calling the BaseAudioDataset obj's underlying member method code with example usage: obj.num_channels(signal_key) and returns: int, item