code: def pad_sequences(batch: List[Tensor]) -> Tuple[Tensor, Tensor]:
      r"""Right zero-pad all one-hot text sequences to max input length.
  
      Modified from https://github.com/NVIDIA/DeepLearningExamples.
      """
      input_lengths, ids_sorted_decreasing = torch.sort(
          torch.LongTensor([len(x) for x in batch]),
          dim=0,
          descending=True,
      )
      max_input_len = input_lengths[0]
  
      text_padded = torch.LongTensor(len(batch), max_input_len)
      text_padded.zero_()
      for i in range(len(ids_sorted_decreasing)):
          text = batch[ids_sorted_decreasing[i]]
          text_padded[i, : text.size(0)] = text
  
      return text_padded, input_lengths
  
file_path: audio/examples/pipeline_tacotron2/utils.py
imports: import logging
  import os
  import shutil
  from typing import Callable, List, Tuple
  import torch
  from torch import Tensor
label_desc: Use image node_id 2 for calling a global function with example usage: pad_sequences(batch) and returns: text_padded,  input_lengths