code: def get_mask_from_lengths(lengths):
      max_len = torch.max(lengths).item()
      ids = torch.arange(0, max_len, out=torch.cuda.LongTensor(max_len))
      mask = ids < lengths.unsqueeze(1)
      return mask
  
imports: import collections
  import io
  import json
  import librosa
  import numpy
  import soundfile
  import time
  import torch
  from scipy.io.wavfile import read
  from .text import SOS_TOK, EOS_TOK
label_desc: Use image node_id 1 for calling a global function with example usage: get_mask_from_lengths(lengths) and returns: mask