code: def prepare_inputs(
      idim,
      odim,
      ilens,
      olens,
      spk_embed_dim=None,
      device=torch.device("cpu"),
  ):
      xs = [np.random.randint(0, idim, lg) for lg in ilens]
      ys = [np.random.randn(lg, odim) for lg in olens]
      ilens = torch.LongTensor(ilens).to(device)
      olens = torch.LongTensor(olens).to(device)
      xs = pad_list([torch.from_numpy(x).long() for x in xs], 0).to(
          device
      )
      ys = pad_list([torch.from_numpy(y).float() for y in ys], 0).to(
          device
      )
      labels = ys.new_zeros(ys.size(0), ys.size(1))
      for i, lg in enumerate(olens):
          labels[i, lg - 1 :] = 1
      batch = {
          "xs": xs,
          "ilens": ilens,
          "ys": ys,
          "labels": labels,
          "olens": olens,
      }
  
      if spk_embed_dim is not None:
          batch["spembs"] = torch.FloatTensor(
              np.random.randn(len(ilens), spk_embed_dim)
          ).to(device)
  
      return batch
  
imports: import json
  import os
  import shutil
  import tempfile
  from argparse import Namespace
  import numpy
  import pytest
  import torch
  from espnet.nets.pytorch_backend.e2e_tts_fastspeech import FeedForwardTransformer
  from espnet.nets.pytorch_backend.e2e_tts_tacotron2 import Tacotron2
  from espnet.nets.pytorch_backend.e2e_tts_transformer import Transformer
  from espnet.nets.pytorch_backend.fastspeech.duration_calculator import DurationCalculator
  from espnet.nets.pytorch_backend.fastspeech.length_regulator import LengthRegulator
  from espnet.nets.pytorch_backend.nets_utils import pad_list
label_desc: Use image node_id 1 for calling a global function with example usage: prepare_inputs(idim, odim, ilens, olens, spk_embed_dim, device) and returns: batch