code: def _numpy_pulse_preprocess(x, normalize, window):
      if window is not None:
          n = x.shape[-1]
          if callable(window):
              x *= window(numpy.fft.fftfreq(n))
          else:
              from scipy.signal import get_window
  
              x *= get_window(window, n, False)
  
      if normalize:
          x /= numpy.linalg.norm(x)
  
      return x
  
file_path: cupy/tests/cupyx_tests/signal_tests/radartools_tests/test_radartools.py
imports: import numpy
  import pytest
  import cupy
  from cupy import testing
  from cupyx import signal
label_desc: Use image node_id 1 for calling a global function with example usage: _numpy_pulse_preprocess(x, normalize, window) and returns: x