code: def pitch_shift(
      waveform,
      sample_rate: int,
      n_steps: int,
      bins_per_octave: int = 12,
      n_fft: float = 0.032,
      win_length: Optional[float] = None,
      hop_length: float = 0.008,
      window: Optional[str] = "hann",
  ):
      """Shift the pitch of a waveform by `n_steps` steps.
  
      Note: this function is slow.
  
      Args:
          waveform (torch.Tensor): audio signal (..., time)
          sample_rate (int): sampling rate in Hz
          n_steps (int): the (fractional) steps to shift the pitch
              -4 for shifting pitch down by 4/`bins_per_octave` octaves
              4 for shifting pitch up by 4/`bins_per_octave` octaves
          bins_per_octave (int): number of steps per octave
          n_fft (float): length of FFT (in second)
          win_length (float or None): The window length (in second) used for STFT
              If None, it is treated as equal to n_fft
          hop_length (float): The hop size (in second) used for STFT
          window (str or None): The windowing function applied to the signal after
              padding with zeros
  
      Returns:
          ret (torch.Tensor): filtered signal (..., time)
      """
      n_fft = int(sample_rate * n_fft)
      if hop_length is None:
          hop_length = n_fft // 4
      else:
          hop_length = int(sample_rate * hop_length)
      if win_length is None:
          win_length = n_fft
      if window is not None:
          window_func = getattr(torch, f"{window}_window")
          window = window_func(
              win_length, dtype=waveform.dtype, device=waveform.device
          )
      ret = torchaudio.functional.pitch_shift(
          waveform,
          sample_rate,
          n_steps,
          bins_per_octave=bins_per_octave,
          n_fft=n_fft,
          win_length=win_length,
          hop_length=hop_length,
          window=window,
      )
      return ret
  
imports: import math
  import random
  from typing import Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  import torchaudio
label_desc: Use image node_id 8 for calling a global function with example usage: pitch_shift(waveform, sample_rate, n_steps, bins_per_octave, n_fft, win_length, hop_length, window) and returns: ret