code: def prepare_data(
      b,
      f,
      t,
      device="cuda",
      freq_masks=0,
      time_masks=0,
      freq_width=10,
      time_width=0.1,
      seed=0,
      dtype="float32",
      **kwargs,
  ):
      torch.manual_seed(seed)
  
      if dtype == "float16":
          dtype = torch.float16
      else:
          dtype = torch.float
  
      x = torch.randn([b, f, t], dtype=dtype, device=device)
      x_len = torch.randint(t, size=[b], device=x.device)
  
      sh = x.shape
      bs = sh[0]
  
      if isinstance(time_width, int):
          adaptive_temporal_width = False
      else:
          if time_width > 1.0 or time_width < 0.0:
              raise ValueError(
                  "If `time_width` is a float value, must be in range [0, 1]"
              )
  
          adaptive_temporal_width = True
  
      orginal_time_width = time_width
  
      # Construct the freq and time masks as well as start positions
      if freq_masks > 0:
          freq_starts = torch.randint(
              0,
              sh[1] - freq_width + 1,
              size=[bs, freq_masks],
              device=x.device,
          )
          freq_lengths = torch.randint(
              0, freq_width + 1, size=[bs, freq_masks], device=x.device
          )
      else:
          freq_starts = torch.zeros(
              [bs, 1], dtype=torch.int64, device=x.device
          )
          freq_lengths = torch.zeros(
              [bs, 1], dtype=torch.int64, device=x.device
          )
  
      if time_masks > 0:
          if adaptive_temporal_width:
              time_width = (
                  (x_len * orginal_time_width).int().clamp(min=1)
              )
          else:
              time_width = (
                  torch.tensor(
                      orginal_time_width,
                      dtype=torch.int32,
                      device=x.device,
                  )
                  .unsqueeze(0)
                  .repeat(sh[0])
              )
  
          time_starts = []
          time_lengths = []
          for idx in range(sh[0]):
              time_starts.append(
                  torch.randint(
                      0,
                      max(1, x_len[idx] - time_width[idx]),
                      size=[1, time_masks],
                      device=x.device,
                  )
              )
              time_lengths.append(
                  torch.randint(
                      0,
                      time_width[idx] + 1,
                      size=[1, time_masks],
                      device=x.device,
                  )
              )
  
          time_starts = torch.cat(time_lengths, 0)
          time_lengths = torch.cat(time_lengths, 0)
      else:
          time_starts = torch.zeros(
              [bs, 1], dtype=torch.int64, device=x.device
          )
          time_lengths = torch.zeros(
              [bs, 1], dtype=torch.int64, device=x.device
          )
  
      output = dict(
          x=x,
          x_len=x_len,
          freq_starts=freq_starts,
          freq_lengths=freq_lengths,
          time_starts=time_starts,
          time_lengths=time_lengths,
          sh=sh,
      )
      return output
  
file_path: NeMo/tests/collections/asr/numba/spec_augment/test_spec_aug_numba.py
imports: import pytest
  import torch
  from omegaconf import OmegaConf
  from nemo.collections.asr.parts.numba.spec_augment import spec_aug_numba
  from nemo.core.utils import numba_utils
  from nemo.core.utils.numba_utils import __NUMBA_MINIMUM_VERSION__
label_desc: Use image node_id 2 for calling a global function with example usage: prepare_data(b, f, t, device, freq_masks, time_masks, freq_width, time_width, seed, dtype) and returns: output