code: def get_sample_small_random(
      cls, blank_first: bool, device=torch.device("cpu")
  ) -> "RnntLossSampleData":
      vocab_size = 4
      blank_id = 0 if blank_first else vocab_size - 1
      num_frames = 4
      text_len = 2
      if blank_first:
          text = np.asarray([1, 3])
      else:
          text = np.asarray([0, 2])
  
      targets = torch.from_numpy(text).unsqueeze(0).to(device)
      logits = torch.rand(
          [1, num_frames, text_len + 1, vocab_size],
          requires_grad=True,
          device=device,
      )
      input_lengths = torch.tensor([num_frames], device=device)
      target_lengths = torch.tensor([text_len], device=device)
      return RnntLossSampleData(
          vocab_size=vocab_size,
          blank_id=blank_id,
          logits=logits,
          targets=targets,
          input_lengths=input_lengths,
          target_lengths=target_lengths,
      )
  
file_path: NeMo/tests/collections/asr/conftest.py
imports: from dataclasses import dataclass
  from typing import Optional, Type
  import numpy
  import pytest
  import torch
label_desc: Use image node_id 4 for calling the RnntLossSampleData obj's underlying member method code with example usage: obj.get_sample_small_random(cls, blank_first, device) and returns: RnntLossSampleData