code: def expand_to_frame(expand_len, len_size, label, midi, duration):
      # expand phone to frame level
      bs = label.size(0)
      seq_label, seq_label_lengths = [], []
      seq_midi, seq_midi_lengths = [], []
      seq_duration, seq_duration_lengths = [], []
  
      for i in range(bs):
          length = sum(expand_len[i])
          seq_label_lengths.append(length)
          seq_midi_lengths.append(length)
          seq_duration_lengths.append(length)
  
          seq_label.append(
              [
                  label[i][j]
                  for j in range(len_size[i])
                  for k in range(int(expand_len[i][j]))
              ]
          )
          seq_midi.append(
              [
                  midi[i][j]
                  for j in range(len_size[i])
                  for k in range(int(expand_len[i][j]))
              ]
          )
          seq_duration.append(
              [
                  duration[i][j]
                  for j in range(len_size[i])
                  for k in range(int(expand_len[i][j]))
              ]
          )
  
      seq_label = torch.LongTensor(ListsToTensor(seq_label)).to(
          label.device
      )
      seq_label_lengths = torch.LongTensor(seq_label_lengths).to(
          label.device
      )
      seq_midi = torch.LongTensor(ListsToTensor(seq_midi)).to(
          label.device
      )
      seq_midi_lengths = torch.LongTensor(seq_midi_lengths).to(
          label.device
      )
      seq_duration = torch.LongTensor(ListsToTensor(seq_duration)).to(
          label.device
      )
      seq_duration_lengths = torch.LongTensor(seq_duration_lengths).to(
          label.device
      )
  
      return (
          seq_label,
          seq_label_lengths,
          seq_midi,
          seq_midi_lengths,
          seq_duration,
          seq_duration_lengths,
      )
  
imports: from typing import Any, Dict, Optional, Tuple, Union
  import torch
  from typeguard import check_argument_types
  from espnet2.tts.feats_extract.abs_feats_extract import AbsFeatsExtract
  from espnet.nets.pytorch_backend.nets_utils import make_pad_mask
label_desc: Use image node_id 2 for calling a global function with example usage: expand_to_frame(expand_len, len_size, label, midi, duration) and returns: seq_label,  seq_label_lengths,  seq_midi,  seq_midi_lengths,  seq_duration,  seq_duration_lengths