class_docstr: Dataset class that loads a json file containing paths to audio files,
  RTTM files and number of speakers. This Dataset class is designed for
  training or fine-tuning speaker embedding extractor and diarization decoder
  at the same time.
  
  Example:
  {"audio_filepath": "/path/to/audio_0.wav", "num_speakers": 2,
  "rttm_filepath": "/path/to/diar_label_0.rttm}
  ...
  {"audio_filepath": "/path/to/audio_n.wav", "num_speakers": 2,
  "rttm_filepath": "/path/to/diar_label_n.rttm}
  
  Args:
      manifest_filepath (str):
          Path to input manifest json files.
      multiscale_args_dict (dict):
          Dictionary containing the parameters for multiscale segmentation and clustering.
      emb_dir (str):
          Path to a temporary folder where segmentation information for embedding extraction is saved.
      soft_label_thres (float):
          Threshold that determines the label of each segment based on RTTM file information.
      featurizer:
          Featurizer instance for generating features from the raw waveform.
      window_stride (float):
          Window stride for acoustic feature. This value is used for calculating the numbers of feature-level frames.
      emb_batch_size (int):
          Number of embedding vectors that are trained with attached computational graphs.
      pairwise_infer (bool):
          This variable should be True if dataloader is created for an inference task.
      random_flip (bool):
          If True, the two labels and input signals are randomly flipped per every epoch while training.
code: def __getitem__(self, index):
      sample = self.collection[index]
      if sample.offset is None:
          sample.offset = 0
      (
          clus_label_index,
          targets,
          scale_mapping,
      ) = self.parse_rttm_for_ms_targets(sample)
      features = self.featurizer.process(
          sample.audio_file,
          offset=sample.offset,
          duration=sample.duration,
      )
      feature_length = torch.tensor(features.shape[0]).long()
      ms_seg_timestamps, ms_seg_counts = self.get_ms_seg_timestamps(
          sample
      )
      if self.random_flip:
          torch.manual_seed(index)
          flip = torch.cat(
              [
                  torch.randperm(self.max_spks),
                  torch.tensor(-1).unsqueeze(0),
              ]
          )
          clus_label_index, targets = (
              flip[clus_label_index],
              targets[:, flip[: self.max_spks]],
          )
      return (
          features,
          feature_length,
          ms_seg_timestamps,
          ms_seg_counts,
          clus_label_index,
          scale_mapping,
          targets,
      )
  
imports: import os
  from collections import OrderedDict
  from statistics import mode
  from typing import Dict, Optional
  import torch
  from nemo.collections.asr.parts.utils.offline_clustering import get_argmin_mat
  from nemo.collections.asr.parts.utils.speaker_utils import convert_rttm_line, prepare_split_data
  from nemo.collections.common.parts.preprocessing.collections import DiarizationSpeechLabel
  from nemo.core.classes import Dataset
  from nemo.core.neural_types import AudioSignal, EncodedRepresentation, LengthsType, NeuralType, ProbsType
label_desc: Use image node_id 9 for calling the _AudioMSDDTrainDataset obj's underlying member method code with example usage: obj.__getitem__(index) and returns: features,  feature_length,  ms_seg_timestamps,  ms_seg_counts,  clus_label_index,  scale_mapping,  targets