code: def get_scale_mapping_argmat(
      uniq_embs_and_timestamps: Dict[str, dict]
  ) -> Dict[int, torch.Tensor]:
      """
      Calculate cosine similarity values among speaker embeddings for each scale then
      apply multiscale weights to calculate the fused similarity matrix.
  
      Args:
          uniq_embs_and_timestamps: (dict)
              The dictionary containing embeddings, timestamps and multiscale weights.
              If uniq_embs_and_timestamps contains only one scale, single scale diarization
              is performed.
  
      Returns:
          scale_mapping_argmat (dict)
              Dictionary containing scale mapping information matrix for each scale.
      """
      scale_mapping_argmat = {}
      embeddings_in_scales, timestamps_in_scales = split_input_data(
          embeddings_in_scales=uniq_embs_and_timestamps["embeddings"],
          timestamps_in_scales=uniq_embs_and_timestamps["timestamps"],
          multiscale_segment_counts=uniq_embs_and_timestamps[
              "multiscale_segment_counts"
          ],
      )
      session_scale_mapping_list = get_argmin_mat(timestamps_in_scales)
      for scale_idx in range(len(session_scale_mapping_list)):
          mapping_argmat = session_scale_mapping_list[scale_idx]
          scale_mapping_argmat[scale_idx] = mapping_argmat
      return scale_mapping_argmat
  
imports: import gc
  import json
  import math
  import os
  import shutil
  from copy import deepcopy
  from typing import Dict, List, Tuple, Union
  import numpy
  import omegaconf
  import soundfile
  import torch
  from pyannote.core import Annotation, Segment
  from tqdm import tqdm
  from nemo.collections.asr.data.audio_to_label import repeat_signal
  from nemo.collections.asr.parts.utils.longform_clustering import LongFormSpeakerClustering
  from nemo.collections.asr.parts.utils.offline_clustering import SpeakerClustering, get_argmin_mat, split_input_data
  from nemo.utils import logging
label_desc: Use image node_id 40 for calling a global function with example usage: get_scale_mapping_argmat(uniq_embs_and_timestamps) and returns: scale_mapping_argmat