# -*- coding: utf-8 -*-
"""Stimulus resampling functions
"""

import numpy as np
from scipy.fftpack import ifft, fft, ifftshift, fftfreq
from scipy.signal import get_window
import warnings
from distutils.version import LooseVersion
from mne.filter import resample as _resample

from .._parallel import parallel_func, _check_n_jobs


def _smart_pad(x, n_pad):
    """Pad vector x
    """
    # need to pad with zeros if len(x) <= npad
    z_pad = np.zeros(max(n_pad - len(x) + 1, 0), dtype=x.dtype)
    return np.r_[z_pad, 2 * x[0] - x[n_pad:0:-1], x,
                 2 * x[-1] - x[-2:-n_pad - 2:-1], z_pad]


try:
    import mne
    if LooseVersion(mne.__version__) < LooseVersion('0.8'):
        raise ImportError('mne-python too old')
    from mne.filter import resample
except Exception:
    resample = _resample

@@ -78,116 +78,8 @@
  np%0A
-from scipy.fftpack import ifft, fft, ifftshift, fftfreq%0Afrom scipy.signal import get_window%0Aimport warnings%0A
 from
@@ -167,62 +167,8 @@
 le%0A%0A
-from .._parallel import parallel_func, _check_n_jobs%0A%0A
 %0Adef

remove unused repos