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.
docstr: Get start and end time of segments in each scale.
  
  Args:
      sample:
          `DiarizationSpeechLabel` instance from preprocessing.collections
  Returns:
      ms_seg_timestamps (torch.tensor):
          Tensor containing Multiscale segment timestamps.
      ms_seg_counts (torch.tensor):
          Number of segments for each scale. This information is used for reshaping embedding batch
          during forward propagation.
docstr_tok: ["Get","start","and","end","time","of","segments","in","each","scale",".","Args",":","sample",":","`","DiarizationSpeechLabel","`","instance","from","preprocessing.collections","Returns",":","ms_seg_timestamps","(","torch.tensor",")",":","Tensor","containing","Multiscale","segment","timestamps",".","ms_seg_counts","(","torch.tensor",")",":","Number","of","segments","for","each","scale",".","This","information","is","used","for","reshaping","embedding","batch","during","forward","propagation","."]
code: def get_ms_seg_timestamps(self, sample):
      """
      Get start and end time of segments in each scale.
  
      Args:
          sample:
              `DiarizationSpeechLabel` instance from preprocessing.collections
      Returns:
          ms_seg_timestamps (torch.tensor):
              Tensor containing Multiscale segment timestamps.
          ms_seg_counts (torch.tensor):
              Number of segments for each scale. This information is used for reshaping embedding batch
              during forward propagation.
      """
      uniq_id = self.get_uniq_id_with_range(sample)
      ms_seg_timestamps_list = []
      max_seq_len = len(
          self.multiscale_timestamp_dict[uniq_id]["scale_dict"][
              self.scale_n - 1
          ]["time_stamps"]
      )
      ms_seg_counts = [0 for _ in range(self.scale_n)]
      for scale_idx in range(self.scale_n):
          scale_ts_list = []
          for k, (seg_stt, seg_end) in enumerate(
              self.multiscale_timestamp_dict[uniq_id]["scale_dict"][
                  scale_idx
              ]["time_stamps"]
          ):
              stt, end = (
                  int((seg_stt - sample.offset) * self.frame_per_sec),
                  int((seg_end - sample.offset) * self.frame_per_sec),
              )
              scale_ts_list.append(torch.tensor([stt, end]).detach())
          ms_seg_counts[scale_idx] = len(
              self.multiscale_timestamp_dict[uniq_id]["scale_dict"][
                  scale_idx
              ]["time_stamps"]
          )
          scale_ts = torch.stack(scale_ts_list)
          scale_ts_padded = torch.cat(
              [
                  scale_ts,
                  torch.zeros(max_seq_len - len(scale_ts_list), 2),
              ],
              dim=0,
          )
          ms_seg_timestamps_list.append(scale_ts_padded.detach())
      ms_seg_timestamps = torch.stack(ms_seg_timestamps_list)
      ms_seg_counts = torch.tensor(ms_seg_counts)
      return ms_seg_timestamps, ms_seg_counts
  
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 8 for calling the _AudioMSDDTrainDataset obj's underlying member method code with example usage: obj.get_ms_seg_timestamps(sample) and returns: ms_seg_timestamps,  ms_seg_counts