code: def unsort_tensor(
      ordered: torch.Tensor,
      indices: torch.Tensor,
      dim: Optional[int] = 0,
  ) -> torch.Tensor:
      """Reverses the result of sort_tensor function:
         o, _, ids = sort_tensor(x,l)
         assert unsort_tensor(o,ids) == x
      Args:
          ordered: context tensor, sorted by lengths
          indices: torch.tensor: 1D tensor with 're-order' indices returned by sort_tensor
      Returns:
          ordered tensor in original order (before calling sort_tensor)
      """
      return torch.index_select(ordered, dim, indices.argsort(0))
  
imports: from enum import Enum
  from typing import Optional, Tuple
  import librosa
  import matplotlib.pylab
  import numpy
  import torch
  from einops import rearrange
  from numba import jit, prange
  from nemo.collections.tts.torch.tts_data_types import DATA_STR2DATA_CLASS, MAIN_DATA_TYPES, WithLens
  from nemo.utils import logging
  from nemo.utils.decorators import deprecated
label_desc: Use image node_id 7 for calling a global function with example usage: unsort_tensor(ordered, indices, dim) and returns: torch