code: def test_speed_perturb(device):
      from speechbrain.augment.time_domain import SpeedPerturb
  
      test_waveform = torch.sin(
          torch.arange(16000.0, device=device)
      ).unsqueeze(0)
  
      # Edge cases
      no_perturb = SpeedPerturb(16000, speeds=[100]).to(device)
      assert no_perturb(test_waveform).allclose(test_waveform)
  
      # Half speed
      half_speed = SpeedPerturb(16000, speeds=[50]).to(device)
      assert half_speed(test_waveform).allclose(
          test_waveform[:, ::2], atol=3e-1
      )
  
file_path: speechbrain/tests/unittests/test_augment.py
imports: import os
  import torch
  import torchaudio
  from speechbrain.dataio.dataio import write_audio
label_desc: Use image node_id 3 for calling a global function with example usage: test_speed_perturb(device) without return types