code: def stft(
      x,
      n_fft,
      n_shift,
      win_length=None,
      window="hann",
      center=True,
      pad_mode="reflect",
  ):
      # x: [Time, Channel]
      if x.ndim == 1:
          single_channel = True
          # x: [Time] -> [Time, Channel]
          x = x[:, None]
      else:
          single_channel = False
      x = x.astype(np.float32)
  
      # FIXME(kamo): librosa.stft can't use multi-channel?
      # x: [Time, Channel, Freq]
      x = np.stack(
          [
              librosa.stft(
                  x[:, ch],
                  n_fft=n_fft,
                  hop_length=n_shift,
                  win_length=win_length,
                  window=window,
                  center=center,
                  pad_mode=pad_mode,
              ).T
              for ch in range(x.shape[1])
          ],
          axis=1,
      )
  
      if single_channel:
          # x: [Time, Channel, Freq] -> [Time, Freq]
          x = x[:, 0]
      return x
  
imports: import librosa
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: stft(x, n_fft, n_shift, win_length, window, center, pad_mode) and returns: x