code: def prepare_inputs(mode, ilens=[20, 10], olens=[4, 3], is_cuda=False):
      np.random.seed(1)
      assert len(ilens) == len(olens)
      xs = [
          np.random.randint(0, 5, ilen).astype(np.int32)
          for ilen in ilens
      ]
      ys = [
          np.random.randint(0, 5, olen).astype(np.int32)
          for olen in olens
      ]
      ilens = np.array([x.shape[0] for x in xs], dtype=np.int32)
  
      if mode == "chainer":
          raise NotImplementedError
  
      elif mode == "pytorch":
          ilens = torch.from_numpy(ilens).long()
          xs_pad = pad_list([torch.from_numpy(x).long() for x in xs], 0)
          ys_pad = pad_list(
              [torch.from_numpy(y).long() for y in ys], -1
          )
          if is_cuda:
              xs_pad = xs_pad.cuda()
              ilens = ilens.cuda()
              ys_pad = ys_pad.cuda()
  
          return xs_pad, ilens, ys_pad
      else:
          raise ValueError("Invalid mode")
  
imports: from __future__ import division
  import argparse
  import importlib
  import os
  import tempfile
  from test.utils_test import make_dummy_json_mt
  import chainer
  import numpy
  import pytest
  import torch
  from espnet.nets.pytorch_backend.nets_utils import pad_list
  from espnet.utils.training.batchfy import make_batchset
label_desc: Use image node_id 2 for calling a global function with example usage: prepare_inputs(mode, ilens, olens, is_cuda) and returns: xs_pad,  ilens,  ys_pad