code: def min_component_filter(x, y, feature_mask, p=1, fcut=None, Q=None):
      """Minimum component filtering
  
      Minimum component filtering is useful for determining the background
      component of a signal in the presence of spikes
  
      Parameters
      ----------
      x : array_like
          1D array of evenly spaced x values
      y : array_like
          1D array of y values corresponding to x
      feature_mask : array_like
          1D mask array giving the locations of features in the data which
          should be ignored for smoothing
      p : integer (optional)
          polynomial degree to be used for the fit (default = 1)
      fcut : float (optional)
          the cutoff frequency for the low-pass filter.  Default value is
          f_nyq / sqrt(N)
      Q : float (optional)
          the strength of the low-pass filter.  Larger Q means a steeper cutoff
          default value is 0.1 * fcut
  
      Returns
      -------
      y_filtered : ndarray
          The filtered version of y.
  
      Notes
      -----
      This code follows the procedure explained in the book
      "Practical Statistics for Astronomers" by Wall & Jenkins book, as
      well as in Wall, J, A&A 122:371, 1997
      """
      x = np.asarray(x, dtype=float)
      y = np.asarray(y, dtype=float)
      feature_mask = np.asarray(feature_mask, dtype=bool)
  
      if (
          (x.ndim != 1)
          or (x.shape != y.shape)
          or (y.shape != feature_mask.shape)
      ):
          raise ValueError(
              "x, y, and feature_mask must be 1 dimensional "
              "with matching lengths"
          )
  
      if fcut is None:
          f_nyquist = 1.0 / (x[1] - x[0])
          fcut = f_nyquist / np.sqrt(len(x))
  
      if Q is None:
          Q = 0.1 * fcut
  
      # compute polynomial features
      XX = x[:, None] ** np.arange(p + 1)
  
      # compute least-squares fit to non-masked data
      beta = np.linalg.lstsq(
          XX[~feature_mask], y[~feature_mask], rcond=None
      )[0]
  
      # subtract polynomial fit and mask the data
      y_mask = y - np.dot(XX, beta)
      y_mask[feature_mask] = 0
  
      # get Fourier transforms of arrays
      yFT_mask = fftpack.fft(y_mask)
  
      # compute (shifted) frequency array for filter
      N = len(x)
      f = fftpack.ifftshift(
          (np.arange(N) - N / 2.0) * 1.0 / N / (x[1] - x[0])
      )
  
      # construct low-pass filter
      filt = np.exp(-((Q * (abs(f) - fcut) / fcut) ** 2))
      filt[abs(f) < fcut] = 1
  
      # reconstruct filtered signal
      y_filtered = fftpack.ifft(yFT_mask * filt).real + np.dot(XX, beta)
  
      return y_filtered
  
imports: import numpy
  from scipy import optimize, fftpack, signal
  from astroML.utils.decorators import deprecated
  from astroML.utils.exceptions import AstroMLDeprecationWarning
label_desc: Use image node_id 3 for calling a global function with example usage: min_component_filter(x, y, feature_mask, p, fcut, Q) and returns: y_filtered