code: def prepare_inputs(mode, num_encs=2, is_cuda=False):
      ilens_list = [[3, 2] for _ in range(num_encs)]
      olens = [2, 1]
      np.random.seed(1)
      assert len(ilens_list[0]) == len(ilens_list[1]) == len(olens)
      xs_list = [
          [
              np.random.randn(ilen, 2).astype(np.float32)
              for ilen in ilens
          ]
          for ilens in ilens_list
      ]
      ys = [
          np.random.randint(1, 2, olen).astype(np.int32)
          for olen in olens
      ]
      ilens_list = [
          np.array([x.shape[0] for x in xs], dtype=np.int32)
          for xs in xs_list
      ]
  
      if mode == "pytorch":
          ilens_list = [
              torch.from_numpy(ilens).long() for ilens in ilens_list
          ]
          xs_pad_list = [
              pad_list([torch.from_numpy(x).float() for x in xs], 0)
              for xs in xs_list
          ]
          ys_pad = pad_list(
              [torch.from_numpy(y).long() for y in ys], -1
          )
          if is_cuda:
              xs_pad_list = [xs_pad.cuda() for xs_pad in xs_pad_list]
              ilens_list = [ilens.cuda() for ilens in ilens_list]
              ys_pad = ys_pad.cuda()
  
          return xs_pad_list, ilens_list, 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
  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, num_encs, is_cuda) and returns: xs_pad_list,  ilens_list,  ys_pad