code: def butterworth(
      signals,
      sampling_rate,
      low_pass=None,
      high_pass=None,
      order=5,
      padtype="odd",
      padlen=None,
      copy=False,
  ):
      """Apply a low-pass, high-pass or band-pass \
      `Butterworth filter <https://en.wikipedia.org/wiki/Butterworth_filter>`_.
  
      Apply a filter to remove signal below the `low` frequency and above the
      `high` frequency.
  
      Parameters
      ----------
      signals : :class:`numpy.ndarray` (1D sequence or n_samples x n_sources)
          Signals to be filtered. A signal is assumed to be a column
          of `signals`.
  
      sampling_rate : :obj:`float`
          Number of samples per second (sample frequency, in Hertz).
      %(low_pass)s
      %(high_pass)s
      order : :obj:`int`, default=5
          Order of the `Butterworth filter
          <https://en.wikipedia.org/wiki/Butterworth_filter>`_.
          When filtering signals, the filter has a decay to avoid ringing.
          Increasing the order sharpens this decay. Be aware that very high
          orders can lead to numerical instability.
  
      padtype : {"odd", "even", "constant", None}, optional
          Type of padding to use for the Butterworth filter.
          For more information about this, see :func:`scipy.signal.filtfilt`.
  
      padlen : :obj:`int` or None, optional
          The size of the padding to add to the beginning and end of ``signals``.
          If None, the default value from :func:`scipy.signal.filtfilt` will be
          used.
  
      copy : :obj:`bool`, optional
          If False, `signals` is modified inplace, and memory consumption is
          lower than for ``copy=True``, though computation time is higher.
  
      Returns
      -------
      filtered_signals : :class:`numpy.ndarray`
          Signals filtered according to the given parameters.
      """
      if low_pass is None and high_pass is None:
          return signals.copy() if copy else signals
  
      if (
          low_pass is not None
          and high_pass is not None
          and high_pass >= low_pass
      ):
          raise ValueError(
              f"High pass cutoff frequency ({high_pass}) is greater than or "
              f"equal to low pass filter frequency ({low_pass}). "
              "This case is not handled by this function."
          )
  
      nyq = sampling_rate * 0.5
  
      critical_freq = []
      if high_pass is not None:
          btype = "high"
          critical_freq.append(_check_wn(btype, high_pass, nyq))
  
      if low_pass is not None:
          btype = "low"
          critical_freq.append(_check_wn(btype, low_pass, nyq))
  
      if len(critical_freq) == 2:
          btype = "band"
          # Inappropriate parameter input might lead to coercion of both
          # elements of critical_freq to a value just below Nyquist.
          # Scipy fix now enforces that critical frequencies cannot be equal.
          # See https://github.com/scipy/scipy/pull/15886.
          # If this is the case, we return the signals unfiltered.
          if critical_freq[0] == critical_freq[1]:
              warnings.warn(
                  "Signals are returned unfiltered because band-pass critical "
                  "frequencies are equal. Please check that inputs for "
                  "sampling_rate, low_pass, and high_pass are valid."
              )
              return signals.copy() if copy else signals
      else:
          critical_freq = critical_freq[0]
  
      b, a = sp_signal.butter(
          order,
          critical_freq,
          btype=btype,
          output="ba",
          fs=sampling_rate,
      )
      if signals.ndim == 1:
          # 1D case
          output = sp_signal.filtfilt(
              b,
              a,
              signals,
              padtype=padtype,
              padlen=padlen,
          )
          if copy:  # filtfilt does a copy in all cases.
              signals = output
          else:
              signals[...] = output
      elif copy:
          # No way to save memory when a copy has been requested,
          # because filtfilt does out-of-place processing
          signals = sp_signal.filtfilt(
              b,
              a,
              signals,
              axis=0,
              padtype=padtype,
              padlen=padlen,
          )
      else:
          # Lesser memory consumption, slower.
          for timeseries in signals.T:
              timeseries[:] = sp_signal.filtfilt(
                  b,
                  a,
                  timeseries,
                  padtype=padtype,
                  padlen=padlen,
              )
  
          # results returned in-place
  
      return signals
  
imports: import warnings
  import numpy
  import pandas
  from scipy import linalg, signal
  from scipy.interpolate import CubicSpline
  from sklearn.utils import as_float_array, gen_even_slices
  from nilearn._utils import fill_doc, stringify_path
  from nilearn._utils.numpy_conversions import as_ndarray, csv_to_array
  from nilearn._utils.param_validation import check_run_sample_masks
label_desc: Use image node_id 6 for calling a global function with example usage: butterworth(signals, sampling_rate, low_pass, high_pass, order, padtype, padlen, copy) and returns: signals, unknown, unknown