code: def get_minimal_indices(Y_new: torch.Tensor) -> torch.Tensor:
      """
      Force the unique indices of the labels to use the lowest numbers.
  
      Example:
          >>> Y_new = [3, 3, 3, 4, 4, 5]
          >>> get_minimal_indices(Y_new)
          Return:
              [0, 0, 0, 1, 1, 2]
  
      Args:
          Y_new (Tensor):
              Tensor containing cluster labels
  
      Returns:
          (Tensor): Newly mapped cluster labels that has minimized indicies
      """
      device = Y_new.device
      Y_new_enlisted = (
          torch.unique(Y_new).sort()[0].to(torch.long).to(device)
      )
      sequence = torch.arange(torch.max(Y_new_enlisted) + 1).to(device)
      sequence[Y_new_enlisted] = torch.arange(len(Y_new_enlisted)).to(
          device
      )
      return sequence[Y_new]
  
imports: from typing import List, Tuple
  import torch
  from nemo.collections.asr.parts.utils.offline_clustering import NMESC, SpeakerClustering, SpectralClustering, get_scale_interpolated_embs, getAffinityGraphMat, getCosAffinityMatrix, split_input_data
  from nemo.collections.asr.parts.utils.optimization_utils import linear_sum_assignment
label_desc: Use image node_id 2 for calling a global function with example usage: get_minimal_indices(Y_new) and returns: sequence