code: def _fft_resample(
      x,
      new_len,
      npads,
      to_removes,
      cuda_dict=None,
      pad="reflect_limited",
  ):
      """Do FFT resampling with a filter function (possibly using CUDA).
  
      Parameters
      ----------
      x : 1-d array
          The array to resample. Will be converted to float64 if necessary.
      new_len : int
          The size of the output array (before removing padding).
      npads : tuple of int
          Amount of padding to apply to the start and end of the
          signal before resampling.
      to_removes : tuple of int
          Number of samples to remove after resampling.
      cuda_dict : dict
          Dictionary constructed using setup_cuda_multiply_repeated().
      %(pad_resample)s
          The default is ``'reflect_limited'``.
  
          .. versionadded:: 0.15
  
      Returns
      -------
      x : 1-d array
          Filtered version of x.
      """
      cuda_dict = (
          dict(use_cuda=False) if cuda_dict is None else cuda_dict
      )
      # add some padding at beginning and end to make this work a little cleaner
      if x.dtype != np.float64:
          x = x.astype(np.float64)
      x = _smart_pad(x, npads, pad)
      old_len = len(x)
      shorter = new_len < old_len
      use_len = new_len if shorter else old_len
      x_fft = cuda_dict["rfft"](x, None)
      if use_len % 2 == 0:
          nyq = use_len // 2
          x_fft[nyq : nyq + 1] *= 2 if shorter else 0.5
      x_fft *= cuda_dict["W"]
      y = cuda_dict["irfft"](x_fft, new_len)
  
      # now let's trim it back to the correct size (if there was padding)
      if (to_removes > 0).any():
          y = y[to_removes[0] : y.shape[0] - to_removes[1]]
  
      return y
  
file_path: mne-python/mne/cuda.py
imports: import numpy
  from scipy.fft import irfft, rfft
  from .utils import _check_option, _explain_exception, fill_doc, get_config, logger, sizeof_fmt, verbose, warn
label_desc: Use image node_id 10 for calling a global function with example usage: _fft_resample(x, new_len, npads, to_removes, cuda_dict, pad) and returns: y