class_docstr: Dataset class that loads a json file containing paths to audio files,
  RTTM files and number of speakers. This Dataset class is built for diarization inference and
  evaluation. Speaker embedding sequences, segment timestamps, cluster-average speaker embeddings
  are loaded from memory and fed into the dataloader.
  
  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.
      emb_dict (dict):
          Dictionary containing cluster-average embeddings and speaker mapping information.
      emb_seq (dict):
          Dictionary containing multiscale speaker embedding sequence, scale mapping and corresponding segment timestamps.
      clus_label_dict (dict):
          Subsegment-level (from base-scale) speaker labels from clustering results.
      soft_label_thres (float):
          A threshold that determines the label of each segment based on RTTM file information.
      featurizer:
          Featurizer instance for generating features from raw waveform.
      seq_eval_mode (bool):
          If True, F1 score will be calculated for each speaker pair during inference mode.
      window_stride (float):
          Window stride for acoustic feature. This value is used for calculating the numbers of feature-level frames.
      use_single_scale_clus (bool):
          Use only one scale for clustering instead of using multiple scales of embeddings for clustering.
      pairwise_infer (bool):
          This variable should be True if dataloader is created for an inference task.
docstr: Generate target tensor variable by extracting groundtruth diarization labels from an RTTM file.
  This function is only used when ``self.seq_eval_mode=True`` and RTTM files are provided. This function converts
  (start, end, speaker_id) format into base-scale (the finest scale) segment level diarization label in a matrix
  form to create target matrix.
  
  Args:
      sample:
          DiarizationSpeechLabel instance containing sample information such as audio filepath and RTTM filepath.
      target_spks (tuple):
          Two Indices of targeted speakers for evaluation.
          Example of target_spks: (2, 3)
  Returns:
      seg_target (torch.tensor):
          Tensor variable containing hard-labels of speaker activity in each base-scale segment.
docstr_tok: ["Generate","target","tensor","variable","by","extracting","groundtruth","diarization","labels","from","an","RTTM","file",".","This","function","is","only","used","when","``","self.seq_eval_mode=True","``","and","RTTM","files","are","provided",".","This","function","converts","(","start",",","end",",","speaker_id",")","format","into","base-scale","(","the","finest","scale",")","segment","level","diarization","label","in","a","matrix","form","to","create","target","matrix",".","Args",":","sample",":","DiarizationSpeechLabel","instance","containing","sample","information","such","as","audio","filepath","and","RTTM","filepath",".","target_spks","(","tuple",")",":","Two","Indices","of","targeted","speakers","for","evaluation",".","Example","of","target_spks",":","(","2",",","3",")","Returns",":","seg_target","(","torch.tensor",")",":","Tensor","variable","containing","hard-labels","of","speaker","activity","in","each","base-scale","segment","."]
code: def parse_rttm_multiscale(self, sample):
      """
      Generate target tensor variable by extracting groundtruth diarization labels from an RTTM file.
      This function is only used when ``self.seq_eval_mode=True`` and RTTM files are provided. This function converts
      (start, end, speaker_id) format into base-scale (the finest scale) segment level diarization label in a matrix
      form to create target matrix.
  
      Args:
          sample:
              DiarizationSpeechLabel instance containing sample information such as audio filepath and RTTM filepath.
          target_spks (tuple):
              Two Indices of targeted speakers for evaluation.
              Example of target_spks: (2, 3)
      Returns:
          seg_target (torch.tensor):
              Tensor variable containing hard-labels of speaker activity in each base-scale segment.
      """
      if sample.rttm_file is None:
          raise ValueError(
              f"RTTM file is not provided for this sample {sample}"
          )
      rttm_lines = open(sample.rttm_file).readlines()
      uniq_id = os.path.splitext(os.path.basename(sample.rttm_file))[0]
      mapping_dict = self.emb_dict[max(self.emb_dict.keys())][uniq_id][
          "mapping"
      ]
      rttm_timestamps = extract_seg_info_from_rttm(
          uniq_id, rttm_lines, mapping_dict, sample.target_spks
      )
      fr_level_target = assign_frame_level_spk_vector(
          rttm_timestamps,
          self.round_digits,
          self.frame_per_sec,
          sample.target_spks,
      )
      seg_target = self.get_diar_target_labels_from_fr_target(
          uniq_id, fr_level_target
      )
      return seg_target
  
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 4 for calling the _AudioMSDDInferDataset obj's underlying member method code with example usage: obj.parse_rttm_multiscale(sample) and returns: seg_target