code: def test_batch_pad_right_to(device):
      from speechbrain.utils.data_utils import batch_pad_right
      import random
  
      n_channels = 40
      batch_lens = [1, 5]
  
      for b in batch_lens:
          rand_lens = [random.randint(10, 53) for x in range(b)]
          tensors = [
              torch.ones((rand_lens[x], n_channels), device=device)
              for x in range(b)
          ]
          batched, lens = batch_pad_right(tensors)
          assert batched.shape[0] == b
          np.testing.assert_almost_equal(
              lens, [x / max(rand_lens) for x in rand_lens], decimal=3
          )
  
      for b in batch_lens:
          rand_lens = [random.randint(10, 53) for x in range(b)]
          tensors = [
              torch.ones(rand_lens[x], device=device) for x in range(b)
          ]
          batched, lens = batch_pad_right(tensors)
          assert batched.shape[0] == b
          np.testing.assert_almost_equal(
              lens, [x / max(rand_lens) for x in rand_lens], decimal=3
          )
  
imports: import pytest
  import torch
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: test_batch_pad_right_to(device) without return types