code: def assign_frame_level_spk_vector(
      rttm_timestamps,
      round_digits,
      frame_per_sec,
      target_spks,
      min_spks=2,
  ):
      """
      Create a multi-dimensional vector sequence containing speaker timestamp information in RTTM.
      The unit-length is the frame shift length of the acoustic feature. The feature-level annotations
      `fr_level_target` will later be converted to base-segment level diarization label.
  
      Args:
          rttm_timestamps (list):
              List containing start and end time for each speaker segment label.
              stt_list, end_list and speaker_list are contained.
          frame_per_sec (int):
              Number of feature frames per second. This quantity is determined by window_stride variable in preprocessing module.
          target_spks (tuple):
              Speaker indices that are generated from combinations. If there are only one or two speakers,
              only a single target_spks variable is generated.
  
      Returns:
          fr_level_target (torch.tensor):
              Tensor containing label for each feature level frame.
      """
      stt_list, end_list, speaker_list = rttm_timestamps
      if len(speaker_list) == 0:
          return None
      else:
          sorted_speakers = sorted(list(set(speaker_list)))
          total_fr_len = int(max(end_list) * (10**round_digits))
          spk_num = max(len(sorted_speakers), min_spks)
          speaker_mapping_dict = {
              rttm_key: x_int
              for x_int, rttm_key in enumerate(sorted_speakers)
          }
          fr_level_target = torch.zeros(total_fr_len, spk_num)
  
          # If RTTM is not provided, then there is no speaker mapping dict in target_spks.
          # Thus, return a zero-filled tensor as a placeholder.
          for count, (stt, end, spk_rttm_key) in enumerate(
              zip(stt_list, end_list, speaker_list)
          ):
              stt, end = round(stt, round_digits), round(
                  end, round_digits
              )
              spk = speaker_mapping_dict[spk_rttm_key]
              stt_fr, end_fr = int(round(stt, 2) * frame_per_sec), int(
                  round(end, round_digits) * frame_per_sec
              )
              fr_level_target[stt_fr:end_fr, spk] = 1
          return fr_level_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 3 for calling a global function with example usage: assign_frame_level_spk_vector(rttm_timestamps, round_digits, frame_per_sec, target_spks, min_spks) and returns: None, fr_level_target